Citations and References

Last updated on 2025-06-24 | Edit this page

Estimated time: 12 minutes

Overview

Questions

  • How do I add bibliographic references to my document?
  • How do I format my references in LaTeX?
  • How do I cite references in my document?

Objectives

  • Learn how to use a reference database to manage references in LaTeX documents.
  • Explore different ways of citing references in our document.

Citations and References


For bibliographic citations, while you can include references sources directly in our document, usually you will get that information from one or more external files. Such a file is a database of references, containing the information in a processing-friendly format (which is called BibTeX). Using one or more reference databases lets you re-use information and avoid manual formatting.

Reference Databases (BiBTeX)


Reference databases are normally referred to as BiBTeX files, and have the extension .bib. They contain one or more entries, one for each reference, and within each are a series of fields.

Create a new file in your project called sample-references.bib and add the following content:

BIBTEX

@article{Thomas2008,
  author  = {Thomas, Christine M.},
  title   = {The Fascinating World of Penguins},
  journal = {Penguin Chronicles},
  year    = {2008},
  pages   = {7009-7024},
}
@book{Graham1995,
  author    = {Richard L. Graham and Lisa A. Harris},
  title     = {The Humble Paperclip: Master of the Modern Office},
  publisher = {Scranton Press},
  year      = {1995},
}

This is an example of a BiBTeX file that contains a reference for an article and another for a book. Each entry type starts with a the @ symbol, followed by the type of the referencing item (e.g. article) and all information appears within a pair of curly braces {}.

The various fields are given in key-value format. Exactly which fields you need to give depends on the type of entry.

Callout

You might notice that in the author field, each entry is separated by the word and. This is essential: the format of the output needs to know which author is which.

You might also notice that in the article title, some entries are in an extra set of braces. This is to prevent any case-changing that might be applied to the title.

The BibTeX Format

Editing BiBTeX files by hand can be difficult and tedious. A number of tools exist to help you manage your reference files. You can find a list of sugggested tools in the references section.

We’re going to cover two different ways to include references in our document: using the natbib package and using the biblatex package. For the purposes of this workshop, we’ll use biblatex, but feel free to explore natbib on your own - an identical example is provided in the natbib tab below.

Callout

There are many different bibliography styles available, and you can find a list of them at CTAN. Check if one of those bibligraphy and citation styles meets your requirements. If you want to finetune an existing one we suggest to take a look at biblatex-ext.

Inline instructor notes can help inform instructors of timing challenges associated with the lessons. They appear in the “Instructor View”

Challenges


Challenge 1: Try out the other example?

Go back up to the natbib tab and try out the example there. What differences do you notice?

The natbib package is a bit more manual than biblatex. You have to specify the bibliography style and the bibliography file separately, and the citation commands are a bit more manual. This isn’t necessarily a bad thing, as it gives you more control over the output. There’s no wrong answer, just personal preference.

Challenge 2: Add another reference, then delete it.

Try adding the following reference to your sample-references.bib file:

BIBTEX

@book{Huff1954,
  author    = {Huff, Darrell},
  title     = {How to Lie with Statistics},
  publisher = {W. W. Norton \& Company},
  year      = {1954},
}

Then, add a citation to this reference in your document. Try a couple different styles of citation commands. Then, once you have it working, delete the reference and re-compile your document. What happens?

You might expect removing the reference to either error or remove the citation from the text, but it doesn’t - instead we get a placeholder in the text and a warning in the log. A missing reference is not so critical an error that we can’t render the document, but we should probably fix it.

Challenge 3: What’s wrong with this?

We have the following reference in our document:

BIBTEX

@misc{mikolov2013,
      title={Efficient Estimation of Word Representations in Vector Space},
      author={Tomas Mikolov and Kai Chen and Greg Corrado and Jeffrey Dean},
      year={2013},
      eprint={1301.3781},
      archivePrefix={arXiv},
      primaryClass={cs.CL},
      url={https://arxiv.org/abs/1301.3781},
}

We are using biblatex to manage our references, and we identify this reference in the text like this:

LATEX

The Word2Vec algorithm \autocite{mikolov} is a popular method for generating word embeddings.

When we compile our document, we see the following error:

OUTPUT

The Word2Vec algorithm (mikolov) is a popular method for generating word embeddings.

What’s wrong with this reference? How can we fix it?

We are referencing the key mikolov in our document, but the key in our BiBTeX file is mikolov2013. We need to update our citation command to \autocite{mikolov2013}. Note that LaTeX still compiles the document, but it gives us a warning that the reference is missing and uses the key as a placeholder. You might use this to temporarily mark a reference that you haven’t added yet, just be sure to clear all of your warnings before finializing your document.

Key Points

  • References are stored in a reference database, seperate from the LaTeX document.
  • BiBTeX files are used to store references in a processing-friendly format and have the extension .bib.
  • There are multiple libraries available to manage references in LaTeX documents, including natbib and biblatex.
  • We can use the \cite command or one of its variants to cite references in our document.