Citations and bibliography
Citing your sources
- Academic writing must say where facts came from. LaTeX makes this tidy.
- You keep a list of sources, each with a key, and cite the key in your text.
The bibliography
- List your sources in a
thebibliographyenvironment, each as a\bibitem:
\begin{thebibliography}{9}
\bibitem{lamport} Leslie Lamport. \emph{LaTeX}. 1986.
\end{thebibliography}
- The
{9}just says "numbers are one digit wide".lamportis the key you choose.
Citing in the text
- Anywhere in the document, write
\cite{lamport}:
LaTeX is powerful~\cite{lamport}.
- With this manual
thebibliography, numbers follow the order of the\bibitementries, not the order in which you first cite them. A single first entry is[1]; inserting an entry before another changes the later entry’s number.
Common mistakes
- A key that does not match a
\bibitem.\cite{knut}with\bibitem{knuth}prints[?], and the log saysLaTeX Warning: Citation 'knut' on page 1 undefined. The PDF still builds, so look for[?]. - One compile only. Citations, like
\ref, need a second run to show their numbers. - Putting the bibliography in the preamble.
thebibliographyis part of the document: place it before\end{document}.
Difficulty 2/5 · 140 coins + a small bonus on first completion today
Cite the book in the sentence with \cite{lamport}, and add a matching \bibitem{lamport} entry inside the bibliography. The same key links the two.
Difficulty 2/5 · 140 coins + a small bonus on first completion today
Add a second source. Give the second book a \bibitem{knuth} entry, then cite it in the sentence with \cite{knuth}. In this manual bibliography, numbers follow bibitem entry order: Knuth is [2] when Lamport is listed first.
Difficulty 2/5 · 140 coins + a small bonus on first completion today
Cite two sources at once by listing both keys in one command, separated by a comma: \cite{lamport,knuth}. LaTeX prints both numbers in one pair of brackets.