简体   繁体   中英

Sphinx documentation: Include svg images in PDFs via latex

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?

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 .

可以使用Sphinx SVG to PDF 转换器扩展来自动从 SVG 转换为 PDF。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM