The goal is to embed in a pdf file an animation made up of a sequence of images generated using Mathematica and to be able to use live controls inside the PDF to control the play of the animation.
This can be done easily LaTeXanimate package. These examples used TeX Live distribution to compile the LaTeXfile to pdf. Any other LaTeXdistribution such as Mike TeXcan also be used.
The steps are simple and illustrated here using two examples. The first example uses the output of Table[Plot[...]] to generate the plots used as the image frames, and the second uses the output of the Manipulate command.
Any other Mathematica command that can generate sequence of images in that can be exported into sequence of video frame images can be used for animation with this method.
The two PDF files created from these examples are
Important note: The PDF file has to be opened using an Adobe PDF reader. The animation will not run if the PDF file is opened inside the browser using the browser buildin PDF reader. These do not yet support animations inside PDF at this time.
The above will generate 10 .png images in the same folder where the notebook is saved
The count of the frames (10 in this example) used in the above LaTeXcode should match the number of frame images created by Mathematica. Hence the count starts from 1 to 10. Any other values within this range can also be used.
The {3} in the above, is the frame rate. I found that a value around 3 to 6 works best for more purposes.
The documenation for the package animate contains more information on this as well description of many other options that can be used when creating the animation in PDF.
Compile the LaTeXfile to PDF using either
or
The Export command will create 60 frames
Compile the above file to a PDF file
The speed of animation can also be adjusted using the controls shown.