You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
too much white space on top of captioned literal blocks in PDF output #2460
There are currently three cumulated vertical whitespace in PDF output for literal blocks with caption:
a \literalblockcaptiontopvspace which is half of baselineskip, typically 6pt,
a \smallskip, typically 3pt
a \abovecaptionskip coming from the caption itself, typically 10pt.
That makes for a total of about 20pt, this is a lot. Especially when the literal blocks is in an indented context.
Perhaps \literalblocktopvspace comes from a time when the caption was handled otherwise ? (perhaps put at the end of the code-blocks ?). I propose to suppress both \literalblockcaptiontopvspace and \smallskip (from the Verbatim code; it would be kept only for non-captioned case).
.. testtopspace documentation master file, created by sphinx-quickstart on Wed Apr 20 20:10:22 2016. You can adapt this file completely to your liking, but it should at least contain the root `toctree` directive.
Welcome to testtopspace's documentation!
========================================
.. toctree::
:maxdepth:2
Section
-------
A first listing with a caption.
.. code-block:: python3 :caption: Python 3.5 sample A :linenos: >>> 2 + 2 4 >>> 50 - 5*6 20
A second listing but without a caption.
.. code-block:: python :linenos:>>> (50-5*6) /45.0>>>8/5# division always returns a floating point number1.6..
This third listing is quoted and with a caption
.. code-block:: python :caption: Python 3.5 sample C :linenos:>>>2+24>>>50-5*620
The fourth and fifth listings are in a list.
* .. code-block:: python
:caption: Python 3.5 sample D
:linenos:
>>> (50-5*6) /45.0
>>> 8/5# division always returns a floating point number1.6
* .. code-block:: python
:linenos::caption: Python 3.5 sample E
>>> (50-5*6) /45.0
>>> 8/5# division always returns a floating point number1.6
Activity
Fix sphinx-doc#2460: too much white space on top of captioned literal…
Fix sphinx-doc#2460: too much white space on top of captioned literal…
Fix sphinx-doc#2460: too much white space on top of captioned literal…
jfbu commentedon Apr 25, 2016
For comparison here is output from current stable branch compared to output from current https://github.com/jfbu/sphinx/tree/latex_less_space_above_codecaptions (not yet a PR, as I am not sure myself if really better).
Current stable:
Now, with current https://github.com/jfbu/sphinx/tree/latex_less_space_above_codecaptions
Source:
tk0miya commentedon Apr 27, 2016
LGTM! Go ahead :-)
Update CHANGES (ref: sphinx-doc#2460)
jfbu commentedon Apr 27, 2016
fixed by b2b8fa4