Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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

\caption{Write the caption here.}
\vspace{0.0cm} \centering

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!

share|improve this question
I would leave this task to my editor... Thus, what editor do you use? –  Jan Feb 17 '13 at 12:09
I use texshop on mac platform. I use Xcode. –  user26101 Feb 17 '13 at 12:20
so what I have to do. –  user26101 Feb 18 '13 at 10:18
Related: tex.stackexchange.com/questions/53458/… –  Torbjørn T. Feb 18 '13 at 15:30
If you have coding skills, just write a little program in your favorite language to generate the LaTeX source code. –  Ben Crowell Feb 18 '13 at 16:14
add comment

migrated from stackoverflow.com Feb 18 '13 at 15:23

This question came from our site for professional and enthusiast programmers.

1 Answer

This looks easiest to do using \foreach from the pgf bundle:

  \foreach\x in {1,2,...,100}{%
share|improve this answer
add comment

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.