[Tex/LaTex] Get animated GIFs into LaTeX presentation

animationsgifgraphics

I am new to LaTeX. I am trying to put a GIF into my LaTeX presentation.
I followed @samcarter guide here.

I have 23 pictures so I changed something and tried this:

\transduration<0-23>{0}
        \multiinclude[<+->][format=png, graphics={width=\textwidth}]{something}

But I always get this warning:

LaTeX Warning: File `something-0.png' not found on input line 132
/LaTeX_Vorlage_Presentations/.example.tex.
swp:132: Unable to load picture or PDF file 'something-0.png'.

The something.pngs are in the same file folder as the LaTeX stuff too.

Best Answer

Here is the procedure on GNU/Linux. I took the gif image from this answer of mine.

enter image description here

First you need to burst the gif into single frames. I use the ImageMagick tool convert for this.

mkdir gif
convert -coalesce animation.gif gif/frame-%d.png

This will create the files frame-0.png through frame-36.png in the subdirectory gif/. To include this in a beamer presentation I use the animate package. It offers the command \animategraphics to conatenate single images to an animation. The syntax is

\animategraphics[<options>]{<frame rate>}{<path prefix>}{<start frame>}{<end frame>}

In our case, the path prefix is gif/frame-. The start frame is 0, the last frame is 36. A frame rate of 12 is empirically chosen, since it looks best. The image is too large for the slide, so we scale it down using width=\textwidth. Here is the full example.

\documentclass{beamer}
\usepackage{animate}
\begin{document}
\begin{frame}
  \animategraphics[width=\textwidth]{12}{gif/frame-}{0}{36}
\end{frame}
\end{document}

N.B.: This is known to work with Adobe Reader, PDF-XChange, and Foxit. (Thanks @AlexG)

Related Question