Edit Links |
BibTeX /
BiblatexCategories: Bibliography, Biblatex << | Page list | >>How to use Biblatex with LyXTable of contents (hide) 1. What is Biblatex?Biblatex is a specific approach to bibliography management. It avoids the crude language of BibTeX's bst files and controls the design of the bibliographies and citations by LaTeX macros. Biblatex introduces a new, LaTeX-based style file format or, more precisely, a system of task-differentiated style files: "biblatex bibliography styles" (bbx files) controlling the layout of the bibliography, "biblatex citation styles" (cbx file), controlling the layout of the citations, and "language definition files" (lbx files) controlling the localization. The biblatex package itself ships with a number of these files that cover the most common purposes. There are also user contributed additional biblatex styles for specific purposes or specific journals. Biblatex overcomes several limitations of BibTeX, and is much easier to use, for anyone familiar with LaTeX. Customizing a bibliography style can be as easy as adding a LaTeX line in your preamble. Furthermore, it is much more powerful than any other existing approach, providing things like citation filtering, sectioned bibliographies, chapter bibliographies, full cites, ibidem, gender differentiation, full localization, on the fly modification etc. Really, there's hardly a requirement Biblatex cannot fulfill. In terms of LaTeX bibliography management, it is a huge step forward. Biblatex originally used bibtex for preprocessing but now biber, a bibliography processor written in Perl and specifically designed for Biblatex, is the preferred backend. Even though bibtex or bibtex8 can still be used, you'll need to use biber to get Biblatex running at full steam. Biber has no capacity limitations, it is fully unicode aware (but also supports many other encodings), it can modify bibliography data on the fly (thus allowing biblatex to perform many fancy tricks) and much more. Biber is closely tied to biblatex, which means that you can only use it with Biblatex (not with any of the other approaches), and you have to use specific versions of biber with specific versions of biblatex (a thing you usually do not need to care about, since both packages are included in and automatically updated by all modern LaTeX distributions). 2. Using Biblatex with LyX 2.3.0 and newerLyX 2.3 introduces native Biblatex support. As of that version, you can use Biblatex simply by selecting it, and the bibliography and citation styles, in Document→Settings...→Bibliography. The order of inclusion of packages and preamble code means that Biblatex-related code (for example \DeclareFieldFormat, \DeclareNameAlias or \DeclareSourcemap) in the preamble (Document→Settings...→LaTeX Preamble) must be wrapped in \AddToHook{package/after/biblatex}{...} to avoid being executed before Biblatex is loaded (see also item 5 in the transition steps from 2.2 to 2.3 below). E.g.: \AddToHook{package/after/biblatex}{% \DeclareNameAlias{sortname}{family-given}% } Note that this solution requires LaTeX 2020/10/01 at least. With earlier versions, you can use the In earlier versions than LyX 2.3, you had to resort to some tricks to make Biblatex work with LyX. These are described below. If you use such a document (with the Biblatex tricks) in LyX 2.3 and want to use the new native support, you need to "undo" the tricks, since they conflict with the native support. This is documented in what follows. Note: There is a problem in the interaction between Biblatex's option \AfterPackage{biblatex}{% \makeatletter \def\blx@refpatch@chapter#1{% \ifundef\chapter {\blx@err@nodocdiv{chapter}} {\pretocmd\@makechapterhead{#1} {} {\blx@err@patch{\string\@makechapterhead}} \pretocmd\@makeschapterhead{#1} {} {\blx@err@patch{\string\@makeschapterhead}}}} \makeatother } 2.1 How to transition from using Biblatex in LyX 2.2 and earlier to native support in LyX 2.3In order to use the native Biblatex support in a document that uses the pre-2.3 tricks described below, you basically need to undo them:
Note: Further steps may be necessary depending on specific Biblatex commands in the preamble and other changes made in your document. 3. Using Biblatex with LyX 2.2 and earlierAlthough LyX 2.2 doesn't provide native support for Biblatex yet, it is possible to use it with some effort. The Biblatex manual strongly advises to use biber or at least bibtex8 instead of the traditional bibtex as the backend for processing the data, because the capacities of traditional bibtex are too limited for biblatex. To check which backend works for you, try compiling these two simple examples. Then continue reading to find out how it was all made to work for LyX v2.2.0, or earlier, and biber: 3.1 Base settings
3.2 Using different citation styles from the citation dialogIf you want to use different citation styles (such as "Name (Year)", "Name Year", "Year" in author year styles, or "Name [No.]", "[No.]", "Year" in numeric styles) from the citation dialog, you have to activate Biblatex's "natbib compatibility mode". This is done as follows:
The two variants basically do the same. Just select what fits you most.
3.3 Using bibtex or bibtex8 instead of biberBiblatex originally used bibtex for processing, but now biber is its preferred processor. If you want to use Biblatex with classic bibtex or 8bit-character-aware bibtex8 nonetheless, you must
3.4 Using Biblatex with polyglossia (XeTeX or LuaTeX with non-TeX fonts)If you use the polyglossia language package, you will need to manually load the polyglossia package and set the default language manually in the preamble just before the \usepackage of biblatex, as follows: \usepackage{polyglossia} \setdefaultlanguage{english} Substitute english with the main language of your document. 4. Further reading |