# Include a 100 graphs in 100 slides in Beamer

I have a 100 images named Image-1.pdf to Image-100.pdf. Is there a way to include all of them in one slide each without having to type out each name in 100 slides and doing \includegraphics on each slide?

• Is your problem solved? If yes, then accept an answer (the one that you like most). – Dr. Manuel Kuehner Apr 27 '17 at 20:30

There are many ways to implement loops in LaTeX. One possibility is the pgffor package (see section 83 "Repeating Things: The Foreach Statement" of the tikz documentation):

\documentclass{beamer}
\usepackage{pgffor}
\usepackage{graphicx}

\begin{document}
\begin{frame}
\foreach \i in {1,...,3}{
\includegraphics<+>[width=\linewidth]{img/image-\i}
}
\end{frame}
\end{document}


Beamer comes with a command, which does exactly this: \multiinclude

\documentclass{beamer}
\usepackage{xmpmulti}
\begin{document}

\begin{frame}
\multiinclude[<+->][format=pdf, graphics={width=\textwidth}, start=1]{Image}
\end{frame}

\end{document}


You can even animate the sequence using something like \transduration<0-100>{0.5}.

My way of doing this is a combined effort of the filecontents and csvsimple packages. Within the filecontents environment you just list the images to be used (this is helpful when you have no uniform image name pattern).

\documentclass{beamer}
\usepackage{filecontents,csvsimple}

\begin{document}

\graphicspath{{<insert/path/to/image/folder>}}

\begin{filecontents*}{imagelist.txt}
Image-1
Image-2
Image-3
\end{filecontents*}


• You actually don't need graphicx with beamer. – user36296 Apr 26 '17 at 15:48
• You can simplify it even more if you use \includegraphics<+>{\csvcoli} instead of the \only command – user36296 Apr 27 '17 at 16:23