Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/sphinx-doc/sphinx.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJean-François B <jfbu@free.fr>2021-03-12 23:48:34 +0300
committerGitHub <noreply@github.com>2021-03-12 23:48:34 +0300
commit4c8418b58c214d74b21e4e093f3271a1cdd9ff72 (patch)
treed9a3d376db8a08fda397fcf4f9515ece2de1507f /sphinx/texinputs
parentcea87d13acaa963526f8ac67efb101f2cfa53ab3 (diff)
parent4bb151bf364cb4f206a5e9a6cc34a078eed1782b (diff)
Merge branch 'master' into latex_better_fix_pygments
Diffstat (limited to 'sphinx/texinputs')
-rw-r--r--sphinx/texinputs/sphinxlatexliterals.sty15
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"