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

Feature request: GIF support in latexpdf builder #2272

Closed
kottkrig opened this issue Jan 27, 2016 · 3 comments
Closed

Feature request: GIF support in latexpdf builder #2272

kottkrig opened this issue Jan 27, 2016 · 3 comments

Comments

@kottkrig
Copy link

Repro Steps

  1. Refence a GIF image in source files
  2. Run make latexpdf

Expected: The GIF should be visible in the generated PDF. If it's an animated GIF, show the first frame.
Actual: make latex produces an error ! LaTeX Error: Unknown graphics extension: .gif. and the image is not visible in the generated pdf.

@jfbu
Copy link
Contributor

jfbu commented Feb 4, 2016

Citation from pdftex manual: "pdfTEX supports inclusion of pictures in png, jpeg, jbig2, and pdf formats."

Hence, the gif format is not supported. What you can do is convert the gif foo.gif to foo.png, then, according to

http://www.sphinx-doc.org/en/stable/rest.html#images

code in your .rst file:

.. figure:: foo.*

The LaTeX builder will then select the foo.png file and create the latex source to use it. Actually the html builder also, as I just tested. Seems to match this order:

supported_image_types = ['image/svg+xml', 'image/png', 'image/gif', 'image/jpeg']

from http://www.sphinx-doc.org/en/stable/builders.html#builders

Ah, there seems to be a bug in the LaTeX builder image supported types:

supported_image_types = ['application/pdf', 'image/png', 'image/gif', 'image/jpeg']

as, as said above, gif is not usable directly by pdflatex.

@lehmannro
Copy link
Contributor

It seems media9 is the LaTeX way to include GIFs into PDFs. Until somebody builds support for that, I'd agree that removing image/png from LaTeXBuilder seems sensible.

@tk0miya
Copy link
Member

tk0miya commented Feb 16, 2016

I removed image/gif rom supported_image_types of LaTeX writer.

Now, pdflatex does not support GIF format. So we cannot support it at this present.
Please let me know if pdflatex supports it or commonly used package to do that appears.

Thanks,

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

No branches or pull requests

4 participants