I'm using wrapfigure to place images on the outside (o) edge of my document. Mostly it seems to work fine but sometimes an image gets placed on the wrong side.
You can see the problem on page 3. The space for the first image is on the left rather than the right and the image doesn't seem to place correctly.
I think it has to do with a command someone helped me write once that forces the end of a wrapfigure environment:
\documentclass[10pt]{report}
\usepackage{graphicx}
\usepackage{wrapfig}
\usepackage[latin]{babel}
\usepackage{blindtext}
\usepackage{forloop}
\usepackage[twoside,a4paper,portrait,lmargin=10mm,rmargin=10mm,tmargin=14mm,bmargin=9mm]{geometry}
\begin{document}
% make a command, wrapfill, that forces the end of a wrapfigure
\makeatletter
\def\wrapfill{\par
\ifx\parshape\WF@fudgeparshape
\nobreak
\ifnum\c@WF@wrappedlines>\@ne
\advance\c@WF@wrappedlines\m@ne
\vskip\c@WF@wrappedlines\baselineskip
\global\c@WF@wrappedlines\z@
\fi
\allowbreak
\WF@finale
\fi
}
\makeatother
\newcounter{ct}
\forloop{ct}{1}{\value{ct} < 12 }%
{
\begin{wrapfigure}{o}{0pt}
\includegraphics[width=12cm,height=25mm,keepaspectratio=true]{test.jpg}
\end{wrapfigure}
\blindtext
\blindtext
\wrapfill
}
\end{document}
tex file: https://www.dropbox.com/s/30rg37nv2dkpc56/t1.tex
test.jpg: https://www.dropbox.com/s/w5y7ys7twvpmi9c/test.jpg
I'll post a link to the PDF later. I can only include 2 links due to reputation being < 10.
Any idea how I might track down what's going on or how I could fix it?
width=0.1\linewidth
and see if it does place correctly then. – LaRiFaRi Oct 2 '14 at 7:14