Skip to content
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

SVG support when generating PDF ? #905

Closed
PowerKiKi opened this issue Aug 27, 2014 · 12 comments
Closed

SVG support when generating PDF ? #905

PowerKiKi opened this issue Aug 27, 2014 · 12 comments

Comments

@PowerKiKi
Copy link
Contributor

Generation of PDF is broken if the documentation include SVG images.

One workaround is to convert SVG into PDF before processing everything with sphinx, as described there. I successfully implemented that locally. But since readthedocs does not use Makefile, it "skips" the conversion step.

Would it be interesting to support SVG to PDF conversion out of the box for all projects ? That would add step in the build process of reathedocs build server.

Or would another way be preferable ? I suppose we could do something with Virtualenv and setup.py install. But I am not very familiar with that, so I'd rather ask first ...

@ambroisemaupate
Copy link

Same issue.

SVG support is really important to build PDFs for printing as images stay sharp. It’s the only vector image format supported by web browsers and epub readers too.

@stevepiercy
Copy link
Contributor

Here's my lame workaround.
Pylons/pyramid#1500

I would also like to see SVG support in PDFs.

@andras-tim
Copy link

+1

Thx @stevepiercy for workaround!

andras-tim added a commit to andras-tim/StoreKeeper that referenced this issue Mar 13, 2015
ReadTheDocs is not supported SVG images in PDF docs.
readthedocs/readthedocs.org#905
@anarcat
Copy link

anarcat commented May 27, 2015

@PowerKiKi
Copy link
Contributor Author

Does it work on ReadTheDocs ?

@anarcat
Copy link

anarcat commented May 27, 2015

it doesn't, but it may be that i have another unrelated problem: https://readthedocs.org/builds/isuma-media-players/2875649/

@anarcat
Copy link

anarcat commented May 27, 2015

i get this:

LaTeX Warning: File `design3g.*' not found on input line 1996.

i think the workaround above implied there was a generated PNG version, which i don't have / want to bother with here...

@anarcat
Copy link

anarcat commented May 27, 2015

well, i ended up doing that: i can't make this work SVG in here, even without RFTD, it seems like like a sphinx bug as well - i'd be curious to see what's going on on that side.

because you can't just \includegraphics{file.svg} in LaTeX. It just doesn't support SVGs. And that's what Sphinx/RTD is doing... so you need a different directive there. this discussion has also good insight:

http://stackoverflow.com/questions/6473660/using-sphinx-docs-how-can-i-specify-png-image-formats-for-html-builds-and-pdf-im

i ended up using:

.. only:: latex

  .. image:: design3g.png

.. only:: html

  .. image:: design3g.svg

And in my makefile:

%.png: %.svg
    inkscape -z -D --file=$< --export-png=$@

When i change the SVG, i do make file.png by hand because i suspect RTD will not obey my makefile... as described in the summary above. anyways, inkscape is probably not installed...

@ericholscher
Copy link
Member

Seems like this is a Sphinx issue, not a Read the Docs one. SVG support would be implemented there, not on our side. Their issue tracker is here: https://github.com/sphinx-doc/sphinx

@anarcat
Copy link

anarcat commented May 28, 2015

@ericholscher yet one of the things that was identified in this thread is how Sphinx-only builds would work because they would run the Makefile to generate the PNG/PDF files on the fly. RTD skips that, which makes it impossible to not pre-render the PNG files in the git repository, which makes unnecessary overhead.

It would be nice if RTD would at least provide a way to generate those files on the fly...

I opened an issue in Sphinx re. SVG support regardless.

@PowerKiKi
Copy link
Contributor Author

For reference: sphinx-doc/sphinx#1907

@ericholscher
Copy link
Member

Thanks!

On May 29, 2015, at 3:16 AM, Adrien Crivelli notifications@github.com wrote:

For reference: sphinx-doc/sphinx#1907


Reply to this email directly or view it on GitHub.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants