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

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


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

Tags:

Biblatex