diff options
author | Jean-François B <jfbu@free.fr> | 2021-03-12 23:57:45 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-03-12 23:57:45 +0300 |
commit | 1a62d892762dbc13a2e6398f7840ac919d39befa (patch) | |
tree | bda373655df356f29a5b2487a89e624776afcb8d /sphinx/texinputs | |
parent | ddef4950ee4dd73035ba29205acf651157a2440f (diff) | |
parent | 4bb151bf364cb4f206a5e9a6cc34a078eed1782b (diff) |
Merge branch 'master' into pdf_bookmarksdepth
Diffstat (limited to 'sphinx/texinputs')
-rw-r--r-- | sphinx/texinputs/sphinxlatexliterals.sty | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/sphinx/texinputs/sphinxlatexliterals.sty b/sphinx/texinputs/sphinxlatexliterals.sty index 4abb3472a..a2943b2dc 100644 --- a/sphinx/texinputs/sphinxlatexliterals.sty +++ b/sphinx/texinputs/sphinxlatexliterals.sty @@ -343,6 +343,7 @@ \fi\fi }% % auxiliary paragraph dissector to get max and min widths +% but minwidth must not take into account the last line \newbox\spx@scratchbox \def\spx@verb@getwidths {% \unskip\unpenalty @@ -353,10 +354,22 @@ \ifdim\spx@verb@maxwidth<\wd\spx@scratchbox \xdef\spx@verb@maxwidth{\number\wd\spx@scratchbox sp}% \fi + \expandafter\spx@verb@getwidths@loop + \fi +}% +\def\spx@verb@getwidths@loop {% + \unskip\unpenalty + \setbox\spx@scratchbox\lastbox + \ifvoid\spx@scratchbox + \else + \setbox\spx@scratchbox\hbox{\unhbox\spx@scratchbox}% + \ifdim\spx@verb@maxwidth<\wd\spx@scratchbox + \xdef\spx@verb@maxwidth{\number\wd\spx@scratchbox sp}% + \fi \ifdim\spx@verb@minwidth>\wd\spx@scratchbox \xdef\spx@verb@minwidth{\number\wd\spx@scratchbox sp}% \fi - \expandafter\spx@verb@getwidths + \expandafter\spx@verb@getwidths@loop \fi }% % auxiliary macros to implement "cut long line even in middle of word" |