6

I have a question that has been answered a few times, but does not work for me (and also not for another commenter in a previously asked question).

I want to remove the parenthesis around the yead in the bibliography with biblatex style authoryear, and ideally also add a comma and space before it. I have looked at the following questions:

biblatex: How to remove the parentheses around the year in authoryear style?

How to (properly) remove the parentheses around the year in authoryear style?

How to (properly) remove the parentheses around the year in authoryear style? (v2)

I use biber 2.10 and TexLive 2017/W32Tex.

This MWE should work according to the question v2 above, but does not work for me, i.e. the output is still Author, Anne (2001a). Alpha. The output I need is Author, Anne, 2001a. Alpha.

\documentclass{article}

\usepackage[style=authoryear,dashed=false]{biblatex}
\usepackage{xpatch,filecontents}

\begin{filecontents}{\jobname.bib}
@misc{A01,author={Author, Anne},year={2001},title={Alpha}}
@misc{A02,author={Author, Anne},year={2001},title={Beta}}
\end{filecontents}
\addbibresource{\jobname.bib}

\xpatchbibmacro{date+extrayear}{%
  \printtext[parens]%
}{%
  \setunit*{\addperiod\space}%
  \printtext%
}{}{} 

\begin{document}
\nocite{*}
\printbibliography
\end{document} 
6

The bibmacro date+extrayear is deprecated, and is replaced with date+extradate

\documentclass{article}

\usepackage[style=authoryear,dashed=false]{biblatex}
\usepackage{xpatch,filecontents}

\begin{filecontents}{\jobname.bib}
@misc{A01,author={Author, Anne},year={2001},title={Alpha}}
@misc{A02,author={Author, Anne},year={2001},title={Beta}}
\end{filecontents}
\addbibresource{\jobname.bib}

\xpatchbibmacro{date+extradate}{%
  \printtext[parens]%
}{%
  \setunit*{\addcomma\space}%
  \printtext%
}{}{} 

\begin{document}
\nocite{*}
\printbibliography
\end{document} 

output of code

3

Allow me to indulge in a bit of advertising for biblatex-ext. The ext-authoryear family has built-in support to change the format of the year. The ext-... styles are compatible with the standard styles and can be used as a drop-in replacement.

You just need to redefine the field format biblabeldate (a biblatex-ext feature) and the delimiter nameyeardelim (a standard biblatex feature) appropriately.

\documentclass{article}

\usepackage[style=ext-authoryear,dashed=false]{biblatex}
\addbibresource{biblatex-examples.bib}

\DeclareFieldFormat{biblabeldate}{#1}
\DeclareDelimFormat[bib]{nameyeardelim}{\addcomma\space}

\begin{document}
\nocite{sigfridsson,knuth:ct:a,knuth:ct:b}
\printbibliography
\end{document}

enter image description here

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.