Creating a List of References

If you're writing one paper with some references, you might as well just "hard-code" in the References. The LaTeX Manual (p.73) describes how to do this using the thebibliography environment and \bibitem's. But if you plan on writing a bunch of papers on the same topic (something all Mathematicians should learn to do...) then you might consider using BibTeX. With BibTeX, you build up a database of references, or different databases for each subject, and pull out only those references you cite in any particular paper.

Now it takes a little more work at the beginning, because the format of the database is, well, ugly. But it allows for many different citation styles and different formats for the References at the end of the document. But if you happen to be using emacs to do your editting, then all the ugly stuff is taken care of--it's so easy it hurts!

This page is by no means exhaustive. I use emacs, so I don't really know how use BibTeX the hard way. Here's a few things:

[Table of Contents]

Running bibtex

The database of references are stored in a file you have to call whatever.bib. When emacs loads in such a .bib file, it loads a special set of BibTeX menu items. In particular, there is a menu of Entry Types. You simply choose the kind of reference you have, an "Article in a journal," say, and you get a list of entries in your document where the cursor is sitting:
@Article{,
  author = 	 "",
  title = 	 "",
  OPTcrossref =  "",
  OPTkey = 	 "",
  OPTjournal = 	 "",
  OPTyear = 	 "",
  OPTvolume = 	 "",
  OPTnumber = 	 "",
  OPTpages = 	 "",
  OPTmonth = 	 "",
  OPTnote = 	 "",
  OPTannote = 	 ""
}
(All these possible entries, and the special format with spaces and commas and quotes are what make the BibTeX database so ugly. All the more reason to switch to emacs.)

Enter all the information you know. When you go to a new line, you can hit Tab and the cursor will jump inside the quotes to where you want to start typing. The fields starting with OPT are, d'uh, optional. If you don't fill out non-optional fields, BibTeX will, to quote Jim, blow chunks and give you errors. Screws up the Reference list at the end, too. So make sure you enter all the necessary information. If you don't know some of it, maybe you should check the Entry Types for something more appropriate, like unpublished.

Enter in all the information that's necessary, and any other stuff you might know. Be sure to use lots of and's between the authors' names. In some places you'll get a "et al." and in other places you'll get all the names, depending on the citation style.

@Article{DY20.1,  <-- that's the key you \cite{...} in the text
  author = 	 "Dyson, F.W. and Eddington, A.S. and Davidson, C.R.",
  title = 	 "A determination of the deflection of light by the
		  sun's gravitaional field made during the total
		  eclipse of May 29, 1919",
  OPTcrossref =  "",
  OPTkey = 	 "",
  OPTjournal = 	 "Mem. Roy. Astron. Soc.",
  OPTyear = 	 "1920",
  OPTvolume = 	 "62",
  OPTnumber = 	 "",
  OPTpages = 	 "291",
  OPTmonth = 	 "",
  OPTnote = 	 "",
  OPTannote = 	 ""
}
Now the beautiful part. Hit Ctrl-c Ctrl-c and all the optional fields disappear, along with any quote marks around numbers:
@Article{DY20.1,
  author = 	 "Dyson, F.W. and Eddington, A.S. and Davidson, C.R.",
  title = 	 "A determination of the deflection of light by the
		  sun's gravitaional field made during the total
		  eclipse of May 29, 1919",
  journal =	 "Mem. Roy. Astron. Soc.",
  year = 	 1920,
  volume =	 62,
  pages =	 291
}
Now whenever you \cite{DY20.1} in any document, you'll get this paper.

Right, so you make this database file and call it, say, references.bib. How do you get LaTeX to use it? In the LaTeX source for your document, put these two lines:

