Citations & BibTeX
Everything about citing references — from \cite commands and citation styles to managing your .bib files.
Citing a reference
Use \cite{key} where key matches an entry in your .bib file:
Transformer models \cite{vaswani2017attention} have become the dominant architecture.Multiple citations
Recent work \cite{brown2020gpt3, ouyang2022instructgpt} has shown...With page numbers
As noted in \cite[p.~42]{knuth1984texbook}...Inline author names
Some styles support \citet (textual) and \citep (parenthetical) via the natbib package:
\usepackage{natbib}
\citet{vaswani2017attention} introduced the Transformer. % → Vaswani et al. (2017) introduced...
\citep{vaswani2017attention} % → (Vaswani et al., 2017)
\citep[see][Chapter 3]{knuth1984texbook} % → (see Knuth, 1984, Chapter 3)Citation autocomplete
Type \cite{ in the editor and the autocomplete dropdown shows all keys from your .bib files. Use arrow keys to navigate and Tab to accept.
Similarly, \ref{ autocompletes from all \label{} values in your document.
Citation styles
The style is controlled by \bibliographystyle{} or your document class:
| Style | Output | Common use |
|---|---|---|
plain | Numbered [1], [2] | General purpose |
alpha | [Van17], [Bro20] | Math, some CS venues |
unsrt | Numbered, order of appearance | Short papers |
apalike | Author-year: (Vaswani, 2017) | Social sciences |
IEEEtran | [1] IEEE format | IEEE conferences |
abbrvnat | Author-year, abbreviated names | natbib-based styles |
Most conference and journal templates define the style in their .cls file — you typically don't need to set it yourself.
The .bib file
A .bib file is a plain-text database of references. Each entry looks like:
@article{vaswani2017attention,
title = {Attention is All You Need},
author = {Vaswani, Ashish and Shazeer, Noam and ...},
journal = {Advances in Neural Information Processing Systems},
volume = {30},
year = {2017},
doi = {10.48550/arXiv.1706.03762}
}Entry types
| Type | Use |
|---|---|
@article | Journal papers |
@inproceedings | Conference papers |
@book | Books |
@misc | arXiv preprints, websites, software |
@phdthesis | PhD dissertations |
@techreport | Technical reports |
Key naming conventions
The key (e.g., vaswani2017attention) is how you reference the paper with \cite{}. Common conventions:
authorYearword— e.g.,brown2020gpt3AuthorYear— e.g.,Vaswani2017
Keys are case-sensitive.
Adding references
There are four ways to add entries to your .bib file:
- Search panel — use the References sidebar to search 6 databases and click + Add to .bib
- DOI / arXiv lookup — click the BookPlus icon in the sidebar toolbar, paste a DOI or arXiv ID, and the BibTeX is fetched automatically via CrossRef or arXiv API. The tool auto-detects whether you've entered a DOI, arXiv ID, or paper title.
- Copy from the References panel — click the BibTeX button on any search result to copy the formatted entry
- Manual — open your
.bibfile and type the entry directly
Printing the bibliography
Add these two lines before \end{document}:
\bibliography{references} % name of your .bib file (without .bib)
\bibliographystyle{plain} % or whatever style your template usesTroubleshooting
| Problem | Cause | Fix |
|---|---|---|
| Citations show as [?] | BibTeX needs multiple passes | Run a full compile — latexmk handles this automatically |
| "Citation undefined" warning | Key typo | Check that \cite{key} exactly matches a key in your .bib |
| Duplicate key warning | Two entries share the same key | Rename one of the keys |
| Missing fields error | Style requires specific fields | Check your style's docs (e.g., @article needs journal) |
| Author names formatted wrong | BibTeX expects Last, First format | Use author = {Last, First and Last2, First2} |