77

I was wondering if there is any way to lessen the spaces between figures and text. In my paper I have a lot of figures (graphics) and it is inconvenient for me to have default (large) spaces between text and graphics. Is there any command I could use to change the default settings?

108

Change one or more of the following lengths:

  • \textfloatsep — distance between floats on the top or the bottom and the text;
  • \floatsep — distance between two floats;
  • \intextsep — distance between floats inserted inside the page text (using h) and the text proper.

The command used to change them is \setlength:

\setlength{\textfloatsep}{10pt plus 1.0pt minus 2.0pt}

The default values in the article document class with the 10pt option are:

  • \textfloatsep: 20.0pt plus 2.0pt minus 4.0pt;
  • \floatsep: 12.0pt plus 2.0pt minus 2.0pt;
  • \intextsep: 12.0pt plus 2.0pt minus 2.0pt.

You can get them yourself with \showthe\textfloatsep or \the\textfloatsep etc.

The plus and minus parts allow the space to stretch or shrink (the greater they are, the more it stretches or shrinks when needed). It's not recommended to leave out the plus and minus parts, as it leaves LaTeX less typesetting choices to select from and the output might look worse.

When typesetting in two column mode, two more lengths are available:

  • \dbltextfloatsep — distance between a float spanning both columns and the text;
  • \dblfloatsep — distance between two floats spanning both columns.

Remember that too little space will, again, make the document look worse.

  • "\intextsep — distance between floats inserted inside the page text (using h) and the text proper." so if I use H(capital H) which option should I change ? – kronos Aug 25 '11 at 15:38
  • @kronos: It is the same for h and H. – Andrey Vihrov Aug 25 '11 at 15:44
  • 9
    @AndreyVihrov One important question remains: How can I set this locally? I know I can use \begingroup, so my question is rather, does that change for the whole document if I place \setlength{\textfloatsep}{10pt plus 1.0pt minus 2.0pt} before the figure? Also maybe there is a different way to obtain local changes? – TomM Jan 3 '14 at 22:56
  • Is this used in the beamer class? Thanks. – PatrickT Apr 16 '18 at 20:42
3

Another option I found useful was through \vspace{10pt}. If placed before invoking the image, \vspace will separate the figure and the text. If placed after invoking the image but before the caption, it will separate the caption and figure. If placed after the caption, then it will separate the caption and bottom text. Of course you could decrease spacing by doing something like -10pt instead of 10pt.

  • 1
    The spacing between the image and the caption is a different matter. This is controlled by length registers \abovecaptionskip and \belowcaptionskip. – Heiko Oberdiek Jan 12 '17 at 19:35

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.