diff --git a/CHANGES.rst b/CHANGES.rst index 1d04bc27010..ade5ca74599 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -19,6 +19,10 @@ Bugs fixed * #12514: intersphinx: fix the meaning of a negative value for :confval:`intersphinx_cache_limit`. Patch by Shengyu Zhang. +* #12722: LaTeX: avoid TeX reporting ``Overfull \hbox`` from too long + strings in a codeline when the problem has actually been solved thanks + to :ref:`latexsphinxsetupforcewraps`. + Patch by Jean-François B. Testing ------- diff --git a/sphinx/texinputs/sphinxlatexliterals.sty b/sphinx/texinputs/sphinxlatexliterals.sty index c2c0806455d..11991d9c3e8 100644 --- a/sphinx/texinputs/sphinxlatexliterals.sty +++ b/sphinx/texinputs/sphinxlatexliterals.sty @@ -512,6 +512,9 @@ \setbox\spx@tempboxa \vtop{\raggedright\hyphenpenalty\z@\exhyphenpenalty\z@ \doublehyphendemerits\z@\finalhyphendemerits\z@ +% Avoid TeX reporting Overfull \hbox'es during this measuring phase. Setting +% \hbadness to \@M to avoid Underfull reports is unneeded due to \raggedright. + \hfuzz\maxdimen \spx@everypar{}\noindent\strut\FV@Line\strut\spx@par \spx@verb@getwidths}% \ifdim\spx@verb@maxwidth>