<HTML>

<HEAD>
		<META HTTP-EQUIV="content-type" CONTENT="text/html;charset=iso-8859-1">
		<TITLE>BibTeX</TITLE>
		<META NAME="copyright" CONTENT="Copyright (c) 2003 Richard Koch under the GNU FDL">
		<META NAME="description" CONTENT="bibtex; bibliography; citation">
		<link href="../sty/screen.css" rel="stylesheet" media="all">
	</HEAD>

<BODY>
	<div id="content_border">
		<P>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. </P>
		<p>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 &quot;mybibliography.bib&quot; containing the text shown below. In this text, the entries &quot;Felici:1991, Knuth:WEB,&quot; and &quot;Liang:1983&quot; are key values used to cite the articles in the LaTeX source.</p>
		<dl>
			<dd><tt>@article{Felici:1991,</tt>
			<dd><tt>author	={James Felici},</tt>
			<dd><tt>title	={{PostScript versus TrueType}},</tt>
			<dd><tt>journal	={Macworld},</tt>
			<dd><tt>volume	=8, pages={195--201},</tt>
			<dd><tt>month	=sep, year = 1991		}</tt>
			<dd>
			<dd><tt>@techreport{Knuth:WEB,</tt>
			<dd><tt>title	={{The \textsf{WEB} System of</tt>
			<dd><tt>Structured Documentation}},</tt>
			<dd><tt>month	=sep, year = 1983,</tt>
			<dd><tt>author	={Donald E. Knuth},</tt>
			<dd><tt>address	={Stanford, CA 94305},</tt>
			<dd><tt>number	={STAN-CS-83-980},</tt>
			<dd><tt>institution={Department of Computer</tt>
			<dd><tt>Science, Stanford University}  }</tt>
			<dd>
			<dd><tt>@phdthesis{Liang:1983,</tt>
			<dd><tt>author	={Franklin Mark Liang},</tt>
			<dd><tt>month	=jun, year = 1983,</tt>
			<dd><tt>school	={Stanford University},</tt>
			<dd><tt>address	={Stanford, CA 94305},</tt>
			<dd><tt>title	={{Word Hy-phen-a-tion by</tt>
			<dd><tt>Com-pu-ter}},</tt>
			<dd><tt>note	={Also available as Stanford</tt>
			<dd><tt>University, Department of</tt>
			<dd><tt>Computer Science Report</tt>
			<dd><tt>No. STAN-CS-83-977}   }</tt>
		</dl>
		<p>Suppose the LaTeX source file is called &quot;myfile.tex&quot; and contains the following text:</p>
		<dl>
			<dd><tt>\begin{document}</tt>
			<dd><tt>Consider the  argument of Felici~\cite{Felici:1991} in light of these comments.</tt>
			<dd><tt>\nocite{Liang:1983} We provide further remarks later.</tt>
			<dd>
			<dd><tt>\bibliographystyle{plain}</tt>
			<dd><tt>\bibliography{mybibliography}</tt>
			<dd><tt>\end{document}</tt>
		</dl>
		<p>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.</p>
		<p>TeXShop can be used with this example in the following way. First edit and typeset the document &quot;myfile.tex&quot; as usual. Citations will appear in the output as &quot;[?]&quot; and the bibliography will be missing. Then select &quot;BibTeX&quot; under the Program button and run BibTeX. Next select &quot;LaTeX&quot; and typeset again. Citations will still appear as &quot;[?]&quot;, but the bibliography will be added to the output. Typeset a final time, and citations will have their correct values.</p>
<p> Notice that the BibTeX menu command has a keyboard equivalent.</p>
		<p>The file &quot;mybibliography.bib&quot; can be opened and edited by TeXShop. If you use TeXShop to create the file &quot;mybibliography.bib&quot; in the first place, use the pulldown tag labeled &quot;file format&quot; to save the file as a bib file rather than as a tex file.</p>
		
<p> 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.

<p> 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.
<dl>
<dd> % !BIB TS-program = biber
</dl>		
<p> For compatibility with other platforms, the following syntax is also acceptable
<dl>
<dd> % !BIB program = biber
</dl>		
<p> If this line is missing from the source file, the corresponding Preference entry will be used when the BibTeX menu command is selected.		
		
		
		
		
		</div>
<div id="header_background"></div>
<div id="header_logo"><a href="../TeXShop%20Help.html"><IMG HEIGHT="40" WIDTH="40" border="0" SRC="../gfx/xicnsc.gif"></a></div>
<div id="header_chapter">Advanced Help</div><div id="header_title">BibTeX</div>
	<div id="menu_border">
		<ul>
			<LI><a href="advanced_personaltetex.htm">Adding Personal Sty and Macro Files to TeX Live</a>
			<LI><a href="advanced_addengine.htm">Additional Typesetting Engines</a>
			<li><a href="advanced_encoding.htm">Encodings</a>
			<li><a href="advanced_xetex.htm">XeTeX and XeLaTeX</a>
			<LI><a href="advanced_removeaux.htm">Removing AUX Files</a>
			<li><a href="advanced_experiments.htm">Experiments</a>
			<li><a href="advanced_externaleditor.htm">Using an External Editor</a>
			<li><a href="advanced_pdfcopypaste.htm">Copy-Paste and Drag-Drop from the Preview Window </a>
			<li><a href="advanced_root.htm">Setting a Project Root File</a>
			<li><a href="advanced_pdfsync.htm">Synchronizing Source and Preview</a>
			<li><a href="advanced_unicode.htm">Unicode</a>
			<li><a href="advanced_bibtex.htm">BibTeX</a>
			<li><a href="advanced_makeindex.htm">MakeIndex</a>
			<li><a href="advanced_formats.htm">Making and Using New TeX Formats</a>
			<li><a href="advanced_otherfiles.htm">Opening Other Files with TeXShop</a>
			<li><a href="advanced_mathematica.htm">Mathematica</a>
			<li><a href="advanced_localization.htm">Localizations</a>
			<li><a href="advanced_syntaxcolor.htm">Syntax Colors </a>
			<li><a href="advanced_shellescape.htm">Shell Escape Protection </a>			
			<li><a href="advanced_coloredtext.htm">Colored Text in TeX </a>			
			<li><a href="advanced_moretetex.htm">More About TeX Live</a>
			<li><a href="advanced_fink.htm">Coexisting with Fink</a>
			<li><a href="advanced_otherdistributions.htm">Coexisting with Other TeX Distributions</a>
			<li><a href="advanced_context.htm">ConTeXt and MetaPost</a>
			<li><a href="advanced_plist.htm">Plist Files</a>
			<li><a href="advanced_menushortcuts.htm">Redefining Keyboard Menu Shortcuts</a>
		</UL>
	</div>
	</BODY>

</HTML>