Skip to Main Content

Referencing, Citing, and Structuring Bibliographies

A beginners' guide to referencing and bibliographies.

What are the differences between BibTeX and BibLaTeX?

There are two main methods to insert citations and a bibliography in LaTEX: BibTEX and BibLaTEX. Which one you use will depend on the reason why you are creating the document and whether you are working from a template or not.

BibTEX has been around for a long time and it is still used in template for journal articles and some assignments. If you have given a LaTEtemplate which uses BibTEX for referencing, you should use BibTEX .

BibLaTEX is more modern and flexible. Whereas with BibTEX there are several compilation steps, when using BibLaTEX with the biber backend, you can define your bibliography style and source directly in the LaTEXdocument using commands like \usepackage{biblatex} and \addbibresource{}. Many LaTEX editors (like Overleaf) automate the biber compilation step, making it feel like a single-step process.

This tutorial has more information about refencing with BibTEX and BibLaTEX.

Using BibTEX

Although it is possible to use insert citations with BibTEX without any packages loaded, this is rather limited.We recommend that you use the natbib package, which allows the creation of different types of citation and has a lot of styles available.

1. Create a .bib file with your references. Each reference should look something like this:

@article{einstein1905,
  author = {Albert Einstein},
  title = {On the Electrodynamics of Moving Bodies},
  journal = {Annalen der Physik},
  year = {1905},
  volume = {17},
  pages = {891--921}
}    

2. Insert citations in your LaTEX document. A citation within the text should loke something like this:

Einstein's work on relativity \cite{einstein1905} changed physics.

In this example, einstein1905 is the citation for the bibliography entry shown in step 1. This combination of author's surname and year of publication is what is called a citekey. Most citekeys will have this format, but some referencing management systems will produce citekeys in different formats.

3. Add bibliography commands:

\bibliographystyle{plain}
\bibliography{references}

In the above example, references refers to the BibTEX file which has all your references in the format explained in step 1.This file will have the extension .bib.

To compile the bibliography, make sure that both the LaTEX and BibTEX files are in the same directory, and follow these copilation steps:

  1. Run LaTEX (pdflatex).
  2. Run BibTEX.
  3. Run LaTEX twice more to resolve references.

Using BibLaTEX

BibLaTEX offers more flexibility and modern features. It uses biber as its backend instead of bibtex.

1. Set up your document: Add the usepackage biblatex with the backend biber and, if relevant to your referencing style, the authoryear style.

\usepackage[backend=biber,style=authoryear]{biblatex}
\addbibresource{references.bib}

2. Insert your reference file:

\addbibresource{references.bib}

The format for each entry in the reference file will be similar to this:

@article{einstein1905,
  author = {Albert Einstein},
  title = {On the Electrodynamics of Moving Bodies},
  journal = {Annalen der Physik},
  year = {1905},
  volume = {17},
  pages = {891--921}
}    

3. Insert citations in your text.  A citation within the text should loke something like this:

Einstein's work on relativity \cite{einstein1905} changed physics.

4. Compile the bibliography with the \printbibliography command.

My references are not appearing right - why?

Much time and effort can be saved by automatically generating BibTEX files through bulk export of multiple references either direct from databases or from reference management software. This automatic process may cause some issues and require you to tidy up the BibTEX files.

Here are some suggestions to help with this:

  • LaTEX special characters (e.g. $, %, &, \,) present in a BibTEX file can create problems during typesetting. To avoid this, all these characters should be prefixed with the ‘\’ character. Use a text editor such as Notepad or TeXworks to Find and Replace e.g. replace $ with \$
  • The BibTEX file is likely to contain extra fields of information not required for the actual reference. This information may pull through into the reference e.g. Notes field.We recommend that you remove this information from the BibTEX file
  • Retaining capitalization. Some bibliography styles strip out capitalization in fields such as the title field; this can be a problem if you want to preserve e.g. acronyms. To preserve capitalization, edit the BibTEX file and enclose the specific text (whole not partial words) in curly brackets. For example, title={Study of incompressible {MHD} flow in a circular pipe with transverse magnetic field using a spectral/finite element solver},
  • Make sure that there is a comma after each line in the reference except for the last one (see the Einstein example in the main text of this page).
Creative Commons License
Royal Holloway Library LibGuide by Royal Holloway Library is licensed under a Creative Commons Attribution-NonCommercial 4.0 International License.