3

I'm trying to make an animation with beamer. I usually do the following:

\begin{animateinline}{12}
  \multiframe{11}{i=0+1}{%
  \includegraphics[width=\textwidth]{image_\i}}     
\end{animateinline} 

This allows me to concatenate 12 images (that are called image_0, image_1, ... , image_11) at a certain velocity (11 frames per second).

My question is the following: Imagine that now I want to concatenate these 12 images such that the time between them is not constant. For instance, image_0 appears at time t=0, image_1 appears at time t=2 sec, etc. The set of times are known. How can I do that? Is it possible with the animate package? If not... what can I use?

3
  • Welcome to TeX.SX! Usually, we don't put a greeting or a “thank you” in our posts. While this might seem strange at first, it is not a sign of lack of politeness, but rather part of our trying to keep everything very concise. Accepting and upvoting answers is the preferred way here to say “thank you” to users who helped you.
    – Herr K.
    Nov 18, 2013 at 23:44
  • A tip: If you indent lines by 4 spaces or enclose words in backticks `, they'll be marked as code, as can be seen in @Ruben's edit. You can also highlight the code and click the "code" button (with "{}" on it).
    – Herr K.
    Nov 18, 2013 at 23:45
  • 2
    the documentation says: 6.2 The `timeline' option timeline=<timeline file> <timeline file> is a plain text file whose contents determines the order of appearance of the embedded material during the animation. It allows the user to freely rearrange, repeat and overlay the material at any point of the animation. This may greatly reduce the file size of the resulting PDF, as objects that do not change between several or all frames, such as coordinate axes or labels, can be embedded once and re-used in other frames of the animation. Nov 19, 2013 at 0:02

1 Answer 1

1

Use a timeline file.

The frame rate is the second field (<1st>:<2nd>:<3rd field>) in a timeline entry. It is measured in frames per second and thus equals 1/frame delay in seconds.

Since we specify a frame rate for the zeroth frame in the example below, the default frame rate (12) given with \animategraphics becomes meaningless.

The third field determines what to show.

It is more sensible to use \animategraphics for animating external graphics files.

\documentclass{article}
\usepackage{animate}
\usepackage{filecontents}

\begin{filecontents*}{mytmln.txt}
:0.2:0   %  1/0.2*1s=5s
:0.25:1  %  4s  
:0.5:2   %  2s  
:1:3     %  1s  
:2:4     %  0.5s  
:4:5     %  0.25s  
:5:6     %  0.2s
:8:7     %  0.125s
:0.1:8   %  10s
::9      %  10s
::10     %  10s
::11     %  10s
\end{filecontents*}

\begin{document}
\noindent\animategraphics[timeline=mytmln.txt,width=\linewidth,loop]{12}{image_}{0}{11}%
\end{document}
0

You must log in to answer this question.

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