Graphics, Figures & TablesSpacing between figure and text

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
Amlaser
Posts: 5
Joined: Wed Apr 07, 2021 10:08 am

Spacing between figure and text

Post by Amlaser »

I'm currently writing my thesis using latex and normally there are a lot of figures and texts. For figures, I use [h] to place the float here. If the paragraph after the figure is not enough to fill the whole page, Latex makes a gap between the figure and the text to fill the whole page, see the attached image. It seems for me latex starts to fill the page from the bottom to the top. I'm using Overleaf. Does anyone have an idea, how I can overcome this problem?

Regards
Attachments
Image.png
Image.png (90.05 KiB) Viewed 5107 times

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: 10335
Joined: Mon Mar 10, 2008 9:44 pm

Spacing between figure and text

Post by Stefan Kottwitz »

Hi,

[h] means "allow the figure here". It alone doesn't allow the figure to float to the top of a page [t], the bottom of a page , a float page on its own [p], for better placement and page breaks.

I would use [htbp!] for most flexible placement.

Furthermore, such a gap can occur if your document does text balancing on pages to have the text always end at the bottom of the page, so, aligned at the bottom.

Try the command \raggedbottom in the document preamble to see if it's what you want.

Stefan
LaTeX.org admin
Amlaser
Posts: 5
Joined: Wed Apr 07, 2021 10:08 am

Spacing between figure and text

Post by Amlaser »

Thanks
Post Reply