The biblatex package

Creates citations and the bibliography from a .bib file with the program Biber: \addbibresource, \parencite, \textcite and \printbibliography.

Loading the package

\usepackage[backend=biber, style=authoryear]{biblatex}

In the older BibTeX workflow, a .bst file written in its own language decides how citations and bibliography look. With biblatex the formatting is done by LaTeX macros: the option style picks a citation style, and further options change details such as the number of names or the sorting.

The program Biber sorts the entries and reads the .bib file as UTF-8. The order of the runs is pdfLaTeX, Biber, then pdfLaTeX twice.

Common styles are numeric (the default, [1]), alphabetic ([Knu84]), authoryear (Knuth 1984) and authortitle. Styles such as ieee and apa come as separate packages.

Main commands

\addbibresource{references.bib}Names the .bib file, in the preamble and with the file extension.
\parencite[558]{lamport1978}Citation in parentheses; the optional argument is the page and gets "p." in front.
\textcite{knuth1984}Citation as part of the sentence: Knuth (1984).
\cite{knuth1984}The plain citation of the style, without parentheses in the author-year styles.
\footcite{knuth1984}Citation in a footnote.
\autocite{knuth1984}The citation form that suits the style: parentheses for authoryear, a footnote for the verbose styles.
\printbibliography[heading=bibintoc]Prints the bibliography; heading=bibintoc adds it to the table of contents.
\nocite{*}Lists all entries of the .bib file, also the ones that are not cited.

Complete example

\documentclass{article}
\usepackage[backend=biber, style=authoryear]{biblatex}
\addbibresource{references.bib}
\begin{document}
\textcite{knuth1984} describes the program. Logical clocks order the
events of a distributed system \parencite[558]{lamport1978}.

\printbibliography
\end{document}
Result
The compiled example

Open in the editor

File references.bib:

@book{knuth1984,
  author    = {Donald E. Knuth},
  title     = {The {\TeX}book},
  publisher = {Addison-Wesley},
  year      = {1984}
}
@article{lamport1978,
  author  = {Leslie Lamport},
  title   = {Time, Clocks, and the Ordering of Events in a Distributed System},
  journal = {Communications of the ACM},
  volume  = {21},
  number  = {7},
  pages   = {558--565},
  year    = {1978}
}

Compiled with pdfLaTeX from TeX Live 2023. Tools run in this order: pdflatex → biber → pdflatex → pdflatex.

Pitfalls

Related pages