我正在尝试使用authoryear
样式并删除年份周围的括号:
作者...2018。标题...
代替
作者...(2018) 标题...
在参考书目中。但是,我无法让它工作。例如
biblatex:如何删除 authoryear 样式中年份周围的括号?
失败。biblatex-chicago
也失败了。我发现在较新的版本中,宏必须更改,添加一个 *。我的新 MWE 将是
\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}
因此也失败了:
我在 macOS 和 Windows 上测试了pdflatex
。lualatex
软件包是最新的。有人能帮忙吗?
答案1
关键在于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}}
你只需要改变
\xpatchbibmacro{date+extrayear}{%
到
\xpatchbibmacro{date+extradate}{%