LaTeX error "I found no \citation commands---while reading file main.aux": cause and fix
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
- The document has
\bibliography{...}but no\citeyet. - The document uses
biblatexwith Biber, and BibTeX was run on it. BibTeX then also reports "I found no \bibdata command" and "I found no \bibstyle command".
How to fix it
- Cite at least one entry with
\cite{key}, then run LaTeX, BibTeX and LaTeX twice. - To list entries without citing them in the text, use
\nocite{key}, or\nocite{*}for every entry of the.bibfile. - For a document with
biblatex, run Biber and not BibTeX. See Please (re)run Biber on the file: main and rerun LaTeX afterwards.
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.