Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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

share|improve this question
6  
Only load-time options can't be set with \ExecuteBibliographyOptions. You'll have to demonstrate your problem. The options you mention are set in some of the standard styles without issue. –  Audrey Nov 25 '12 at 3:30
1  
According to the biblatex manual (3.1.1) only the following options must be set at load time: style, bibstyle, citestyle, natbib and mcite. –  Roey Angel Nov 25 '12 at 13:59
    
As of 2+ backend should also be in that list. Could've sworn we already made that edit to the manual... –  Audrey Nov 25 '12 at 17:06
    
That was my fault - it was in the wrong doc section for some reason. I've corrected this in the 2.4 beta docs. –  PLK Nov 25 '12 at 18:04
add comment

1 Answer

up vote 7 down vote accepted

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.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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