Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Adding Vertical Space in Sphinx Documents

I am using sphinx to build latex and HTML documents with a lot of figures and enumerated lists. When I use figures in the middle of text outside of enumerated lists, the spacing is fine in both latex and HTML with and without captions. There is about a line of space above and below, which is acceptable. However When I try to use a figure within enumerated lists, such as the example below, the spacing is bad in HTML.

#.    Here is an item in the list, above the figure

      .. figure:: _images/myimage.png
          :align: center
          :width: 80 %

#.    Here is another item below the figure.

The result of the above code is the bottom of the figure is right up against the next item in the list. There is no spacing between them, and this looks bad. This can be fixed in HTML by using the | character at the end of the figure to add a little space, but in the LaTeX output, this causes a DUlineblock environment that adds way too much space in the pdf.

Is there a way to simply add a single blank line after the figure in both HTML and Latex?

like image 318
Alex Avatar asked Jun 30 '14 13:06

Alex


2 Answers

You can enter empty lines with:

text

|

text
like image 151
Adobe Avatar answered Oct 14 '22 06:10

Adobe


I found that the replacement:

.. |br| raw:: html

    <br />

Works well for adding a black line after a figure in enumerated lists. Since its a raw substitution it only affects html and the figure spacing in latex is fine without modification.

like image 3
Alex Avatar answered Oct 14 '22 06:10

Alex