Update CHANGES and docs relative to new verbatimforcewraps

This commit is contained in:
jfbu 2021-02-09 15:47:15 +01:00
parent 7175d11f05
commit 035d13fd24
3 changed files with 11 additions and 5 deletions

View File

@ -131,7 +131,9 @@ Bugs fixed
* #8780: LaTeX: long words in narrow columns may not be hyphenated
* #8788: LaTeX: ``\titleformat`` last argument in sphinx.sty should be
bracketed, not braced (and is anyhow not needed)
* #8849: LaTex: code-block printed out of margin
* #8849: LaTex: code-block printed out of margin (see the opt-in LaTeX syntax
boolean :ref:`verbatimforcewraps <latexsphinxsetupforcewraps>` for use via
the :ref:`'sphinxsetup' <latexsphinxsetup>` key of ``latex_elements``)
Testing
--------

View File

@ -646,6 +646,8 @@ macros may be significant.
Default: ``true``
.. _latexsphinxsetupforcewraps:
``verbatimforcewraps``
Boolean to specify if long lines in :rst:dir:`code-block`\ 's contents
should be forcefully wrapped to never overflow due to long strings.
@ -692,7 +694,8 @@ macros may be significant.
}
This can be done locally for a given code-block via the use of raw latex
directives to insert suitable ``\sphinxsetup`` into the latex file.
directives to insert suitable ``\sphinxsetup`` (before and after) into the
latex file.
Default: ``100``

View File

@ -1224,9 +1224,10 @@
% box does not store in an accessible way what was the maximal
% line-width during paragraph building.
%
% If the max width exceed the linewidth by at least 4 character
% widths, then we apply the "force wrapping" with potential line
% break at each character, else we don't.
% If the max width exceeds the linewidth by more than verbatimmaxoverfull
% character widths, or if the min width plus verbatimmaxunderfull character
% widths is inferior to linewidth, then we apply the "force wrapping" with
% potential line break at each character, else we don't.
\long\def\spx@verb@FormatLineForceWrap#1{%
% \spx@image@box is a scratch box register that we can use here
\global\let\spx@verb@maxwidth\z@