Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Sphinx docs: Remove blank pages from generated PDFs?

By default, Sphinx documentation outputs a PDF that's formatted for duplex printing. So there is a blank page between the title page and the TOC, the TOC and the introduction, the introduction and the first section, etc.

My users are always going to look at the PDF online. So I would like to remove these blank pages.

This seems to be a vexed issue in Sphinx. See this email thread.

This user suggests two solutions, but neither work for me. Curiously, the first solution:

latex_elements = {
     'classoptions': ',oneside',
}

gives me ! Package babel Error: You haven't specified a language option.

The second option:

latex_font_size = '10pt,oneside'

runs, but produces a PDF that only has the odd-numbered pages of my document. Alas.

Does anyone know how to produce a PDF without these blank pages?

like image 806
AP257 Avatar asked Mar 24 '11 17:03

AP257


People also ask

How do I get rid of a blank page in latex?

To get rid of these empty pages, just add the oneside option (or alternatively, the openany option) to your document class declaration.


1 Answers

Put this in your source/conf.py configuration file in the "Options for LaTeX output" section:

latex_elements = {   'extraclassoptions': 'openany,oneside' } 
like image 129
Noah Heldman Avatar answered Sep 28 '22 11:09

Noah Heldman