# standalone mode=image with animated pdf

I'm using animate to generate animated images, read by acroread. It seems this pdf can't be included in another TeX file without loosing the animation capabilities so I'm using \includestandalone with mode=tex to generate to have the animated image compiled in the main TeX file. This can take a very long time, at each compilation.

In order to save some time when writing/compiling other parts of the file, I'd like to use the mode=image of \includestandalone for most compilations and only swith tho mode=tex for the final one. However only a blank space is produced, even though a regular pdf viewer like evince has no problem displaying the first view of the animation pdf file.

In the following example, I tried both includestandalone[mode=image] and includegraphics with no success. Of cours, includestandalone[mode=tex] works and includegraphics successfully displays a png version of the animated pdf produced by convert.

Main TeX file:

\documentclass{article}

\usepackage{standalone,animate,tikz}

\begin{document}

\begin{frame}

\includestandalone[mode=image,height=.25\textheight]{test-animate}

\includegraphics[height=.25\textheight]{test-animate.pdf}

\includegraphics[height=.25\textheight]{test-animate.png}

\includestandalone[mode=tex,height=.25\textheight]{test-animate}

\end{frame}
\end{document}


Animation TeX file (rename to test-animate.tex)

\documentclass{standalone}
\RequirePackage{tikz}
\RequirePackage{animate}
\begin{document}
\begin{animateinline}[poster=first,controls,loop]{1}%
\multiframe{5}{icount=0+10}{%
\begin{tikzpicture}
\draw (-5,-5) rectangle (5,5);
\draw (0,0) -- (\icount:4);
\end{tikzpicture}
}
\end{animateinline}

\end{document}


Here are the corresponding pictures

pdf->png version of the main TeX file

test-animate.png

• It is hard to understand what you're really after. Why don't you just use the animate package option "draft" to save compile time while working on the document? – AlexG Sep 15 '15 at 12:02
• Try using the package pdfpages this can include pdf documents. But it will be a separate page in the document. Is that good enough for you? – Dr. Manuel Kuehner Sep 15 '15 at 12:02
• With standalone every page can be a different size. This might cause problems. – John Kormylo Sep 15 '15 at 14:38
• @Dr.ManuelKuehner: That won't do it since the images are small sketchs, which are commented on the main document. – wilk Sep 15 '15 at 16:31
• @JohnKormylo. I usually draw a rectangle larger than the changing part so that each page is the same size. – wilk Sep 15 '15 at 16:31

I suggest using package option draft of animate while working on other parts of the document in order to save compilation time:

\documentclass{beamer}

\usepackage{tikz}
\usepackage[draft]{animate}

\begin{document}

\begin{frame}
\begin{animateinline}[controls,loop]{1}%
\multiframe{5}{icount=0+10}{%
\begin{tikzpicture}[scale=0.5]
\draw (-5,-5) rectangle (5,5);
\draw (0,0) -- (\icount:4);
\end{tikzpicture}
}
\end{animateinline}
\end{frame}

\end{document}

• I didn't know this option, but it will have the same effect as my failed attempt at including in image mode: displaying a blank rectangle the size of the actual animated picture. However, I would prefer to have an image of the first page, but I can do without. – wilk Sep 15 '15 at 16:35
• @wilk You could also produce a "short" version of the animation. If it has less than, say a thousand frames, every=1000 will insert only the first frame and drop the others. However, this option is only locally available (not as a package option). – AlexG Sep 16 '15 at 10:35