2

When I use the subcaption package, there is but a very small amount of whitespace between the subcaption title and the image below it.

I can add a big space with '\bigskip', but I want to know whether there is a command to change the amount of spacing globally.

\documentclass{article}

\usepackage[demo]{graphicx}
\usepackage[font={small}, justification=centering]{caption}
\usepackage[labelformat=simple]{subcaption}
\renewcommand\thesubfigure{(\alph{subfigure})}
\captionsetup[subfigure]{position=below,skip=25pt}
\usepackage{lipsum}

\begin{document}

\lipsum[1]

\begin{figure}[!htbp]
\subcaptionbox{heading}{\includegraphics[width=0.49\linewidth]{imagefile}}%
\hfill
\subcaptionbox{heading}{\includegraphics[width=0.49\linewidth]{imagefile}}

\subcaptionbox{heading}{\includegraphics[width=0.49\linewidth]{imagefile}}%
\hfill
\subcaptionbox{heading}{\includegraphics[width=0.49\linewidth]{imagefile}}

\caption{text text text text text text text text text text text text text} 
\end{figure}

\lipsum[1]

\end{document}

enter image description here

3
  • The instruction \captionsetup[subfigure]{position=below,skip=25pt} tells LaTeX to insert 25pt of whitespace between the subfigure's image and associated caption. That would appear to be quite a lot -- likely even excessive. You probably want something like \captionsetup[subfigure]{position=below,skip=0.5\baselineskip} -- and set the \belowcaptionskip length parameter, as shown in @Zxcvasdf's answer.
    – Mico
    Jul 26, 2022 at 6:50
  • Thank you. @Mico
    – zongxian
    Jul 26, 2022 at 7:10
  • @zongxian, please accept the answer if it answers your question so that others get to know it has been addressed.
    – Zxcvasdf
    Jul 27, 2022 at 3:16

1 Answer 1

3

Set \belowcaptionskip.

\documentclass[]{article}

\usepackage[demo]{graphicx}
\usepackage[font={small}, justification=centering]{caption}
\usepackage[labelformat=simple]{subcaption}
\renewcommand\thesubfigure{(\alph{subfigure})}
\captionsetup[subfigure]{position=below,skip=1em}
\usepackage{blindtext}

\begin{document}
    \setlength\belowcaptionskip{1em}
    
    \blindtext[1]
    \begin{figure}[!htbp]
        \subcaptionbox{heading}{\includegraphics[width=0.5\linewidth]{imagefile}}
        \subcaptionbox{heading}{\includegraphics[width=0.5\linewidth]{imagefile}}\\
        \subcaptionbox{heading}{\includegraphics[width=0.5\linewidth]{imagefile}}
        \subcaptionbox{heading}{\includegraphics[width=0.5\linewidth]{imagefile}}
        \caption{text text text text text text text text text text text text text} 
    \end{figure}
    
    \blindtext[1]
\end{document}

enter image description here

You must log in to answer this question.

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