[Tex/LaTex] Only one caption under multiple subfigures

captionsfloatssubfloats

I have the following code

\begin{figure*}[h]
    \centering
    \begin{subfigure}[b]{0.475\textwidth}
        \centering
        \includegraphics[width=\textwidth]{imagenes/1.jpg}
        \caption{Image 1.}
    \end{subfigure}
    \quad
    \begin{subfigure}[b]{0.475\textwidth}  
        \centering 
        \includegraphics[width=\textwidth]{imagenes/2.jpg}
        \caption{Image 2.}
    \end{subfigure}
    \vskip\baselineskip
    \begin{subfigure}[b]{0.475\textwidth}   
        \centering 
        \includegraphics[width=\textwidth]{imagenes/3.jpg}
        \caption{Image 3.}
    \end{subfigure}
    \quad
    \begin{subfigure}[b]{0.475\textwidth}   
        \centering 
        \includegraphics[width=\textwidth]{imagenes/4.jpg}
        \caption{Image 4.}
    \end{subfigure}
    \caption{Global caption.}
\end{figure*}

which outputs the following figure.

figurea

Is it possible to get only one caption for all the figures in a row? The result should be something like this.

figureb

Best Answer

You can put all figures of a row in only one subfigure environment.

Example (assuming package subcaption is used):

\documentclass{article}
\usepackage{subcaption}
\usepackage[demo]{graphicx}
\begin{document}

\begin{figure}[htb]
    \centering
    \begin{subfigure}[b]{\textwidth}
        \centering
        \includegraphics[width=0.475\linewidth]{imagenes/1.jpg}%
        \hfill
        \includegraphics[width=0.475\linewidth]{imagenes/2.jpg}
        \caption{Image 1 and 2}
    \end{subfigure}
    \vskip\baselineskip
    \begin{subfigure}[b]{\textwidth}
        \centering
        \includegraphics[width=0.475\linewidth]{imagenes/3.jpg}%
        \hfill
        \includegraphics[width=0.475\linewidth]{imagenes/4.jpg}
        \caption{Image 3 and 4}
    \end{subfigure}
    \caption{Global caption.}
\end{figure}
\end{document}

enter image description here

Related Question