# Text on the left, picture on the right and other text follows

I use the following code to produce a picture on the right of the text

\documentclass[12pt,landscape]{article}
\usepackage[demo]{graphicx}
\usepackage{lipsum}
\usepackage{wrapfig}
\begin{document}

\begin{wrapfigure}[8]{r}{2.5in}
\centering
\includegraphics[width=2.4in]{governator.jpg}
\end{wrapfigure}
BOO

\begin{wrapfigure}[8]{r}{2.5in}
\centering
\includegraphics[width=2.4in]{governator.jpg}
\end{wrapfigure}
\lipsum[1]

\end{document}


The idea is to have text on the left, the picture on the right, and the new text in the bottom.

The second paragraph is good, but the text in the first paragraph is shorter and this breaks the layout.

Is there a way to correct this situation?

-
Welcome to TeX.SE. Note that it is customary here to thank those who helped you by up-voting the answer (assuming it was helpful), and possibly accepting that answer (via the check mark) that helped you the most. See how do you accept an answer –  Peter Grill Jan 31 '12 at 17:55

\documentclass[12pt,landscape]{article}
\usepackage[demo]{graphicx}
\usepackage{lipsum}
\usepackage{wrapfig}
\makeatletter
\newcommand\wrapfill{\par
\ifx\parshape\WF@fudgeparshape
\nobreak
\vskip-\baselineskip
\vskip\c@WF@wrappedlines\baselineskip
\allowbreak
\WFclear
\fi
}
\makeatother
\begin{document}

\begin{wrapfigure}[8]{r}{2.5in}
\centering
\includegraphics[width=2.4in]{governator.jpg}
\end{wrapfigure}
BOO\wrapfill

\begin{wrapfigure}[8]{r}{2.5in}
\centering
\includegraphics[width=2.4in]{governator.jpg}
\end{wrapfigure}
\lipsum[1]

\end{document}

-