语境: biblatex 2.9a
和biber 1.9
。
由于defernumbers
,biblatex
'即使跳过参考书目中的条目(options={skipbib}
),数字标签也是正确的,如以下 MWE 所示:
\documentclass{article}
\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
@misc{skipbib-aaaa,
title={Aaaa (skipped from bibliography)},
options={skipbib}
}
@misc{bbbb,
title = {Bbbb}
}
@misc{cccc,
title={Cccc (manually added at end of document)}
}
@misc{dddd,
title={Dddd (automatically added at end of document)}
}
\end{filecontents}
%
\usepackage[backend=biber,defernumbers]{biblatex}%
\addbibresource{\jobname.bib}
%
\begin{document}
\citetitle{skipbib-aaaa} and \citetitle{bbbb}
\printbibliography
\citetitle{cccc}%
% \AtEndDocument{and \citetitle{dddd}}
\end{document}
得到 (ascii 艺术):
Aaaa (skipped from bibliography) and Bbbb
References
[1] Bbbb.
[2] Cccc (manually added at end of document).
Cccc (manually added at end of document)
但是,一旦添加引用\AtEndDocument
(通过注释掉倒数第二行),数字标签就会出错(ascii art):
Aaaa (skipped from bibliography) and Bbbb
References
[2] Bbbb.
[3] Cccc (manually added at end of document).
[4] Dddd (automatically added at end of document).
Cccc (manually added at end of document)
and Dddd (automatically added at end of document)
笔记:
- 有了
bibtex
后端,就没问题了。 - 有了
biblatex 3.0
和biber 2.0
,情况就更糟了:添加了引用后\AtEndDocument
,所有数字标签都变成了0
。
答案1
biblatex 在“结束文档”钩子中做了很多(清理和其他)工作。您应该确保您的 cite 命令更早出现。因此,要么将您的代码移到\AtEndDocument
前面\usepackage{biblatex}
,要么将代码添加到钩子前面:
\citetitle{cccc}%
\makeatletter\preto\@enddocumenthook{and \citetitle{dddd}}\makeatother
(我不知道补丁包中是否提供了“\PreToAtEndDocument”命令)。