小编Ale*_*lex的帖子

在Sphinx文档中添加垂直空间

我正在使用sphinx来构建具有大量数字和枚举列表的乳胶和HTML文档.当我在枚举列表之外的文本中间使用数字时,在带有和不带标题的latex和HTML中间距都很好.上面和下面有一排空间,这是可以接受的.但是,当我尝试在枚举列表中使用数字时,例如下面的示例,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.
Run Code Online (Sandbox Code Playgroud)

上面代码的结果是图的底部正对着列表中的下一个项目.它们之间没有间距,这看起来很糟糕.这可以通过使用|图末尾的字符来修复,以添加一点空间,但是在LaTeX输出中,这会导致DUlineblock环境在pdf中添加太多空间.

有没有办法简单地在HTML和Latex中添加一个空白行?

html latex spacing python-sphinx

7
推荐指数
2
解决办法
1010
查看次数

狮身人面像到乳胶图放置

我正在尝试使用Sphinx生成乳胶和HTML手册,但是乳胶中的图形放置存在问题。在狮身人面像中,我的数据如下:

.. figure:: _images/somepicture.png
    :figwidth: 100 %
    :width: 100 %
    :align: center

    some caption
Run Code Online (Sandbox Code Playgroud)

这样一来,当它写入HTML时,图形将覆盖页面的整个宽度。这很好。

麻烦来自乳胶,乳胶中的典型数字写为:

\begin{figure}[htbp]
\centering

\includegraphics[width=1.000\linewidth]{reset.png}
\end{figure}
Run Code Online (Sandbox Code Playgroud)

问题是[htbp]放置选项。由于图像的长度为\ linewidth,因此它们非常大,最终浮动到下一页,并且pdf输出中通常不会保留文档中文本和图形的任何顺序。我想将[htbp]更改为[H]。

我在“ figure_align”乳胶元素部分下找到了放入conf.py文件的选项,但是当我使用它时,它不起作用。链接在此处http://sphinx.readthedocs.org/en/latest/config.html#options-for-latex-output

在我的conf.py文档中,我具有以下内容:

latex_elements = {
# The paper size ('letterpaper' or 'a4paper').
#'papersize': 'letterpaper',

# The font size ('10pt', '11pt' or '12pt').
#'pointsize': '10pt',

# Additional stuff for the LaTeX preamble.
#'preamble':'',

#Figure placement within LaTeX paper NOT WORKING
'figure_align': 'H'

}
Run Code Online (Sandbox Code Playgroud)

我的问题是,为什么该选项不起作用,我应该怎么做才能使其起作用?

latex figure python-sphinx

5
推荐指数
1
解决办法
2310
查看次数

标签 统计

latex ×2

python-sphinx ×2

figure ×1

html ×1

spacing ×1