Animation using a sequence of images in a single pdf file
You can use the animate package to do this:
Code
\documentclass{beamer}
\usepackage{animate}
\begin{document}
\begin{center}
\animategraphics[autoplay,loop]{1}{animation}{}{}
\end{center}
\end{document}
The syntax is the following:
\animategraphics[<options>]{<frames per second>}{<name without extension>}{<first frame>}{<last frame>}
If you don't specify <first frame>
or <last frame>
, the first respectively last page are used. In the given example the <options>
make the animation looping continuosely. Other things, as control buttons (start, stop etc.) are possible, please refer to the manual for more options.
Alternatively, the media9
package can be used, movie15
is outdated, and playback, of GIF files in particular, is very unreliable as it depends on third-party plug-ins used by AdobeReader.
For use with media9
, the PDF needs to be converted to SWF, using pdf2swf. This conversion keeps the vector-graphical nature of the original file:
pdf2swf --set framerate=1 --output animation.swf animation.pdf
The frame rate is adjusted to 1 FPS, as requested.
Inclusion is done as:
\usepackage{media9}
\usepackage{graphicx}
...
\includemedia{\includegraphics[page=1]{animation}}{animation.swf}
The first page of the original animation.pdf
is used as the poster image.
1. Animated .gif:
You can produce an animated .gif
file via:
pdfcrop animation.pdf
and then use convert
from ImageMagick to obtain a .gif
file. So something like:
convert -verbose -delay 100 -loop 0 -density 400 animation-crop.pdf animation.gif
2. Include .gif:
As per How to add a gif file to my LaTeX file?
the .gif
file can be included by including the movie15
package in the preamble:
\includemovie{1cm}{1cm}{animation.gif}