Guide
Citations and BibTeX
Each paper carries its own BibTeX library. You cite entries in the text; LabTeX numbers or sorts them in the layout’s style and builds the reference list at the end.
The library
Open References in the side panel. Every entry shows how it will be listed, its key, and whether it is cited ([1], or “not cited”). Cite inserts a citation at the cursor, Edit shows the BibTeX to change it, ✕ removes it. Only cited entries appear in the paper’s reference list; citations of keys that are not in the library show as a red [?] and are listed at the top of the panel.
Adding references
- Paste BibTeX — from Google Scholar (“Cite → BibTeX”), Zotero, Mendeley, a publisher’s page or your own .bib file. Several entries at once are fine. An entry with an existing key replaces the old one.
- Look up a DOI — type a DOI such as
10.1038/s41586-020-2649-2(or paste the doi.org address) and press Look up. LabTeX fetches the BibTeX from doi.org; this works for journal articles, conference papers, books and arXiv papers with a DOI. - Import .bib… reads a whole BibTeX file. Export .bib saves the library.
- Pasting LaTeX source with a
filecontentsblock, or opening a .tex/.bib file from Drafts, adds its entries too.
Citing
Press Cite (or Ctrl/⌘ + Shift + C), search by author, title, year or key, tick one or more entries and press Cite. Or type \cite{key} in the text. Click a citation to change its entries, its command or its note.
| Command | Numbered layouts | Author–year (arXiv) |
|---|---|---|
\cite{a} | [1] | (Strogatz, 2015) |
\cite{a,b} | [1, 2] · [1–3] for ranges | (Strogatz, 2015; Dormand and Prince, 1980) |
\citep{a} | [1] | (Strogatz, 2015) |
\citet{a} | Strogatz [1] | Strogatz (2015) |
\cite[p.~4]{a} | [1, p. 4] | (Strogatz, 2015, p. 4) |
The same text and library, typeset in a numbered layout:
Phase portraits \cite{strogatz2015} and adaptive Runge--Kutta methods \cite{dormand1980} are standard; \citet{strogatz2015} gives many examples \cite[ch.~5]{strogatz2015}.
\begin{filecontents*}{refs.bib}
@book{strogatz2015,
author = {Steven H. Strogatz},
title = {Nonlinear Dynamics and Chaos},
publisher = {Westview Press}, edition = {2}, year = {2015}
}
@article{dormand1980,
author = {J. R. Dormand and P. J. Prince},
title = {A family of embedded {Runge--Kutta} formulae},
journal = {Journal of Computational and Applied Mathematics},
volume = {6}, number = {1}, pages = {19--26}, year = {1980},
doi = {10.1016/0771-050X(80)90013-3}
}
\end{filecontents*}…and in the author–year style of the arXiv layout:
Phase portraits \cite{strogatz2015} and adaptive Runge--Kutta methods \cite{dormand1980} are standard; \citet{strogatz2015} gives many examples \cite[ch.~5]{strogatz2015}.
\begin{filecontents*}{refs.bib}
@book{strogatz2015,
author = {Steven H. Strogatz},
title = {Nonlinear Dynamics and Chaos},
publisher = {Westview Press}, edition = {2}, year = {2015}
}
@article{dormand1980,
author = {J. R. Dormand and P. J. Prince},
title = {A family of embedded {Runge--Kutta} formulae},
journal = {Journal of Computational and Applied Mathematics},
volume = {6}, number = {1}, pages = {19--26}, year = {1980},
doi = {10.1016/0771-050X(80)90013-3}
}
\end{filecontents*}Citation styles
| Layout | In the text | Reference list |
|---|---|---|
| Article, Two-column, Letter / report | [1], numbered in order of first citation | IEEE style: A. B. Author, “Title,” Journal, vol. 6, no. 1, pp. 19–26, 1980. |
| Journal | superscript ¹, in order of citation | Nature style: Author, A. B. Title. Journal 6, 19–26 (1980). |
| arXiv preprint | (Author, year) | Author–year, alphabetical: Author, A. B. (1980). Title. Journal, 6(1):19–26. |
BibTeX tips
- Separate authors with
and; writeand othersfor “et al.”. Both “Last, First” and “First Last” work. - Put braces around words whose capitals must stay:
{NumPy},{Runge--Kutta}. - Accents can be written the TeX way (
{\"o},{\'e}) or typed directly (ö, é). - A
doifield becomes a link in the list;eprintadds the arXiv number. - Keys can be anything without spaces or commas. A common habit: author + year + first word, e.g.
strogatz2015nonlinear.
In the LaTeX export
The library is written into the .tex file in a filecontents* block, so LaTeX creates refs.bib itself when it compiles; the LaTeX project also contains refs.bib as a file. Citations use natbib, with a bibliography style that matches the layout (unsrtnat for numbered, plainnat for author–year). Compile with latexmk -pdf main.tex, or with pdflatex, bibtex, pdflatex, pdflatex.