Latex 產生參考文獻
BibTeX 是一個使用資料庫的的方式來管理參考文獻程式, 用於協調LaTeX的參考文獻處理.
BibTeX 檔案的尾碼名為 .bib . 先來看一個例子:
@article{Gettys90,
author = {Jim Gettys and Phil Karlton and Scott McGregor},
title = {The {X} Window System, Version 11},
journal = {Software Practice and Experience},
volume = {20},
number = {S2},
year = {1990},
abstract = {A technical overview of the X11 functionality. This is an update of the X10 TOG paper by Scheifler \& Gettys.}
}
說明:
第一行@article 告訴 BibTeX 這是一個文章類型的參考文獻. 還有其它格式, 例如 article, book, booklet, conference, inbook, incollection, inproceedings, manual, misc, mastersthesis, phdthesis, proceedings, techreport, unpublished 等等.
接下來的"Gettys90", 就是你在本文中引用這個條目的名稱.
其它就是參考文獻裡面的具體內容啦.
在LaTeX中使用BibTeX
為了在 LaTeX 中使用BibTeX 資料庫, 你必須先做下面三件事情:
1) 設定參考文獻的類型 (bibliography style). 標準的為 plain:
\bibliographystyle{plain}
其它的類型包括unsrt – 基本上跟 plain 類型一樣, 除了參考文獻的條目的編號是按照引用的順序, 而不是按照作者的字母順序.
alpha – 類似於 plain 類型, 當參考文獻的條目的編號基於作者名字和出版年份的順序.
abbrv – 縮寫格式 .
2) 標記引用 (Make citations). 當你在文檔中想使用引用時, 插入 LaTeX命令
\cite{引用文章名稱}
"引用文章名稱" 就是前邊定義@article後面的名稱.
3) 告訴 LaTeX 產生參考文獻列表 . 在 LaTeX 的結束前輸入
\bibliography{bibfile}
這裡bibfile 就是你的 BibTeX 資料庫檔案 bibfile.bib .
運行 BibTeX分為下面四步
1.用LaTeX編譯你的 .tex 檔案 , 這是產生一個 .aux 的檔案, 這告訴BibTeX 將使用那些引用.
2.用BibTeX 編譯 .bib 檔案.
3.再次用LaTeX 編譯你的 .tex 檔案, 這個時候在文檔中已經包含了參考文獻, 但此時引用的編號可能不正確.
4.最後用 LaTeX 編譯你的 .tex 檔案, 如果一切順利的話, 這是所有東西都已正常了.
例子: 將上面的 BibTeX 的的例子儲存為 bibfile.bib.
\documentclass{article}
\begin{document}
We cite \cite{name1} and \cite{name2}.
\bibliography{bibfile}
\bibliographystyle{plain}
\end{document}
將上面的內容儲存為bibtex-example.tex .
latex編譯一次, bibtex 編譯一次, 再用 latex編譯兩次就大功告成了!
擷取bib檔案
使用如下網址可以將springer文獻格式變成bibtex:
http://www.it.usyd.edu.au/~niu/cgi-bin/springer.cgi
關於文獻類型:(摘自TeXGuru的Latex2e使用者手冊)
@article條目為期刊或雜誌上的一篇文章。
不可少域author, title, journal, year.
可省略域volume, number, pages, month, note.
@article{name,
author = {a and b},
title = {title},
journal = {journal name},
volume = {42},
number = {1},
year = {2008},
issn = {0110-0101},
pages = {1--8},
doi = {http://doi.xxx.org},
publisher = {ACM},
address = {New York, NY, USA},
};
@book條目為有確定出版社的書籍。
不可少域author或editor, title, publisher, year.
可省略域volume或number, series, address, edition, month, note.
@booklet條目為印製的有封皮的作品,但沒有出版社或贊助機構的名稱。
不可少域title.
可省略域author, howpublished, address, month, year, note.
@conference與下面的@inproceedings相同。
@inbook條目為一本書的一部分(章,節或某些頁)。
不可少域author或editor, title, chapter和/或pages, publisher,year.
可省略域volume或number, series, type, address, edition, month,note.
@incollection條目為一本書中有自己題目的一部分。
不可少域author, title, booktitle, publisher, year.
可省略域editor, volume或number,series, type, chapter, pages,address, edition, month, note.
@inproceedings條目為會議論文集中的一篇文章。
不可少域author, title, booktitle, year.
可省略域editor, volume或number, series, pages, address, month,
organization, publisher, note.
@InProceedings{b07name,
author = {a and b},
title = {title},
booktitle = {Proceedings of the conference},
address = {Sydney, Australia},
month = Nov,
year = 2008,
pages = {1-2},
affiliation = {Uni-name, Country},
URL = {http://url/}
};
@manual條目為科技文檔。
不可少域title.
可省略域author, organization, address, edition, month, year, note.
@mastersthesis條目為碩士論文。
不可少域author, title, school, year.
可省略域type, address, month, note.
@misc條目為不屬於其它任何類型的作品。
不可少域沒有。
可省略域author, title, howpublished, month, year, note.
@misc{name,
author = "a",
title = "title",
howpublished = "Website",
year = {2008},
note = {\url{https://www.mysite.org}}
};
@phdthesis條目為博士論文。
不可少域author, title, school, year.
可省略域type, address, month, note.
@proceedings條目為會議論文集。
不可少域title, year.
可省略域editor,volume或number, series, address, month,
organization, publisher, note.
@techreport條目為學校或其它研究機構印製的報告。
不可少域author, title, institution, year.
可省略域type, number, address, month, note.
@techreport{name,
author = {a and b}
title = {title},
institution = {institution rpt no.}
year = {2008}
};
@unpublished條目為有作者和標題的還未出版的作品。
不可少域author, title, note.
可省略域month, year.
在每項條目中還可以有可省略域key和crossref
無法產生參考文獻原因
編輯和使用參考文獻確實比較頭疼,如果不小心的疏忽,文獻列表中多寫了,結果文中卻沒有引用,這樣的錯誤是不能容忍的。 而且在寫的過程中,自己常常弄不清格式,會議,書籍,url等多種格式,比較繁瑣。 好在很多的期刊會議都會提供模板。 我這裡使用的是CTEX的編輯工具,這裡專門介紹使用bib檔案來寫參考文獻, 它的好處就是你可以把很多參考文獻寫在bib檔案中, 然後引用的時候比較方便,如果你使用某篇文獻,那麼它會在文中顯示,反之, 它是在bib中出現, 文章中是不會出現的。 而且使用這種方式編輯參考文獻, 參考文獻的順序是按照字母排列的,也省去了整理參考文獻的麻煩。 1. 由於模板不一樣,所以在文中寫的格式也不一樣。 如IEEE需要: \bibliographystyle{IEEEtran} \bibliography{IEEEabrv,bare_conf} 第一行表示使用的bst檔案, 這個不用管它。 第二行的第一個參數表示使用的bib檔案, 第二個參數是你自己寫的bib檔案。
如果是其他的模板: \bibliographystyle{ownbib} 只需這一句就可以, 參數就是自己的bib檔案名稱。
2. 編譯過程 首先 latex 然後 bib 最後 latex 這樣就編譯好了, 同時還會產生 bbl 和 aux檔案 3. bib檔案的編寫 通常也就是會議,書籍,論文等幾種格式。 一般情況下,網站都會提供該論文的參考文獻格式, export citation ->選擇bib格式->下載。 然後用記事本開啟, 把所有找到的都粘在一個記事本內,然後,尾碼改為bib。 總結一下通常的格式: @INPROCEEDINGS{8, author={Carbunar, B. and Grama, A. and Vitek, J.}, booktitle={Parallel and Distributed Systems, 2004. ICPADS 2004. Proceedings. Tenth International Conference on}, title={Distributed and dynamic voronoi overlays for coverage detection and distributed hash tables in ad-hoc networks}, year={2004}, month={july}, volume={}, number={}, pages={ 549 - 556}, keywords={ Voronoi diagram; ad hoc network; ad-hoc wireless network; coverage detection; coverage-boundary detection; distributed Voronoi overlays; distributed algorithm; distributed hash table; dynamic Voronoi overlays; ad hoc networks; computational geometry; distributed algorithms; file organisation;}, doi={10.1109/ICPADS.2004.1316137}, ISSN={1521-9097 },} @INPROCEEDINGS是格式類型。 後面的第一個參數是自己在文中引用的標號。 例如在文中/cite{8}。 其他的格式有:@ARTICLE @book
最後注意 ,bib檔案, bst檔案和自己的論文要在一個檔案夾目錄下或者給出明確的路徑bib檔案沒必要和文章放在一個檔案夾下,告訴路徑就行了,例如
\bibliography{E:/xxx/bib_name}。 (謝謝趙振華的補充 )
再推薦趙振華的一個博文,非常好希望能對大家寫作有協助。 http://bbs.sciencenet.cn/home.php?mod=space&uid=117412&do=blog&id=288385 找到一個說明的很清楚的一個網址 http://www.csse.monash.edu.au/documents/bibtex/