2

How can I avoid that a \parencite{key} will get broken over 2 pages?

Linebreaking is fine, but page breaking is not. The reason I do not want this is that I have TIKZ customization for citations, which goes wrong with page breaking. Also linking goes (sometimes not always) wrong causing (\pdfendlink ended up in different nesting level than \pdfstartlink)

I can solve this by \mbox{\parencite{key}} but then linebreaking is also not possible.

I can apply this \mbox{\parencite{key}} to only citations which breaks the compilation, however this can vary from time to time (depending on layout), so I am looking for a more generic solution which always work.

Thanks

MWE

\begin{filecontents}{\jobname.bib}
@book{Labov1972, 
    Author = {William Labov}, 
    Year = {1972}} 
}
\end{filecontents}
\documentclass[a4paper]{article}

\usepackage{needspace}
\usepackage[nopar]{lipsum}
\usepackage[backend=bibtex,url=false,backref=true,bibencoding=ascii,firstinits=true,uniquename=init,style=alphabetic,citestyle=authoryear]{biblatex}
\addbibresource{\jobname.bib}
\newbox\one
\newbox\two
\long\def\loremlines#1{%
    \setbox\one=\vbox { \lipsum }
   \setbox\two=\vsplit\one to #1\baselineskip
   \unvbox\two}
\begin{document}
\loremlines{46}
Some famous linguists wrote a couple of books asdasdsad asdsad \parencite{Labov1972}.
\loremlines{1} 
Some famous linguists wrote a couple of books asdasdsad asdsad \parencite{Labov1972}asdasdas asdasd asdsad
\printbibliography
\end{document}

Produces: enter image description here

2
  • Can you provide an MWE we can play round with?
    – moewe
    Dec 16, 2015 at 10:31
  • I have enhanced my post with MWE
    – robert
    Dec 16, 2015 at 10:55

1 Answer 1

2

You can insert a penalty after the current line with \vadjust (the red example). But this is not fool proof (see the blue pages). E.g. in your example it wouldn't work as on the first and last line of a paragraph \clubpenalty and \windowpenalty can interfere (https://tex.stackexchange.com/a/179917/2388).

\documentclass[a4paper]{article}

\usepackage{needspace}
\usepackage{lipsum,xcolor}
\usepackage[style=authoryear]{biblatex}
\addbibresource{biblatex-examples.bib}
\begin{document}
\lipsum[1]
\vspace{26\baselineskip}

\lipsum*[1]
Some famous linguists wrote a couple of books asdasdsad as \parencite{doody}.
\lipsum*[1]

\newpage\color{red}

\lipsum[1]
\vspace{26\baselineskip}

\lipsum*[1]
Some famous linguists wrote a couple of books asdasdsad as \vadjust{\penalty10000}\parencite{doody}\vadjust{\penalty0}.
\lipsum*[1]


\newpage\color{blue}%\clubpenalty10000 %uncomment to see the difference

\lipsum[1]
\vspace{25\baselineskip}

\lipsum[1]
Some famous linguists wrote a couple of books asdasdsad asblblblblb \vadjust{\penalty10000}\parencite{doody}\vadjust{\penalty0}.
\lipsum*[1]
\end{document}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .