参考了这篇文章,本文针对文章进行一些补充说明。
环境:
TeXLive2017
TeXstudio2.12.10
提示1:每次改完.tex文件中的错误之后,都要删掉.aux和.bbl两个文件,然后再重新编译。
提示2:修改.bbl文件之后,保存并编译即可,不要再删掉了,不然就白改了。
- 在TeXstudio中,编译文件时不需要像上述文章一样,分别编译Latex文档和Bib文档,只需要按照正常步骤,一键编译,正常编译输出如下,里面的warnings可以不用管。
开始 : bibtex.exe "document"
This is BibTeX, Version 0.99d (TeX Live 2017/W32TeX)
The top-level auxiliary file: document.aux
The style file: unsrt.bst
Database file #1: ref.bib
Warning--empty booktitle in Li2018
Warning--empty journal in Tejwani2017Autism
Warning--there's a number but no volume in G2018A
Warning--empty journal in Selvaraju2016Grad
(There were 4 warnings)
完成
- .bib文件放在.tex文件的同级目录即可,如上述文章提到的,在正文中添加如下两句话,其中“ref”是指.bib文件名为ref.bib,如果文件为其他名称,则对应修改。
% 参考文献呈现方式
\bibliographystyle{unsrt}
% .bib文件名
\bibliography{ref}
- 要先添加.bib,再在文章中使用如下语句添加引用。这里容易出现一个问题,就是多篇引用的方法,如下所示,用逗号分隔多篇文献的第一行内容,要注意,不能有空格,否则会报错如下。
% 单篇文章引用
\cite{Wille1982}
% 多篇文章引用
\cite{Turner2016Pallidum,Martino2014The,Zielinski2014Longitudinal}
% 错误的 多篇文章引用
\cite{Turner2016Pallidum , Martino2014The,Zielinski2014Longitudinal}
开始 : bibtex.exe "document"
This is BibTeX, Version 0.99d (TeX Live 2017/W32TeX)
The top-level auxiliary file: document.aux
White space in argument---line 6 of file document.aux
: \citation{Turner2016Pallidum
: ,Martino2014The,Zielinski2014Longitudinal}
I'm skipping whatever remains of this command
The style file: unsrt.bst
Database file #1: ref.bib
Warning--empty booktitle in Li2018
Warning--empty journal in Tejwani2017Autism
Warning--there's a number but no volume in G2018A
Warning--empty journal in Selvaraju2016Grad
(There was 1 error message)
出现错误
- .bib文件当中,author中逗号和and不能直接相连,这仿佛是Bibtex的格式要求,某些网站导出的参考文献格式可能不正确,如下所示,报错信息如下,这时候只需要在逗号和and之间添加一个点将二者分开即可。
@article{Martino2014The,
title={The autism brain imaging data exchange: towards a large-scale evaluation of the intrinsic brain architecture in autism},
author={Martino, A, Di and C-G, Yan and Li, Q. , and Denio, E. ,. and Castellanos, F X,. and Alaerts, K. ,. and Anderson, J S,. and Assaf, M. ,. and Bookheimer, S Y,. and Dapretto, M. ,.},
journal={Molecular Psychiatry},
volume={19},
number={6},
pages={659-667},
year={2014},
}
开始 : bibtex.exe "document"
This is BibTeX, Version 0.99d (TeX Live 2017/W32TeX)
The top-level auxiliary file: document.aux
The style file: unsrt.bst
Database file #1: ref.bib
Name 3 in "Martino, A, Di and C-G, Yan and Li, Q. , and Denio, E. ,. and Castellanos, F X,. and Alaerts, K. ,. and Anderson, J S,. and Assaf, M. ,. and Bookheimer, S Y,. and Dapretto, M. ,." has a comma at the end for entry Martino2014The
while executing---line 944 of file unsrt.bst
Warning--empty booktitle in Li2018
Warning--empty journal in Tejwani2017Autism
Warning--there's a number but no volume in G2018A
Warning--empty journal in Selvaraju2016Grad
(There was 1 error message)
出现错误
- 下面是一个例子,一个文献的journal部分包含了“&”符号,会出现下示的错误信息(这里我放了3条错误信息,因为我编辑的文档的参考文献中有三个这种情况出现),只需要在.bbl文件中将“&”符号添加“\”符号,类似于转义字符,变为“\&”,然后重新编译即可。
@article{G2018A,
title={A novel machine learning model to predict autism spectrum disorders risk gene},
author={Gök, Murat},
journal={Neural Computing & Applications},
number={4},
pages={1-7},
year={2018},
}
Misplaced alignment tab character &. \newblock {\em Neural Computing &
Misplaced alignment tab character &. &
Misplaced alignment tab character &. ...m IEEE Transactions on Pattern Analysis &