LaTex:使用CTex套装引用BibTex步骤

LaTex排版功能及其强大,同时加入BibTex更可以方便地整理引用的文献,可谓是写论文的利器。因此在这里作些简要记录和介绍。

本文整体分为三大部分,一是引文.bib文件的准备,二是在正文.tex文件中添加引用,三是编译过程。

目录

引文.bib文件的准备

在正文.tex文件中添加引用

开头引用cite包

文中引用位置添加数字标号

文末添加文献列表

编译过程

参考资料


引文.bib文件的准备

首先在WinEdt中新建一个BibTex文件作为我们当前文档所需引用的论文的集合,可以先将其保存为“cited.bib”,保存路径与正文.tex文件路径相同。

接着我们需要获取引文的BibTex描述,根据获取源不同可能得到的文件形式也不同,有的网站会提供给一个.bib文件下载,有的网站则可以直接从浏览器复制,但格式都是一样的,例如下面的两篇:

@ARTICLE{7562516,
author = {H. Wang and D. Yeung},
journal = {IEEE Transactions on Knowledge & Data Engineering},
title = {Towards Bayesian Deep Learning: A Framework and Some Existing Methods},
year = {2016},
volume = {28},
number = {12},
pages = {3395-3408},
keywords={Machine learning;Bayes methods;Neural networks;Uncertainty;Probabilistic logic;Recommender systems;Medical services},
doi = {10.1109/TKDE.2016.2606428},
url = {doi.ieeecomputersociety.org/10.1109/TKDE.2016.2606428},
ISSN = {1041-4347},
month={Dec.}
}

@ARTICLE{10.3389/fpsyg.2015.00663,
AUTHOR={Sala-Llonch, Roser and Bartrés-Faz, David and Junqué, Carme},
TITLE={Reorganization of brain networks in aging: a review of functional connectivity studies},
JOURNAL={Frontiers in Psychology},
VOLUME={6},
PAGES={663},
YEAR={2015},
URL={https://www.frontiersin.org/article/10.3389/fpsyg.2015.00663},
DOI={10.3389/fpsyg.2015.00663},
ISSN={1664-1078},
ABSTRACT={Healthy aging (HA) is associated with certain declines in cognitive functions, even in individuals that are free of any process of degenerative illness. Functional magnetic resonance imaging (fMRI) has been widely used in order to link this age-related cognitive decline with patterns of altered brain function. A consistent finding in the fMRI literature is that healthy old adults present higher activity levels in some brain regions during the performance of cognitive tasks. This finding is usually interpreted as a compensatory mechanism. More recent approaches have focused on the study of functional connectivity, mainly derived from resting state fMRI, and have concluded that the higher levels of activity coexist with disrupted connectivity. In this review, we aim to provide a state-of-the-art description of the usefulness and the interpretations of functional brain connectivity in the context of HA. We first give a background that includes some basic aspects and methodological issues regarding functional connectivity. We summarize the main findings and the cognitive models that have been derived from task-activity studies, and we then review the findings provided by resting state functional connectivity in HA. Finally, we suggest some future directions in this field of research.  A common finding of the studies included is that older subjects present reduced functional connectivity compared to young adults. This reduced connectivity affects the main brain networks and explains age-related cognitive alterations. Remarkably, the default mode network appears as a highly compromised system in HA. Overall, the scenario given by both activity and connectivity studies also suggests that the trajectory of changes during task may differ from those observed during resting-state. We propose that the use of complex modeling approaches studying effective connectivity may help to understand context-dependent functional reorganizations in the aging process.}
}

每个@ARTICLE{...}代表一篇文章(也有非Article的),后面大括号里的第一个字符串就是引用的缩写名,比如上面第一篇的缩写名就是7562516,第二篇则是10.3389/fpsyg.2015.00663。

最后将需要的文章的BibTex描述复制到我们所预先创建好的“cited.bib”中即可完成准备工作。


在正文.tex文件中添加引用

这里也可分为三个小步骤:开头引用cite包、文字引用位置添加数字标号和文末添加文献列表。

开头引用cite包

在tex文件开头下面的位置引用cite包

\documentclass{article}
\usepackage{cite}
\begin{document}

...

文中引用位置添加数字标号

在tex文件要引用该论文的位置添加\cite{<对应引文缩写名>},如\cite{7562516}或\cite{10.3389/fpsyg.2015.00663}:

如果之前的.bib文件的准备工作已经做好,在输入\cite{}的最后一个大括号的时候会出现对话框,我们就可以方便地在这里选择要引用的文章:

文末添加文献列表

在文末下面的位置添加对.bib文件的引用

...

\bibliographystyle{unsrt}       %%大括号里是参考文献的风格,常用unsrt、plain、abbrv、alpha等
\bibliography{cited}            %%大括号里是.bib文件名
\end{document}


编译过程

首先使用XeLaTeX编译第一遍,这时的编译效果是在标号处有问号:

接着使用BibTex(工具栏上红色的B)编译.bib文件,之后再使用XeLaTeX编译第二遍,

【这里提醒读者,如果直接用我上面给的引文的话,在这一步会出现错误提示“misplaced alignment tab chacter &”,请先将第一篇引文的bib文件中的“&”改为“\&”后,将路径内的.aux文件和.bbl文件删除,再重新从第一步从头开始编译过程。这并非我故意找茬,而是为了让大家熟悉在编译时出错的处理方式,即查看控制台报错信息—>搜索对策—>修改出错的位置—>删除错误的中间文件—>重新编译解决问题】

这时正常情况应出现文献列表,但是标号处还是有问号:

最后使用XeLaTeX编译第三遍,此时应一切正常:

若中途出现了其他问题,可以去网上查,通常像上面尝试将路径内的.aux文件和.bbl文件删除再将整个编译过程重新来过。


参考资料

https://blog.csdn.net/lilianforever/article/details/53079169

https://jingyan.baidu.com/article/7e44095335ff172fc1e2ef11.html

猜你喜欢

转载自blog.csdn.net/Tele_Anti_Nomy/article/details/86605319