Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

enter image description hereThe 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}
share|improve this question
    
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
add comment

1 Answer

up vote 6 down vote accepted

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.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.