1

I have two figures of unequal size (figure 1 is wider and shorter), and I would like to centre-align the two subfigures vertically, but keep the subcaptions aligned at the top (please see attached image). Can this be done with the subcaption package, without modifying the figures themselves? enter image description here (figure updated)

%preamble
\usepackage[singlelinecheck=false, aboveskip=-3pt]{subcaption}
%document
       %version1----
            \begin{figure}
            \captionsetup[subfigure]{labelformat=simple, position = top}
            \captionsetup{font={onehalfspacing},skip=-10pt}
            \subcaptionbox{}[0.5\textwidth]{\includegraphics[width=0.5\linewidth]{fig1.pdf}}
            \subcaptionbox{}[0.5\textwidth]{\includegraphics[width=0.5\linewidth]{fig2.pdf}}

        \end{figure}
        \clearpage
       %version2----
        \begin{figure}[hb]
            \captionsetup[subfigure]{labelformat=simple}
            \captionsetup{font={onehalfspacing},skip=-10pt}
                \begin{subfigure}[c]{0.49\textwidth}
                    \caption{}                
                    \includegraphics[width=\textwidth]{fig1.pdf}
                \end{subfigure}
                \begin{subfigure}[c]{0.49\textwidth}
                    \caption{}                
                    \includegraphics[width=\textwidth]{fig2.pdf}
                \end{subfigure}
srao
  • 647

1 Answers1

1

You might like this solution:

\documentclass{article}

\usepackage{graphicx}
\usepackage[singlelinecheck=false, aboveskip=-3pt]{subcaption}
\renewcommand{\thesubfigure}{\Alph{subfigure}}

\begin{document}

\begin{figure}[htbp]
\captionsetup[subfigure]{labelformat=simple}
\begin{subfigure}{\textwidth}
\valign{\hsize=0.49\hsize \linewidth=\hsize #\cr
  \caption{}
  \vfill
  \includegraphics[height=2cm,width=\hsize]{example-image}
  \vfill
  \cr\noalign{\hfill}
  \caption{}
  \vfill
  \includegraphics[width=\hsize]{example-image}
  \vfill
  \cr
}
\end{subfigure}

\end{figure}

\end{document}

enter image description here

egreg
  • 1,121,712