LaTeX error "I found no \citation commands---while reading file main.aux": cause and fix

Error I found no \citation commands---while reading file main.aux

BibTeX reads the .aux file to learn which entries the document cites, and found none. LaTeX writes one \citation line into the .aux file for every \cite. The message is in the BibTeX log, the .blg file, and the bibliography stays empty.

Why it happens

How to fix it

A document that produces the message

\documentclass{article}
\begin{document}
Text without a citation.
\bibliographystyle{plain}
\bibliography{refs}
\end{document}

File refs.bib:

@book{knuth1984,
  author = {Donald E. Knuth},
  title = {The TeXbook},
  publisher = {Addison-Wesley},
  year = {1984}
}

Tools run in this order: pdflatex → bibtex.

The corrected document

\documentclass{article}
\begin{document}
Text with a citation \cite{knuth1984}.
\bibliographystyle{plain}
\bibliography{refs}
\end{document}

Both documents were compiled with pdfLaTeX from TeX Live 2023. The first produces the message, the second compiles without an error.

Finding the line in the editor

The editor lists every error and warning of a compile run with file and line. Select an entry and the cursor jumps to that line. See Error list with jump to the line.

Related pages