情境: 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 art):
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
before \usepackage{biblatex}
,要么將代碼添加到鉤子中:
\citetitle{cccc}%
\makeatletter\preto\@enddocumenthook{and \citetitle{dddd}}\makeatother
(我不知道補丁包是否提供了“\PreToAtEndDocument”命令)。