-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
no SVG support in PDFs #1907
Comments
The sphinx latex generation generates invalid latex that won't compile when you try to use it.[1][2] This commit adds a helper script to generate the sphinx latex and then modify it so it'll work. It depends on ImageMagick convert and sed being available to work. [1] sphinx-doc/sphinx#1907 [2] sphinx-doc/sphinx#1959 Change-Id: Id289c10907aaddae2483f18b39063852ec699d66
Project: openstack/nova 29c08cdccb069da20eb8af4b545765bb73a242e6 Add tool to build a doc latex pdf The sphinx latex generation generates invalid latex that won't compile when you try to use it.[1][2] This commit adds a helper script to generate the sphinx latex and then modify it so it'll work. It depends on ImageMagick convert and sed being available to work. [1] sphinx-doc/sphinx#1907 [2] sphinx-doc/sphinx#1959 Change-Id: Id289c10907aaddae2483f18b39063852ec699d66
I also incurred in this issue. Are the commits pushed to openstack useful? |
I don't think so. It seems to be a workaround on a non-related project unfortunately |
XXX Let's wait for a real fix for sphinx-doc/sphinx#1907
XXX Let's wait for a real fix for sphinx-doc/sphinx#1907
XXX Let's wait for a real fix for sphinx-doc/sphinx#1907
XXX Let's wait for a real fix for sphinx-doc/sphinx#1907
XXX Let's wait for a real fix for sphinx-doc/sphinx#1907
XXX Let's wait for a real fix for sphinx-doc/sphinx#1907
I've made a PR #2166 to solve this issue. Please check it out if you are interested :) |
Now So I'm closing this now. |
@tk0miya is |
Please take a look the name. It's an extension. So please enable it in your conf.py :-) |
Hi, thanks for the update. |
Yes, please use |
Sphinx and Latex are unable to include SVG apparently: sphinx-doc/sphinx#1907 Signed-off-by: Lubomír Sedlář <[email protected]>
Coming from readthedocs/readthedocs.org#905 here... it looks like Sphinx doesn't support SVGs properly. Or, more accurately, the LaTeX file it generates asumes that
\includegraphics
can deal with SVG files: it can't.In LaTeX, SVG images are special: they need to be first converted into another format using Inkscape, and the SVG package. More information about this is available in this TeX stackexchange question, but basically, if a
.svg
file extension is detected, sphinx should generate the following, in the preambule:and instead of
\includegraphics
, use:Notice how the
.svg
file extension should not be provided. It may be possible to hack up something to replace the\includegraphics{}
directive so it calls\includesvg
when there's a.svg
extension, but i would recommend against that confusing tactic and generate the right directive straight from Sphinx.Of course, Inkscape needs to be available (in the path, or the path can be specified in the preambule, with
\usepackage[inkscape={/opt/bin/inkscape -z -C}]{svg}
) and--shell-escape
must be passed on the commandline. It may be interesting to allow inkscape parameters to be overridable from theconf.py
of course.A workaround is to generate a PNG file by hand on the side, then include the right file depending on the ouput format:
Then, to generate
file.png
, one could add this to the makefile:You could also add targets to the makefile to make sure those images are built automatically:
(Inspired in part by this tutorial.)
But that's kind of a horrible hack that shouldn't be necessary.
The text was updated successfully, but these errors were encountered: