Embedding Animations in PDFs via LaTeX

Ensure a sequence of images is available in the LaTeX document's directory (e.g. ./figures). To generate a sequence of images from a .gif file, see Generate an Image Sequence from a GIF.

Include the animate package in the LaTeX document:

\usepackage{animate}

Embed the sequence of images (e.g. im-0.png ... im-18.png in the figures subdirectory at 12 frames per second):

\animategraphics[loop,controls,width=\linewidth]{12}{figures/im-}{0}{18}