默认情况下,Sphinx文档会输出格式化为双面打印的PDF.因此,标题页和TOC之间有一个空白页,TOC和介绍,介绍和第一部分等.
我的用户总是会在线查看PDF.所以我想删除这些空白页面.
这似乎是Sphinx中一个棘手的问题.查看此电子邮件主题.
这个用户提出了两个解决方案,但对我来说都不起作用 奇怪的是,第一个解决方案:
latex_elements = {
'classoptions': ',oneside',
}
Run Code Online (Sandbox Code Playgroud)
给我
! Package babel Error: You haven't specified a language option.
第二种选择:
latex_font_size = '10pt,oneside'
Run Code Online (Sandbox Code Playgroud)
运行,但生成的PDF只包含我的文档的奇数页.唉.
有没有人知道如何在没有这些空白页的情况下制作PDF?
我是使用sphinx的新手,第一次为python项目做文档.如何在sphinx文档中嵌入图像?
有没有办法如何在sphinx文档中自动显示变量var1和var2及其init-values?
class MyClass:
"""
Description for class
"""
def __init__(self, par1, par2):
self.var1 = par1 * 2
self.var2 = par2 * 2
def method(self):
pass
Run Code Online (Sandbox Code Playgroud) 在Sphinx中,如果我有以下标题声明:
.. _somestuff:
``this is code``, this is not!
==============================
Run Code Online (Sandbox Code Playgroud)
它渲染,像这样:
this is code, 这不是!哪个好,但是,如果我使用参考,例如:
Have a look at :ref:`somestuff`
Run Code Online (Sandbox Code Playgroud)
它丢失了代码格式并呈现如下:
代替:
是否可以在引用中保留代码格式?我该怎么办呢?
documentation restructuredtext documentation-generation python-sphinx
我想知道是否有办法扩展文件中包含的标题下的所有子部分index.rst?
举个例子,它是这样的:
Section 1
Section 2
Section 3
Run Code Online (Sandbox Code Playgroud)
以下是我希望如何:
Section 1
Subsection 1.1
Subsection 1.2
Subsection 1.3
Section 2
Subsection 2.1
Subsection 2.2
Subsection 2.3
Section 3
Subsection 3.1
Subsection 3.2
Subsection 3.3
Run Code Online (Sandbox Code Playgroud)
如果我点击第1部分,它会显示下面的内容,但是如果我点击第2部分,则隐藏第1部分的内容,只显示2.我想在每次进入索引页面时扩展所有2个部分.我试过加toctree和maxdepth,没有什么作品.
我如何添加自定义css文件?以下配置对我不起作用:
# conf.py
html_static_path = ['_static']
html_theme = 'default'
html_theme_options = {
'cssfiles': ['_static/style.css']
}
Run Code Online (Sandbox Code Playgroud)
结果:
C:\temp\test-docs\docs>make html
Running Sphinx v1.2.2
loading pickled environment... not yet created
building [html]: targets for 2 source files that are out of date
updating environment: 2 added, 0 changed, 0 removed
reading sources... [ 50%] help
reading sources... [100%] index
looking for now-outdated files... none found
pickling environment... done
checking consistency... done
preparing documents...
Theme error:
unsupported theme option 'cssfiles' given
Run Code Online (Sandbox Code Playgroud) 我根本不知道如何链接到reST文件中的另一个文档.
我想install.rst在段落中链接一个名为我的快速入门指南的文件.我不知道如何实现这一目标.
请你也可以参考一个很好的资源,从那里我可以查找语法休息.默认的快速入门有点无聊,并没有涉及使用sphinx休息的深入讨论.
有问题的文件是:http://todx.rtfd.io
我正在使用"阅读文档"Sphinx主题作为我的文档.在原始主题中,给出如下
http://read-the-docs.readthedocs.org/en/latest/theme.html
内容或主要布局宽度设计为移动友好.但是,对于我的项目,我希望这会更广泛.我不知道HTML,因此如果任何人可以给我一些线索来增加内容(布局)宽度,我将不胜感激.
我正在撰写文档,我想包含pdf文件或zip档案的链接.如何使用第一语言和狮身人面像实现这一目标?
如果我这样做
here is a pdf file : `pdf <doc/mypdf.pdf>`_
Run Code Online (Sandbox Code Playgroud)
它不起作用,因为在编译期间sphinx不复制doc目录的包含(我使用sphinx-quickstart生成的makefile).
相反,使用image指令:
.. image:: img/plop.png
Run Code Online (Sandbox Code Playgroud)
sphinx会在构建目录中复制plop.png图像.如何获得pdf或zip存档的相同行为?