TransWikia.com

Clearpage without pagebreak?

TeX - LaTeX Asked on April 15, 2021

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?

3 Answers

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.

Correct answer by Werner on April 15, 2021

I believe you may be after the FloatBarrier command from the placeins package. It forces Tex to typeset all remaining floats at that point and doesn't include a clearpage afterwards.

Answered by Max on April 15, 2021

I had success by combining the two previous answers, i.e., afterpage{FloatBarrier} (to be used directly after the float, maybe even within) in a case where a page-size table was pushed at the very end of an acmart document. This was inspired by a completely different question. Naturally this requires both packages (placeins and afterpage). The alternatives have not - for some reason - not produced nice/acceptable results.

Answered by stefanct on April 15, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP