TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Making sub-files, that are compiled separately, not only helps reducing the compilation time for the main input file but also helps us to separately test the sub-file in the development phase. Sub-files often use preview package to produce tight PDF images that will be imported later from within the main input file.

From my experience, preview package cannot work together with animate package. Shortly speaking, is there a good way to separately test code fragments with animate package loaded? Putting these code fragments in the main input file seems a bad strategy because during the development phase you will waste much time to compile them. Separating each of them in a not-standalone as follows

% shrinking.tex

and importing it later in the main input file can work. But the question is, how do you compile shrinking.tex during the development phase to get a tight paper size? You might think why do you need a tight paper size in the development phase if the imported PDF animate will no longer work. OK. It is my personal restriction that does not make sense of course!

share|improve this question
In your main document, you could use draft as document or animate package option and final as local command option for the animation you are currently working on. Perhaps, this saves some time, at least for the dvips and ps2pdf steps. – AlexG Aug 17 '11 at 13:37
@Alexander: Which method will produce faster animation viewed on Adobe Reader, animateinline or animategraphics? – xport Aug 17 '11 at 13:43
They seem to produce identical results (I used the measure option for getting the FPS). The PDF file structure is similar for both. Some differences (in the file structure) result from using different drivers (dvips/ps2pdf vs. pdftex) but they don't impinge on animation performance. – AlexG Aug 17 '11 at 14:18
up vote 2 down vote accepted

Run this document with




latex <file>
dvips <file>
ps2pdf <file>.ps

then create a new document and use with pdflatex \animategraphics[controls,loop]{5}{<file>}{}{}. Here is an example of such a document: http://latex.userpage.fu-berlin.de/animate.pdf`

share|improve this answer
I will test it now. Whether it is what I am looking for. – xport Aug 17 '11 at 12:33
I think I don't need pst-pdf because it internally invokes preview. – xport Aug 17 '11 at 13:07
but then you have to use \PreviewEnvironment{pspicture} – Herbert Aug 17 '11 at 13:23

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.