Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to clear after floating images in LaTeX?

Tags:

image

latex

I'm trying to text-wrap floating images in LaTeX, using code like the following:

\begin{wrapfigure}{R}{0.5\textwidth}
\begin{center}
\includegraphics{images/image.png}
\caption{This is the caption.}
}
\label{fig:image1}
\end{center}
\end{wrapfigure

This works fine most of the time (creating an image that floats on the right-hand side), but sometimes LaTeX does not properly clear after the image, and it leaves an open column for another page or two. How does one remedy this, or ideally, does LaTeX have a function similar to clear: both in CSS?

There is the \clearpage command, but it's not appropriate when there's no natural place to break to a new page near the image.

like image 320
Herman Schaaf Avatar asked Oct 04 '10 10:10

Herman Schaaf


1 Answers

You might try to manually set the height of the figure using the optional argument of wrapfigure

\begin{wrapfigure}[lineheight]{alignment}{width}

where lineheight is the number of text lines which shall wrap around the image.

like image 197
fschmitt Avatar answered Oct 20 '22 05:10

fschmitt