在用TeX的过程中遇到引用参考文献的各种问题,将方法记录如下以备再次使用。
一. 不使用BibTeX
begin{thebibliography}{99}
\bibitem{ref1} \doi{X. Xie, and X. Mu, ``Observer-based Intermittent Consensus Control of Nonlinear Singular Multi-agent Systems,'' \textit {International Journal of Control, Automation, and Systems}, vol. 17, no. 9, pp. 2321-2330, September 2019. }{https://doi.org/10.1007/s12555-018-0842-y}
\bibitem{ref2} H. K. Khalil and J. Grizzle, \textit{Nonlinear Systems}, Upper Saddle River, NJ: Prentice hall, vol. 3, 2002.
\end{thebibliography}
其中,ref1,ref2为每篇参考文献的label,可以根据自己的习惯设置。
在文中引用的话可以直接利用\cite{ref1},\cite{ref1,ref2}完成单篇文章以及多篇的引用。
若要引用doi链接可以使用第一个的方法,不需要的话可以直接使用第二个。
同时,想达到[1-4]这种效果,直接利用\cite{ref1,ref2,ref3,ref4}即可。
二. 使用BibTeX
1.构建 .bib文件
在搜索参考文献的时候下载BibTeX的格式
下载后将如下格式复制到 .bib文件中即可。
@article{xie2019observer,
title={Observer-based intermittent consensus control of nonlinear singular multi-agent systems},
author={Xie, Xinxin and Mu, Xiaowu},
journal={International Journal of Control, Automation and Systems},
volume={17},
number={9},
pages={2321--2330},
year={2019},
publisher={Springer}
}
2. 在代码的最末写在下面两行
\bibliographystyle{plain}
\bibliography{xxx}
第一行表示的为参考文献的style,其中包括
\bibliographystyle{unsrt} - 文献展示效果为所有作者姓名全拼,参考文献按照文章中先后顺系排序;
\bibliographystyle{plain} - 文献展示效果为所有作者姓名全拼,参考文献按照第一作者首字母排序;
\bibliographystyle{plainat},\bibliographystyle{unsrtnat}和上述效果一样,但是不含有编号引用编号;
\bibliographystyle{elsarticle-num} - 文献展示效果为所有作者姓全拼、名缩写,参考文献按照文章中先后顺系排序;
\bibliographystyle{elsarticle-harv} - 文献展示效果为所有作者姓全拼、名缩写,参考文献按照第一作者首字母排序;
\bibliographystyle{elsarticle-num-names} - 文献展示效果为所有作者姓全拼、名缩写,参考文献按照文章中先后顺系排序。
第二行表示引用 'xxx.bib' 文件中的参考文献
3. 在正文中引用直接引用BibTeX中文章的名字,例如\cite{xie2019observer}即可。
如果想引用(名字,年限)的正文引用方式,在代码导言区中补充
\usepackage{natbib}
\setcitestyle{authoryear,round}
同时,利用引用命令
\citet(..) - 只给年份加括号
\citep(...) - 作者和年份都加括号
\citet*,\cite*和上述命令效果相同,但是显示所有的作者。
三. 运行
latex编译一次,记录正文中记录的\cite命令,这里需要正文中有\cite命令,否则会报错。
bibtex编译一次,再用latex编译即可,若出现?继续编译便可正常显示。
若在编译过程中报错,删除辅助文件,以及BBL文件再进行编译。
上述问题学习链接:
https://blog.csdn.net/beta_2187/article/details/101208526
https://jingyan.baidu.com/article/574c52196e12496c8d9dc1c5.html