Getting started with BibLaTeX
Author: Josh Cassidy (July 2013)
For years LaTeX users have been using BibTeX along with multiple additional packages such as natbib
to write bibliographies. However, now there's a new option, BibLaTeX. It's designed to give you many more options to easily configure your bibliographies/citations. Conveniently, existing .bib
files are unlikely to need much altering to work with BibLaTeX. In addition to the 300+ pages of BibLaTeX documentation, CTAN also has a useful BibLaTeX “cheat sheet”. To complement those resources, here is a video tutorial followed by some notes/examples to help you get started.
Basic commands and styles
Firstly the commands you use in the tex file to add a bibliography into the document are quite different. In the preamble you need to use the following code:
\usepackage{biblatex}
\addbibresource{}
The first command just loads up the biblatex
package. The second is used to specify which bib files you want to use. You simply enter the file name in the curly brackets including the .bib
extension. Then in the body of the document instead of using a \bibliography
command to construct the bibliography, you use the \printbibliography
command. When using BibTeX you specify the bibliography style by using the \bibliographystyle
command. In biblatex
we no longer use this command, instead we specify style options by passing more arguments into the \usepackage
command. To do this we enter style=
followed by a style name into square brackets immediately before the curly brackets. For example:
\usepackage[style=numeric]{biblatex}
Alternatively if you want to declare one style for the citations and a different style for the bibliography, you use the words citestyle
and bibstyle
. Here's an example:
\usepackage[citestyle=alphabetic,bibstyle=authortitle]{biblatex}
Before moving on I will quickly show you what some of these styles look like for both the citations and the actual bibliography entry. However, you can refer to the documentation for a full list of styles.
- The
numeric
style: - The
alphabetic
style: - The
reading
style: - The
authoryear
style:
Another argument you can give the \usepackage
command is the sorting option. For example:
\usepackage[style=authoryear,sorting=ynt]{biblatex}
This would use the author-year style and then sort the bibliography entries by year, name, title. Here's a list of some of the different sorting options available:
nty
—sorts entries by name, title, year;nyt
—sorts entries by name, year, title;nyvt
—sorts entries by name, year, volume, title;anyt
—sorts entries by alphabetic label, name, year, title;anyvt
—sorts entries by alphabetic label, name, year, volume, title;ynt
—sorts entries by year, name, title;ydnt
—sorts entries by year (descending order), name, title;none
—no sorting. Entries appear in the order they appear in the text.
If you don't specify an order the default is nty
.
Citation Commands
The citation commands have also been overhauled in biblatex
. These more intelligent commands give you the option of adding a prenote
and postnote
in as arguments:
- a
prenote
is a word or phrase like 'see' that is inserted at the start of the citation; - a
postnote
is text you want inserted at the end of the citation.
To add these notes in you uses two sets of square brackets in the citation command. Here's an example:
\cite[see][page 12]{latexcompanion}
In this example we've already loaded the alphabetic
style and latexcompanion
is just the citation key. This is what the citation would look like in the text:
If you only open one set of square brackets it will assume the contents of the brackets is a postnote
, so if you only want a prenote
make sure you still open the second set of square brackets and then just leave it empty.
There are also a number of different citation commands available for you to use. Here are some of the standard ones:
\cite
—the most basic one. Prints without any brackets except when using thealphabetic
ornumeric
style when it uses square brackets;\parencite
—prints citations in parentheses except when using thealphabetic
ornumeric
style when it uses square brackets;\footcite
—puts the citation in a footnote.
Subdividing Bibliographies
One of the nice things about biblatex
is that you can subdivide bibliographies according to source type. Here's an example of subdividing by source type:
\printbibheading
\printbibliography[type=book,heading=subbibliography,title={Book Sources}]
\printbibliography[nottype=book,heading=subbibliography,title={Other Sources}]
In this example we are subdividing the bibliography into two sections, one for sources that are books and one for sources that aren't. Here's an example output:
Another way you can subdivide bibliographies is using a keyword filter. To do this you need to add a keywords
field into the entries in your .bib
file. For example:
@article{key,
keywords = {keywordA,keywordB,keywordC}
Here's an example of how you'd then subdivide by keyword:
\printbibheading
\printbibliography[keyword=major,heading=subbibliography,title={Major Sources}]
\printbibliography[keyword=minor,heading=subbibliography,title={Minor Sources}]
And the corresponding output:
It looks like one day soon BibTeX will be nothing but a piece of LaTeX history! I hope this has been helpful in getting you started with biblatex
.
Overleaf guides
- Creating a document in Overleaf
- Uploading a project
- Copying a project
- Creating a project from a template
- Using the Overleaf project menu
- Including images in Overleaf
- Exporting your work from Overleaf
- Working offline in Overleaf
- Using Track Changes in Overleaf
- Using bibliographies in Overleaf
- Sharing your work with others
- Using the History feature
- Debugging Compilation timeout errors
- How-to guides
- Guide to Overleaf’s premium features
LaTeX Basics
- Creating your first LaTeX document
- Choosing a LaTeX Compiler
- Paragraphs and new lines
- Bold, italics and underlining
- Lists
- Errors
Mathematics
- Mathematical expressions
- Subscripts and superscripts
- Brackets and Parentheses
- Matrices
- Fractions and Binomials
- Aligning equations
- Operators
- Spacing in math mode
- Integrals, sums and limits
- Display style in math mode
- List of Greek letters and math symbols
- Mathematical fonts
- Using the Symbol Palette in Overleaf
Figures and tables
- Inserting Images
- Tables
- Positioning Images and Tables
- Lists of Tables and Figures
- Drawing Diagrams Directly in LaTeX
- TikZ package
References and Citations
- Bibliography management with bibtex
- Bibliography management with natbib
- Bibliography management with biblatex
- Bibtex bibliography styles
- Natbib bibliography styles
- Natbib citation styles
- Biblatex bibliography styles
- Biblatex citation styles
Languages
- Multilingual typesetting on Overleaf using polyglossia and fontspec
- Multilingual typesetting on Overleaf using babel and fontspec
- International language support
- Quotations and quotation marks
- Arabic
- Chinese
- French
- German
- Greek
- Italian
- Japanese
- Korean
- Portuguese
- Russian
- Spanish
Document structure
- Sections and chapters
- Table of contents
- Cross referencing sections, equations and floats
- Indices
- Glossaries
- Nomenclatures
- Management in a large project
- Multi-file LaTeX projects
- Hyperlinks
Formatting
- Lengths in LaTeX
- Headers and footers
- Page numbering
- Paragraph formatting
- Line breaks and blank spaces
- Text alignment
- Page size and margins
- Single sided and double sided documents
- Multiple columns
- Counters
- Code listing
- Code Highlighting with minted
- Using colours in LaTeX
- Footnotes
- Margin notes
Fonts
Presentations
Commands
Field specific
- Theorems and proofs
- Chemistry formulae
- Feynman diagrams
- Molecular orbital diagrams
- Chess notation
- Knitting patterns
- CircuiTikz package
- Pgfplots package
- Typesetting exams in LaTeX
- Knitr
- Attribute Value Matrices
Class files
- Understanding packages and class files
- List of packages and class files
- Writing your own package
- Writing your own class