I want to arrange 33 subfigures by putting them in groups of 3, I tried the following solution:
\documentclass[smallextended,table]{svjour3}
\begin{document}
\begin{figure}
%start first row
\begin{subfigure}{0.3\textwidth}
\includegraphics[width=\textwidth]{IMG/IMG_RQs/cli/....pdf}
\end{subfigure}
\hfill
\begin{subfigure}{0.3\textwidth}
\includegraphics[width=\textwidth]{IMG/IMG_RQs/cli/....pdf}
\end{subfigure}
\hfill
\begin{subfigure}{0.3\textwidth}
\includegraphics[width=\textwidth]{IMG/IMG_RQs/cli/....pdf}
%end first row
....
%start last row...
\hfill
\begin{subfigure}{0.3\textwidth}
\includegraphics[width=\textwidth]{IMG/IMG_RQs/cli/....pdf}
\hfill
\begin{subfigure}{0.3\textwidth}
\includegraphics[width=\textwidth]{IMG/IMG_RQs/cli/....pdf}
\hfill
\begin{subfigure}{0.3\textwidth}
\includegraphics[width=\textwidth]{IMG/IMG_RQs/cli/....pdf}
\end{subfigure}
\end{figure}
\end{document}
The output is partially correct, indeed, the figures occupy three columns, however, the last group of images is drawn outside the vertical margin of the document,
as shown in figure 
How can I fix it?


graphicxprovides a set of dummy images such asexample-image,example-image-a,example-image-betc. you could use with\includegraphics. This helps to provide a self-contained MWE. – Celdor Oct 20 '22 at 10:21fitall images into the same page or accept that they spread along different pages? – Ignasi Oct 20 '22 at 13:27