\bibliography{references,more_references}
\bibliographystyle{style}
where references,more_references are a list of .bib databases you might use in this document, and style is the .bst citation style you've chosen for this document. Cite as usual in the text of the document:
"...should refer to \cite{DY20.1} and references therein..."
Now you compile the document called, say, root.tex. It takes four (4) commands:
1. latex root
This makes a bunch of .aux files, one for the root and one for each \include'd file, listing what references will be needed.
2. bibtex root
This reads the .aux files and makes a new file called root.bbl with the LaTeX source for the bibliography. You can edit this file if you don't like the placement of italics or capital letters or something.
3. latex root
Run latex again to, uh, do something. You'll probably get the "...references may have changed" message.
4. latex root
The usual gotta-run-LaTeX-twice command. Now everything should be done. Any citation labels that don't match between the .tex file and the .bib file will be spewed onto the terminal.
Be careful not to say latex root.tex and then bibtex root where sometimes you add the .tex extension and sometimes not. As our friend Jim would say, BibTeX blows chunks.

Citation Styles

The citation style is the way the reference shows up in the document and the way the List of References appear at the end. There are four styles plain, unsrt, alpha, and abbrv that come with LaTeX (and I use Lamport's descriptions below) and about a billion others that individual journals, publishers, etc. distribute. The styles are described in files style.bst usually stored in a bib/ directory in the same place as the LaTeX inputs/.

To make things clear, let's suppose the database references.bib looks like this:

@Article{DY20.1,
  author = 	 "Dyson, F.W. and Eddington, A.S. and Davidson, C.R.",
  title = 	 "A determination of the deflection of light by the
		  sun's gravitaional field made during the total
		  eclipse of May 29, 1919",
  journal =	 "Mem. Roy. Astron. Soc.",
  year = 	 1920,
  volume =	 62,
  pages =	 291
}

@InProceedings{SU93.1,
  author = 	 "Surdej, J. and Soucail, G.",
  title = 	 "Lists of accepted and proposed gravitational lens systems",
  editor =	 "Surdej, J. and Fraipont-Caro, D. and Gosset, E. and
		  Refsdal, S. and Remy, M.",
  booktitle =	 "Gravitational lenses in the Universe",
  year =	 1993,
  note =	 "Proceedings of the 31st Li\`{e}ge International
		  Astrophysical Colloquium"
}
and the LaTeX file root.tex has these lines:
\documentstyle{article}
\begin{document}

In this sentence we make references to \cite{SU93.1}, which is from
a conference I didn't go to, and also \cite{DY20.1}.

\bibliography{references}
\bibliographystyle{style}

\end{document}
where style is one of the styles below. Here's what you get out in the text and for reference list:
style plain
Entries are sorted alphabetically, labeled with numbers:

style unsrt
Same as plain except the entries appear in the order of their first citation.

style alpha
Same as plain except the entry labels are formed from the authors' names and the year of publication. The Reference list isn't too pretty.

style abbrv
Same as plain except the entries are a bit more compact because the authors' first names, months, and journal names are abbreviated. Well, okay my reference list has only initials, no months and an abbreviated journal already, but you get the picture.

style astron
This style is becoming very common. The astronomy community has been using it for years (hence the name).

Notes about astron

  1. You have to include a style file astron.sty in the document, and it only seems to work if you do it like this:
    \documentstyle[astron]{article}
    
    The IAM has this file; you'll have to check the system you're on.
  2. You wouldn't want to have your output looking like
    In this sentence we refer the great work of Surdej and Soucail (Surdej and Soucail, 1993), which is...
    where you repeat the authors' names. Instead, you can use the special form \cite*{blah} which simply prints the year:
    In this sentence we refer the great work of Surdej and Soucail (1993), which is...

Un-cited references

"`Un-cited references?' What does that mean?" If there is a reference, in the .bib database, that you want to include in the List of References but don't actually \cite in the text (like the standard text on the subject where you learned everything you know but can't decide where to actually acknowledge it), use the \nocite{blah} command in the .tex source. Then the reference labeled by blah will appear at the end, too.


[Table of Contents] [Top of References]
Peter Newbury e-mail: newbury@math.ubc.ca
Last update: 30 June 1995