Skip to Main Content

BibTeX for LaTeX

This guide provides a brief overview of managing references in LaTeX using BibTeX. Follow the instructions to integrate BibTeX into your LaTeX documents, allowing you to cite sources and generate bibliographies.

Citing and referencing using BibTeX

Why use BibTeX?

  • Once stored in a BibTeX file, a reference can be re-used in future documents (you may choose to maintain one master or a series of BibTeX files)
  • Many databases and reference management software allow the automatic export of reference details as BibTeX files (in some cases, bulk export of multiple references is possible)

Basic structure of a BibTeX file

A BibTeX file (.bib) is a list of entries, each representing a different reference. Individual entry begins with a resource type (such as @article, @book, @inproceedings, etc.), followed by a unique key and other fields like author, title, year, etc.


Example: a .bib file entry


@article{goel_using_2017,
    title = {Using {AI} to teach {AI}: lessons from an online {AI} class},
    volume = {38},
    number = {2},
    urldate = {2023-11-28},
    journal = {Ai Magazine},
    author = {Goel, Ashok K. and Joyner, David A.},
    year = {2017},
    pages = {48--59},    
    url = {https://ojs.aaai.org/aimagazine/aimagazine/article/2732},
}

 

An example of a .bib file entry

 

 

What is natbib?

Natbib is a LaTeX package that provides greater control over how citations are created and displayed in your document. It supports various citation styles including numerical style (Vancouver) and author / date (Harvard).

Inserting citations and generating a reference list 

  • Create a .bib File: compile your references in a .bib file (see Generating BibTeX file)
  • Include natbib package: add \usepackage{natbib} in the preamble of your LaTeX document
  • Add citations: use relevant variations of the \cite command to add in-text citations
  • Specify bibliography style: choose your referencing style with \bibliographystyle{style} (see Harvard, Vancouver, IEEE)
  • Generate reference list: add \bibliography{filename} at the end of your document to generate the reference list
 

In practice:

\documentclass{article}
\usepackage{natbib}
 
\begin{document}
 
You are citing a reference using Natbib: \citep{Unique_key}.
 
\bibliographystyle{agsm}
\bibliography{references}
\end{document}
 

Example: Using Harvard style with Natbib package

A screenshot illustrating the use of the Natbib package in creating a Harvard Referencing Style in Overleaf