I'm trying to create my own biblatex style, and I want to give an option to show titles in italics or bold.
Based on other style files, I tried this:
\newtoggle{bftitle}
\DeclareBibliographyOption{bftitle}[true]{
\settoggle{bftitle}{#1}}
\ExecuteBibliographyOptions{bftitle=true}
\iftoggle{bftitle}{
\DeclareFieldFormat{title}{\bfseries{#1}}
\DeclareFieldFormat{journaltitle}{\bfseries{#1}}
\DeclareFieldFormat{issuetitle}{\bfseries{#1}}
\DeclareFieldFormat{maintitle}{\bfseries{#1}}
\DeclareFieldFormat{booktitle}{\bfseries{#1}}
\DeclareFieldFormat{citetitle}{\bfseries{#1}}
}{}
And this:
\newbool{bftitle}
\DeclareBibliographyOption{bftitle}{
\ifstrequal{#1}{true}
{\global\booltrue{bftitle}}
{\global\boolfalse{bftitle}}}
\ifbool{bftitle}{
\DeclareFieldFormat{title}{\bfseries{#1}}
\DeclareFieldFormat{journaltitle}{\bfseries{#1}}
\DeclareFieldFormat{issuetitle}{\bfseries{#1}}
\DeclareFieldFormat{maintitle}{\bfseries{#1}}
\DeclareFieldFormat{booktitle}{\bfseries{#1}}
\DeclareFieldFormat{citetitle}{\bfseries{#1}}
}{}
Neither option works. Whatever I use when I call biblatex (bftitle=true or bftitle=false), the result is always the same (sometimes always bold, sometimes always italics).
I don't know if the problem could be ExecuteBibliographyOptions… I couldn't figure out how to use these commands, the documentation says very little about them.
So what am I doing wrong? Is there a better way to do what I'm trying to do?
\bfseriesis a switch and not a macro (see here ), it is probably nicer to use\mkbibboldhere anyway:\DeclareFieldFormat{title}{\mkbibbold{#1}}. – moewe Apr 22 '16 at 07:23mkbibbold. I also usescshapein my code, do you know if there's a macro for that? I tired googling it now but didn't find anything about it. – dbmrq Apr 22 '16 at 07:40biblatexwrapper for small caps, but\scshape{foo}is still wrong, use\textsc{foo}instead (or{\scshape foo}if you insist on\scshape). – moewe Apr 22 '16 at 13:06