latex 引用奇葩bug修复

发布时间 2023-03-28 21:41:08作者: lif323

今天遇到了一个十分新奇的latex的bug。折腾很长时间也只能弄清大致成因。主要就是在.bib文件中加入引用时,要慎重。有些引用条目造成reference无法生成。

Package natbib Warning: Citation `box2015time' on page 2 undefined on input line 217.


Package natbib Warning: Citation `DBLP:journals/ijon/Zhang03' on page 2 undefined on input line 217.


Package natbib Warning: Citation `seltman2012experimental' on page 2 undefined on input line 220.


Package natbib Warning: Citation `TEALAB2018334' on page 2 undefined on input line 220.


Package natbib Warning: Citation `DBLP:conf/nips/VaswaniSPUJGKP17' on page 2 undefined on input line 220.


Package natbib Warning: Citation `lance2016sampling' on page 2 undefined on input line 228.

修改如下

@Inbook{Watson2018,
author="Watson, Jane
and Fitzallen, Noleine
and Fielding-Wells, Jill
and Madden, Sandra",
editor="Ben-Zvi, Dani
and Makar, Katie
and Garfield, Joan",
title="The Practice of Statistics",
bookTitle="International Handbook of Research in Statistics Education",
year="2018",
publisher="Springer International Publishing",
address="Cham",
pages="105--137",
isbn="978-3-319-66195-7",
url="https://doi.org/10.1007/978-3-319-66195-7_4" #移除改行
}

主要成因猜测如下:
部分期刊,会议模版在编译.bib文件时,并没有把他当做纯文本,而是会识别其中的特殊符号例如数学公式前后的'$'。这会导致十分奇葩的问题。

这个问题尤其容易出现在不同模版之间迁移时出现,十分令人头疼。。。

不得不说overleaf的错误提示相当精确。比本地的vscode 的 Latex Workshop 要智能很多!