Page LayoutUnderfull page strategy

Information and discussion about page layout specific issues (e.g. header and footer lines, page formats, page numbers).
Post Reply
jornb
Posts: 2
Joined: Wed May 25, 2011 12:45 am

Underfull page strategy

Post by jornb »

Hello,

I have a document consisting of several images (tikzpicture and no text in between) split into different sections/subsections.

If I start a subsection and there is not enough place for two images on that page, only one image is shown on that page and this gives a badness warning, as the page is mainly empty.

However, the image is placed at the bottom of the page, whereas the subsection is at the top, and the middle is completely empty. This, to me, looks really stupid, so I would like to know if there is any way that I could tell latex to place the image close to the text at the top and leave the bottom of the page blank instead?

The thing is, the latex document is auto-generated, so I cannot tweak every single issue by hand, there must be some general rule to change, or something that I can add to every single picture/subsection.

I can add some screenshots if you are having problem understanding me :)

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

kaiserkarl13
Posts: 707
Joined: Tue Mar 25, 2008 5:02 pm

Underfull page strategy

Post by kaiserkarl13 »

You have two options that I think will both work. First, you can append [htp] to all floats, which overrides the default of [tbp] (here, then top of next page, then on a page by itself; instead of top, bottom, page). You can also use the float package's \floatplacement command to redefine the default placement for ALL figures.

You might also have a look at redefining the values (topfraction, bottomfraction, etc.) that TeX uses to compute penalties and how many floats are "allowed" to be on a page. http://people.cs.uu.nl/piet/floats/node1.html, for example. Another example is http://mintaka.sdsu.edu/GF/bibliog/latex/floats.html, though be wary: he/she uses phrases like "dumb defaults" when in fact the defaults are just fine (and preferable in the cases they were designed for, namely professional documents). They just weren't what he/she wanted to do in that situation....
jornb
Posts: 2
Joined: Wed May 25, 2011 12:45 am

Re: Underfull page strategy

Post by jornb »

Thanks for the reply.

I tried [htp], but I get a "too many unplaced floats" error (I have about 200 pictures, but they are auto-generated so the coude ough to scale to any number).

I will check out your links and post back with my results.
kaiserkarl13
Posts: 707
Joined: Tue Mar 25, 2008 5:02 pm

Re: Underfull page strategy

Post by kaiserkarl13 »

You can force TeX to clear the float queue with \clearpage; if the pages break naturally between floats, then you can issue it periodically and get rid of the unplaced float problems.
Post Reply