Summary
This lesson teaches how to cite the works in a bibliographic database and how to build the list of references from them. It presents how to load BibLaTeX with Biber as its helper program, together with csquotes, which BibLaTeX asks for alongside babel; it explains the compilation cycle, in which Biber runs between two passes of the engine, which file each program produces, and how latexmk runs the whole cycle on its own; it goes through the citation commands, \cite, \parencite, \textcite and \autocite, with their prenotes and postnotes, \citeauthor and \citeyear, and citations of several works at once; it compares the same text in the author-year, numeric, compressed numeric and alphabetic styles; it shows how \printbibliography sets the title, heading, order and filters of the list, and which words English puts into it; and it ends with the most frequent warnings and what each one means.
Learning objectives
- Load BibLaTeX with Biber and csquotes, and declare the database with
\addbibresource. - Explain the compilation cycle with Biber and which file each step produces, and run it by hand, with latexmk or with Texmaker.
- Choose between
\cite,\parencite,\textciteand\autociteaccording to the grammatical role of the citation, and write their prenotes and postnotes. - Predict what the same citation prints in the author-year, numeric, compressed numeric and alphabetic styles, including the numbers the works receive.
- Build the list of references with its title, heading, order and filters by entry type or keyword.
- Interpret the warnings about undefined citations, pending Biber runs and empty bibliographies, and fix their cause.
Loading BibLaTeX
The lesson on the bibliographic database showed how each work is recorded, once, in a .bib file, under a key that identifies it. This lesson takes that database for granted and studies the other half of the work: citing the works in the text by their keys and letting LaTeX typeset both the citations and the list of references. The tool is the BibLaTeX package, which formats the citations and the list, helped by an external program, Biber, which reads the database, sorts the works and prepares them for the engine. The examples in this lesson use the following database, which contains a biology article, a monograph on the history of science, a computer science textbook with four authors, an essay in Spanish and a collected volume on philosophy with its editor.
@book{kuhn1962, author = {Kuhn, Thomas S.}, title = {The Structure of Scientific Revolutions}, year = {1962}, publisher = {University of Chicago Press}, location = {Chicago}, keywords = {sciences},}@article{watson1953, author = {Watson, James D. and Crick, Francis H. C.}, title = {Molecular Structure of Nucleic Acids: A Structure for Deoxyribose Nucleic Acid}, journal = {Nature}, volume = {171}, number = {4356}, pages = {737--738}, year = {1953}, keywords = {sciences},}@book{cormen2009, author = {Cormen, Thomas H. and Leiserson, Charles E. and Rivest, Ronald L. and Stein, Clifford}, title = {Introduction to Algorithms}, edition = {3}, year = {2009}, publisher = {MIT Press}, location = {Cambridge, Mass.}, keywords = {sciences},}@book{ortega1930, author = {Ortega y Gasset, José}, title = {La rebelión de las masas}, year = {1930}, publisher = {Revista de Occidente}, location = {Madrid}, keywords = {humanities},}@book{barnes1995, editor = {Barnes, Jonathan}, title = {The Cambridge Companion to Aristotle}, year = {1995}, publisher = {Cambridge University Press}, location = {Cambridge}, keywords = {humanities},}The file is saved as fuentes.bib in the document's folder. Three new lines in the preamble are enough: csquotes, BibLaTeX with its options, and the declaration of the database. The option backend=biber names the helper program, and style chooses the style of the citations and of the list. The command \addbibresource declares the database and requires the full file name, extension included: with \addbibresource{fuentes}, Biber looks for a file called exactly fuentes and stops with the error “Cannot find 'fuentes'!”. In the body, \printbibliography typesets the list where it is written.
\documentclass{article}\usepackage{fontspec}\usepackage[english]{babel}\usepackage{csquotes}\usepackage[backend=biber, style=authoryear]{biblatex}\addbibresource{fuentes.bib}\begin{document}According to \textcite{kuhn1962}, normal science rests onpast achievements that a community accepts as a model.\printbibliography\end{document}The list contains only the cited work: the other four are in the database, but the text does not cite them. The title “References” comes from BibLaTeX's English language file, which it chooses because babel sets the document in English; in the report and book classes the default title is “Bibliography”.
Why csquotes? BibLaTeX puts the titles of articles and chapters in quotation marks, and to choose the marks of the language (double curly quotes in English) it relies on csquotes, the same package studied in the lesson on notes, quotations and verse. If it detects babel and does not find csquotes, it says so in the log: “'babel/polyglossia' detected but 'csquotes' missing. Loading 'csquotes' recommended.” The recommended order is the one in the example: babel, csquotes and then BibLaTeX.
Loading the content…
Completed
Sign in to save your progress