BibTeX:警告:顶层出现 1 个垃圾字符

BibTeX:警告:顶层出现 1 个垃圾字符

我在 Google 上搜索了几个小时,却没有找到任何解决警告的方法。警告内容为:BibTeX:警告:顶层显示 1 个垃圾字符。我的参考书目中有 21 个有效引文。如果我再添加一个,不管是哪一个,我都会收到警告(即使是复制的,例如更改了名称)

@article{courbariaux2016binarized,
title={Binarized Neural Networks: Training Deep Neural Networks with Weights and Activations Constrained to +1 or -1},
author={Matthieu Courbariaux and Itay Hubara and Daniel Soudry and Ran El-Yaniv and Yoshua Bengio},
year={2016},
eprint={1602.02830},
archivePrefix={arXiv},
primaryClass={cs.LG}
}

如果我使用另一个已经有效的 bibtex 引用,则没有关系。我收到每个 Bibtex 文件的警告。不确定您是否有足够的信息来帮助我。

我使用 Natbib 和 Overleaf。

\documentclass[a4paper,12pt,twoside, numbers=noenddot]{scrartcl} 
\usepackage[backend=biber,natbib=true]{biblatex}
\addbibresource{literatur/bibliography.bib} 
% }
% @book{meyer2021embedded,
% title={Embedded Microprocessor System Design Using FPGAs},
% author={Meyer-Baese, Uwe},
% year={2021},
% publisher={Springer Nature},
% pages ={1}
% } 
\begin{document} 
\cite{meyer2021embedded}
\newpage
\end{document}

答案1

该警告来自biber(而非 bibtex),如果 bib 文件中存在@xxx{...}条目中没有的字符,则会生成该警告。

例如,如果我从你的 tex 文件中取出注释条目并保存为bibliography.bib

有内容

}
@book{meyer2021embedded,
title={Embedded Microprocessor System Design Using FPGAs},
author={Meyer-Baese, Uwe},
year={2021},
publisher={Springer Nature},
pages ={1}
}

然后biber将生成输出

INFO - Looking for bibtex format file 'bibliography.bib' for section 0
INFO - LaTeX decoding ...
INFO - Found BibTeX data source 'bibliography.bib'
WARN - BibTeX subsystem: /tmp/biber_tmp_ludL/f4d088b3f9f145b5c3058da33afd57d4_750.utf8, line 2, warning: 1 characters of junk seen at toplevel

}这是由于文件开头的spurious 造成的。删除它会导致警告:

@book{meyer2021embedded,
title={Embedded Microprocessor System Design Using FPGAs},
author={Meyer-Baese, Uwe},
year={2021},
publisher={Springer Nature},
pages ={1}
} 

请注意,警告并没有说明错误字符是什么,但给出了检测到错误时的行号(或显然比行号多一个),因此}在第 1 行生成

line 2, warning: 1
^^^^^^^

所以你应该能够很容易地找到坏字符。

相关内容