Quick answer
To cite sources in Overleaf:
- Create a
references.bibfile and paste in your entries. - Load biblatex in the preamble and point it at that file.
- Cite each source with
\cite{key}where you need it. - Place
\printbibliographywhere the reference list should appear.
Overleaf usually runs the bibliography tool for you when the project uses biblatex, so you rarely need to run it by hand.
Step 1: Create a .bib file
In your project, create a new file named references.bib. Then paste in entries from your reference source. Common sources include:
- Google Scholar: click Cite, then BibTeX, and copy the text.
- A reference manager: export your references as BibTeX. See how to use Zotero with LaTeX and Overleaf or using Mendeley with Overleaf.
- A publisher’s website: many publishers offer a BibTeX download for each article.
Each entry starts with a key after the opening brace. In @article{smith2020,, the key is smith2020. You use this key in \cite, and keys are case-sensitive.
Check each entry before you cite it. Scraped or exported entries can have missing pages, odd capitalization, or incomplete author names.
Step 2: Load biblatex in the preamble
Add these lines to the preamble, before \begin{document}:
\usepackage[backend=biber,style=numeric]{biblatex}
\addbibresource{references.bib}
backend=biber selects the modern bibliography tool. style=numeric gives numbered citations. You can change the style later.
Step 3: Cite in your text
Put \cite{key} where you want the citation:
Several studies report similar results \cite{smith2020}.
To cite more than one source, separate the keys with commas and no spaces: \cite{smith2020,lee2021}.
biblatex also offers \textcite and \parencite, which give different layouts depending on the style. For the full list of commands, see Bibliographies and Citations in LaTeX.
Step 4: Print the bibliography
Place this line where the reference list should appear, usually before \end{document}:
\printbibliography
The list includes the entries you cited. biblatex leaves out uncited entries unless you cite them with \nocite{key}.
Complete example
Create a references.bib file with this entry. The entry is made up for illustration:
@article{smith2020,
author = {Smith, Jane},
title = {An Example Article},
journal = {Journal of Examples},
year = {2020},
}
Then paste this into main.tex:
\documentclass{article}
\usepackage[backend=biber,style=numeric]{biblatex}
\addbibresource{references.bib}
\begin{document}
\section{Introduction}
Several studies report similar results \cite{smith2020}.
\printbibliography
\end{document}
Changing the citation style
Change the style option to change how citations and the list look:
numericgives numbered citations.alphabeticgives short labels built from author names and years.authoryearputs the author and year in the text.
Many journals and universities use their own style. Some styles come from separate packages: apa, ieee, mla, and chicago-authordate come from biblatex-apa, biblatex-ieee, biblatex-mla, and biblatex-chicago. If you see an error about a missing style, check that the matching package is installed.
Using BibTeX instead
Some templates, such as acmart for ACM papers, use BibTeX rather than biblatex. In that case, leave out the biblatex lines and end the document with:
\bibliographystyle{plain}
\bibliography{references}
Here, references is the name of your .bib file without the extension. Use this route only when your template requires it.
Troubleshooting
- Question marks instead of numbers. The key is missing from the
.bibfile, or the bibliography has not been built yet. Check the spelling and case of the key, then compile again. - “Citation undefined” warnings. The usual cause is the same: a key that does not match an entry. The log names the key, so you can find the mismatch.
- Empty bibliography. Make sure you cite at least one entry and that
\printbibliographyis in the document. - Entries look wrong. Check the entry in
references.bib. Missing fields and lost capitalization are the usual causes. Protect capitals with braces, such as{GPU}, as described in Bibliographies and Citations in LaTeX. - Layout changed after you switched styles. Compile again. Labels and the list update after a second or third run.