Skip to main content
A university for the real world

Tips

Using BibTeX in a LaTeX document

In order to use your BibTeX database in a LaTeX document, you must essentially do three things:

1) Set the bibliography style.

\bibliographystyle{plain}

Put this command just before the \end{document} command in your LaTeX document. Other styles include

  • unsrt – The same as plain except entries are numbered based on when they are cited, not alphabetically by author.
  • alpha – Similar to plain except instead of having numerical identifiers (e.g. [1]), labels are created based on the year of publication and the name of the author(s).
  • abbrv – Names and journal titles are abbreviated.
  • apalike - author/date in-text citations based on APA5th

2) Make citations. When you come to a passage in your text where you need a citation, insert the LaTeX command

\cite{citekey}     where citekey is the identifier you chose when either typing the database file by hand or using a                         graphical manager.

\cite{smith2012}

3) Tell LaTeX to make the bibliography. This happens at the end of the LaTeX document. Just type

\bibliography{bibfile} where bibfile is the the file bibfile.bib – your BibTeX database.

\bibliography(MyBibTeXDatabaseFile}


* The hardest part is running BibTeX on your LaTeX file. This assumes that you have BibTeX installed already (most distributions come with it by default).

 In order for LaTeX to compile your BibTeX database into a document, you must do the following:

  1. Run LaTeX on your .tex file – this will generate the .aux file that BibTeX needs to find the citations.
  2. Run BibTeX on your .tex file – this can usually be done from your LaTeX frontend. If not, use the command line.
  3. Run LaTeX on your .tex file – this will create the bibliography section in the document, but will not insert the correct numbering
  4. Run LaTeX on your .tex file one more time – this step finishes everything; the references section will be created and all of the citations will be properly numbered.