How to Fix the LaTeX Warning “Citation Undefined”
At a glance
- 1. Check the citation key
Make sure the key in \cite{} exactly matches an entry key in your bibliography.
- 2. Check the bibliography setup
Confirm that the document loads or prints the bibliography using the method you intend.
- 3. Run the right tools
For BibTeX, run LaTeX, BibTeX, then LaTeX twice; use Biber instead when configured for biblatex.
- 4. Read the final log
Recompile and check whether the citation warning remains after all bibliography files have been processed.
The warning Citation 'key' undefined means LaTeX found a citation command but did not find the corresponding citation data in the files it read. It is usually a key mismatch, a missing bibliography setup, or an incomplete compilation sequence—not a problem with IEEE citation formatting itself.
For a traditional BibTeX project, check the citation key and bibliography database, then compile in this order: LaTeX, BibTeX, LaTeX, LaTeX. If you use biblatex, the normal processor is Biber, and the setup is different. The examples below show how to identify which case applies.
What the warning means
A command such as \cite{knuth1984} asks LaTeX to print a citation associated with the key knuth1984. During compilation, LaTeX records citation requests in an auxiliary file. A bibliography processor uses that information to find and format the relevant entry, and a later LaTeX run inserts the formatted citation into the document.
If any part of that process is missing or out of date, LaTeX may print a placeholder such as [?] and report an undefined citation. The warning can appear on the first compilation even in a correctly configured project; run the full sequence before diagnosing it.
Check the key and bibliography entry
Keys are exact identifiers. They must match in spelling and capitalization, without the braces. For example, these match:
\cite{knuth1984}
@book{knuth1984,
author = {Donald E. Knuth},
title = {The TeXbook},
publisher = {Addison-Wesley},
year = {1984}
}
But \cite{Knuth1984} does not match the lowercase key knuth1984. Check for typos, changed keys, and entries saved in a different .bib file from the one named in your document. Also make sure the .bib file is saved and located where your editor or build command can find it.
Working example with IEEEtran and BibTeX
Save these two files in the same directory. This example uses the IEEEtran document class and traditional BibTeX. It needs an installation of LaTeX, the IEEEtran class, and the IEEEtran.bst bibliography style; it does not require an additional citation package.
main.tex:
\documentclass{IEEEtran}
\begin{document}
A standard reference on TeX is \cite{knuth1984}.
\bibliographystyle{IEEEtran}
\bibliography{references}
\end{document}
references.bib:
@book{knuth1984,
author = {Donald E. Knuth},
title = {The TeXbook},
publisher = {Addison-Wesley},
year = {1984}
}
From a command line, compile it in this order:
pdflatex main
bibtex main
pdflatex main
pdflatex main
The first LaTeX run creates main.aux, which tells BibTeX which entries are cited. BibTeX reads that file and references.bib, then writes formatted reference data. The next LaTeX run reads it; the final run resolves citation and reference-list details that may still have been pending. An editor’s “Build” or “Typeset” button may automate these steps, but verify its recipe if the warning persists.
If you use biblatex
Do not apply the BibTeX example’s commands unchanged to a biblatex project. A typical Biber setup uses \addbibresource and \printbibliography, for example:
\usepackage[backend=biber,style=ieee]{biblatex}
\addbibresource{references.bib}
The ieee style is provided by the separate biblatex-ieee package, which must be installed. Place \printbibliography where the reference list should appear, then run LaTeX, Biber, and LaTeX again (a further LaTeX run may be needed). The ieee style gives an IEEE-like citation and bibliography style, but the biblatex system is not the same as the traditional IEEEtran plus BibTeX setup. Use the processor specified by your project configuration: BibTeX for the traditional setup, Biber when biblatex is configured with backend=biber.
Common mistakes
- Using a different key:
\cite{smith2020}cannot find an entry namedSmith2020orsmith-2020. - Skipping the bibliography processor: Running LaTeX repeatedly does not replace running BibTeX or Biber when the project needs one.
- Mixing citation systems: Avoid combining commands and styles from a BibTeX setup with a
biblatexsetup unless you have a specific, compatible configuration. - Omitting the bibliography: In a BibTeX document,
\bibliography{references}loads the database namedreferences.bib, and\bibliographystyle{...}selects a style. Inbiblatex, use\addbibresource{...}and\printbibliographyinstead. - Looking only at the first run: The warning may be expected before BibTeX or Biber has processed the citations. Check the final compilation log and PDF.
- Using the wrong file name or path: In
\bibliography{references}, normally omit the.bibextension; confirm the file is actually namedreferences.biband is accessible from the build directory.
If the warning remains
Read the complete log, not just the final warning. Messages such as “I couldn’t open database file” point to a missing or incorrectly named .bib file. A message that a citation is undefined after the full build usually points to a misspelled key, an entry absent from the loaded database, or a build process that did not run the expected processor. Clean generated auxiliary files only if they are stale or corrupted, then rerun the correct sequence. If the citation key is correct and the bibliography processor completes without errors, compile again and inspect the final log before changing the citation style.
References
- BibTeXing
- The BibLaTeX Package: Programmable Bibliographies and Citations
- The IEEEtran LaTeX Class User’s Guide
Spotted an error? Send a correction. Read how we write and check articles in our editorial policy.