1

Here is what I am trying to do:

(a) Picture, Picture

(Caption for BOTH images (a) goes here)

(b) Picture, Picture

(Caption for BOTH images (b) goes here)

Etc. For the life of me I cannot figure out how to get ONE caption per pair of subfigure without LaTeX stacking the subfigures on top of each other. Each section of code typically looks like this:

\begin{subfigure}[h]{5cm}
    \includegraphics[scale=0.3]{graphicA1}
    \includegraphics[scale=0.3]{graphicA2}
    \caption{captionA}
\end{subfigure}\\

With a simple \begin{figure} and \end{figure} around the whole thing. When I try this, graphicA1 and graphicA2 get stacked on top of each other. I do NOT want this. I want A1 and A2 in one single row, with a combined caption designed specifically for that subfigure set. How?

2

2 Answers 2

5

Here is an example using subfigure. You can set width dependent on \textwidth to prevent linebreak caused by to big images.

\documentclass[a4paper]{article}
\usepackage{graphicx}
\usepackage{subfigure}

\begin{document}
    \begin{figure}
        \centering
        \subfigure[caption A B]{
            \includegraphics[width=0.49\textwidth]{example-image-a}
            \includegraphics[width=0.49\textwidth]{example-image-b}
        }
        \subfigure[caption C A]{
            \includegraphics[width=0.49\textwidth]{example-image-c}
            \includegraphics[width=0.49\textwidth]{example-image-a}
        }
        \caption{caption}
    \end{figure}
\end{document}

enter image description here

1
  • Thank you for the simplest, yet informative answer. Commented Aug 14, 2023 at 23:59
0

You could try to use this sample

\begin{figure}[ht]
        \begin{center}
        \begin{minipage}[b]{0.4\linewidth}
            \centering
            \includegraphics[scale = 0.5]{image A}
        \end{minipage}
        \quad
        \begin{minipage}[b]{0.4\linewidth}
            \centering
            \includegraphics[scale = 0.5]{image B}
        \end{minipage}\\

        \caption{...}
        \end{center}
\end{figure}
2
  • Don't use a center-environment inside of a figure-environment! It adds too much space. Instead you should use \centering as you did in your minipages.
    – Skillmon
    Commented Jun 15, 2017 at 16:44
  • Thank you for your advice. It really adds too much space compare with the case I don't use it.
    – Dennis
    Commented Jun 16, 2017 at 1:33

You must log in to answer this question.

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