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.
Any suggestions would be helpful.
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}
\hypersetup{pdfpagemode=FullView, colorlinks=true,
pdfhighlight=/P,linkbordercolor=.9 1 1, linkcolor=blue, citecolor=black,pdftex}
\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}
\fancyhead[co, ce]{\thepage{}}
\fancyhead[le ro]{Demo newsleter pages}
\fancyfoot{}
\scalefont{1.5}
% Item 01
% =========================
\begingroup
\color{blue}
\subsection*{news item 1 heading}
\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}
Best Answer
The command
\href
doesn't start LR mode by itself. Due to howwrapfigure
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 isSee Function and usage of \leavevmode for some details about
\leavevmode
.