Sorry, didn't see the first request for an example and just saw aprendiz request also. Here it is:
First create frames of the video in Mathematica and save as png type:
SetDirectory[NotebookDirectory[]];
videoFrameData = Table[Plot[Sin[a + x], {x, 0, 10}], {a, 20}];
Export["d:\\NewFunctionFolder2\\pdfVideoTestFile.png", videoFrameData,
"VideoFrames"];
Now create the latex code with the animate
package shown below. I use TeXnic Center and included the lstlisting
package to include a listing of the Mathematica code in the PDF file for reference. Now compile it into a PDF file and run it. It will show a frame of the video and a Manipulate-like GUI for running the animation.
\documentclass[12pt,reqno]{amsart}
\usepackage{animate}
\usepackage{graphicx}
\usepackage{listings}
\usepackage{xcolor}
\lstdefinestyle{myMathematica}{
frame=tb,
language=Mathematica,
aboveskip=3mm,
belowskip=3mm,
showstringspaces=false,
columns=flexible,
basicstyle={\ttfamily},
numbers=none,
numberstyle=\tiny\color{gray},
keywordstyle=\color{blue},
commentstyle=\color{mauve},
stringstyle=\color{dkgreen},
breaklines=true,
breakatwhitespace=true,
morekeywords={AsymptoticSolve},
tabsize=3
}
\definecolor{dkgreen}{rgb}{0,0.6,0}
\definecolor{gray}{rgb}{0.5,0.5,0.5}
\definecolor{mauve}{rgb}{0.58,0,0.82}
\begin{document}
This is a test of imbeding Mathematica video into PDF file using animate package. First create the video frames and save in directory of this TeXnicCenter latex file:
\begin{center}
\begin{minipage}{0.85\linewidth}
\begin{lstlisting}[title={Mathematica Code},style=myMathematica,
frame=single,
label=code2]
SetDirectory[NotebookDirectory[]];
videoFrameData = Table[Plot[Sin[a + x], {x, 0, 10}], {a, 20}];
Export["d:\\NewFunctionFolder2\\pdfVideoTestFile.png", videoFrameData, "VideoFrames"];
\end{lstlisting}
\end{minipage}
\end{center}
\begin{center}
\animategraphics[controls,loop,width=3in]{3}{pdfVideoTestFile}{1}{20}
\end{center}
\end{document}
CloudPublish
(note that published stuff may not remain accessible forever depending on your account type) $\endgroup$