How to Fix “Empty thebibliography” in LaTeX
At a glance
- 1. Find the empty list
Check the line named in the warning and the generated .bbl file for a bibliography environment with no bibitem entries.
- 2. Add bibliography entries
Cite valid references, use nocite when appropriate, or add bibitem entries if you are writing the bibliography manually.
- 3. Run the right tools
For BibTeX, compile LaTeX, run BibTeX, then compile LaTeX at least twice more.
- 4. Remove unused bibliography code
If the document has no references, remove the empty bibliography command or environment.
The warning LaTeX Warning: Empty 'thebibliography' environment means LaTeX found a bibliography list but no entries inside it. In a BibTeX workflow, the empty list is usually in the generated .bbl file; in a hand-written bibliography, it means there are no \bibitem commands between \begin{thebibliography} and \end{thebibliography}. The warning is usually not fatal, but the bibliography will have no entries; a heading such as “References” may still appear.
The reported input line is where LaTeX encountered the empty environment, often near the start of the .bbl file. The line number alone does not identify the cause: check the .bbl contents and the bibliography commands in your source.
If you use BibTeX
BibTeX normally makes bibliography entries from citation commands such as \cite{key}. If there are no citations, or none of the citations select an entry, BibTeX can produce a .bbl file containing an empty bibliography environment.
A minimal working example uses a citation key that matches an entry in a .bib file:
\documentclass{article}
\begin{document}
A useful reference is \cite{knuth1984}.
\bibliographystyle{plain}
\bibliography{references}
\end{document}
Save this as main.tex and create references.bib alongside it:
@book{knuth1984,
author = {Donald E. Knuth},
title = {The TeXbook},
publisher = {Addison-Wesley},
year = {1984}
}
Compile in this order:
pdflatex main
bibtex main
pdflatex main
pdflatex main
Run BibTeX using the document’s job name (main here), not the .tex extension. The later LaTeX runs read the bibliography and resolve citation labels and references. If your editor has a “BibTeX” or “bibliography” build command, it may run this sequence for you.
If you want every entry in the .bib database to appear even when it is not cited in the text, add \nocite{*} before the bibliography commands. To include only one uncited entry, use \nocite{key} with its database key. Do this only when you actually intend to list those references.
If you write the bibliography by hand
A manual bibliography needs at least one \bibitem inside the environment. The argument to thebibliography gives LaTeX an estimate of the widest label; 9 is suitable for a list of up to nine numbered items.
\documentclass{article}
\begin{document}
A reference is listed below.\cite{knuth}
\begin{thebibliography}{9}
\bibitem{knuth}
Donald E. Knuth.
\textit{The TeXbook}.
Addison-Wesley, 1984.
\end{thebibliography}
\end{document}
Here the \bibitem{knuth} command creates the entry, and \cite{knuth} refers to it. You can keep a manual bibliography even if no citation is made in the prose, but it must contain an entry to avoid this warning.
Check the generated files
For a BibTeX document, inspect the .bbl file after running BibTeX. A populated file contains one or more \bibitem commands inside thebibliography. If it contains only the begin and end commands, BibTeX did not produce entries. Check that:
- The
\bibliography{...}filename matches the.bibfilename, without the.bibextension. - The cited keys exactly match keys in the database.
- The bibliography style command names an available style.
- You ran BibTeX after changing citations or the database, then reran LaTeX.
An unknown citation key often also causes a warning about an undefined citation or a missing database entry. Fix that separately; an empty bibliography warning specifically says that the bibliography list itself has no entries.
If you have no references
Remove the unused thebibliography environment, or remove \bibliography{...} if the document uses BibTeX. Do not add a made-up entry just to silence the warning. If you intended to include a bibliography but have not added sources yet, leaving the empty environment will keep producing the warning until it contains an entry.
Common mistakes
- Editing the
.bblfile directly: BibTeX regenerates it, so manual changes can be lost. Edit the.bibdatabase or the.texsource instead. - Running only LaTeX: BibTeX must be run between LaTeX passes when using a BibTeX database.
- Confusing
biblatexwith BibTeX:biblatexgenerally uses\addbibresource{...}and\printbibliography, with a backend such as Biber. Follow the build sequence for the package and backend you actually use; do not mix its commands with the traditional BibTeX setup above. - Treating the warning as a missing bibliography style: A style controls formatting, but an empty bibliography means there are no entries to format. First check citations and the contents of the generated
.bblfile.
References
Spotted an error? Send a correction. Read how we write and check articles in our editorial policy.