# avoid a single figure on one page with lots of empty space

This script:

\documentclass{article}
\usepackage{lipsum}
\usepackage{graphicx}
\usepackage{subfig}
\begin{document}
\lipsum[1-5]
\begin{figure}
\centering
\subfloat[]{
\includegraphics[width=0.5\textwidth]{example-image-a}
}\\
\subfloat[]{
\includegraphics[width=0.5\textwidth]{example-image-b}
}
\end{figure}
\lipsum[6-10]
\end{document}


produces the output:

There is a lot of empty space around the figure that could be economically filled with text. How to solve this problem?

• I think increasing the \floatpagefraction (default=0.5) should do: \renewcommand{\floatpagefraction}{0.8}... – Phelype Oleinik Apr 5 '19 at 19:13
• Have a look at this question: avoid that figure gets its own page, especially the last answer, for more information. – barbara beeton Apr 5 '19 at 19:31
• David showed it. You have to understand how the floats are placed. There is real "must read" about here. The you can fill the entire page with text without leaving a free space. Now the question is: why the hell? You spend the same number of pages and the text is worse distributed, and the figure is left in a less prominent place. Not an improvement, IMHO. – Fran Apr 5 '19 at 19:53
• @Fran in the example it stays at three pages but it's likely to be more compact in other documents, if there had been a few more lines of text then this example would already have gone from 4 to 3 pages by forcing a top float here. – David Carlisle Apr 6 '19 at 10:44
• @DavidCarlisle Of course. I was referring to this specific MWE. It is clear that in another document this can help to save trees, and depending of how big is the figure, even in a elegant way. – Fran Apr 6 '19 at 16:14

\documentclass{article}
\usepackage{lipsum}
\usepackage{graphicx}
\usepackage{subfig}
\begin{document}
\lipsum[1-5]
\begin{figure}[t]
\centering
\subfloat[]{
\includegraphics[width=0.5\textwidth]{example-image-a}
}\\
\subfloat[]{
\includegraphics[width=0.5\textwidth]{example-image-b}
}
\end{figure}
\lipsum[6-10]
\end{document}