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

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章