I am looking for the most basic example code for using biblatex.
Consider the following bib entries (copied from the answer for this question)
\begin{filecontents}{\jobname.bib}
@book{Labov1972,
Address = {Philadelphia},
Author = {William Labov},
Publisher = {University of Pennsylvania Press},
Title = {Sociolinguistic Patterns},
Year = {1972}}
@book{Chomsky1957,
Address = {The Hague},
Author = {Noam Chomsky},
Publisher = {Mouton},
Title = {Syntactic Structures},
Year = {1957}}
\end{filecontents}
and this code
\documentclass[a4paper,11pt]{article}
\usepackage[style=numeric,backend=biber]{biblatex}
\addbibresource{\jobname.bib}
\begin{document}
As first example citation here is \cite{Chomsky1957}.
Here is another example citation \cite{Labov1972}
\printbibliography
\end{document}
How should I load biblatex (what should I change in the above code) in order to get numeric citation style that would look like: [1] (a number in a square brackets).
How different (what exactly to change) in order to get author-year style that would look like Labov (1972).
For some reason the list does not print. It is not the main issue here.
However, here is an arbitrary option to list the entries (copied from the same answer above).
What are the additional minimal required commands to print it?
Best Answer
Bibliography and citation formatting is complicated, and that's why the
biblatex
package, which has thought through the issues extremely thoroughly, is also complicated. As end users, we tend to think of simple cases without realizing that making the simple case more general is not always simple.For this reason, especially if you are a beginner, (and even if you're not) you should try to adapt to some of the standard styles offered by the
biblatex
package itself, or use one of the many excellent user contributed styles that implement most of the major schemes. This is especially true if you have any flexibility in your choice of styles (i.e., you are not bound to a very particular style by a specific journal, for example.)For a list of available styles see the
biblatex
section of:For author/year citations, the
apa
style forbiblatex
is an excellent implementation of the APA style.Citation styles and bibliography styles
There are two main formatting considerations for any citation system: the formatting of the citations themselves in the text, and the formatting of the bibliography items in the bibliography. The
biblatex
package treats both of these separately, although there are obviously dependencies between the two. In this answer I will discuss only author/year and numeric schemes, which are common in the natural and social sciences. Footnote style citations as used in the humanities are quite different, and pose their own set of problems (althoughbiblatex
is also designed to deal with them.)Citation commands
There are three basic citation commands in
biblatex
plus some automatic ones. All of the citation commands allow two optional arguments: a prenote and a postnote.\cite
standard citation\parencite
standard citation in parentheses\footcite
like\cite
but puts the citation in a footnote.There are many variants of these commands. See §3.7 of the
biblatex
manual for more details.Among the more useful special cite commands are:
\textcite
is like\cite
but puts the label text (like the year in an author/year system) in parentheses.\autocite
is designed for (almost) seamlessly transitioning between\parencite
and\footcite
, for example, and provides a higher level markup that can be mapped to either command.Author/Year Style
Numeric style
Author/year citations with numeric bibliography
Compiling documents that use
biblatex
As with other bibliography packages, compiling documents with
biblatex
requires a multi-step process. First you compile your document using your regular TeX engine (pdflatex
,xelatex
, orlualatex
) and then you run a separate programbiber
which processes the bibliography. For example, if you are compiling any of the of the MWEs shown above, using the filenametest.tex
, then the full compilation command chain would be the following. (Replacepdflatex
withxelatex
orlualatex
as needed.)where
biber test
is short-hand forbiber test.bcf
.Since most people use IDEs to process their source documents, it's helpful to know how to set up your editor to use
biber
instead ofbibtex
. See this question for details on that.Do I have to use
biber
? Why can't I usebibtex
?Although it's possible with some
biblatex
styles to usebibtex
to process the bibliography by passing the[backend=bibtex]
option to the package, most modern styles depend on the use ofbiber
so you should generally not usebibtex
to process documents that usebiblatex
.