Skip to content

LaTeX build log still contains Overfull \hbox reports although verbatimforcewraps is active and has actually solved the PDF output problem #12722

Closed
@jfbu

Description

@jfbu

Describe the bug

$ grep -n 'Overfull \\hbox' _build/latex/foo.log
893:Overfull \hbox (60.49344pt too wide) in paragraph at lines 99--99

but the output is absolutely fine:
Capture d’écran 2024-08-01 à 11 04 15

because verbatimforcewraps solved the problem of digits overflowing into margin.

How to Reproduce

index.rst:

FOO documentation
=================

Add your content using ``reStructuredText`` syntax. See the
`reStructuredText <https://www.sphinx-doc.org/en/master/usage/restructuredtext/index.html>`_
documentation for details.

SymPy can evaluate floating point expressions to arbitrary precision.  By
default, 15 digits of precision are used, but you can pass any number as the
argument to ``evalf``.  Let's compute the first 100 digits of `\pi`.

    >>> pi.evalf(100)
    3.141592653589793238462643383279502884197169399375105820974944592307816406286208998628034825342117068

conf.py contains:

latex_elements = {
    'sphinxsetup': 'verbatimforcewraps',
}

then make latexpdf and check the TeX log.

Environment Information

Python version:        3.12.3 (v3.12.3:f6650f9ad7, Apr  9 2024, 08:18:48) [Clang 13.0.0 (clang-1300.0.29.30)])
Python implementation: CPython
Sphinx version:        8.1.0+/7875ec862
Docutils version:      0.20.1
Jinja2 version:        3.1.4
Pygments version:      2.18.0

Sphinx extensions

No response

Additional context

With verbatimforcewraps Sphinx uses a "measuring phase" when rendering code-blocks to detect overflows. The Overfull \hbox originates in this measuring phase.

Having it in log file gives false positives which complicates search for other overflowing not originating in code-blocks. On the other hand it gives a way to locate where the verbatimforcewraps kicked in...

relates sympy/sympy#26867

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions