I have two subfigures side by side in one figure, and one subfigure is less than half the height of the other. I would like to align the subfigures at their titles and have the caption fill the empty space under the smaller subfigure, then overflow beneath both figures. Is this possible? Below is the code and picture of how it is now.

Thank you in advance!

  \subfloat[]{{\includegraphics[width=5cm]{Fig10a.png} }}%
  \subfloat[]{{\includegraphics[width=5cm]{Fig10b.png} }}%
  \caption{Caption text goes here.}

enter image description here


1 Answer 1


This solution modifies \@makecaption locally to format the caption using \hangindent and \hangafter. The saveboxes are used to compute the distance for the text to be wrapped.

The \subfloats are aligned at the top using \raisebox. Technically, the caption overlaps the left picture, hence the [0pt].

The extra \topskip is due to a feature (bug) in subfig which behaves differently in vmode and hmode.

\usepackage{caption}% not used, test for compatibility

\newcommand{\hangcaption}[2]{% #1 = \hangindent, #2 = \hangafter\baselineskip (negative distance)
    \hangafter=\numexpr #2\relax/\baselineskip\relax
    ##1: ##2\par


  \raisebox{\dimexpr \topskip-\height}{\usebox1}% \topskip ?????
  \hangcaption{0.5\textwidth}{\dimexpr \ht1-\ht0}%
  \caption[short caption]{\blindtext}



You must log in to answer this question.

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