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!

  • 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, 2011 at 13:37
  • @Alexander: Which method will produce faster animation viewed on Adobe Reader, animateinline or animategraphics? Aug 17, 2011 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, 2011 at 14:18

1 Answer 1


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`

  • I will test it now. Whether it is what I am looking for. Aug 17, 2011 at 12:33
  • I think I don't need pst-pdf because it internally invokes preview. Aug 17, 2011 at 13:07
  • but then you have to use \PreviewEnvironment{pspicture}
    – user2478
    Aug 17, 2011 at 13:23

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .