[Tex/LaTex] Biber/BibLaTeX \printbibliography causes “undefined control sequence” in the proceeding line

biberbiblatexerrors

I'm using biblatex with biber as the backend to write my document. Without \printbibliography, all the citations work perfectly well, and appear in the document, so I assume that my bibliography.bib file is fine. The problem comes, however, when I include the line \printbibliography at the end of my document (just before \end{document}): suddenly every time I try to compile I get "undefined control sequence" referencing whatever line is after \printbibliography.

Following suggestions elsewhere on the internet, I combed my document for "smart" quotation marks, and other weird characters, but there aren't any. My citations are downloaded from ADSABS, with the occasional @ONLINE resource, too. As I said, though, all the references work fine, it's just the \printbibliography command that bails.

To illustrate (I'm not going to paste the entire document here unless someone thinks it will be helpful):

\usepackage[style=authoryear-icomp,sorting=anyt]{biblatex}
\addbibresource{bibliography.bib}

...

\printbibliography

Best Answer

I had a similar issue. I pinpointed the problem to be in the .bib file. My advice is to carefully examine your .bib file for possible ambiguous syntax. In my case, the problematic syntax was:

...
title = {A 70~kW stationary fuel cell system},
...

The undefined control sequence issue was resolved, when this was changed to the following (i.e., the expression with the tilde was enclosed in the curly braces):

...
title = {A {70~kW} stationary fuel cell system},
...

A short comment (maybe someone will find it useful). In my case, the issue occurred after the matlab-prettifier package was loaded, which also loads the listings package. Until these packages were load, I had experienced no issues whatsoever.