17

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.

halloleo
  • 985

2 Answers2

19

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.

moewe
  • 175,683
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.

ggll
  • 153