I have a folder containing files fig-0.png, fig-1.png, ... and so on. Since there are many files, to make things convenient is is possible to write some kind of a "for" loop such that beamer makes one image per-slide?
Asked
Active
Viewed 1,375 times
1
smilingbuddha
- 2,421
1 Answers
3
Sure. This will work with your pictures as well, but the other users on this site won't have your pics so I use an example that loads pics that are part of the standard installations.
\documentclass{beamer}
\usepackage{pgffor}
\begin{document}
\foreach \X in {a,...,c,duck}
{\begin{frame}[t]
\frametitle{image \X}
\includegraphics[width=0.95\textwidth]{example-image-\X}
\end{frame}}
\end{document}

my_file.png), they should be escaped (my\_file.png) to avoid a mess in the frame title. Fortunately,includegraphicswill recognize them without problems. – gibbone Nov 17 '22 at 10:49