Troubleshooting overleaf integration: Undefined reference

I used the overleaf integration for my new paper, and it looks like I can successfully include the file in my overleaf project, and when typing in main.tex there is also autocompletion for a reference. However, strangely, overleaf always complains about the references undefined despite their existence in the imported file.

I do have \bibliography{references} at the end of the tex file. Is there something that I missed?

Welcome to the community @Chris_Liu. There could be a number of causes of this issue. If references.bib is the name of your BibTeX file, along with \bibliography{references}, you also need to include a bibliography style file for the references to be outputted properly, i.e., you need \bibliographystyle{…} and \bibliography{…} for BibTeX to function correctly. If you keep getting “undefined citation” warnings, check that you have included those two commands, and that the file names are spelled correctly. Furthermore, BibTeX citation keys are case-sensitive, so you need to use the exact same case and spelling in your \cite{…} commands as in your .bib file.

You may also need to compile the source code of the document more than once. In the first compilation the LaTeX compiler writes the .aux file for information about different numbering and in the second, the compiler reads the information to generate a bibliography.

2 Likes