为什么引用带有“年份”键的 .bib 条目会破坏参考书目?

为什么引用带有“年份”键的 .bib 条目会破坏参考书目?

我无法弄清楚为什么我在处理文档时会遇到错误LaTeX warning: Citation '...' on page X undefined on input line Yempty bibliography on line Z我不断删除代码,直到只剩下生成引用的最低限度的代码,但问题仍然存在。

我已将其范围缩小至:

以下 MWE 编译正确(显示参考表,其中包含从文中引用到表格的链接)。

\documentclass[a4paper]{scrartcl}
\usepackage{filecontents}

\begin{filecontents*}{\jobname.bib}
@book{dirac,
title = {The Principles of Quantum Mechanics},
author = {Paul Adrien Maurice Dirac},
isbn = {9780198520115},
series = {International series of monographs on physics},
publisher = {Clarendon Press},
keywords = {physics}
}
\end{filecontents*}

\usepackage[backend=biber]{biblatex}
\addbibresource{\jobname}

\begin{document}

\section{test}

this is a reference. \cite{dirac}   

\printbibliography 

\end{document}

但是,如果我将关键词添加 year = {1981}到参考书目条目中,则内容如下:

@book{dirac,
title = {The Principles of Quantum Mechanics},
author = {Paul Adrien Maurice Dirac},
isbn = {9780198520115},
series = {International series of monographs on physics},
publisher = {Clarendon Press},
keywords = {physics},
year = {1981}
}

该文档不再包含参考文献!

我收到以下警告:

LaTeX Warning: Citation 'dirac' on page 1 undefined on input line 23.

LaTeX Warning: Empty bibliography on input line 25.

我正在使用命令

xelatex main.tex
biber main
xelatex main.tex
xelatex main.tex

进行编译,但是使用时我也遇到了同样的问题pdflatex

biber这是关键是不是存在(参考文献编译正确):

INFO - This is Biber 2.14
INFO - Logfile is 'main.blg'
INFO - Reading 'main.bcf'
INFO - Found 1 citekeys in bib section 0
INFO - Processing section 0
INFO - Globbing data source 'main'
INFO - Globbed data source 'main' to main
INFO - Looking for bibtex format file 'main' for section 0
INFO - LaTeX decoding ...
INFO - Found BibTeX data source './main.tex'
WARN - BibTeX subsystem: /var/folders/0v/640gnlsn7757klpyxs64hlz00000gn/T/biber_tmp_Nl1z/main.tex_18596.utf8, line 4, warning: 93 characters of junk seen at toplevel
INFO - Overriding locale 'en-US' defaults 'variable = shifted' with 'variable = non-ignorable'
INFO - Overriding locale 'en-US' defaults 'normalization = NFD' with 'normalization = prenormalized'
INFO - Sorting list 'nty/global//global/global' of type 'entry' with template 'nty' and locale 'en-US'
INFO - No sort tailoring available for locale 'en-US'
INFO - Writing 'main.bbl' with encoding 'UTF-8'
INFO - Output to main.bbl
INFO - WARNINGS: 1

biber下面是钥匙现在(引用已损坏):

INFO - This is Biber 2.14
INFO - Logfile is 'main.blg'
INFO - Reading 'main.bcf'
INFO - Found 1 citekeys in bib section 0
INFO - Processing section 0
INFO - Globbing data source 'main'
INFO - Globbed data source 'main' to main
INFO - Looking for bibtex format file 'main' for section 0
INFO - LaTeX decoding ...
INFO - Found BibTeX data source './main.tex'

(我已经更新了 tex live 管理器tlmgr update --self --all并尝试了“rm -rf `biber --cache`”,但问题仍然存在)

答案1

删除 biber 缓存文件实际上确实解决了该问题(此处确认已修复谢谢@ulrike)。我最初以为它没有起作用,因为我在 fish 而不是 bash 中运行了“rm -Rf `biber --cache`”,它默默地失败了,因为反引号在 fish 中不执行

跑进rm -Rf (biber --cache)鱼里解决了这个问题。

相关内容