2

I'am a bit confused by the animate package I compile with LuaTeX. It is a very simple code:

\documentclass{article}
\usepackage{graphicx}
\usepackage{animate}

\begin{document}

\animategraphics[controls]{1}{boot}{01}{11}


\end{document}

and all I want to do is simply switch through the pics (boot01.png to boot11.png) showing them in their original sizes. BUT, after the very first pic (boot01.png), all the other pics come in the same geometry (so, if the first pic is 400 x 100 and the second is 200 x 600, the second will be shown in 400 x 100 too and so on ... completely distorted. There must be an option to prevent this behavior, but I didn't find it. I have found this keepaspectratio, but ... Could anyone give me a hint?

1
  • \animategraphics[width=4cm,height=1cm]...?
    – Hugh
    Jul 27, 2015 at 10:10

1 Answer 1

1

By design, all frames are displayed in a PDF widget annotation whose dimensions are adjusted to the first frame's dimensions, subject to the width, height, totalheight, keepaspectratio & scale options.

All subsequent frames are scaled to fit into this widget, leading to distorted images if their original size and/or aspect ratio vary.

But fortunately, there is option viewport allowing you to force a given input size for the sequence: Just find the maximum width and height of all images and put the said option as

viewport=0 0 <max width> <max height>

In your example I can find 400px to be the maximum width and 600px to be the maximum height occurring and thus the wanted inclusion command should read

\documentclass{article}
\usepackage{graphicx}
\usepackage{animate}

\begin{document}

\noindent%
\animategraphics[controls,viewport=0 0 400 600,width=\linewidth]{1}{boot}{01}{11}

\end{document} 
1
  • THANK you, AlexG, for your useful answer---this is exactly what I needed to know: [viewport]
    – tobber
    Jul 27, 2015 at 13:59

You must log in to answer this question.

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