17

I have a paper with 30 figures. I added all the figures before conclusion section. But after compiling the document, 10 figures are placed into the middle of the document and after the references. I applied \begin{figure}[!htbp] in the first of the figures definition.

How can I force the figure to stay in the place where I defined it in the paper, for example before the references or conclusion sections?

Alan Munn
  • 218,180
BlueBit
  • 457
  • you can't "force" a float to stay where you put it, if there isn't enough space for the float there. the answer is not to put your figures and things inside a float, but rather inside a \parbox or the like, using \captionof from the capt-of (or caption) package to define the content of the box. when you do that, the outside (non-)floats run over the end of the page, producing "overfull vbox" errors, and you can track them that way. – wasteofspace Nov 03 '13 at 00:09

1 Answers1

38

You can add a \clearpage before your references. It will flush all the figures up to that point.

RobV
  • 616
  • 4
    This creates weird spacing in references and main text – melatonin15 Oct 11 '20 at 02:46
  • 2
    The \clearpage command needs to be strategically placed. In my case, the order of figure and reference is messed up by a small paragraph with a large figure. Instead of placing \clearpage before the reference, I placed it before that small paragraph, and the problem is resolved. – Fanchen Bao Apr 09 '21 at 19:36
  • This works perfectly, thanks – Tanel May 07 '22 at 11:06