Graphics, Figures & TablesSpace after figures

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
Txuko
Posts: 16
Joined: Mon Jan 17, 2011 9:17 am

Space after figures

Post by Txuko »

When I use parskip (\setlength{\parskip}{10pt}), the space after figures (with the caption in the bottom) is very big.

I have a book document and my figures are created with this command:

Code: Select all

\newcommand{\nfig}[4][0.90]
{
\begin{figure}[htb]
\centering
\includegraphics[width=#1\textwidth]{#2}
\begin{quote}
\caption[#3]{#4}
\label{#2}
\end{quote}
\end{figure}
}
The tables have the caption above and are well spaced.

The vspace command is not a good option because sometimes it alters dramatically some pages.

Thanks
Last edited by Txuko on Mon Jan 17, 2011 5:57 pm, edited 1 time in total.

Recommended reading 2024:

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

Learn LaTeX easily with newest books:

The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis

The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more

LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis

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

Space after figures

Post by localghost »

Txuko wrote:When I use parskip (\setlength{\parskip}{10pt}), the space after figures (with the caption in the bottom) is very big. […]
It's recommended to use the parskip package instead. See also l2tabu (Secton 1.5, p. 5f). The modification of this length has its effects also in other places.


Best regards and welcome to the board
Thorsten
Txuko
Posts: 16
Joined: Mon Jan 17, 2011 9:17 am

Space after figures

Post by Txuko »

localghost wrote: It's recommended to use the parskip package instead. See also l2tabu (Secton 1.5, p. 5f). The modification of this length has its effects also in other places.
The parskip package solves the problem of vertical spaces very well (thanks) but eliminates the indent. If I add \setlength{\parindent}{25pt} the problem of the vertical spacing comes again. Anyway, the noindentation is a small problem comparing with the vertical spacing problem.
localghost wrote: As soon as the problem is sorted out,please act exactly according to Section 3 of the Board Rules (can be found on top of every sub-forum).
Where are that Board Rules? I can only see a FAQ.

Thanks.
Txuko
Posts: 16
Joined: Mon Jan 17, 2011 9:17 am

Re: Space after figures

Post by Txuko »

Suddenly, at the middle of the document, the paragraphs start to have bigger space between them.

I am completely lost and astonished about thids random behaviour.

EDIT: Now I know the reason of this behaviour: Latex is trying to put an image at the top of a page without leaving a section or something like that so it put large spaces between paragraphs.

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

Space after figures

Post by localghost »

Txuko wrote:[…] Where are that Board Rules? I can only see a FAQ. […]
As already said, on top of this forum (as of every forum here) in the »Announcements« section right below the forum title. Actually can't be overlooked.
Txuko wrote:Suddenly, at the middle of the document, the paragraphs start to have bigger space between them. […]
Depending on your document class you may tray the \raggedbottom command.
Txuko
Posts: 16
Joined: Mon Jan 17, 2011 9:17 am

Re: Space after figures

Post by Txuko »

Thank you very much. The \raggedbottom command was the solution.

Thanks again.
User avatar
sommerfee
Posts: 503
Joined: Mon Apr 09, 2007 4:20 pm

Space after figures

Post by sommerfee »

Txuko wrote: \begin{quote}
\caption[#3]{#4}
\label{#2}
\end{quote}
Please note that the quote environment will add additional vertical space, too!

(Why are you using it here?)
Txuko
Posts: 16
Joined: Mon Jan 17, 2011 9:17 am

Re: Space after figures

Post by Txuko »

I use the quote environment to avoid the caption to fill the width of the page.
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Space after figures

Post by localghost »

Txuko wrote:I use the quote environment to avoid the caption to fill the width of the page.
This job is better done by the excellent caption package.

Code: Select all

\documentclass[11pt,a4paper,english]{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{babel}
\usepackage{geometry}
\usepackage[%
  font=small,
  labelfont=bf,
  margin=1cm,
  tableposition=top
]{caption}
\usepackage{blindtext}

\begin{document}
  \blindtext

  \begin{figure}[!ht]
    \centering
    \rule{6.4cm}{3.6cm}
    \caption{\blindtext}\label{fig:dummy}
  \end{figure}

  \blindtext
\end{document}
The blindtext package is only for creating dummy text thus not part of the solution.
Post Reply