Sphinx文档:从生成的PDF中删除空白页? [英] Sphinx docs: Remove blank pages from generated PDFs?

查看:101
本文介绍了Sphinx文档:从生成的PDF中删除空白页?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

默认情况下,Sphinx文档输出的PDF格式可进行双面打印.因此,标题页和目录之间,目录和引言,引言和第一节之间都有空白页.

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.

我的用户总是会在线查看PDF.所以我想删除这些空白页.

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

这在Sphinx中似乎是一个烦人的问题.请参阅此电子邮件线程.

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',
}

给我!包裹babel错误:您尚未指定语言选项.

第二个选项:

latex_font_size = '10pt,oneside'

运行,但生成的PDF仅具有我文档的奇数页.唉.

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

有人知道如何在没有这些空白页的情况下生成PDF吗?

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

推荐答案

将其放在" source/conf.py 配置文件中:

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

latex_elements = {
  'extraclassoptions': 'openany,oneside'
}

这篇关于Sphinx文档:从生成的PDF中删除空白页?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