GUIDES · LATEX
How to cite in LaTeX.
LaTeX builds your bibliography from a .bib file: a plain-text list of references, each with a key you cite in the text. You choose one of two systems to turn it into a reference list, classic BibTeX or the newer biblatex. Here is how each works, with a minimal file you can copy.
The .bib file
Save your references in a file such as references.bib. Each entry has a type, a key and fields:
@article{lecun2015deep,
author = {LeCun, Yann and Bengio, Yoshua and Hinton, Geoffrey},
title = {Deep learning},
journal = {Nature},
volume = {521},
number = {7553},
pages = {436--444},
year = {2015},
doi = {10.1038/nature14539}
}
Separate authors with and, write page ranges with --, and wrap words whose capitals must survive, such as {DNA} or {Bayesian}, in an extra pair of braces, because many styles lowercase titles.
With BibTeX
\documentclass{article}
\begin{document}
Deep networks learn layered representations \cite{lecun2015deep}.
\bibliographystyle{plain}
\bibliography{references}
\end{document}
\bibliographystyle picks the style (plain, alpha, unsrt, or a journal’s own .bst), and \bibliography names the .bib file without its extension. For author–year citations, load natbib and use \citet{…} for “LeCun et al. (2015)” and \citep{…} for “(LeCun et al., 2015)”, with an author–year style such as plainnat.
Compile in four steps: pdflatex, bibtex, then pdflatex twice, or let latexmk -pdf run them for you. Overleaf runs them automatically.
With biblatex and Biber
\documentclass{article}
\usepackage[style=authoryear]{biblatex}
\addbibresource{references.bib}
\begin{document}
Deep networks learn layered representations \parencite{lecun2015deep}.
\printbibliography
\end{document}
Here the style is a package option (numeric, authoryear, or a style package such as biblatex-apa with style=apa), \addbibresource takes the file name with its extension, and \printbibliography places the list. Use \textcite and \parencite for narrative and parenthetical citations. Compile with biber in place of bibtex.
Which to choose
- Use BibTeX when a journal or conference template gives you a
.bstfile. Submission systems often expect it. - Use biblatex for theses and your own documents: styles are easier to adjust, it handles Unicode names well, and it can print several bibliographies.
A simple .bib file like the one above works with both. biblatex also understands extra entry types and fields, such as date in place of year, that classic BibTeX ignores, so a file written for biblatex may need converting, or exporting again as BibTeX, before you switch back.
Getting BibTeX entries
Typing entries by hand invites mistakes. Paste a DOI into the free BibTeX generator to get an entry with a readable key like lecun2015deep, build up a list, and download it as a .bib file. Check each entry against the work, since a registry’s record can be incomplete.
If you keep your papers in Docr’d, a research library in early access, it can keep a BibTeX or BibLaTeX file of your library up to date automatically for LaTeX to read, and its LaTeX export of a reconstructed paper comes with its own references.bib.