GeneralRemove space after figure and before text

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
std00088
Posts: 9
Joined: Mon Apr 07, 2008 12:02 pm

Remove space after figure and before text

Post by std00088 »

Hi,

I have a figure in my latex paper (I am using IEEE tran package). After this figure there exists a space between the figure and the text. How can I reduce the size of this white space. To be specific the space is between the caption of the figure and the text of my paper. Any suggestions ?

Thanks

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Remove space after figure and before text

Post by localghost »

Without any code it is nearly impossible to give specific help. So I can only guess. I assume that you centre your figure with the center environment. You should try another approach.

Code: Select all

\begin{figure}[!ht]
  \centering
  \rule{12.8cm}{7.2cm}
  \caption{Dummy figure}\label{fig:dummy}
\end{figure}
That eliminates the additional vertical space before and after the float environment. For more information about figures (and tables) refer to the document epslatex.


Best regards
Thorsten¹
User avatar
Stefan Kottwitz
Site Admin
Posts: 10321
Joined: Mon Mar 10, 2008 9:44 pm

Remove space after figure and before text

Post by Stefan Kottwitz »

Hi std00088,

you can read some more explanation in the UK TeX FAQ: Extra vertical space in floats.

Stefan
std00088
Posts: 9
Joined: Mon Apr 07, 2008 12:02 pm

Re: Remove space after figure and before text

Post by std00088 »

This is my code:

\begin{figure}[!t]
\centering
\includegraphics[scale=0.25]{.....}
\caption{\footnotesize ....}
\label{fig_....}
\end{figure}

I need to reduce the space after whole the figure, not between figure and caption. Between figure/caption and following text !
User avatar
gmedina
Posts: 2313
Joined: Wed Jul 11, 2007 11:45 pm

Remove space after figure and before text

Post by gmedina »

Then you can change some lengths. Take a look at the following example and, of course, feel free to change the values according to your needs:

Code: Select all

\documentclass{article}
\usepackage[belowskip=-15pt,aboveskip=0pt]{caption}

\setlength{\intextsep}{10pt plus 2pt minus 2pt}

\begin{document}

text text text text text text text text text text text text text text text text text text text text text text text text text text
\begin{figure}[!ht]
  \centering
  \fbox{Test figure 1}
  \caption{test figure 1}
  \label{fig:testfig1}
\end{figure}
text text text text text text text text text text text text text text text text text text text text text text text text text text
\begin{figure}[!ht]
  \centering
  \fbox{Test figure 2}
  \caption{test figure 2}
  \label{fig:testfig2}
\end{figure}
text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text 

\end{document}
1,1,2,3,5,8,13,21,34,55,89,144,233,...
std00088
Posts: 9
Joined: Mon Apr 07, 2008 12:02 pm

Re: Remove space after figure and before text

Post by std00088 »

Thanks. It works perfect!
neo
Posts: 1
Joined: Tue Dec 21, 2010 8:19 pm

Remove space after figure and before text

Post by neo »

In addition, you can use the \setlength command with an appropriate switch, before the \begin{document}. For example,

\setlength{\intextsep}{1ex} % set space above and below in-line float
or
\setlength{\intextsep}{-1ex} % remove extra space above and below in-line float

Some useful switches are,
  • \floatsep - Space between floats. \dblfloatsep for 2 column format
  • \intextsep - Space above and below in-line text floats
  • \abovecaptionskip - Space above float caption
  • \belowcaptionskip - Space below float caption
The same technique can be used for Tables. Additional switches can be found at
http://www.eng.cam.ac.uk/help/tpl/textp ... ueeze.html

The savetrees package http://www.ctan.org/tex-archive/macros/ ... savetrees/ is another useful package, when it comes to space saving. However, this is brute force space saver so handle with care. :lol:
Post Reply