I just want to automate a report, but i have to add photos from a folder one after the other (all with the same termination(.jpg)), is there a macro or something that adds all the photos at once? For now im doing it manually, but it would be a lot faster and easier like this. I suppose I need to write a macro and then add it in my LaTeX file, but im new in this I don't know how to do it. I'm using windows
{\section{Imatges seguiment}
\begin{figure}[h]
\includegraphics[width=\linewidth]{images/coffee1.jpeg}
\caption{Coffee.}
\end{figure}
\begin{figure}[h]
\includegraphics[width=\linewidth]{images/coffee2.jpeg}
\caption{Coffee.}
\end{figure}
\begin{figure}[h]
\includegraphics[width=\linewidth]{images/coffee3.jpeg}
\caption{Coffee.}
\end{figure}
\newpage}
That's what I'm calling manually, so the thing is taking all the photos that are in the same folder (Note: not all the photos start with coffee, this is just an example)

.jpgis not needed, if all photos have the same size, you can use keyGin, and if photos are collected in one figure, you can include them in the loop (as suggested @leandriis. in his comment. Also you can define path to your folder with photos (images). – Zarko Jun 28 '19 at 08:24