Graphics, Figures & TablesToo much spacing between figures and text

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
Diogo Remoaldo
Posts: 26
Joined: Mon Apr 06, 2015 8:24 pm

Too much spacing between figures and text

Post by Diogo Remoaldo »

Hi again.

In my latex document sometimes the spacing between the figure and the text is too big as can be seen in the picture. Thanks in advance for your time once again

My latex code is as follows:

Code: Select all

\documentclass[openleft,a4paper,12pt,twoside]{report}
\usepackage[utf8]{inputenc}
\usepackage[portuguese]{babel}
\usepackage[T1]{fontenc}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{epstopdf} 
\usepackage{float}
\usepackage{graphicx}
\usepackage[hidelinks]{hyperref}
\usepackage{url}
\usepackage[all]{hypcap}
\usepackage{caption}
\usepackage[paper=a4paper,top=2cm,bottom=2cm,right=2.5cm,left=2.5cm,twoside ,bindingoffset=1cm,marginparwidth=0in,marginparsep=0in]{geometry}
\usepackage{array}
\usepackage{booktabs}
\usepackage{tabularx}
\usepackage{indentfirst}
\usepackage[export]{adjustbox}
\usepackage[font=small,labelfont=bf]{caption}
\usepackage{enumitem}
\usepackage{titlesec}
\usepackage{multirow}
\captionsetup[table]{position=above}
\usepackage{siunitx}
\newcolumntype{C}{>{\centering\arraybackslash}m}
\sisetup{per-mode=symbol}
\usepackage{hhline}
\captionsetup[table]{position=above}
\setcounter{secnumdepth}{4}
\DeclareSIUnit{\year}{ano}
\titleformat{\paragraph}
{\normalfont\normalsize\bfseries}{\theparagraph}{1em}{}
\titlespacing*{\paragraph}
{0pt}{3.25ex plus 1ex minus .2ex}{1.5ex plus .2ex}
\usepackage{eurosym}
\usepackage{makeidx}
\usepackage{subcaption}
\usepackage{afterpage}
\usepackage{booktabs}
\usepackage{longtable}
\setlength{\belowcaptionskip}{-2pt}

\usepackage{fancyhdr}

\setlist{itemsep=2pt}

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

\setlength{\floatsep}{5pt plus 1.0pt minus 2.0pt}
\setlength{\intextsep}{5pt plus 1.0pt minus 2.0pt}



\fancyhead{}
\fancyhead[LO,LE]{\nouppercase{\leftmark}}
\fancyfoot{}

\fancyfoot[RO,LE]{\thepage}





\begin{document}



Com os valores de $ \theta $; $\upsilon_l$ torna-se possível a avaliação do conforto térmico no ponto critico.
\vspace{2.0mm}
\begin{figure}[H]
\center
\includegraphics[width=0.95\textwidth]{ankle}
\caption[Verificação de conforto pelo método IDDA - zona do tornozelo]{Verificação de conforto pelo método IDDA - zona do tornozelo. Retirado de \cite{american20092009}}
\label{IDDA1}
\end{figure}
\vspace{2.0mm}
\vspace{2.0mm}
\begin{figure}[H]
\center
\includegraphics[width=0.95\textwidth]{neck}
\caption[Verificação de conforto pelo método IDDA - zona da nuca]{Verificação de conforto pelo método IDDA - zona da nuca. Retirado de \cite{american20092009}}
\label{IDDA2}
\end{figure}
\vspace{2.0mm}
	Como é possível verificar através das figuras \ref{IDDA1} e \ref{IDDA2} que o $IDDA < 90 \%$ para a situação mais crítica do estudo do nosso edifício, se for utilizado um difusor \textit{size} 2, cuja velocidade do jacto pode ser determinada através da figura \ref{ID}.

\end{document}
Attachments
Screenshot_2.png
Screenshot_2.png (60.29 KiB) Viewed 49243 times
Last edited by Stefan Kottwitz on Tue Jul 28, 2015 2:59 pm, edited 1 time in total.

