I've split an animated GIF into the frames and saved them as a PNG sequence. I use the beamer class and want to load the images from the sequence, replacing each other without an autostart animation.
\begin{frame}\frametitle{FooBar}
\foreach \x in {0,...,5} {
\includegraphics<\x+1>[width=0.95\textwidth]{dbgp-setup2-\x.png}
}
\end{frame}
The compiler output says that
Latexmk: Missing input file: 'dbgp-setup2-.png' from line
The filename should be dbgp-setup2-0.png, dbgp-setup2-1.png etc.. Why does \x not work?


\foreach \x [count=\y] in {0,...,5} { \includegraphics<\y>[width=0.95\textwidth]{dbgp-setup2-\x.png} }The parser does not know that it should compute the argument of<....>, so you have to do that. – Feb 28 '19 at 00:29dbgp-setup2-0.png,dbgp-setup2-1.png, ... are in the working folder? – Werner Feb 28 '19 at 01:00\graphicspath{ {./img/} }before. The package graphicx is also loaded. – Christian Feb 28 '19 at 21:31\foreachthat isn't defined. As such, the\xisn't defined, leading to the missing number in the image reference. For future reference, include a complete, yet minimal example that allows us to replicate the behaviour. Such a minimal, working example (MWE) should start with\documentclassand end with\end{document}and allow the community to copy-and-paste-and-compile and see exactly what you're seeing. For that, use images frommweandlipsumtext, if needed. – Werner Feb 28 '19 at 22:23