我怎样才能避免\parencite{key}
遗嘱分裂为两页?
换行是可以的,但分页则不行。我不想这样做的原因是,我对引用进行了 TIKZ 自定义,导致分页出错。此外,链接(有时并非总是)错误,导致 ( \pdfendlink ended up in different nesting level than \pdfstartlink
)
我可以通过\mbox{\parencite{key}}
以下方式解决这个问题但是换行也是不可能的。
我可以将其应用于\mbox{\parencite{key}}
仅破坏编译的引用,但这可能会不时变化(取决于布局),所以我正在寻找一种始终有效的更通用的解决方案。
谢谢
平均能量损失
\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}
答案1
您可以使用(红色示例)在当前行后插入惩罚\vadjust
。但这并不是万无一失的(参见蓝色页面)。例如,在您的示例中,它不起作用,因为在段落的第一行和最后一行,\clubpenalty 和 \windowpenalty 可能会干扰(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}