2

I have a pair of figures with uneven levels of information needed in the captions (though in both cases documentation that really should go in the caption instead of elsewhere). How could I best typeset these to cope with the very different lengths? I thought about having the longer one in an L shape, occupying the whole line once below the shorter caption, but I don't know how I could effect this.

\documentclass{article}



\usepackage{graphicx}
\usepackage{caption}
\usepackage{subcaption}

\begin{document}

\begin{figure}
\centering
\begin{subfigure}[t]{0.6\textwidth}
\includegraphics[width=\textwidth]{a}
\caption{Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque id ligula a lacus interdum ullamcorper a eu eros. Pellentesque eu interdum nisi. Integer ut dui eros. Nulla porta leo consectetur risus varius tincidunt. Curabitur varius diam metus, sit amet elementum nulla eleifend at. Nulla vitae enim ac urna tristique tristique et at nibh. Morbi urna velit, sollicitudin sit amet vehicula eget, luctus at urna. Cras at rutrum diam, vel viverra erat.}
\label{fig:gull}
\end{subfigure}
~
\begin{subfigure}[t]{0.3\textwidth}
\includegraphics[width=\textwidth]{b}
\caption{Lorem ipsum dolor sit amet, consectetur adipiscing elit.}
\end{subfigure}
\caption{Figures of uneven caption length.}
\end{figure}






\end{document}
  • And placing one below the other instead of side-by-side? – Gonzalo Medina Jul 31 '15 at 18:21
  • Sorry: should have covered that. Unfortunately they are better placed side-by-side because the viewer is asked to directly compare them in a manner which would be less clear on top. – alice19 Jul 31 '15 at 18:26
  • I see. Would reducing the width for the image with the longer caption and increasing its caption width be a possibility? – Gonzalo Medina Jul 31 '15 at 18:31
  • Unfortunately, it still results in an ugly, deeply unbalanced caption appearance. – alice19 Jul 31 '15 at 18:33
  • So you want something like \begin{figure} \centering \begin{subfigure}[t]{0.6\textwidth} \includegraphics[width=\textwidth]{example-image-a} \caption{Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque id ligula a lacus interdum ullamcorper a eu eros. Pellentesque eu interdum nisi. Integer ut dui eros. Nulla porta leo consectetur risus} \label{fig:gull} \end{subfigure}\hfill \begin{subfigure}[t]{0.3\textwidth} \includegraphics[width=\textwidth]{example-image-b} \caption{Lorem ipsum dolor sit amet, consectetur adipiscing elit.} \end{subfigure}\vskip-\abovecaptionskip – Gonzalo Medina Jul 31 '15 at 18:52
4

Here's one option implementing your "L" shape idea for the longer caption:

enter image description here

The code:

\documentclass{article}
\usepackage{graphicx}
\usepackage{caption}
\usepackage{subcaption}

\begin{document}

\begin{figure}
  \centering
  \begin{subfigure}[t]{0.65\textwidth}
  \includegraphics[width=\textwidth]{example-image-a}
  \caption{Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque id ligula a lacus interdum ullamcorper a eu eros. Pellentesque eu interdum nisi. Integer ut dui eros. Nulla porta leo consectetur risus varius tincidunt.}
  \label{fig:gull}
  \end{subfigure}\hfill
  \begin{subfigure}[t]{0.3\textwidth}
  \includegraphics[width=\textwidth]{example-image-b}
  \caption{Lorem ipsum dolor sit amet, consectetur adipiscing elit.}
  \end{subfigure}\vskip-\abovecaptionskip
  \caption*{\small Curabitur varius diam metus, sit amet elementum nulla eleifend at. Nulla vitae enim ac urna tristique tristique et at nibh. Morbi urna velit, sollicitudin sit amet vehicula eget, luctus at urna. Cras at rutrum diam, vel viverra erat.}
  \caption{Figures of uneven caption length.}
\end{figure}

\end{document}

The idea is to interrupt the longer caption at an appropriate location (for example, when it is one line below the shorter caption) and typset the remaining text using \caption* with the necessary vertical adjustment.

I'd still like to see another possible approaches to treat this situation.

  • With a slight adjustment to make the lower caption's text smaller (it emerges bigger that the caption it is supposed to continue) this looks great (thanks so much); it does however require careful judgement of where to break the text. – alice19 Jul 31 '15 at 19:11
  • @marcellinus12 Yes, the font has to be set according to the one used for subcaptions and the breaking point has to be carefully chosen. I attempted to use \vboxes and \vsplit to automate the process, but couldn't find a satisfying result. – Gonzalo Medina Jul 31 '15 at 23:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.