9

Why does using \AtEndDocument{\printbibliography} cause the following warning?

LaTeX Warning: There were undefined references.

Package biblatex Warning: Please rerun LaTeX.

Just to clarify: The references are displayed exactly like they should be. I'm just wondering why this warning is issued.

MWE:

\documentclass{book}

\usepackage{biblatex} \addbibresource{biblatex-examples.bib} \AtEndDocument{\printbibliography}

\begin{document}

\cite{knuth:ct:c}

\end{document}

Note:

In case one wonders why this complicated syntax and not just using \printbibliography at the end of the document: This is just really convenient if used together with subfiles, see e.g. Bibliographies when using subfiles.

1 Answers1

12

biblatex does a lot of cleaning up (also with respect to .aux files and warnings) in the \AtEndDocument hook. You don't get the warning if you issue

\AtEndDocument{\printbibliography}

before loading biblatex.

moewe
  • 175,683