2

For some reason I'm not able to have a top alignment of figures using subfigure and the environmental option [t]. I have search the internet for solutions and found them pretty complex for such a simple and general problem... What is the simple solution?

\documentclass[11pt]{article}
\usepackage[draft]{graphicx}
\usepackage{caption}
\usepackage{subcaption}

\begin{document}

\begin{figure}[h!]
\centering

\begin{subfigure}[t]{.49\linewidth}
\centering
\includegraphics[width=1\textwidth]{calCurve.pdf}
\caption{Caption 1}
\end{subfigure}%
\begin{subfigure}[t]{.49\linewidth}
\centering
\includegraphics[scale=0.7]{anova.pdf}
\caption{Caption 2}
\end{subfigure}%
\end{figure}

\end{document}

Output

Werner
  • 603,163
Simon
  • 155

1 Answers1

1

You could give floatrow a roll:

\documentclass[12pt]{article}

\usepackage{caption,floatrow}

\DeclareCaptionSubType[alph]{figure}
\captionsetup[figure]{labelsep=colon}
\captionsetup[subfigure]{labelformat=brace,labelsep=space,labelfont=bf}
\floatsetup[subfigure]{capposition=bottom,heightadjust=all,valign=t}

\begin{document}
\begin{figure}[htp]
  \ffigbox[\FBwidth]
  {\begin{subfloatrow}
      \ffigbox
        {\caption{First subfigure}}%
        {\rule{3cm}{3cm}}

        \ffigbox
        {\caption{Second subfigure with more Text so we have a line break}}%
        {\rule{1.5cm}{1.5cm}}
  \end{subfloatrow}}
  {\caption{Two figures}}
\end{figure}
\end{document}

enter image description here

Arash Esbati
  • 7,416