3

I'm trying to use authoryear style and remove the parentheses around the year:

Authors...2018. Title...

instead of

Authors...(2018) Title...

in the bibliography. I am, however, not able to get it to work. e.g. biblatex: How to remove the parentheses around the year in authoryear style? fails. biblatex-chicago also fails. I found that in newer versions, the macro has to be changed adding a *. My new MWE would be

\documentclass{article}
\usepackage[style=authoryear]{biblatex}
\usepackage{xpatch}
\usepackage{filecontents}

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

\addbibresource{\jobname.bib}
\nocite{*}

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

which consequently fails too:

enter image description here

I tested pdflatex, lualatex on macOS and Windows. Packages are up to date. Can someone help?

BambOo
  • 8,801
  • 2
  • 20
  • 47
Max
  • 185
  • I marked this question as a duplicate. If the answer in the duplicate does for some reason not work for you, please edit your question, explain how and share more details about your package versions (upload the relevant parts of the .log file). In that case I will immediately vote to reopen this question. – moewe Nov 08 '18 at 22:47
  • That one was my question, I thin something went wrong here. However, the solution provided does work. Thank you – Max Nov 09 '18 at 16:23
  • I thought you referred to https://tex.stackexchange.com/q/12254/35864? I closed as a duplicate of https://tex.stackexchange.com/q/428190/35864 (a different question with similar title), where one of the answers is exactly what SrongBad suggests in his answer. – moewe Nov 09 '18 at 16:27

1 Answers1

2

The key is in authoryear.bbx

\providebibmacro*{date+extrayear}{%
  \blx@warning{bibmacro 'date+extrayear' is deprecated.\MessageBreak
    Please use 'date+extradate'.\MessageBreak
    Using 'date+extradate' instead}%
  \usebibmacro{date+extradate}}

You just need to change

\xpatchbibmacro{date+extrayear}{%

to

\xpatchbibmacro{date+extradate}{%
StrongBad
  • 20,495