# how to insert a large number of images in latex

I am not sure whether this question has been asked here before or the question is stupid to ask due to insufficient knowledge in how latex graphics actually work.

I add a picture using \includegraphics{1.jpg} now If I have a large number of images(finite), how can I insert those images in a single command or so? I mean what is easy and quick way to insert rather than writing \includegraphics{1.jpg}, \includegraphics{2.jpg}, \dots \dots, \includegraphics{n.jpg}?

Thanks!

Edit: Just after asking the question I saw this post but not sure if it is answering my query: How to insert multiple images in one figure using LaTeX?

• the linked question might not do exactly what you need. What you need to do depends on what your document will look like. What I mean, is: will the images be placed on more than one page? Will you add captions? Do you need to refer to individual images in your text? Is there going to be running text between the individual images that you will add later on? In summary: a potential answerer needs more information as to what you will want to do with your document later on. Give an example of what you have in mind or (best) add an MWE so people can work on that. Aug 23, 2019 at 14:36
• Well, very simple, imagine I have 2000 images from a trip, and I just want them to keep as a pdf book, each page will have one image say. Aug 23, 2019 at 14:38
• Do the image filenames follow a recognizable sequence (img1, img2 ...) or do you intend to input a list of image names? Aug 23, 2019 at 14:43
• image files names are 1.jpg, dot dot 2000.jpg Aug 23, 2019 at 14:44
• @Marso Your comment includes 4 dots .... but it should only be three ..., as in {1,2,...,2000} Aug 23, 2019 at 14:51

easy with foeach:

\documentclass{article}

\usepackage{graphicx}
\usepackage{pgffor}

\begin{document}

\foreach \x in {1,2,...,3}{%
\includegraphics[width=1cm]{\x}%
}%

\end{document}

• @Marso re your attempted edit: Not fix height and width, at most one of them. And file type is not necessary, better remove it. Latex will know which type is best Aug 23, 2019 at 15:42