[Tex/LaTex] Warning–I didn’t find a database entry for “:”

bibliographiesbibtexciting

This warning is somewhat different than the other questions I've seen on this site, in that only a colon and now bibtexkey is mentioned. It doesn't cause an error and seem output seems fine to me, but I'm interested in what I would need to clean up to make get rid of this warning.

I use \usepackage[numbers]{natbib} and \bibliographystyle{unsrtnat}.

When I run BibTex, I get Warning--I didn't find a database entry for ":" after the usual output. I've checked by searching for {:} in my document to make sure I am never citing anything by this bibtexkey, like \cite[...]{:} or \cite[...]{:} and did not find anything. But that would also cause undefined citations, I believe, because it would certainly be a typo.

What might be the issue?

Best Answer

If I try with

\documentclass{article}
\usepackage[numbers]{natbib}

\begin{document}

\cite{x}

\citep[x]:

\end{document}

then the .aux file contains

\relax
\citation{x}
\citation{:}

These entries will be picked up by BibTeX in order to populate the .bbl file. Once you run BibTeX and LaTeX again, the entries in the .bbl file will produce \bibcite lines in the .aux file, such as

\bibcite{x}{{1}{2020}{{Uthor}}{{}}}

Thus you will be able to find the offending \citation{:} entry in the .aux file and guess where the problem is. A binary search can be useful to narrow down the lookup.

The warning

Warning--I didn't find a database entry for “:”

can only be issued by BibTeX and it only looks for \citation lines in the .aux file. So if the warning is issued, there is a line of the form \citation{:}.