10

I am using the caption and subcaption packages to create sub-figures in a document. I have two cases of sub-figures:

  1. Two sub-figures side-by-side. For this, the captioning is excellent.
  2. Two sub-figures one below the other. in this case, the first sub-caption appears immediately above the second sub-figure.

How can I configure the sub-captions to include a small space between themselves and the next element in the second case, without messing up the setup for the first case?

The rude way is to stick a vskip explicitly after the first sub-figure. I prefer to avoid this hack.

1
  • 1
    I do not think that \vskip is a hack. You want vertical space and that is what \vskip gives you. If you want to separate content from presentation, you can define your own macros, say \horiontalsubfigures[caption1][caption2]{figure1}{figure2} and \verticalsubfigures[caption1][caption2]{figure1}{figure2} and use \hskip and \vskip in the macro definitions.
    – Aditya
    Nov 20 '10 at 15:18
6

You can set the length \belowcaptionskip (default value 0pt) as you need it. Either do this locally inside the concerned figure environment as shown below or globally in the preamble.

\documentclass[11pt,a4paper,english]{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{babel}
\usepackage[font=small,labelfont=bf,tableposition=top]{caption}
\usepackage[font=footnotesize]{subcaption}

\begin{document}
  \begin{figure}[!ht]
    \setlength{\belowcaptionskip}{5pt}
    \centering
    \begin{subfigure}[b]{0.75\textwidth}
      \rule{\linewidth}{0.5\linewidth}
      \caption{First sub-figure}\label{fig:first}
    \end{subfigure}
    \begin{subfigure}[b]{0.75\textwidth}
      \rule{\linewidth}{0.5\linewidth}
      \caption{Second sub-figure}\label{fig:second}
    \end{subfigure}
    \caption{Two dummy sub-figures}\label{dummy}
  \end{figure}
\end{document}

The caption manual has the details.

3
  • I have exactly the same problem, but this solution doesn't work for me. Setting \belowcaptionskip adds space after the caption for the whole figure (which I don't want), rather than under the subfigure captions (which is what I do want). Any ideas?
    – Roly
    Jan 7 '14 at 10:28
  • 1
    @Roly: Move the line with \setlength into the first subfigure environment (or insert it in both). Jan 8 '14 at 8:35
  • Thanks. Actually I had already tried that. Unfortuately, inside the subfigure environment \setlength does nothing for my document. (Moved back to the figure environment it affects only the spacing after the caption of the whole figure.) I'll have to come up with a MWE.
    – Roly
    Jan 8 '14 at 8:50

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.