# Wrapfigure apparently creating dummy space on a following page

The example below is a newsletter with two news items.

The first item has a wrapfigure to include a graphic. The second does not

But the resulting PDF (made with PDFLaTeX) has a blank area close to the as if the second item had a graphic too.

Sorry about the extensive preamble - that's direct from the full document (which has dozens of news items).

\documentclass[a4paper,10pt]{book}
\usepackage{color}
\usepackage{pdfcolmk}
\usepackage{alltt}
\usepackage{graphicx}![enter image description here][2]
\usepackage{wrapfig}
\usepackage{textcomp}
\usepackage[labelformat=empty]{caption}
\usepackage{placeins}
\usepackage{needspace}
\usepackage{makeidx}
\makeindex
\usepackage{boxedminipage}
\definecolor{gray}{RGB}{200,200,200}
\usepackage{multicol}
\usepackage{pdfpages}
\setlength{\parindent}{0pt}
\usepackage{fancyhdr}
\widowpenalty=10000
\clubpenalty=10000
\pagenumbering{roman}
\usepackage{scalefnt}
\usepackage[top=2cm, bottom=1cm, left=1.5cm, right=1.5cm]{geometry}
\pdfminorversion=5
\usepackage{hyperref}
\setlength{\parskip}{2ex}
% Different font in captions
\newcommand{\captionfonts}{\Large}
\makeatletter % Allow the use of @ in command names
\long\def\@makecaption#1#2{%
\vskip\abovecaptionskip
\sbox\@tempboxa{{\captionfonts #2}}%
\ifdim \wd\@tempboxa >\hsize
{\captionfonts #2\par}
\else
\hbox to\hsize{\hfil\box\@tempboxa\hfil}%
\fi
\vskip\belowcaptionskip}
\makeatother % Cancel the effect of \makeatletter

\usepackage[english]{babel}
\usepackage{blindtext}

\begin{document}
\pagestyle{fancy}
\fancyfoot{}
\scalefont{1.5}

% Item 01
% =========================

\begingroup
\color{blue}
\endgroup

\begin{wrapfigure}
{R}{0.25\textwidth}
\begin{center}
\includegraphics*[width=0.24\textwidth]{public-domain-image-01.jpg}
\caption{caption for item-01}
\end{center}
\end{wrapfigure}
\href{http://www.publicdomainpictures.net/view-image.php?image=9353&picture=sunset-on-a-california-beach&large=1}{[source of public domain image]}

\blindtext
\blindtext
\blindtext
\blindtext
\blindtext
\blindtext

% Item 02
% =========================

\begingroup
\color{blue}
\subsection*{news item 2}
\endgroup

\blindtext
\blindtext
\blindtext
\blindtext
\blindtext
\blindtext

\end{document}

-
Add \leavevmode before \href –  egreg Jan 26 '12 at 15:25
\leavevmode certainly looks good, thanks; why not upgrade your comment to an answer, and perhaps x-ref to this explanation a little more here: tex.stackexchange.com/questions/22852/… –  DavidT Jan 26 '12 at 16:24

The command \href doesn't start LR mode by itself. Due to how wrapfigure works (the details are rather technical), the appearance of \href in vertical mode blocks the reset mechanism of the special paragraph shape required for placing the figure. So the simple solution is
\leavevmode\href{...}{...}

See Function and usage of \leavevmode for some details about \leavevmode.