使用Sphinx docs,如何为HTML构建指定png图像格式,为Latex/PDF构建指定pdf图像格式? [英] Using Sphinx docs how can I specify png image formats for HTML builds and pdf image formats for Latex/PDF builds?
问题描述
我使用sphinx doc生成器,试图将.png图像用于文档的HTML版本,然后我希望将.svg图像用于PDF/LATEx版本.
Using sphinx doc generator, I am trying to use .png images for the HTML builds of the documentation, and then I want to have the .svg images used for the PDF/LATEx builds.
有人知道如何将部分标记"为仅HTML构建"和仅Latex构建"吗?
Anyone know how to "tag" sections as "HTML build"-only and "Latex build"-only?
欢呼
推荐答案
看看这些选项:
-
图片文件名通配符:
Image filename wildcard:
.. image:: gnu.*
从文档:例如,如果给定文件名gnu.*,并且源树中存在两个文件gnu.pdf和gnu.png,则LaTeX构建器将选择前者,而HTML构建器将选择后者."
From the documentation: "For instance, if the file name gnu.* was given and two files gnu.pdf and gnu.png existed in the source tree, the LaTeX builder would choose the former, while the HTML builder would prefer the latter."
only
指令:
.. only:: latex
This appears only in LaTeX output.
.. only:: html
This appears only in HTML output.
这篇关于使用Sphinx docs,如何为HTML构建指定png图像格式,为Latex/PDF构建指定pdf图像格式?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!