Tx · LaTeX & TikZ

How to Add a Numbered BibLaTeX Bibliography to the TOC

Published By the 9to5Science editorial team

At a glance

  1. 1. Use BibLaTeX headings

    Set the heading option on \printbibliography; tocbibind's numbib option is for traditional LaTeX bibliographies.

  2. 2. Choose numbered output

    Use heading=bibnumbered to print a numbered heading and include it in the table of contents.

  3. 3. Run the full build

    Run LaTeX, Biber, then LaTeX twice so the bibliography and table of contents can update.

If you use BibLaTeX, tocbibind is usually not the right way to make the bibliography a numbered table-of-contents entry. Use BibLaTeX’s own bibliography-heading option instead: heading=bibnumbered.

The default \printbibliography heading is typically unnumbered and is not automatically added to the table of contents. BibLaTeX provides different heading types for these behaviors.

Use heading=bibnumbered

Give the option directly to \printbibliography:

\printbibliography[heading=bibnumbered]

This prints a numbered bibliography heading and adds it to the table of contents. The heading level depends on the document class: it is normally a chapter-level heading in report or book, and a section-level heading in article.

Here is a complete minimal example. The filecontents* environment creates the bibliography file when you compile the document with a modern LaTeX installation.

\begin{filecontents*}{references.bib}
@book{knuth,
  author    = {Donald E. Knuth},
  title     = {The TeXbook},
  publisher = {Addison-Wesley},
  year      = {1984}
}
\end{filecontents*}

\documentclass{report}
\usepackage[backend=biber]{biblatex}
\addbibresource{references.bib}

\begin{document}
\tableofcontents

\chapter{Introduction}
This document has a bibliography.\nocite{knuth}

\printbibliography[heading=bibnumbered]
\end{document}

Compile with LaTeX, then Biber, then LaTeX twice. For example, with a PDFLaTeX workflow, run pdflatex, biber, pdflatex, and pdflatex. The first LaTeX run writes auxiliary information, Biber processes the bibliography, and later LaTeX runs update the bibliography and table of contents.

If you want an unnumbered entry

If the bibliography should appear in the table of contents without a section or chapter number, use:

\printbibliography[heading=bibintoc]

In short, choose bibnumbered for a numbered heading and bibintoc for an unnumbered heading with a contents entry. These options let BibLaTeX handle both the heading and the table-of-contents entry.

What tocbibind does

The tocbibind package was designed to add items such as a bibliography to the table of contents in documents using the traditional LaTeX bibliography mechanism, including thebibliography. Its numbib option requests a numbered bibliography heading in that setup. BibLaTeX manages its bibliography headings itself, so numbib should not be treated as the fix for a BibLaTeX \printbibliography command.

If you use tocbibind for another reason, avoid having it and BibLaTeX both try to control the bibliography entry. You can use the notbib option to disable tocbibind’s bibliography handling, then specify the desired BibLaTeX heading on \printbibliography.

Common mistakes

  • Adding \addcontentsline as well as a BibLaTeX heading option. This can create duplicate entries. Use bibnumbered or bibintoc by itself for the standard cases.
  • Choosing bibintoc when you want a number. It adds an unnumbered heading to the contents; use bibnumbered for a numbered one.
  • Expecting the contents to update immediately. The table of contents is written to an auxiliary file, so additional LaTeX runs are needed. Biber must also run when the bibliography data changes.
  • Using a different bibliography mechanism than expected. If the document uses BibTeX and a traditional thebibliography environment rather than BibLaTeX, tocbibind may be appropriate; the BibLaTeX heading options apply to \printbibliography.

References

  1. The biblatex Package: Programmable Bibliographies and Citations
  2. The tocbibind Package

Spotted an error? Send a correction. Read how we write and check articles in our editorial policy.