3

How can I have a figure (with a caption) that has three subfigures (each with its own caption, say (a), (b) and (c)) with the following layout: There are two columns; the first column is a single subfigure, the second column consists of two subfigures stacked vertically:

enter image description here

2

2 Answers 2

4

Using subcaption and minipages you can achieve this:

\documentclass[]{article}

\usepackage{subcaption}
\usepackage[]{graphicx}

\begin{document}
\begin{figure}% >>>
  \centering
  \begin{minipage}[t]{.45\linewidth}
    \subcaptionbox{text1}
      {\includegraphics[width=\linewidth]{example-image-duck}}%
  \end{minipage}%
  \hfill
  \begin{minipage}[b]{.45\linewidth}
    \subcaptionbox{text2}
      {\includegraphics[width=.5\linewidth]{example-image-duck}}
    \subcaptionbox{text3}
      {\includegraphics[width=.5\linewidth]{example-image-duck}}%
  \end{minipage}%
  \caption
    {%
      Caption.%
      \label{fig:caption}%
    }%
\end{figure}% <<<

\end{document}

enter image description here

Using the subfig package as though one has tried to read its manual:

\documentclass[]{article}

\usepackage{subfig}
\usepackage[]{graphicx}

\begin{document}
\begin{figure}% >>>
  \centering
  \begin{minipage}[t]{.45\linewidth}
    \subfloat[text1]
      {\includegraphics[width=\linewidth]{example-image-duck}}%
  \end{minipage}%
  \hfill
  \begin{minipage}[b]{.45\linewidth}
    \subfloat[text2]
      {\includegraphics[width=.5\linewidth]{example-image-duck}}\\
    \subfloat[text3]
      {\includegraphics[width=.5\linewidth]{example-image-duck}}%
  \end{minipage}%
  \caption
    {%
      Caption.%
      \label{fig:caption}%
    }%
\end{figure}% <<<

\end{document}

Output is almost identical.

3
  • Thanks! it works. However, I was using the subfig package for some other figures and it is incompatible with subcaption. Is there a similar solution with subfig instead of subcaption? Sep 20, 2018 at 20:21
  • @AbolfazlKarimi yes. You know that you can read its manual?
    – Skillmon
    Sep 20, 2018 at 20:56
  • @AbolfazlKarimi See new answer below (it uses subcaption instead)
    – Domi
    Sep 1, 2022 at 10:45
0

With the more modern subcaption package, you can simply nest subfigure for advanced layouts, like so:

Result

enter image description here

Code

\documentclass[a4paper,12pt]{book}
\usepackage{subcaption}
\usepackage[]{graphicx}

\begin{document}
  \begin{figure}[th]
    \begin{subfigure}[b]{0.65\textwidth}
      \includegraphics[width=\textwidth]{test}
      \caption{1}
    \end{subfigure}
    \hfill  % NOTE1: hfill moves horizontally stacked objects as far apart as it can
    \begin{subfigure}[b]{0.32\textwidth}
      \begin{subfigure}[t]{\textwidth}
        \includegraphics[width=\textwidth]{test}
        \caption{2}
      \end{subfigure}
      % NOTE2: two empty lines = 1 linebreak


      \begin{subfigure}[b]{\textwidth}
        \includegraphics[width=\textwidth]{test}
        \caption{3}
      \end{subfigure}
    \end{subfigure}

    \caption{figure caption}
  \end{figure}
\end{document}

A few things to note

  1. You can force linebreaks (i.e. move to the next "row") through several means. The simplest approach is add two empty lines. Conversely, you want to be careful not to insert random empty lines into your figure environment. (E.g. the other day, I wasted an hour debugging this exact problem because I forgot that empty lines insert rows).
  2. \hfill can be used to space things out horizontally.
  3. If the total width of all horizontally stacked subfigure exceeds \textwidth, it will also automatically move things to the next line. If you want to use more than \textwidth, you have to solve a more complicated problem (see here).

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .