8

I use biblatex with the following call:

\usepackage[style=authoryear,
  mergedate=false,
  maxcitenames=1, 
  mincitenames=1, 
  maxbibnames=999, 
  minbibnames=999, 
  uniquename=false,
  uniquelist=minyear,
  ibidtracker=context,
  labeldate=true,
  hyperref=true,
  isbn=false,
  dashed=false,
  eprint=false,
  doi=false,
  url=true]{biblatex}

However, because of some templating reasons (*) I want to set the package options separately after I load the package. So I wnat to do something like this:

\usepackage{biblatex}

and then later (but still before the \begin{document}):

\setbiblatexoptions[style=authoryear,
  mergedate=false,
  maxcitenames=1, 
  mincitenames=1, 
  maxbibnames=999, 
  minbibnames=999, 
  uniquename=false,
  uniquelist=minyear,
  ibidtracker=context,
  labeldate=true,
  hyperref=true,
  isbn=false,
  dashed=false,
  eprint=false,
  doi=false,
  url=true]

How can I do this?


(*) The tex file is created by pandoc from a markdown document; pandoc uses a template system wheer the main template already contains a plain call to \usepackage{biblatex} while the local customisations are inserted later (just before the \begin{document}). In these customisations I can easily add biblatex options or I could even reload the package with the style=authoryear option if this were possible.

  • 1
    Imho you can set all your options with the exception of style=authoryear with \ExecuteBibliographyOptions. – Ulrike Fischer Sep 1 '15 at 6:35
  • 3
    All options except those listed in §3.1.1 Load-time Options of the biblatex documentation can be passed to biblatex with \ExecuteBibliographyOptions. The load-time options are (cite/bib)style, backend, natbib, mcite. – moewe Sep 1 '15 at 6:51
  • Can you be a bit more precise what exactly you want to be able to do? – moewe Sep 2 '15 at 13:03
  • @moewe I have added some details as a footnote to the question. Hope this helps! – halloleo Sep 2 '15 at 13:56
  • You will have to set the style when loading biblatex and it cannot be changed afterwards. You will have to change your template appropriately. (Which seems possible here) See also tex.stackexchange.com/q/208296/35864 – moewe Sep 2 '15 at 14:02
10

Of the many options available for biblatex, there are only very few that have to be set at loading time in the square brackets, all others can also be used with \ExecuteBibliographyOptions later in the preamble.

These exceptions are listed in §3.1.1 Load-time Options, p. 44-45 of the biblatex documentation. They are

  • backend,
  • style, bibstyle and citestyle,
  • and the natbib and mcite compatibility options.

The other options listed in §3.1.2 Preamble Options, pp. 45-60, can be used in \ExecuteBibliographyOptions later on.

2

With the command \PassOptionsToPackage, you can choose options before loading the package for the first time: if necessary even before your \documentclass preamble, in case that is where the package is loaded.

Example:

\PassOptionsToPackage[style=authoryear,
                      mergedate=false,
                      maxcitenames=1, 
                      mincitenames=1, 
                      maxbibnames=999, 
                      minbibnames=999, 
                      uniquename=false,
                      uniquelist=minyear,
                      ibidtracker=context,
                      labeldate=true,
                      hyperref=true,
                      isbn=false,
                      dashed=false,
                      eprint=false,
                      doi=false,
                      url=true]{biblatex}
\documentclass{article}
…
\usepackage{biblatex}

To my understanding, it adds to the option list, it does not override further options.

More info here. Adapted from this answer.

  • 3
    Isn't the point of the question to set options after the package is loaded? – Johannes_B Oct 12 '15 at 18:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.