mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Merge pull request #2498 from jfbu/latex_less_space_above_codecaptions
This commit is contained in:
1
CHANGES
1
CHANGES
@@ -45,6 +45,7 @@ Bugs fixed
|
||||
* #2088: intersphinx crashes if the mapping URL requires basic auth
|
||||
* #2304: auto line breaks in latexpdf codeblocks
|
||||
* #1534: Word wrap long lines in Latex verbatim blocks
|
||||
* #2460: too much white space on top of captioned literal blocks in PDF output
|
||||
|
||||
|
||||
Release 1.4.1 (released Apr 12, 2016)
|
||||
|
||||
@@ -180,9 +180,11 @@
|
||||
\newcommand*\SphinxLiteralBlockLabel {}
|
||||
\newcommand*\SphinxSetupCaptionForVerbatim [2]
|
||||
{%
|
||||
\needspace{\literalblockneedspace}\vspace{\literalblockcaptiontopvspace}%
|
||||
\needspace{\literalblockneedspace}%
|
||||
% insert a \label via \SphinxLiteralBlockLabel
|
||||
% reset to normal the color for the literal block caption
|
||||
% the caption inserts \abovecaptionskip whitespace above itself (usually 10pt)
|
||||
% there is also \belowcaptionskip but it is usually zero, hence the \smallskip
|
||||
\def\SphinxVerbatimTitle
|
||||
{\py@NormalColor\captionof{#1}{\SphinxLiteralBlockLabel #2}\smallskip }%
|
||||
}
|
||||
@@ -275,8 +277,6 @@
|
||||
\renewcommand{\Verbatim}[1][1]{%
|
||||
% list starts new par, but we don't want it to be set apart vertically
|
||||
\parskip\z@skip
|
||||
% in case of caption there was already \literalblockcaptiontopvspace
|
||||
% plus there will be additionally \abovecaptionskip. Don't do \smallskip then.
|
||||
% first, let's check if there is a caption
|
||||
\ifx\SphinxVerbatimTitle\empty
|
||||
% there was no caption. Check if nevertheless a label was set.
|
||||
@@ -812,9 +812,6 @@
|
||||
% control caption around literal-block
|
||||
\RequirePackage{capt-of}
|
||||
\RequirePackage{needspace}
|
||||
% if the left page space is less than \literalblockneedsapce, insert page-break
|
||||
% if the left page space is less than \literalblockneedspace, insert page-break
|
||||
\newcommand{\literalblockneedspace}{5\baselineskip}
|
||||
\newcommand{\literalblockwithoutcaptionneedspace}{1.5\baselineskip}
|
||||
% margin before the caption of literal-block
|
||||
% this will cumulate with \abovecaptionskip !
|
||||
\newcommand{\literalblockcaptiontopvspace}{0.5\baselineskip}
|
||||
|
||||
Reference in New Issue
Block a user