I appear to have come across a bug using wrapfig. If I use a wrapfig environment immediately before a \section{...} command, then I get some bad behaviour, which appears to go away if I add some text after the wrapfig environment.
\documentclass[12pt,a4paper]{article}
\usepackage{todonotes}
\usepackage{lipsum}
\usepackage{wrapfig}
\usepackage{fullpage}
\begin{document}
\lipsum[1]
\begin{wrapfigure}{r}{0.6\textwidth}
\missingfigure{}
\caption{a figure}
\end{wrapfigure}
%This text fixes it.
\section*{Lorem}
\lipsum[2-3]
\end{document}
Note the extra space in the final paragraph. If however I uncomment "This text fixes it", I get
I did a (brief) search and found nothing about this. What's going on?



wrapfigureafter the section title. – egreg Feb 15 '16 at 10:07