Sphinx documentation: Include svg images in PDFs via latex

空扰寡人 提交于 2020-05-14 05:18:26

问题


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

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.

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?


回答1:


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.

In docs/narr/router.rst:

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

And we place images in docs/_static.

The HTML uses SVG and the PDF uses PNG.



来源:https://stackoverflow.com/questions/44905597/sphinx-documentation-include-svg-images-in-pdfs-via-latex

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!