第一步:创建.bib文件
格式如下:
以用{}包含具体内容
@article {name1,
author = {作者, 多个作者用 and 连接},
title = {标题},
journal = {期刊名},
volume = {卷20},
number = {页码},
year = {年份},
}
也可以直接用双引号“”包含具体内容
@book {name2,
author ="作者",
year ="年份2008",
title ="书名",
publisher ="出版社名称"
}
红色字体如article, book 表示所引用的参考文献的类型. bibtex共支持如下14种类型的参考文献,每种参考文献包括必须的条目(蓝色字体)也在后文中给出。接下来的"name1", 就是你在正文中引用这个文献的名称. 在文中,应当为/cite{name1}。
Bibliography entries included in a .bib file are split by types. The following types are understood by virtually all BibTeX styles:
参考文献类型 | 说明 | Required fields 必填内容 | Optional fields 选填内容 |
article | An article from a journal or magazine. | author, title, journal, year | volume, number, pages, month, note, key |
book | A book with an explicit publisher. | author/editor, title, publisher, year | volume, series, address, edition, month, note, key, pages |
booklet | A work that is printed and bound, but without a named publisher or sponsoring institution. | title | author, howpublished, address, month, year, note, key |
conference | The same as inproceedings , included for Scribe compatibility | author, title, booktitle, year | editor, pages, organization, publisher, address, month, note, key |
inbook | A part of a book, usually untitled. May be a chapter (or section or whatever) and/or a range of pages. | author/editor, title, chapter/pages, publisher, year | volume, series, address, edition, month, note, key |
i ncollection | A part of a book having its own title. | author, title, booktitle, year | editor, pages, organization, publisher, address, month, note, key |
inproceedings | An article in a conference proceedings. | author, title, booktitle, year | editor, pages, organization, publisher, address, month, note, key |
manual | Technical documentation. | title | author, organization, address, edition, month, year, note, key |
mastersthesis | A Master's thesis . | author, title, school, year | address, month, note, key |
misc | For use when nothing else fits | none | author, title, howpublished, month, year, note, key |
phdthesis | A Ph.D. thesis | author, title, school, year | address, month, note, key |
proceedings | The proceedings of a conference. | title, year | editor, publisher, organization, address, month, note, key |
t ec hreport | A report published by a school or other institution, usually numbered within a series | author, title, institution, year | type, number, address, month, note, key |
unpublished | A document having an author and title, but not formally published. | author, title, note | month, year, key |
bibtex支持的参考文献的条目:
Item | 说明 |
address | Publisher's address (usually just the city, but can be the full address for lesser-known publishers) |
annote | An annotation for annotated bibliography styles |
author | The name(s) of the author(s) (in the case of more than one author, separated byand ) |
booktitle | The title of the book, if only part of it is being cited |
chapter | The chapter number |
crossref | The key of the cross-referenced entry |
edition | The edition of a book, long form (such as "first" or "second") |
editor | The name(s) of the editor(s) |
eprint | A specification of an electronic publication, often a preprint or a technical report |
howpublished | How it was published, if the publishing method is nonstandard |
institution | The institution that was involved in the publishing, but not necessarily the publisher |
journal | The journal or magazine the work was published in |
key | A hidden field used for specifying or overriding the alphabetical order of entries (when the "author" and "editor" fields are missing). Note that this is very different from the key (mentioned just after this list) that is used to cite or cross-reference the entry. |
month | The month of publication (or, if unpublished, the month of creation) |
note | Miscellaneous extra information |
number | The "number" of a journal, magazine, or tech-report, if applicable. (Most publications have a "volume", but no "number" field.) |
organization | The conference sponsor |
pages | Page numbers, separated either by commas or double-hyphens. For books, the total number of pages. |
publisher | The publisher's name |
school | The school where the thesis was written |
series | The series of books the book was published in (e.g. "The Hardy Boys " or "Lecture Notes in Computer Science ") |
title | The title of the work |
type | The type of tech-report, for example, "Research Note" |
url | The WWW address |
volume | The volume of a journal or multi-volume book |
year | The year of publication (or, if unpublished, the year of creation) |
第二步:在.tex文件中引用
1) 设置参考文献的类型 (bibliography style). 标准的为 plain:
/bibliographystyle{plain}
将上面的命令放在 LaTeX 文档的 /begin{document}后边. 其它的类型包括
unsrt -- 基本上跟 plain 类型一样, 除了参考文献的条目的编号是按照引用的顺序, 而不是按照作者的字母顺序.
alpha --类似于 plain 类型, 当参考文献的条目的编号基于作者名字和出版年份的顺序.
abbrv --缩写格式 .
2) 标记引用 (Make citations). 当你在文档中想使用引用时, 插入 LaTeX 命令
/cite{引用文章名称} --"引用文章名称" 就是前边定义@article后面的名称.
3) 告诉 LaTeX 生成参考文献列表 . 在 LaTeX 的结束前输入
/bibliography{mybibfile}
第三步:编译
如果你的.tex文件名为myarticle.tex; 你的.bib文件名为mybibfile.bib
那么需要执行的命令如下:
latex myarticle.tex
bibtex myarticle
latex myarticle.tex
latex myarticle.tex
实例(源于[2]):
1. 建立.bib文件--mybibfile.bib
@misc{ Nobody06,
author = "Nobody Jr",
title = "My Article",
year = "2006" }
2. 建立.tex文件myarticle.tex并在文中引用.bib文件
/documentclass[11pt]{article}
/usepackage{cite}
/begin{document}
/title{My Article}
/author{Nobody Jr.}
/date{Today}
/maketitle Blablabla said Nobody ~/cite{Nobody06}.
/bibliography{mybibfile}{}
/bibliographystyle{plain}
/end{document}
3. 编译:
[ysong@ECEL216D-2076 Desktop]$ latex myarticle.tex
- This is pdfeTeX, Version 3.141592-1.21a-2.2 (Web2C 7.5.4) entering extended mode
- (./myarticle.tex LaTeX2e <2003/12/01> Babel <v3.8d> and hyphenation patterns for american, french, german, ngerman, b ahasa, basque, bulgarian, catalan, croatian, czech, danish, dutch, esperanto, e stonian, finnish, greek, icelandic, irish, italian, latin, magyar, norsk, polis h, portuges, romanian, russian, serbian, slovak, slovene, spanish, swedish, tur kish, ukrainian, nohyphenation, loaded.
- (/usr/share/texmf/tex/latex/base/article.cls
- Document Class: article 2004/02/16 v1.4f Standard LaTeX document class (/usr/share/texmf/tex/latex/base/size11.clo)) (/usr/share/texmf/tex/latex/cite/cite.sty)
- No file myarticle.aux.
- LaTeX Warning: Citation `Nobody06' on page 1 undefined on input line 11. No file myarticle.bbl. [1] (./myarticle.aux)
- LaTeX Warning: There were undefined references.)
- Output written on myarticle.dvi (1 page, 468 bytes).
- Transcript written on myarticle.log.
[ysong@ECEL216D-2076 Desktop]$ bibtex myarticle
- This is BibTeX, Version 0.99c (Web2C 7.5.4) The top-level auxiliary file: myarticle.aux The style file: plain.bst Database file #1: mybibfile.bib
[ysong@ECEL216D-2076 Desktop]$ latex myarticle.tex
- This is pdfeTeX, Version 3.141592-1.21a-2.2 (Web2C 7.5.4) entering extended mode (./myarticle.tex LaTeX2e <2003/12/01> Babel <v3.8d> and hyphenation patterns for american, french, german, ngerman, b ahasa, basque, bulgarian, catalan, croatian, czech, danish, dutch, esperanto, e stonian, finnish, greek, icelandic, irish, italian, latin, magyar, norsk, polis h, portuges, romanian, russian, serbian, slovak, slovene, spanish, swedish, tur kish, ukrainian, nohyphenation, loaded. (/usr/share/texmf/tex/latex/base/article.cls
- Document Class: article 2004/02/16 v1.4f Standard LaTeX document class (/usr/share/texmf/tex/latex/base/size11.clo)) (/usr/share/texmf/tex/latex/cite/cite.sty) (./myarticle.aux) LaTeX Warning: Citation `Nobody06' on page 1 undefined on input line 11. (./myarticle.bbl) [1] (./myarticle.aux)
- LaTeX Warning: There were undefined references.
- LaTeX Warning: Label(s) may have changed. Rerun to get cross-references right.)
- Output written on myarticle.dvi (1 page, 592 bytes).
- Transcript written on myarticle.log.
[ysong@ECEL216D-2076 Desktop]$ latex myarticle.tex
- This is pdfeTeX, Version 3.141592-1.21a-2.2 (Web2C 7.5.4) entering extended mode
- (./myarticle.tex LaTeX2e <2003/12/01> Babel <v3.8d> and hyphenation patterns for american, french, german, ngerman, b ahasa, basque, bulgarian, catalan, croatian, czech, danish, dutch, esperanto, e stonian, finnish, greek, icelandic, irish, italian, latin, magyar, norsk, polis h, portuges, romanian, russian, serbian, slovak, slovene, spanish, swedish, tur kish, ukrainian, nohyphenation, loaded. (/usr/share/texmf/tex/latex/base/article.cls
- Document Class: article 2004/02/16 v1.4f Standard LaTeX document class (/usr/share/texmf/tex/latex/base/size11.clo)) (/usr/share/texmf/tex/latex/cite/cite.sty) (./myarticle.aux) (./myarticle.bbl) [1] (./myarticle.aux) )
- Output written on myarticle.dvi (1 page, 548 bytes).
- Transcript written on myarticle.log.
生成的PDF文件如下图所示
[2] http://www.bibtex.org/Format