11

I personally prefer to set biblatex's package options in a .bbx file using \ExecuteBibliographyOptions so that I can just call biblatex minimally in my preamble (preferably using only \usepackage[style=myStyle, natbib=true,backend=biber]{biblatex}). I noticed however that some options do not work when parsed from the .bbx file using \ExecuteBibliographyOptions but must be supplied in the preamble using either \usepackage options or \ExecuteBibliographyOptions. In my case I found the following options to cause the problem while others worked fine:

  1. labelyear
  2. uniquename
  3. uniquelist

Of course, I only use a small set of all the possible options so there very well be more options with the same problem.


EDIT - added minimal example


Calling for options from an external .bbx file

\documentclass{article}

\usepackage{filecontents}

\begin{filecontents}{mystyle.bbx}
% Build on the original author-year comp
\RequireBibliographyStyle{authoryear-comp}

\ExecuteBibliographyOptions{
    maxcitenames = 2, 
    mincitenames = 1, 
    firstinits = true,
    terseinits = false,
    labelyear=true,  
    uniquename=false, 
    uniquelist=false,
}
\end{filecontents}

\begin{filecontents}{mystyle.cbx}
\ProvidesFile{emi.cbx}[biblatex style for Environmental Microbiology]

\RequireCitationStyle{authoryear-comp}

\endinput
\end{filecontents}

\begin{filecontents}{\jobname.bib}
@article{ref1,
  author = {Doe, J. and Dane, D., and Dewy, R.},
  year = {2000},
  title = {This and that},
  journal = {Journal of deep understanding of things},
}

@article{ref2,
  author = {Doe, J. and Dewy, D., and Dane, R.},
  year = {2000},
  title = {The other},
  journal = {Journal of deep understanding of things},
}
\end{filecontents}

\usepackage[style=mystyle,natbib=true,backend=biber]{biblatex}

\addbibresource{\jobname.bib}

\begin{document}

Some text and a ref \citep{ref1}.
Then another ref with same first author and year \citep{ref2}

\printbibliography

\end{document}

Produces an undesired output: enter image description here

But calling for the same options with \usepackage produces the desired output

\documentclass{article}

\usepackage{filecontents}

\begin{filecontents}{\jobname.bib}
@article{ref1,
  author = {Doe, J. and Dane, D., and Dewy, R.},
  year = {2000},
  title = {This and that},
  journal = {Journal of deep understanding of things},
}

@article{ref2,
  author = {Doe, J. and Dewy, D., and Dane, R.},
  year = {2000},
  title = {The other},
  journal = {Journal of deep understanding of things},
}
\end{filecontents}

\usepackage[style=authoryear-comp,natbib=true, 
    maxcitenames = 2, 
    mincitenames = 1, 
    firstinits = true,
    labelyear=true,  
    uniquename=false, 
    uniquelist=false,
    terseinits = false,
    backend=biber]{biblatex}

\addbibresource{\jobname.bib}

\begin{document}

Some text and a ref \citep{ref1}.
Then another ref with same first author and year \citep{ref2}

\printbibliography

\end{document}

enter image description here

Roey Angel
  • 1,699

1 Answers1

10

Your cbx file loads authoryear-comp.cbx. This file contains the line

\ExecuteBibliographyOptions{labelyear,uniquename,uniquelist,sortcites,autocite=inline}

Since cbx files are loaded after bbx, the option settings in your style's bbx file get overwritten. To resolve the problem, move your option settings to the cbx file, after \RequireCitationStyle.

Audrey
  • 28,881