使用 Sphinx 文档,如何为 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?

查看:34
本文介绍了使用 Sphinx 文档,如何为 HTML 构建指定 png 图像格式,为 Latex/PDF 构建指定 pdf 图像格式?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用 sphinx 文档生成器,我尝试将 .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 构建"和仅乳胶构建"吗?

Anyone know how to "tag" sections as "HTML build"-only and "Latex build"-only?

干杯

推荐答案

看看这些选项:

  1. 图像文件名通配符:

  1. 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:: latex

   This appears only in LaTeX output.

.. only:: html

   This appears only in HTML output. 

这篇关于使用 Sphinx 文档,如何为 HTML 构建指定 png 图像格式,为 Latex/PDF 构建指定 pdf 图像格式?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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