# Customizing utilization of only-float pages

I believe that option p of figure environment is necessary (if you don't want that big floats filling up almost an entire page are placed at the end of document, followed by smaller floats which could otherwise easily mix with text) but is unsatisfactory in its default behaviour. As the following MWE shows (but many other examples could be made), with the p option of figure (image on the left) the second figure ends up on a float-only page, whereas without the p option (image on the right) the second figure, correctly IMHO, mix with the text.

\documentclass{article}
\usepackage{mwe}

\begin{document}
\lipsum

\begin{figure}[htbp]
\centering
\includegraphics[width=.8\textwidth]{example-image-1x1}
\caption{A figure caption.}
\end{figure}

\begin{figure}[htbp]
\centering
\includegraphics[width=.8\textwidth]{example-image-1x1}
\caption{A figure caption.}
\end{figure}

\lipsum
\end{document}


Is it possible to adjust the utilization of float-only pages so that they are used only when really needed? In my opinion the criterion triggering the employment of float-only pages should be something like "use float-only pages only when more than 85% (or so) of available text height gets filled up".

Thanks in advance for any clue.

P.S. I know that one could use the p option only "when needed", but if you have dozens of images in each one of dozens of documents you really do not want to check every single image for the p option.

• \includegraphics does not have a p option (or any positioning logic at all you mean figure just increase float page fraction, I would guess. – David Carlisle Jun 11 '18 at 10:02
• @DavidCarlisle Thanks for noticing the typo, I fixed it. – mmj Jun 11 '18 at 10:15

The logic that you suggest is more or less what latex does but article class has

\renewcommand\floatpagefraction{.5}


so the cutoff is 50% not 85% however you can redefine that to be .85

Note however that article also has

\renewcommand\topfraction{.7}


so if you make \floatpagefraction 0.85 without changing \topfraction then a float of size 75% of textheight will be too small for your new float page logic, but too big to be placed on a text page so it will not be allowed anywhere, and go to the end of the document or \clearpage, taking all following figures with it,

• Thanks, I started experimenting with those 2 and the other parameteres and the results are interesting, unfortunately I get annoying isolated (1 or 2) lines between floats (top and inline) which I manage to avoid only dropping the h placement option. – mmj Jun 11 '18 at 13:53
• @mmj avoiding just one or two lines of text is why \topfraction defaults to .7 so that latex tries to make 30% of the page text, the higher you make topfraction the more likely you get lonely lines of text – David Carlisle Jun 11 '18 at 15:04