如何(正確)以作者年份風格刪除年份周圍的括號?

如何(正確)以作者年份風格刪除年份周圍的括號?

前段時間,Alan Munn 提出問題,步調一致地雄辯地回答關於去掉括號的問題來自 biblatexauthoryear風格參考。不幸的是,lockstep 的解決方案將不需要的內容注入\addperiod\space到「破折號」引用中。例如,給定作者 A. 被引用兩次:

\documentclass{article}

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

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

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

\begin{document}

\printbibliography

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

\printbibliography

\end{document}

我們得到:

在此輸入影像描述

我嘗試使用類似的構造來建立解決方案,\usebibmacro{bbx:dashcheck}但沒有成功。那麼,基於lockstep基於nice的方法,我如何有條件地僅在“非破折號”引用的情況下xpatch包含?\addperiod\space

答案1

單位的輸出應該在命令內完成\setunit

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

在此輸入影像描述

相關內容