BibTeX is a tool used to create bibliographies in LaTeX documents. The tool assumes that you have a large database of references which you often quote. Simple commands allow you to cite certain of these references in your LaTeX source, and BibTeX then creates a bibliography for your article containing only the items cited.

Here is a brief example taken from The LaTeX Companion by Goossens, Mittelbach, and Samarin. Consult this book for many additional details. Suppose the database is a file called "mybibliography.bib" containing the text shown below. In this text, the entries "Felici:1991, Knuth:WEB," and "Liang:1983" are key values used to cite the articles in the LaTeX source.

@article{Felici:1991,
author ={James Felici},
title ={{PostScript versus TrueType}},
journal ={Macworld},
volume =8, pages={195--201},
month =sep, year = 1991 }
@techreport{Knuth:WEB,
title ={{The \textsf{WEB} System of
Structured Documentation}},
month =sep, year = 1983,
author ={Donald E. Knuth},
address ={Stanford, CA 94305},
number ={STAN-CS-83-980},
institution={Department of Computer
Science, Stanford University} }
@phdthesis{Liang:1983,
author ={Franklin Mark Liang},
month =jun, year = 1983,
school ={Stanford University},
address ={Stanford, CA 94305},
title ={{Word Hy-phen-a-tion by
Com-pu-ter}},
note ={Also available as Stanford
University, Department of
Computer Science Report
No. STAN-CS-83-977} }

Suppose the LaTeX source file is called "myfile.tex" and contains the following text:

\begin{document}
Consider the argument of Felici~\cite{Felici:1991} in light of these comments.
\nocite{Liang:1983} We provide further remarks later.
\bibliographystyle{plain}
\bibliography{mybibliography}
\end{document}

When this source is typeset, a reference to Felici's article will appear in the text, and a bibliography will be created at the end of the text containing the articles of Felici and Liang, but not the article of Knuth.

TeXShop can be used with this example in the following way. First edit and typeset the document "myfile.tex" as usual. Citations will appear in the output as "[?]" and the bibliography will be missing. Then select "BibTeX" under the Program button and run BibTeX. Next select "LaTeX" and typeset again. Citations will still appear as "[?]", but the bibliography will be added to the output. Typeset a final time, and citations will have their correct values.

Notice that the BibTeX menu command has a keyboard equivalent.

The file "mybibliography.bib" can be opened and edited by TeXShop. If you use TeXShop to create the file "mybibliography.bib" in the first place, use the pulldown tag labeled "file format" to save the file as a bib file rather than as a tex file.

In recent years, additional programs like biber have been written to handle bibliographies. Japanese typesetting is done using a modified TeX and still other programs like pbibtex and ubibtex are available there for bibliographies. So TeXShop has a preference setting to set the program called when the BibTeX menu item is chosen. It is at the bottom of the Engine tab. Fill in with the appropriate name, and any flags that should be used when calling this command line program.

Often users use different bibliography programs for different projects, or when working with different coauthors. TeXShop allows the bibliography program to be set on a file-by-file basis. To set it for a given source file, include the following line within the first twenty lines of the source, replacing "biber" with the desired program names and any desired flags.

% !BIB TS-program = biber

For compatibility with other platforms, the following syntax is also acceptable

% !BIB program = biber

If this line is missing from the source file, the corresponding Preference entry will be used when the BibTeX menu command is selected.

Advanced Help
BibTeX