Creating Bibliographies in LaTeX#

Objective: Learn the basic commands to create and edit in-text citations and bibliographies

Getting started with a .bib file#

In order to include in-text citations and a bibliography, the document needs to refer to a .bib file. There are three ways to include a .bib file in a project in Overleaf.

  1. Upload your own .bib file that you create or export from a citation manager.

  2. Link to a URL (.bib)

  3. Connect your Overleaf account with Mendeley or Zotero.

If you are working in a traditional LaTeX editor, locate the .bib file in the directory.

What does a citation in a .bib file look like?#

bibkey

Bibliography Packages#

LaTeX uses two common packages to generate in-text citations and bibliographies.

  1. natbib: works best with author-year citations and numerical citations. This package works well for simple, short bibliographies, but is not supported and less commonly used.

  2. biblatex: the most flexible package for generating citations and the package that will be referred to in this document.

Packages required for the preamble:

\usepackage[backend=biber,style=authoryear]{biblatex}

The above syntax calls in the biblatex package and the backend (biber), which acts as the interface between the .bib file and the LaTeX document. “Authoryear” denotes the citation style. This can be changed accordingly.

\addbibresource{example.bib}

The above command calls in the .bib file, which has the citation information for in-text citations and the bibliography.

\printbibliography

The above command inserts the bibliography, which will contain citations referenced in the text.

In-text citations#

\cite{} → bare citation command (according to style)

\parencite{} → parenthetical citation

\citeauthor{} → prints author names(s)

\textcite{} → prints authors or editors followed by a citation label enclosed in ()

\nocite {*} → prints publication in bibliography without citation

\citeyear{} → prints only the year field

Examples#

\cite{knyazeva_duplex_2013} → Knyazeva and Pohl 2013

\parencite{singh_erratum:_2013} → (Singh et al. 2013)

\citeauthor{campbell_how_2011} → Campbell and Cabrera

\textcite{elsabbagh_microstructure_2014} → Elsabbagh, Hamouda, and Taha (2014)

Exercise 1#

Objective: Learn to create, edit or upload a .bib file, use basic citation commands, and display a bibliography.

Create a .bib file and add references#

  • Create a new file within your project (click on the paper icon in the upper left) and name it references.bib
  • Search for these three articles and books in Google Scholar and locate their BibTeX formatted citations.
    • 10.1126/science.1214319
    • Hydraulic power system analysis
    • 10.1103/PhysRevB.100.094418
  • Paste each citation within your .bib file. (No preamble is needed).

bibex

Adding a bibliography#

  1. To display bibliography in APA style, add package and style command to preamble:
    \usepackage[backend=biber,style=authoryear]{biblatex}
    \addbibresource{references.bib}

  2. And use these commands within document:
    \printbibliography
    \nocite{*}

Citation commands#

Try using citation commands to recreate the sentence below:

In the example provided, Weber et al. 2012 describes the experiment, but Akers, Gassman, and Smith contradict these conclusions.

Commands needed: \cite{}, \citeauthor{}

For additional examples and more information, please visit Overleaf’s page on bibliography management in LaTeX