Recommended reading 2024:

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

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

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

Stefan Kottwitz
Site Admin
Posts: 10324
Joined: Mon Mar 10, 2008 9:44 pm

Too much spacing between figures and text

Post by Stefan Kottwitz »

I don't have so much spacing with your code. Perhaps complete your example so it actually shows the problem. Or does it show to you, when you test the code from above?

It can happen with \flushbottom, \pagebreak, but I don't see that in your code.

\begin{figure}[H] is a problem anyway. This way, you don't allow figures to float. And that's one of the main points for figures: they float to a good position (usually the top of the next page) to have an optimal filling of the page. To avoid such whitespace. I recommend to use \begin{figure}[!htbp] instead, and to remove \vspace hacks within the document body. Often such things don't fit any more after later changes.

Stefan
LaTeX.org admin
User avatar
Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

Too much spacing between figures and text

Post by Johannes_B »

You have been a Word user, right? ;-)

LaTeX works differently, gimme the content, i'll typeset.

Word users on the other hand insist on deciding to know better and set the layout by hand.

I suggest to remove all the [H] from the figure environments and let them float to a proper place. Remove all the manually added spaces, all they do is harm. By the way, the command is called \centering, not {center}.

When the document get in ints very final stage, and all the content is fixed, you can tweak the output by adding a bit of manual space at some places. But really, at the very very end.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
Diogo Remoaldo
Posts: 26
Joined: Mon Apr 06, 2015 8:24 pm

Too much spacing between figures and text

Post by Diogo Remoaldo »

Yes I have, do you only need the picture johannes?
If you need more whatelse do you need?

If you could correct it for me I would be very thankfull. The full paragraph goes as follows:

Code: Select all

Para um caudal de cerca de 222 $[m^3/h]$ e para uma distancia de 1,3 [m]:

\begin{equation*}
\upsilon_l = 0,31 [m/s]
\end{equation*}

Para avaliação do IDDA:

\begin{equation*}
\theta = \Delta t_l - 8 \cdot (\upsilon_l - 0,15) = 0,73
\end{equation*}

	Com os valores de $ \theta $; $\upsilon_l$ torna-se possível a avaliação do conforto térmico no ponto critico.
\vspace{2.0mm}
\begin{figure}[H]
\center
\includegraphics[width=0.95\textwidth]{ankle}
\caption[Verificação de conforto pelo método IDDA - zona do tornozelo]{Verificação de conforto pelo método IDDA - zona do tornozelo. Retirado de \cite{american20092009}}
\label{IDDA1}
\end{figure}
\vspace{2.0mm}
\vspace{2.0mm}
\begin{figure}[H]
\centering
\includegraphics[width=0.95\textwidth]{neck}
\caption[Verificação de conforto pelo método IDDA - zona da nuca]{Verificação de conforto pelo método IDDA - zona da nuca. Retirado de \cite{american20092009}}
\label{IDDA2}
\end{figure}
\vspace{2.0mm}
	Como é possível verificar através das figuras \ref{IDDA1} e \ref{IDDA2} que o $IDDA < 90 \%$ para a situação mais crítica do estudo do nosso edifício, se for utilizado um difusor \textit{size} 2, cuja velocidade do jacto pode ser determinada através da figura \ref{ID}.
\vspace{2.0mm}
Attachments
ankle.png
ankle.png (33.25 KiB) Viewed 49218 times
neck.png
neck.png (52.12 KiB) Viewed 49218 times
rais
Posts: 419
Joined: Sun Nov 16, 2014 8:51 pm

Too much spacing between figures and text

Post by rais »

Stefan_K wrote: It can happen with \flushbottom, \pagebreak, but I don't see that in your code.
I seem to remember that \flushbottom is implicitly set with two-sided layout of the document, and the OP uses the twoside option.
So \raggedbottom or omission of the twoside option should do, IIRC.

KR
Rainer
Post Reply