0

I made a big effort back in 2016 to get all my needed settings for creating a document matching certain requirements. Now I re-used my setup to create a new document. There were some smaller fixes I had to implement, some deprecated arguments and stuff like that, nothing really big. It seems like everything was working fine.

But one thing gives me trouble. I use footcite and in the output I need brackets around the year. My old setup gets just ignored (it worked definately in 2016). The output is like I expect it to be, but the brackets around the year are missing. What has changed since then?

% Klammern um das Jahr in der Fußnote
\renewbibmacro*{cite:labelyear+extrayear}{% 
  \iffieldundef{labelyear} 
    {} 
    {\printtext[bibhyperref]{% 
       \mkbibparens{% 
         \printfield{labelyear}% 
         \printfield{extrayear}}}}}

My setup of biblatex is the following

\usepackage[
defernumbers=true,
backend=biber,
minnames=1,
maxnames=1,
ibidtracker=context,
bibstyle=numeric,
citestyle=authoryear,
sorting=nyt,
url=false, 
isbn=false,
hyperref=true,
urldate=comp,   
dateabbrev=false,
sortlocale=de]{biblatex}

Thank you very much!

3

One change that is certainly relevant for you is that the bibmacro cite:labelyear+extrayear was renamed to cite:labeldate+extradate (https://github.com/plk/biblatex/commit/189d90db9dbe94dd08f47261e79df09e2a37c66a, https://github.com/plk/biblatex/commit/320f114d493ca7fa310c559c3a48b5912282fa22). A list of relevant recent name changes can be found at https://github.com/plk/biblatex/wiki/Name-Changes.

A few other things with the date handling have changed as well so that a modernised version of the code would probably read

\DeclareFieldFormat{citelabeldate}{\mkbibparens{#1}}
\renewbibmacro*{cite:labeldate+extradate}{%
  \iffieldundef{labelyear}
    {}
    {\printtext[bibhyperref]{\printtext[citelabeldate]{\printlabeldateextra}}}}

A similar effect could be obtained using one of the biblatex-ext styles and

\DeclareInnerCiteDelims{cite}{\bibopenparen}{\bibcloseparen}

I should add that mixing bibstyle=numeric, and citestyle=authoryear, will lead to superfluous numbers in the bibliography that have nothing to do with any other numbering in the document (the citations do not use those numbers, they are author-year).

The option hyperref=true, is usually not better than the default hyperref=auto,. The two options only differ in that true emits a warning if the hyperref package is not loaded. With both options links will be added if and only if the hyperref package is loaded. Neither setting loads the package hyperref automatically.

It should rarely be required to set sortlocale=de, the sortlocale will automatically be inferred from the document language settings.

  • I copied your five lines into my document, replaced my code and it works! Perfect and a very big thank you! I didn't notice any superfluous numbers in the bibliography, all looks fine. The hyperref arguments is just my preferred way. After two years I forget what "auto" means, "true" remains clear after any period of time. The sortlocale... I can't remember why I did it, but it's not harmful... – S.H. Jul 24 at 20:43

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.