98
\documentclass{mwrep}

\usepackage[draft]{graphicx}
\usepackage{hyperref}
\usepackage[all]{hypcap}

\makeatletter
\g@addto@macro\@floatboxreset\centering
\makeatother
I use figures with captions.

\begin{document}

\listoffigures

\chapter{foo}

First paragraph (previous).

\begin{figure}[h]
  \includegraphics{a.jpg}
  \caption{Opis}
\end{figure}

Second paragraph (following).

\end{document}

How can I change vertical space (padding?) between caption and following paragraph? Also, I want to change (increase a little) space between previous paragraph and top of image.

lockstep
  • 250,273
Ichibann
  • 8,381

2 Answers2

127

You can modify the following lengths, which affect all floats.;

  • \floatsep: space left between floats (12.0pt plus 2.0pt minus 2.0pt).
  • \textfloatsep: space between last top float or first bottom float and the text (20.0pt plus 2.0pt minus 4.0pt).
  • \intextsep : space left on top and bottom of an in-text float (12.0pt plus 2.0pt minus 2.0pt).
  • \dbltextfloatsep is \textfloatsep for 2 column output (20.0pt plus 2.0pt minus 4.0pt).
  • \dblfloatsep is \floatsep for 2 column output (12.0pt plus 2.0pt minus 2.0pt).
  • \abovecaptionskip: space above caption (10.0pt).
  • \belowcaptionskip: space below caption (0.0pt).

Source

  • 13
    +1, but it would be handy if you added the default values of these lengths to your answer. – lockstep Jul 17 '11 at 20:11
  • 5
    @lockstep: Done, (at least for article class). – Mikael Öhman Jul 17 '11 at 22:04
  • 4
    \addtolength{\textfloatsep}{-0.2in} is the correct answer as you rightfully mentioned. – Amir Nov 02 '18 at 19:17
  • That's the answer! just for pure beginner like me, to use them put \setlength{\textfloatsep}{2.0pt plus 2.0pt minus 2.0pt} before \begin{document} will take effect. Plus, for two column document, if the figure cross two columns (\begin{figure*}[!t]), \dbltextfloatsep works. For figure fit in single column (\begin{figure}[h!]), \intextsep works. For figures fit in single column but stick at the bottom (\begin{figure}[b!]), \textfloatsep works. – Jason Mar 28 '21 at 21:16
109

You could change \belowcaptionskip, for example:

\setlength{\belowcaptionskip}{-10pt}

For further customizations I recommend using the caption package. It provides a lot of features and is very well documented. If you're using the caption package, you can set the spacing as:

\captionsetup{belowskip=0pt}
Stefan Kottwitz
  • 231,401
  • Thanks to yours and Mikael's answer I was able to set caption spacing to my needs. But still I don't know how can I increase space between paragraph and figure that is below it. – Ichibann Jul 17 '11 at 20:28
  • 3
    You can raise the length \intextsep by \addtolength or \setlength. – Stefan Kottwitz Jul 17 '11 at 20:32
  • 6
    Where should this command go? Inside the figure environment? – Royi Jun 04 '17 at 21:05
  • 5
    Yes. You can place it right before the \caption{} line. For eg: \begin{figure} \centering\includegraphics[]{my_figure.png} \setlength{\belowcaptionskip}{-8pt} \caption{my_caption} \label{my_label} \end{figure} – Benny Nov 18 '17 at 18:14
  • I'm getting ! Undefined control sequence. <argument> \belowcaptionskip Do I need to include some package? – Alec Jacobson Jun 07 '19 at 19:04
  • 2
    How can I apply this setting to just one figure? The above solution seems to affect all figures. – 2523fewqf23f Jun 28 '19 at 18:41