About
Shop
LaTeX
Software
Books
Gallery
News
Contact
Blog
Settings
Account


5.3 Biblatex

The biblatex package is a reimplementation of LaTeX's bibliographic facilities. The formatting of the bibliography is governed by LaTeX commands instead of selecting a BibTeX style (as was done with \bibliographystyle described above). This package uses biber instead of BibTeX to process the bibliographic database and sort the entries. Legacy BibTeX is also supported, but with a reduced feature set. The biblatex package also supports multiple bibliographies, for example a bibliography for each chapter in the document. The biblatex package requires e-TeX, so make sure you have a recent TeX distribution. Biber comes with the latest version of TeX Live.

If you are using JabRef (described in §5.1.1. JabRef) there is a BibLaTeX mode option in the Advanced tab of the JabRef preferences dialog, illustrated in Figure 5.14. (Use OptionsPreferences to open the dialog.) You will have to quit and restart JabRef after enabling this option. When you restart, you should find extra fields when you edit an entry or create a new entry, as illustrated in Figure 5.15. You should also find that there are more entry types available (see Figure 5.16).

Figure 5.14: JabRef Advanced Preferences
 

Figure 5.15: JabRef in BibLaTeX Mode
 

Figure 5.16: JabRef in BibLaTeX Mode (Select Entry Type)
 

With BibTeX, there was a month and year field. BibLaTeX provides a replacement date field, although if this field is missing it will fall back on the month and year fields. In Figure 5.17, I've edited my earlier example to use the new date field. Note that the date should be specified as <year>-<month>-<day> where -<day> or -<month>-<day> maybe omitted. A slash / should be used to indicate a range, for example 2002-01/2002-02.

Figure 5.17: JabRef in BibLaTeX Mode (Setting the Publication Date)
 

Recall from Figure 5.2 and Figure 5.3 that I set the default encoding to UTF-8. With BibLaTeX and biber, my UTF-8 bibliography can be correctly sorted, but I need to make sure that I load the inputenc package before biblatex in my document:

\usepackage[utf8]{inputenc}
\usepackage{biblatex}

§5.2.1. Author-Year Citations described the natbib package. BibLaTeX has a compatibility module:

\usepackage[natbib]{biblatex}

This provides the same commands (such as \citet and \citep) that natbib provides.

The default sorting order is name, title and year. This can be changed using the sorting package option. For example, to sort by name, year and title:

\usepackage[sorting=nyt]{biblatex}

Or you can suppress the sorting, so that all entries are in citation order:

\usepackage[sorting=none]{biblatex}

For other possible values, see the biblatex documentation [9].

If you want a list of back-references in the bibliography, referring to the pages on which the entries were cited, you can use the backref option:

\usepackage[backref]{biblatex}

The default database backend is biber, which is recommended, but if for some reason you want to stick to using bibtex you can use the backend option to switch to bibtex:

\usepackage[backend=bibtex]{biblatex}

There are also options that govern whether certain fields are printed in the bibliography, such as isbn, url or doi. For example:

\usepackage[isbn,url,doi]{biblatex}

The style can be set using the style option. The default is numeric, which produces a numeric citation, such as [1]. There is also numeric-comp, which is like natbib's sort&compress option, described in §5.2.1. Author-Year Citations, or authoryear which displays <author> <year> citations.

There are many other citation styles. For these and for other package options, see the biblatex documentation [9].

With BibLaTeX, you don't use the \bibliography command, described in §5.2. BibTeX. Instead, you add the bib file as a resource in the preamble using:

\addbibresource[<options>]{<resource>}

where <resource> is the name of the bib file including the file extension. However, the resource doesn't have to be a bib file. You can only add one resource at a time:

\addbibresource{bibfile1.bib}
\addbibresource{bibfile2.bib}

The resource can be a remote one, in which case you need to use the location option with the value remote and specify the URL:

\addbibresource[location=remote]{http://www.somewhere.com/bibfile2.bib}

This is only available if you use biber as the backend. Another option is datatype which specifies the format of the resource. The default is bibtex, but it can also be ris, zoterordfxm or endnotexml. See the biblatex and biber documentation [7] for further details.

The bibliography itself is displayed using

\printbibliography[<options>]

This should go in the document where you want the bibliography to be displayed.

Like the natbib commands described in §5.2.1. Author-Year Citations, the biblatex commands generally have two optional arguments, indicating the prenote and postnote, and a mandatory argument specifying the key or a comma-separated list of keys. If you want a prenote but not a postnote, you need to give an empty second optional argument. The basic commands are:

\cite[<prenote>][<postnote>]{<key>}
\Cite[<prenote>][<postnote>]{<key>}

These are bare citation commands. The latter is provided if the citation occurs at the start of a sentence.

\parencite[<prenote>][<postnote>]{<key>}
\Parencite[<prenote>][<postnote>]{<key>}

These commands are like \cite and \Cite but enclose the citation in parentheses (square if the numeric style is used).

\textcite[<prenote>][<postnote>]{<key>}
\Textcite[<prenote>][<postnote>]{<key>}

These commands are used for citations in the flow of text. The latter is provided if the citation occurs at the start of a sentence. For other citation commands, see the biblatex documentation [9].

So, the example document from Listing 1, can now be edited so that the preamble looks like:

Listing 17:

% arara: pdflatex: { synctex: on }
% arara: biber
% arara: pdflatex: { synctex: on }
% arara: pdflatex: { synctex: on }
\documentclass[oneside]{scrbook}

\usepackage[backend=biber]{biblatex}

\addbibresource{thesis-refs.bib}

(where thesis-refs.bib is the name of my bibliography database, see §5.1. Creating a Bibliography Database) and the end of the document looks like:

Elsewhere in the document, I need to cite some of the entries in my bibliography database:

First of all, let's cite a book~\parencite{wainwright93} now let's cite a journal paper and a conference proceedings~\parencite{cawley96,talbot97}. Finally, let's cite a chapter in a book~\parencite[Chapter 9]{goossens97}.

If you want to build the document using arara (§1.1.2. Arara) remember to include the % arara: comments (as shown above). If you are using latexmk (§1.1.1. LaTeXmk) remember to use the -bibtex option as illustrated in Figure 1.5.

If you're not using an automated method, such as arara or latexmk, you need a PDFLaTeX run, a biber run (or bibtex if you've chosen that as your backend) followed by two more PDFLaTeX runs.


This book is also available as A4 PDF or 12.8cm x 9.6cm PDF or paperback (ISBN 978-1-909440-02-9).

© 2013 Dickimaw Books. "Dickimaw", "Dickimaw Books" and the Dickimaw parrot logo are trademarks. The Dickimaw parrot was painted by Magdalene Pritchett.

Terms of Use Privacy Policy Cookies Site Map FAQs