[Tex/LaTex] how to put odd number subfigures in multiple rows

floatspositioningsubfloats

There are five figures. Basically, I'd like them to displayed as following:

     |figure 1|figure 2|

|figure 3|figure 4|figure 5|

The first two figures are in the first row and the last three are in the second row. And
The first row should be in the middle of the second row.

Best Answer

(Updated to include @Mico's suggestion of a \bigskip.)

Here's one possibility that makes use of \parboxes. This solution makes sense, I think, if you want all of the figures to have a figure number that increases.

You can change the length for the first two \parboxes and the length for the first two \includegraphics commands if you want the top two figures to be smaller and not span the entire width of the overall figure environment.

\documentclass{article}

\usepackage{graphicx}
\usepackage{mwe}

\begin{document}

\begin{figure}
\parbox{.48\textwidth}{\includegraphics[width=.48\textwidth]{example-image-a}\caption{}}
\hfill
\parbox{.48\textwidth}{\includegraphics[width=.48\textwidth]{example-image-a}\caption{}}

\bigskip

\parbox{.32\textwidth}{\includegraphics[width=.32\textwidth]{example-image-a}\caption{}}
\hfill
\parbox{.32\textwidth}{\includegraphics[width=.32\textwidth]{example-image-a}\caption{}}
\hfill
\parbox{.32\textwidth}{\includegraphics[width=.32\textwidth]{example-image-a}\caption{}}
\end{figure}

\end{document}

enter image description here

There are also the subfig and subcaption packages that allow you to have subfigures (e.g., the labels will be something like Figure 1(a), Figure 1(b), etc.; see, for starters, subcaption vs. subfig: Best package for referencing a subfigure and also Jesse's answer for a concrete example).