imagelatexoverleaf

Overleaf: How to have several images in one page, like a collage, with figure caption in between?


For my thesis I want to show some pictures, like this: Image collage on A4

What is the best way to code this in overleaf?

So far I was able to get the pictures somewhat in the places I wanted them with the following code. However, I don't know how to get the Figure caption in between the pictures like I want it. I was able to put some text in the place where I want the figure caption, but if I write \caption{} in that place, it gives an error.

\begin{figure}
\centering

\begin{tabular}{@{} c c @{}}
  \begin{tabular}{@{} c  @{}}
    
    \includegraphics[width=0.48\textwidth]{Pictures/M&M/01_sampling.png} \\[10ex] 
    Text \\[1ex]
    \includegraphics[width=0.48\textwidth]{Pictures/M&M/06_sorting.png}
  \end{tabular}
  &
  \begin{tabular}{@{} c @{}}
    \includegraphics[width=0.48\textwidth]{Pictures/M&M/02_sampling.png} \\[1ex]
    \includegraphics[width=0.48\textwidth]{Pictures/M&M/03_sampling.png}\\[1ex]
    \includegraphics[width=0.48\textwidth]{Pictures/M&M/04_sampling.png}\\[1ex]
    \includegraphics[width=0.48\textwidth]{Pictures/M&M/05_sampling.png}
  \end{tabular}
\end{tabular}

\caption{}\label{whatever}
\end{figure}

Solution

  • So after some time I found this option which worked perfectly:

    \begin{figure}[!htp]
    \centering
    \valign{#\cr
      \hsize=0.48\textwidth
      \subfloat{\includegraphics[width=\hsize]{Pictures/M&M/01_sampling.png}}\vfill
      \caption{Text}\vspace{5pt}
      \subfloat{\includegraphics[width=\hsize]{Pictures/M&M/06_sorting.png}}\cr
      \noalign{\hfill}
      \hsize=0.48\textwidth
      \subfloat{\includegraphics[width=\hsize]{Pictures/M&M/02_sampling.png}}\vfill
      \subfloat{\includegraphics[width=\hsize]{Pictures/M&M/03_sampling.png}}\vfill
      \subfloat{\includegraphics[width=\hsize]{Pictures/M&M/04_sampling.png}}\vfill
      \subfloat{\includegraphics[width=\hsize]{Pictures/M&M/05_sampling.png}}\cr
    }
    \end{figure}
    

    From this post