LaTeX gif conversion

22 views
Skip to first unread message

phario

unread,
Oct 2, 2025, 4:33:55 AMOct 2
to PreTeXt support
Hello!

So with pretext output to HTML, this opens up the possibility of using animated gifs, which is great for HTML viewing. 

<image source="test.gif" width="70%"/> 

However, this is not so good for LaTeX output and I don't think xelatex or xetex can handle gifs. The current replacement puts something like this into the latex source:

\begin{image}{0.15}{0.7}{0.15}}
\includegraphics[width=5cm]{external/test.gif}
\end{image}

I have tried to look up the use of \Declaregraphicsrule

but I'm not entirely sure that works (or at least I could not get it to work.

Optimally I'd be happy if there was simply a test.gif and test.png (which could be manually made) in the assets folder, and when it came time to compile the latex version it swapped the gif for the png. 

Any thoughts? 

Rob Beezer

unread,
Oct 9, 2025, 12:00:55 PMOct 9
to pretext...@googlegroups.com
If an animated GIF is being used to convey some information (via an animation),
then a "still" version (as a PNG) would be a poor replacement, I'd say.
Whatever it was about the animation that was important/necessary, would be lost
(silently, as proposed).

I'd liken an animated GIF to being more like a video, which we handle more
carefully in PDF output (see the sample article for examples).

Perhaps

<video source="my-animation.gif"/>

could be accomodated in our current implmentation, since we are already careful
about extensions on the filenames of these @source attributes.

Rob
> --
> You received this message because you are subscribed to the Google Groups
> "PreTeXt support" group.
> To unsubscribe from this group and stop receiving emails from it, send an email
> to pretext-suppo...@googlegroups.com <mailto:pretext-
> support+u...@googlegroups.com>.
> To view this discussion visit https://groups.google.com/d/msgid/pretext-
> support/37116f02-f1c4-416b-8047-943b031718b8n%40googlegroups.com <https://
> groups.google.com/d/msgid/pretext-support/37116f02-
> f1c4-416b-8047-943b031718b8n%40googlegroups.com?utm_medium=email&utm_source=footer>.

Reply all
Reply to author
Forward
0 new messages