In papers and books you cite the works you reference in the body text, and collect them into a reference list at the end. LaTeX supports this in two coordinated parts: a \cite command in the body points at the matching entry in the list, and the list side numbers and aligns everything automatically. This page covers the basics through the citation commands \cite and \nocite, and the hand-written reference environment thebibliography.
Citing in the text — \cite and \nocite
The heart of citing is \cite{key}, where key is the citation key you assigned to a work (a short name you choose). It prints a citation mark in the text (a number like [1] in the standard classes) and adds that work to the reference list. You can cite several at once, comma-separated: \cite{knuth,lamport}.
An optional argument attaches a note such as a page reference. \cite[p.~5]{knuth} prints something like [1, p. 5] (the ~ is a non-breaking space that keeps the note from wrapping). The note appears alongside the citation mark.
クヌースは \TeX{} の設計思想を詳述している~\cite{knuth}。
とくに行分割の議論は重要である~\cite[p.~94]{knuth}。
複数の文献をまとめて挙げることもできる~\cite{knuth,lamport}。For a work you do not cite in the text but still want in the list, use \nocite{key}. It prints no citation mark and only registers the entry. As a special case, \nocite{*} includes every entry in the .bib file in the list (handy when you want to display all entries of a bibliography database).
A hand-written reference list — thebibliography
The most basic way to have LaTeX set the list itself is the thebibliography environment. Each \bibitem{key} ... inside it defines one reference: key is that entry’s citation key, and the text that follows is the bibliographic information shown in the list. A \cite{key} is matched against the \bibitem carrying the same key, and pulls out that entry’s number as the citation mark.
\begin{thebibliography}{99}
\bibitem{knuth}
Donald E. Knuth, \emph{The \TeX book}, Addison-Wesley, 1986.
\bibitem{lamport}
Leslie Lamport, \emph{\LaTeX: A Document Preparation System},
2nd ed., Addison-Wesley, 1994.
\end{thebibliography}The {99} in \begin{thebibliography}{99} is the widest-label argument. The width of the label column is set from it, so as a rule pass {99} (two digits) for ten or more entries and {9} for nine or fewer. Get it wrong and the numbers fail to line up, leaving the indentation uneven.
To use your own label instead of a number, give \bibitem an optional argument. Writing \bibitem[KL94]{lamport} uses [KL94] as the label in place of the automatic number, and \cite{lamport} prints that label too.
As with numbering and cross-references, citations resolve over two compiler passes. The first run writes each \bibitem’s number to the .aux file; the second reads it back and fills in the correct number at each \cite. After only one run the marks remain [?].
Numeric vs author–year styles
Citation styles come in two broad families: the numeric style that marks references with numbers like [1], and the author–year style that marks them with an author name and year like (Knuth, 1986). The plain \cite is numeric by default, but many fields call for author–year.
Switching styles and the richer citation commands come from packages. The principal ones are natbib and biblatex, which distinguish a parenthetical cite \citep{key} (→ (Knuth, 1986)) from a textual cite \citet{key} (→ Knuth (1986)) that lets the author’s name read as part of the sentence. There are also \citeauthor{key} for the name alone and \citeyear{key} for the year alone. natbib supports both numeric and author–year modes. See the dedicated pages for the details.
| Command | Style | Example output |
|---|---|---|
\cite | Standard (numeric) | [1]; with a note, [1, p. 5] |
\citep | natbib / biblatex (parenthetical) | (Knuth, 1986) |
\citet | natbib / biblatex (textual) | Knuth (1986) |
\citeauthor | natbib / biblatex (author only) | Knuth |
\citeyear | natbib / biblatex (year only) | 1986 |
Tidying numeric citations — the cite package
To keep the numeric style but polish its appearance, Donald Arseneau’s cite package is the easy choice. Just \usepackage{cite} and the behavior of the standard \cite improves: it sorts the numbers of a multi-citation into ascending order and compresses consecutive runs into ranges. For example, if \cite{c,a,b,d} points at [2,3,4,6], the output becomes [2–4,6] automatically.
To set the numbers as superscripts, use \usepackage[superscript]{cite} (super is an alias). Options include nosort to stop sorting, nocompress to stop range compression, nospace to tighten the spaces between numbers, and nobreak to suppress line breaks. The note argument of \cite (\cite[p.~5]{knuth}) still works.
For real projects, use BibTeX/biber
Hand-writing thebibliography works when there are few entries or you want total control of the formatting. In practice, though, you store bibliographic data in a .bib file as unformatted records and let BibTeX or biber generate the list. That automates numbering, sorting, and styling to match a journal’s rules, and lets you reuse the same .bib across manuscripts. How you use \cite does not change. The BibTeX page covers this in detail.