LaTeX/Bibliographies with biblatex and biber

Learn how to create a bibliography using modern biblatex and biber - A short tutorial.

This will only be a short overview of the main and most often used features of biblatex and biber to create a bibliography. More detailed information can be found in the package documentation.

The database
Creating a bibliography using biblatex and biber means storing all of your available bibliographic information in a simple text-based database. The name should be as unique as possible, for example. This is helpful when transferring files with your advisor, students or colleagues. biber is used to deal with the database.

A sample database file could look like this:

Every entry in the database starts with an -sign followed by the entry type. More types are available, the package documentation lists all of them. The bibliographic information for each entry are stored in a pair of braces, beginning with a unique keyword for that entry (bibkey). Least complicated way of presenting the data is every field type in a new line, the content in curly braces, followed by a comma. The order in which you give the information is not important.

Please have a close look at the authors, every individual author is separated by the keyword. All dates are written in YYYY-MM-DD, or just the year if the other information is not available. The file which should have been installed with the package contains some sample entries.

Setting up biber
Biber is the name of the helper program that sorts the entries and provides all the relevant information to package biblatex. If you are not comfortable using the command line (aka the terminal), you should set up your editor to call biber for you. | Setting up my editor to use biber shows how to do it for the different editors.

A simple example
Now how does it actually work? Package biblatex is loaded with the option  followed by adding your database file to the list of bibliographic files using . Please note that the file extension is mandatory and that this is happening in the preamble of the document.

Within the document you can cite one of your database entries using. Your database can contain hundreds of entries, but only cited references will occur in the final list. You can use  to add uncited entries to the list. If you want to add all entries from the database use.

Finally, the list of your references is printed with .

Running LaTeX (no matter if,  etc.) on the main document  will result in the following   output. LaTeX Warning: Citation 'wikibook' on page 1 undefined on input line 5.

LaTeX Warning: Citation 'wombat2016' on page 1 undefined on input line 7.

LaTeX Warning: Citation 'lion2010' on page 1 undefined on input line 9.

LaTeX Warning: Empty bibliography on input line 11.

[1{/usr/local/texlive/2017/texmf-var/fonts/map/pdftex/updmap/pdftex.map}] (./lauraPhd2016Main.aux)

LaTeX Warning: There were undefined references.

Package biblatex Warning: Please (re)run Biber on the file: (biblatex)               lauraPhd2016Main (biblatex)               and rerun LaTeX afterwards.

We get several warnings about undefined references, no bibliography and instead of proper citations, we see just the cite key in bold.



In order to really get a bibliography and the citations, and not just the infamous warning, you have to run biber after latex to extract the relevant data from the database. After setting up biber as described in | Setting up my editor to use biber you should be able to do it by pressing one button while working on your document. To incorporate the bibliography information into your document, LaTeX then has to process the data biber has generated before. To sum it up, if you have a file you (or your editor) will have to do:

Everytime your database is updated, remember to process the database by calling biber.

The full result can be seen in the picture below. Please note that package biblatex adds some small little details. Can you see things that are printed but have not been defined?



Reference Styles
Different reference styles are in use within the different disciplines of science. Very broadly speaking, you can divide into a numerical referencing system (Vancouver) or an author date referencing system (Harvard).

Package biblatex provides different citation commands that generate different output (in-text citation, footnotes and more). A few examples are given below, the package documentation contains and explains the use of the whole set.

Numerical Referencing
Numerical referencing is the default style. Numbers within brackets are used in text and in the bibliography. Using makes it easy to change the style into footnotes. gives a bibliography that is sorted chronologically, i.e. the numbers increase to the end of the document.

Using  gives a different output. Can you spot all the differences?



Author Date Referencing
If you want an author-date referencing style, you can use when loading biblatex. The option with the option  puts parenthesis around the cite genererated with (which is similar to using ). In some cases, may come in handy when the citation is the subject and part of the sentence flow.

APA Citing
The American Psychological Association (APA) defines a very strict author year style. You can access it using and additionally defining the language mapping.

Compare the output with the normal author year style. How many changes can you spot?

Separate Bibliographies by Entry Type
Suppose you want to have a separate bibliography for all the online resources you are citing. No problem using the optional argument of. You can also change the title (and other stuff).

Splitting into different topics
You can split your bibliography into different topics, in trusted and untrusted sources, or in primary and secondary sources. The way to tell biblatex what is what, is by adding a tag to the entries of the database.

Note, that the entryfield in the database is called (plural) because you can have more than one keyword (separated by commas). When calling the command, you have to use the singular. biblatex has a powerful system of filtering data, more can be found in the manual.

Bibliographies per Section or Chapter
Some people have the need for a reference list at the end of each chapter or section. This can be done using .

A bibliography in a presentation
You can use package  with   (see  the Presentations section) to have citations and a reference list in your presentation. Using full cites right away is recommended, so listeners don't have to wait till the very end to see where information is drawn from.



Back to main bibliography page