3

When I write a multi-page paper with imported images, I usually try to group the picture with the text referencing it. Sometimes, there is not enough room at the end of the page for the picture, and the picture is moved to the top of the next page. This often leaves some white space at the end of the previous page. In order to remove the white space, LaTeX automatically fills the space with text that is meant to come after the image. Is there a way to prevent this?

Werner
  • 603,163

1 Answers1

4

If this is for a journal paper submission, don't worry about it. The editors will sort out the placement of the contents to fit within their templates.

However, if you want to do this for your own usage, there are a number of options. Easiest is to include the float package and use the [H] float placement specifier

enter image description here

\documentclass{article}
\usepackage{float,graphicx,lipsum}
\begin{document}
\lipsum[1-4]

\begin{figure}[H]
  \centering\includegraphics[height=8\baselineskip]{example-image}
  \caption{An image}
\end{figure}

\lipsum[5-8]
\end{document}

You may have to play around with the inclusion of \raggedbottom in your preamble, depending on whether or not LaTeX complains about underful \vboxes.

If you always want to place a figure in the position where you place it, then you can set the default figure placement to be [H]ERE by adding

\floatplacement{figure}{H}

to your preamble.

Werner
  • 603,163