Blog der Hauptbibliothek

How to cite in LaTeX – reloaded

7. December 2021 | Anna C. Véron | Keine Kommentare |

This post is also available in: Deutsch

With this blog post we would like to provide a guideline on how to create citations and reference lists with the LaTeX typesetting environment, which is a free and open source document preparation system, especially popular among scientists who want to include mathematical and technical expressions in their documents.

In order to cite in LaTeX you need…

  • a *.bib file that contains the references in a specific text-only format
  • a LaTeX package that allows for the creation of citations and reference lists / bibliographies
  • a citation style (if not already included in the package)

The *.bib file

The central part of citing references in LaTeX is a text file containing the metadata of all the references the author wants to use in their document. It has the extension *.bib and is typically stored in the same folder as the corresponding *.tex file.
The structure of a reference in a *.bib file is explained below.

How to get the *.bib file

We recommend that you use a literature management software to export the desired references into a *.bib file. Alternatively, for quick one-time use of a reference, you can copy the BibTeX format from many publisher’s websites and literature databases (e.g. Web of Science or Scopus). Copying the BibTeX format from Google Scholar citations is not recommended, because the data can be of poor quality, leading to incomplete data in the bibliography.

For managing references in *.bib files we recommend you to use the free software JabRef. Even if you use other literature management sofware (like Endnote, Mendeley or Zotero) to export references, JabRef can be very useful to clean up the files, change the format between bibtex to biblatex, etc.

Which package to choose?

There are two main packages that are used in LaTeX for creating citations and bibliographies.

natbib (based on bibtex) comes included in most LaTeX distributions and thus appears as «LaTeX’s native citation functionality». However, this package is partly outdated and not further developed. As an example, users experience problems with the formatting of special characters, because natbib/bibtex does not support Unicode/UTF-8. Also, the adaptation of citation styles is complex and requires programming in a postfix notation.

biblatex (based on biber) is a more modern package for bibliography management in LaTeX. It comes with many options for customization, such as…

  • different citation and bibliography styles and easy modification
  • subdivided reference lists (by type, keyword, etc.). Example: list scientific publications and online sources separately in your reference list)
  • several bibliographies within one document. Example: reference lists after each chapter of a book or thesis.

One drawback of biblatex is that it is not (yet) widely implemented and accepted by journals.

We recommend you to use biblatex, unless a journal requires to use natbib for submission of a paper (e.g. in the REVTex class). For more information on natbib and special characters, check the following post on stackexchange How to write “ä” and other umlauts and accented letters in bibliography?

Basic usage of biblatex

The biblatex package needs to be loaded in the preamble of the document. A minimal working example of the biblatex package is shown below.
Please note, that the *.bib file needs to be formatted according to biblatex (and not bibtex!) in order to be compatible with the biblatex package. If your *.bib file has the wrong format, use JabRef to convert it to biblatex.

Code for copy+paste:

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}

\usepackage{biblatex}
\addbibresource{myreferences.bib}

\begin{document}
Here we write our text and insert a citation whenever necessary. \cite{mypaper1}
\printbibliography 

\end{document}

Adapting citation and bibliography styles in biblatex

The BibLaTeX package offers several built-in styles to adapt the formatting of citations and references, which can be specified when the package is loaded.

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}

\usepackage{biblatex} [
backend=biber,
style=phys, %This is the style of the bibliography
citestyle=phys %This is the style of the citations.
]
\addbibresource{myreferences.bib}

\begin{document}
Here we write our text and insert a citation whenever necessary. \cite{mypaper1}
\printbibliography
\end{document}

Some of the built-in citation styles work very well, while others might require further adaption to your needs. Check out the following stackexchange post on Guidelines for customizing biblatex styles.

Which literature management software to use in combination with LaTeX?

Most literature management softwares are able to export references to *.bib files, but only some of them are also compatible with the modern biblatex package. Among them are Citavi and Zotero. As mentioned before, JabRef is a great tool for managing and cleaning up *.bib files, even if you use other software for your primary literature management.

For a detailed overview on the pros and cons of the different softwares, check out this previous blogpost on How to Cite in LaTeX.

Record from 07.12.2021

Abgelegt unter: Coffee LecturesCourses and LecturesGood to knowTips for ResearchersTips for Students
Tags: