我对 bib.tex (甚至 LATEX) 非常不了解。我曾经使用过
\开始{书目}{99}
在我的 latex 文本中。但现在我必须使用 bib.tex,并且需要“非常简单”的信息,关于我应该如何创建 bib 文件,我应该下载某些东西还是只添加一些 usepackage?
答案1
来自 Wikibooks 示例(https://en.wikibooks.org/wiki/LaTeX/Bibliography_Management#BibTeX)创建一个名为example.bib
(你可以随意命名)的文件,内容如下
@article{AbedonHymanThomas2003,
author = "Abedon, S. T. and Hyman, P. and Thomas, C.",
year = "2003",
title = "Experimental examination of bacteriophage latent-period evolution as a response to bacterial availability",
journal = "Applied and Environmental Microbiology",
volume = "69",
pages = "7499--7506"
},
@incollection{Abedon1994,
author = "Abedon, S. T.",
title = "Lysis and the interaction between free phages and infected cells",
pages = "397--405",
booktitle = "Molecular biology of bacteriophage T4",
editor = "Karam, Jim D. Karam and Drake, John W. and Kreuzer, Kenneth N. and Mosig, Gisela
and Hall, Dwight and Eiserling, Frederick A. and Black, Lindsay W. and Kutter, Elizabeth
and Carlson, Karin and Miller, Eric S. and Spicer, Eleanor",
publisher = "ASM Press, Washington DC",
year = "1994"
}
现在让你的主 tex 文件(我制作了一个虚拟文件bibliographyexample.tex
)包含以下几行
\documentclass{article}
\begin{document}
\nocite{*} % this line is just for this example. you should put \cite commands instead
\bibliographystyle{plain}
\bibliography{example} % this is the important line
\end{document}
现在打开终端/命令行并进入包含上述两个文件的目录并输入latex bibliographyexample.tex
。你将得到类似的输出
This is pdfTeX, Version 3.14159265-2.6-1.40.16 (TeX Live 2015) (preloaded format=latex)
restricted \write18 enabled.
entering extended mode
(./bibliographyexample.tex
LaTeX2e <2015/01/01>
Babel <3.9l> and hyphenation patterns for 79 languages loaded.
(/usr/local/texlive/2015/texmf-dist/tex/latex/base/article.cls
Document Class: article 2014/09/29 v1.4h Standard LaTeX document class
(/usr/local/texlive/2015/texmf-dist/tex/latex/base/size10.clo))
No file bibliographyexample.aux.
No file bibliographyexample.bbl.
(./bibliographyexample.aux) )
No pages of output.
Transcript written on bibliographyexample.log.
如果没有错误,bibliographyexample.aux
目录中会创建一个新文件,名为 。现在输入bibtex bibliographyexample.aux
。你应该得到类似这样的输出
This is BibTeX, Version 0.99d (TeX Live 2015)
The top-level auxiliary file: bibliographyexample.aux
The style file: plain.bst
Database file #1: example.bib
现在,您的目录中将出现一个名为 的新文件bibliographyexample.bbl
。打开它,您会发现它包含bibitem
(您可能很熟悉)
\begin{thebibliography}{1}
\bibitem{Abedon1994}
S.~T. Abedon.
\newblock Lysis and the interaction between free phages and infected cells.
\newblock In Jim D.~Karam Karam, John~W. Drake, Kenneth~N. Kreuzer, Gisela
Mosig, Dwight Hall, Frederick~A. Eiserling, Lindsay~W. Black, Elizabeth
Kutter, Karin Carlson, Eric~S. Miller, and Eleanor Spicer, editors, {\em
Molecular biology of bacteriophage T4}, pages 397--405. ASM Press, Washington
DC, 1994.
\bibitem{AbedonHymanThomas2003}
S.~T. Abedon, P.~Hyman, and C.~Thomas.
\newblock Experimental examination of bacteriophage latent-period evolution as
a response to bacterial availability.
\newblock {\em Applied and Environmental Microbiology}, 69:7499--7506, 2003.
\end{thebibliography}
再运行pdflatex bibliographyexample.tex
两次,您将得到如下所示的结果。
每次修改*.bib
文件时都应该重复此过程