From 66fdb340f7f82ee57709f754eb732a24e9607bc5 Mon Sep 17 00:00:00 2001 From: jfbu Date: Sat, 30 Apr 2016 15:03:41 +0200 Subject: [PATCH] Fix #2507: French lists in LaTeX-PDF output cause vertical space problems modified: sphinx/texinputs/sphinx.sty --- sphinx/texinputs/sphinx.sty | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/sphinx/texinputs/sphinx.sty b/sphinx/texinputs/sphinx.sty index b857b613b..e4b2dc2cd 100644 --- a/sphinx/texinputs/sphinx.sty +++ b/sphinx/texinputs/sphinx.sty @@ -279,8 +279,9 @@ \parskip\z@skip % first, let's check if there is a caption \ifx\SphinxVerbatimTitle\empty - % there was no caption. Check if nevertheless a label was set. + \addvspace\z@% counteract possible previous negative skip (French lists!) \smallskip + % there was no caption. Check if nevertheless a label was set. \ifx\SphinxLiteralBlockLabel\empty\else % we require some space to be sure hyperlink target from \phantomsection % will not be separated from upcoming verbatim by a page break @@ -547,8 +548,11 @@ {\parskip\z@skip\noindent}% } \newcommand{\py@endlightbox}{% - \par\nobreak - {\parskip\z@skip\noindent\rule[.4\baselineskip]{\linewidth}{0.5pt}}\par + \par + % counteract previous possible negative skip (French lists!): + % (we can't cancel that any earlier \vskip introduced a potential pagebreak) + \ifdim\lastskip<\z@\vskip-\lastskip\fi + \nobreak\vbox{\noindent\rule[.4\baselineskip]{\linewidth}{0.5pt}}\allowbreak } % Some are quite plain: