小编And*_*ann的帖子

在Sphinx的html输出中缩放svg图(其余)

我使用scale指令在重组文本中有一个数字,如下所示:

.. figure:: images/my_image.svg
   :scale: 150 %
Run Code Online (Sandbox Code Playgroud)

在sphinx的HTML输出中,图像完全正常,除了它没有缩放.(svg图像有宽度和高度信息和viewBox)

奇怪的是,与png图形相比,<img>HTML文件中的标签不包含图像的宽度和高度属性(hm,由于某种原因,sphinx不能确定svg的宽度和高度?).

这是什么原因?sphinx是否支持:scale:svg数字的指令?

svg restructuredtext python-sphinx

9
推荐指数
1
解决办法
1685
查看次数

如何在python-sphinx中使用角色来使用唯一的内联指令?

在python-sphinx中有唯一的指令,可以根据其输出用于有条件地影响文档.例如,文本仅出现在html或latex中.

它是这样用的:

.. only:: not latex

   Here there is some Text, that does not appear in latex output.

.. only:: html

   Here there is some Text, that only appears in html output.

如何以正确的方式使用角色指令来使用唯一类内联,让我们这样说:

Here there is some Text, that :only-notlatex:`does not appear in latex`
:only-html:`only appears in html`.

我看到了raw指令的类似内容.这也是唯一的指令吗?我试过了:


.. role:: only-html(only)
   :format: html

.. role:: only-notlatex(only)
   :format: not latex 

但这不起作用.

restructuredtext inline role python-sphinx

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

Python反平方根

是否有任何Python库提供实现以下链接中所述的“快速反平方根”算法的函数? http://en.wikipedia.org/wiki/Fast_inverse_square_root 也许是numpy / SciPy?

python performance inverse square-root

3
推荐指数
2
解决办法
5056
查看次数

如何检查乳胶是否在当前页面上开始新章节?

我正在使用everypage包。使用 \AddEverypageHook 命令,我可以在文档每一页的开头重复操作。现在我想做这样的事情:

\AddEverypageHook{
  \if "New chapter starts at current page." - "Do stuff." 
  \else "Do other stuff."
  \fi
}
Run Code Online (Sandbox Code Playgroud)

我如何检查乳胶,新章节是否从当前页面开始?

conditional latex tex

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