Sphinx文档:通过乳胶在PDF中包含svg图像 [英] Sphinx documentation: Include svg images in PDFs via latex

查看:103
本文介绍了Sphinx文档:通过乳胶在PDF中包含svg图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在为一家IT公司实习,该公司需要为其固件文档(md文件)提供文档应用程序.

I'm doing an internship for an IT company which needs a document application for its firmware docs (md files).

请求是维护这些md文件并将其转换为rst格式(我使用pandoc).因此,现在我有一个仅配置了rst文件的Sphinx应用程序.现在的问题是,第一个具有到SVG图像的链接,我必须使用Sphinx的乳胶生成器将它们转换为PDF.

The request was to maintain these md files and to convert them to rst format (I used pandoc). So now I have a configured Sphinx application with only rst files. The problem now is that some rst have links to SVG images, and I have to use the latex builder of Sphinx to convert them to PDFs.

我进行了搜索,发现了2年前的这个解决方案,这基本上就是我一直在寻找的解决方案:

I've searched around and I found this solution from 2 years ago, which was essentially what I was looking for: https://sites.google.com/site/nickfolse/home/sphinx-latexpdf-output-with-svg-images. I tried to implement it but I'm not an expert with GNU makefiles and I don't know if the current version of Sphinx allows it or if it is out there an easy workaround, so the thing didn't succeed.

有人对此有可行的解决方案吗?

Does someone have a viable solution for this?

推荐答案

目前,尚不支持SVG.我通过将原始文件(OmniGraffle)导出到SVG和PNG来解决Pyramid文档中的问题.

At this time, SVG is still not supported. I work around it in Pyramid docs by exporting the original file (OmniGraffle) to both SVG and PNG.

docs/narr/router.rst :

.. image:: ../_static/pyramid_request_processing.*

然后将图像放置在 docs/_static 中.

HTML使用SVG ,而 PDF使用PNG .

这篇关于Sphinx文档:通过乳胶在PDF中包含svg图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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