citet 中最後一項與倒數第二項之間的分離與作者年風格?

citet 中最後一項與倒數第二項之間的分離與作者年風格?

如果用 引用多個項目\citet,我想在最後一個項目和倒數第二個項目之間實現特定的分隔符(如“and”)。例如\citet{Grieg,Greg,Gregor}應該給出類似的東西...Grieg (2002), Greg (2001) and Gregor (2003) ...

一個最小的工作範例:

\documentclass{article}

\usepackage[natbib=true,firstinits=true,
            bibstyle=authoryear,citestyle=authoryear-comp,
            minnames=1,maxnames=2,isbn=false,url=false,eprint=false,doi=false,
            maxbibnames=20
]{biblatex}
\renewcommand*{\finalnamedelim}{\addspace\&\addspace}


\usepackage{filecontents}

\begin{filecontents}{test.bib}
@misc{A01,
  author = {Author, A. A. and Buthor, B. B. and Cuthor, C. C.},
  year = {2001},
  title = {Alpha},
}
@misc{B01,
  author = {Dodelson, D. and Edward, E.},
  year = {2011},
  title = {Beta},
}
\end{filecontents}

\addbibresource{test.bib}


\begin{document}
As shown in \citet{A01,B01}, ...

\printbibliography

\end{document}

編輯:我已經看到 Guido 的回答(https://tex.stackexchange.com/a/89634/30051)但它不適用於authoryear 風格。因此,這裡有更具體的問題。

答案1

使用套件的解決方案xpatch( \usepackage{xpatch})

\xpatchbibmacro{textcite}
  {\multicitedelim}
  {\ifnumequal{\value{citecount}}{\value{citetotal}}
        {\addspace\bibstring{and}\addspace}
        {\multicitedelim}}
  {}
  {}

相關內容