[Tex/LaTex] Clearpage without pagebreak

floatspage-breaking

Is there a command which does the same like \clearpage (typesetting all floats which have not been typeset yet) but then does not insert a pagebreak but continues with the following text/graphics on the same page?

Best Answer

Yes, and this is discussed as one of the advantages of the afterpage package. Use

\afterpage{\clearpage}

This will flush all processed floats after the current page has been completely set, technically avoiding a visible \clearpage. See the first use-case in the afterpage documentation (pageĀ 1):

Sometimes LaTeX's float positioning mechanism gets overloaded, and all floating figures and tables drift to the end of the document. One may flush out all the unprocessed floats by issuing a \clearpage command, but this has the effect of making the current page end prematurely. Now you can issue \afterpage{\clearpage} and the current page will be filled up with text as usual, but then a \clearpage command will flush out all the floats before the next text page begins.