I encounter an issue with the following code and must admit that I was able to find trick on the forum for now.


\begin{animateinline}[loop,poster = first, controls]{1}
   \foreach \x in {a,b}{


When I unflatten the list, there is no problem. However, the \foreach loop throws an error (Undefined control sequence).

I can't find any workaround.

Thank you for your help

  • 1
    Hi, welcomme. Please add a compileable code. – AndréC Sep 13 '19 at 12:41

Pkg animate has its own looping device, \multiframe. It should be used instead of external looping commands, such as \foreach, with a \newframe in the loop body.

For parameterizing the file name argument of \includegraphics with non-numeric values ("a", "b", "c"), use pkg pgf's array-like expression in combination with \multiframe:



\def\imgID{{"a", "b", "c"}}


\begin{animateinline}[loop, controls]{1}
  \multiframe{3}{i=0+1}{  % i = <init. val.> + <incr.>


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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