Skip to content
Get started

Fix "Citation undefined" and [?] in LaTeX

This warning means a \cite key does not match any entry in your bibliography. The PDF still builds, but shows [?] (or the key in bold) where the citation should be. You will learn how to match the key to an entry.

LaTeX Warning: Citation `noether1918' on page 1 undefined on input line 3.
...
LaTeX Warning: There were undefined references.

With BibTeX, the bibliography log adds:

Warning--I didn't find a database entry for "noether1918"
  • The key in \cite{…} is misspelled, or its upper and lower case differs from the key in the .bib file.
  • The entry is not in the .bib file at all.
  • The .bib file is not loaded: \bibliography{…} or \addbibresource{…} names a file that does not exist or has a different name.
  • The .bib file has a syntax error, so the entry was skipped. In that case Luzbase reports the .bib error with its file and line.
main.tex (broken)
\documentclass{article}
\begin{document}
Symmetries and conservation laws are linked \cite{noether1918}.
\bibliographystyle{plain}
\bibliography{references}
\end{document}
references.bib
@article{turing1936,
author = {Turing, Alan M.},
title = {On Computable Numbers, with an Application to the Entscheidungsproblem},
journal = {Proceedings of the London Mathematical Society},
year = {1936}
}

Add the missing entry to the .bib file, or change the key in \cite to one that exists:

references.bib (fixed)
@article{turing1936,
author = {Turing, Alan M.},
title = {On Computable Numbers, with an Application to the Entscheidungsproblem},
journal = {Proceedings of the London Mathematical Society},
year = {1936}
}
@article{noether1918,
author = {Noether, Emmy},
title = {Invariante Variationsprobleme},
journal = {Nachrichten von der Gesellschaft der Wissenschaften zu G{\"o}ttingen, Mathematisch-Physikalische Klasse},
year = {1918},
pages = {235--257}
}

Then compile again. Luzbase runs BibTeX or biber for you and repeats the LaTeX runs that are needed, so one compile is enough.

  • Hover over a \cite key in the editor. If the key is not in any .bib file of the project, the tooltip says “Citation “noether1918” is not in the bibliography”.
  • Type \cite{ and the editor suggests keys from every .bib file in the project. You can search by key, title, author or year.
  • If you sync references from Zotero or Mendeley, citation keys stay the same between syncs. See Bibliographies and citations.

Not on Luzbase yet? It compiles LaTeX in your browser and links each error to its line, often with the fix. Start writing free.