Tx · LaTeX & TikZ

How to Fix “Undefined Control Sequence” at \printbibliography

Published By the 9to5Science editorial team

At a glance

  1. 1. Load biblatex

    Add \usepackage{biblatex} in the preamble; \printbibliography is defined by this package.

  2. 2. Add the database

    Use \addbibresource to point to your .bib file, and check that its name and path are correct.

  3. 3. Choose a backend

    Set backend=biber or backend=bibtex in biblatex options, then run the matching bibliography program.

  4. 4. Compile in sequence

    Run LaTeX, the bibliography backend, and LaTeX again so citations and the reference list are updated.

If LaTeX reports Undefined control sequence at \printbibliography, it has encountered a command it does not know. The command is provided by the biblatex package; it is not a built-in LaTeX command. The usual fix is to load biblatex in the preamble and make sure your document is compiled with the correct bibliography workflow.

Here is a small working example. The filecontents* environment writes a sample .bib file when you compile the document with a current LaTeX installation.

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

\documentclass{article}
\usepackage[backend=biber,style=authoryear]{biblatex}
\addbibresource{references.bib}

\begin{document}
A citation appears here: \cite{knuth1984}.

\printbibliography
\end{document}

Check the preamble

The package must be loaded before \printbibliography, normally between \documentclass and \begin{document}:

\usepackage[backend=biber,style=authoryear]{biblatex}
\addbibresource{references.bib}

Check for a misspelling, a commented-out \usepackage line, or a package loaded only in a different file that is not actually included. If you use a document class or template that manages the bibliography for you, check its instructions: it may load biblatex itself or use a different bibliography system.

Also verify that the command is written exactly as \printbibliography. For example, a missing backslash or a typo in the command produces a similar error.

Compile with the matching backend

Loading biblatex defines \printbibliography; running Biber does not define it. The backend processes citation and bibliography data, so you need both the package in the source and the matching compilation steps.

For the example above, which specifies backend=biber, compile in this order:

  1. Run LaTeX (for example, pdflatex main.tex).
  2. Run Biber on the document name (for example, biber main).
  3. Run LaTeX again, usually twice if references still need updating.

In an editor, select a build recipe that includes Biber rather than only running LaTeX. If you explicitly set backend=bibtex in the biblatex options, use BibTeX as the backend instead. A wrong or skipped backend typically causes missing citations, warnings, or an absent bibliography; it does not usually cause \printbibliography itself to be undefined.

If you are using classic BibTeX

biblatex and the older BibTeX workflow have different commands. A document using classic BibTeX generally has commands like these:

\bibliographystyle{plain}
\bibliography{references}

Here, references is the database filename without the .bib extension. Do not use \printbibliography unless the document loads biblatex. Conversely, if you load biblatex, use \addbibresource{references.bib} and \printbibliography, not the classic \bibliographystyle and \bibliography setup.

Common mistakes

  • Loading a different citation package: natbib and cite do not define \printbibliography. Choose one bibliography system and follow its commands; avoid mixing packages unless you know the combination is supported.
  • Putting the package command in the wrong place: \usepackage belongs in the preamble, before \begin{document}. A package cannot normally be loaded after the document body begins.
  • Confusing package errors with backend errors: If \printbibliography is recognized but the list is empty or citations show as question marks, check the .bib filename, citation keys, backend choice, and compilation sequence.
  • Using a stale build setup: Some online editors and IDEs remember an old engine or build recipe. Confirm the selected recipe actually runs Biber (or BibTeX if that is the chosen backend).
  • Using an old or incomplete installation: If the package is loaded but LaTeX still does not recognize the command, check the log for package-loading errors and update the LaTeX distribution. A failed package load can leave later commands undefined.

Diagnose the exact error location

Look at the first error in the .log file, not only the final lines. If it points directly to \printbibliography and says the command is undefined, focus first on whether biblatex successfully loaded. If the error instead names \addbibresource, the same basic check applies. If the command is accepted but references do not appear, investigate the backend and database separately.

If the document uses \input or \include, inspect the main file that LaTeX actually compiles. Loading biblatex in a different file will not help unless that file is included in the compiled document before the bibliography command.

References

  1. The biblatex Package
  2. The Biber Package

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