I have a large number of figures (~300) in a folder called
'allimages'. The figures are numbered fig1.eps, fig2.eps,…..fig300.eps.
I want to put all of them in latex such that 6 images appear on one page.
What I know to do is something like this
\begin{figure}[h]
\caption{Write the caption here.}
\vspace{0.0cm} \centering
\includegraphics[height=5.4cm]{allimages/fig1.eps}
\includegraphics[height=5.4cm]{allimages/fig2.eps}
\includegraphics[height=5.4cm]{allimages/fig3.eps}
\includegraphics[height=5.4cm]{allimages/fig4.eps}
\includegraphics[height=5.4cm]{allimages/fig5.eps}
\includegraphics[height=5.4cm]{allimages/fig6.eps}
\end{figure}
But doing like this will be time consuming. Is it possible to have some
looping statement that makes it easier and help me skip long listing of
figures. Thanks!
Best Answer
This looks easiest to do using
\foreach
from thepgf
bundle. To get everything on separate pages, you probably need a couple of loops:Doing all of this with floats will run out of space quite quickly (no intervening text), so I've used the
\captionof
command from thecaption
package to generate the appropriate text.