14

I am using subfig package. Is it possible to reduce the spacing between two sufloats one below the other? I couldn't find anything in the documentation.

  • 2
    Just use \\[<negativespace>] after the \subfloat line. By <negativespace> I mean some thing like [-0.5cm] – user11232 Feb 27 '14 at 23:42
  • 1
    Just to help us help you, could you provide a minimal working example (MWE) that uses example-image for the subfloats? It would really speed up getting solutions your way... in general. – Werner Feb 28 '14 at 0:19
12

You can use \\[<negativespace>] like \\[-2ex] after the last sub float in the current line.

Some example:

\documentclass{article}
\usepackage{subfig}
\usepackage{graphicx}
\begin{document}
\begin{figure}[htb]
 \subfloat[Some figure]{\includegraphics[width=0.48\textwidth]{example-image-a}}\hfill
 \subfloat[Some other figure]{\includegraphics[width=0.48\textwidth]{example-image-b}}\\[-2ex]  %%<-- in this line
 \subfloat[Some more]{\includegraphics[width=0.48\textwidth]{example-image-c}}\hfill
 \subfloat[Some less]{\includegraphics[width=0.48\textwidth]{example-image}}
 \caption{There are example figures}
\end{figure}
\end{document}

enter image description here

  • \[negative space] works perfectly – Sandeep Feb 28 '14 at 19:21
12

Here's a way:

\documentclass{article}
\usepackage{subfig}
\usepackage{graphicx}
\begin{document}

\begin{figure}[htb]
\captionsetup[subfloat]{farskip=2pt,captionskip=1pt}
\centering
\subfloat[Some figure]{\includegraphics[width=0.48\textwidth]{example-image-a}}\hfill
\subfloat[Some other figure]{\includegraphics[width=0.48\textwidth]{example-image-b}}

\subfloat[Some more]{\includegraphics[width=0.48\textwidth]{example-image-c}}\hfill
\subfloat[Some less]{\includegraphics[width=0.48\textwidth]{example-image}}

\caption{There are example figures}
\end{figure}
\end{document}

The parameter farskip governs the spacing above and between rows of subfloats; with captionskip we set the distance from the subfigure and the caption. Play with the values; the \captionsetup[subfloat]{...} command can also be given in the preamble and so it will have effect on all subfloats. So, you can have both global and local setting, if necessity arises.

enter image description here

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.