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}