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.

I'm experimenting with typesetting "pull quotes" using wrapfig and noticed some strange behaviour. Under certain conditions, having a wrapfigure at the beginning of the first paragraph after a new section (subsection, etc), LaTeX will sometimes break the page between the section header and the following text/wrapfigure block.

This is of course unacceptable. Any ideas how to prevent it? (The page break also destroys spacing in the wrapfigure, remove the \lipsum[1-4] for comparison.)

MWE

\documentclass{article}
\usepackage{tikz}
\usepackage{wrapfig}
\usepackage{lipsum}

\begin{document}

\lipsum[1-4]
sdjfkljsdf kjsd kdsfj sadlkfj sdjfskldf lskdjf lksdjf klsdf
sklfjsa dklf sdjfkljsdf kjsd kdsfj sadlkfj sdjfskldf lskdjf lksdjf klsdf
sklfjsa dklfsdjfkljsdf kjsd kdsfj sadlkfj sdjfskldf lskdjf lksdjf klsdf
sklfjsa dklf sdjfkljsdf kjsd kdsfj sadlkfj sdjfskldf lskdjf lksdjf klsdf
sklfjsa dklf sklfjsa dklf sdjfkljsdf kjsd kdsfj sadlkfj sdjfskldf lskdjf 
lksdjf klsdf sklfjsa dklf sdjfkljsdf kjsd kdsfj sadlkfj sdjfskldf lskdjf 
lksdjf klsdf sklfjsa dklf sklfjsa dklf

\section{Section}

\begin{wrapfigure}[5]{R}{50mm}
  \fontsize{13}{17}\selectfont\vspace*{-10pt}
  \hspace*{4pt}\begin{tikzpicture}
    \node[anchor=north east,inner xsep=1pt] at (0,12pt) {\fontsize{32}{32}\selectfont''};
    \node[anchor=north west,text width=40mm, align=left, inner sep=0pt] at (0,4pt) { Pull       quote for a nice touch };
  \end{tikzpicture}
\end{wrapfigure}
\lipsum[1-2]

\end{document}
share|improve this question

1 Answer 1

up vote 3 down vote accepted

You can give wrapfigure a bit of a hint that things are not quite the same after a section heading

\section{Section}
\pagedepth\maxdimen
\begin{wrapfigure}[5]{R}{50mm}

seems to work and pushed the section head on to the next page.

share|improve this answer

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.