Cite sources in LaTeX (cite, parencite, textcite, citet, citep)
\cite{key} works everywhere. biblatex adds \parencite for a citation in parentheses and \textcite for one that is part of the sentence; with natbib the two are called \citep and \citet.
Preamble
The snippets on this page need these lines before \begin{document}:
\usepackage[style=authoryear]{biblatex}
\addbibresource{references.bib}In parentheses or in the sentence
With the style authoryear, \parencite prints "(Weber and Schmidt 2019)", \textcite prints "Weber and Schmidt (2019)" and \cite prints "Schmidt 2021" without parentheses. With numeric all three print the number in brackets, and \textcite puts the names before it.
The sensors have no moving parts \parencite{weber2019}.
\textcite{weber2019} tested them in a wind tunnel.
For the calibration see \cite{schmidt2021}.
\printbibliographySeveral sources in one citation
Separate the keys with commas. authoryear prints "(Schmidt 2021; Weber and Schmidt 2019)", and numeric prints [2, 3].
Two studies agree on this \parencite{schmidt2021,weber2019}.
\printbibliographyOnly the author, the year or the title
\citeauthor prints the names, \citeyear the year and \citetitle the title. \fullcite prints the complete entry as it appears in the list.
\citeauthor{schmidt2021} published \citetitle{schmidt2021}
in \citeyear{schmidt2021}.
\printbibliographyCitations in footnotes
\footcite puts the citation into a footnote. \autocite follows the package option autocite: with autocite=footnote it behaves like \footcite, with autocite=inline like \parencite, so one option switches the whole document.
Complete document:
\documentclass{article}
\usepackage[style=authoryear, autocite=footnote]{biblatex}
\addbibresource{references.bib}
\begin{document}
The sensors have no moving parts.\autocite{weber2019}
The calibration is described elsewhere.\footcite{schmidt2021}
\printbibliography
\end{document}The natbib commands
With natbib and BibTeX, \citet prints "Weber and Schmidt (2019)" and \citep prints "(Schmidt, 2021)". \citeauthor and \citeyear print the parts, and \citealp prints the citation without parentheses.
Complete document:
\documentclass{article}
\usepackage[round]{natbib}
\begin{document}
\citet{weber2019} tested the sensors in a wind tunnel.
The calibration is described elsewhere \citep{schmidt2021}.
\bibliographystyle{plainnat}
\bibliography{references}
\end{document}File references.bib:
@book{schmidt2021,
author = {Schmidt, Anna},
title = {Wind Measurement in Practice},
edition = {2},
publisher = {Example Press},
address = {Berlin},
year = {2021}
}
@article{weber2019,
author = {Weber, Ben and Schmidt, Anna},
title = {Ultrasonic Sensors in Wind Tunnels},
journal = {Journal of Example Studies},
volume = {12},
number = {3},
pages = {45--67},
year = {2019}
}
@online{keller2023,
author = {Keller, Mia},
title = {Calibrating a Wind Sensor},
year = {2023},
url = {https://www.example.org/calibration},
urldate = {2025-03-01}
}Pitfalls
- To add a page number or a word such as "see", use the optional arguments, see Cite with page numbers in LaTeX.
biblatexprints an unknown key in bold, BibTeX prints a question mark. Both warn that the citation is undefined, see Citation `knuth84' on page 1 undefined.- The
biblatexoptionnatbib=truealso defines\citetand\citep, which helps when you move a document fromnatbibtobiblatex.
Compiled with pdfLaTeX from TeX Live 2023.
Related pages
- How-to Cite with page numbers in LaTeX
- How-to Citation styles in LaTeX
- How-to Create a bibliography in LaTeX with biblatex and Biber
- Package
natbib - Error Citation `knuth84' on page 1 undefined
- Package
biblatex