如何修改\textcite 及其\finalnamedelim?

如何修改\textcite 及其\finalnamedelim?

当我引用时,\textcites我希望获得如“Status desideratus”所述结果:

enter image description here

这就是 MWE:

\documentclass[ngerman]{scrbook}
\usepackage{filecontents,babel}
\usepackage[           
backend=biber,
style=archaeologie,
inreferences,
lstabbrv,
lstlocations,
lstpublishers,
]{biblatex} 
\addbibresource{archaeologie-examples.bib}
%\renewcommand{\textcitedelim}{\addcomma\space}

\DeclareCiteCommand{\textcite}%
  {\boolfalse{cbx:yearinparens}%  
  \usebibmacro{prenote}%
  }%
  {\usebibmacro{citeindex}%
  \renewcommand*\multinamedelim{\addcomma\space}%
  \renewcommand*\finalnamedelim{%
    \ifnumgreater{\value{liststop}}{2}{\finalandcomma}{}%
     \addspace\bibstring{and}\space}%
   \iffirstcitekey%
    {\setcounter{textcitetotal}{1}}%
    {\stepcounter{textcitetotal}%
     \multinamedelim}%
   \ifbool{cbx:seenote}
     {\usebibmacro{cite:seenote}}%
     {\usebibmacro{textcite}}}%
  {\ifbool{cbx:parens}%
   {\bibcloseparen\global\boolfalse{cbx:yearinparens}}%
   {}}%
  {\ifbool{cbx:seenote}
    {\usebibmacro{postnote}}%
    {\usebibmacro{textcite:postnote}}}
%
 \DeclareMultiCiteCommand{\textcites}{\textcite}{}

\begin{document}
Status quo: \textcites[12]{Mann2011}[23]{Arnolds2005}\par
Status desideratus: Mann (2011, 12) und Arnolds (2005, 23)\par\bigskip
Status quo: \textcites[12]{Mann2011}[23]{Arnolds2005}[34]{Emme2013}\par
Status desideratus: Mann (2011, 12), Arnolds (2005, 23) und Emme (2013, 34)
\end{document}

答案1

这里发生了几件事。

首先,biblatex.def其中有一段有趣的内容:

% This is a provisional definition for \iffinalcitedelim{<true>}{<false>}, a
% test that should expand <true> if the next non-compact citation delimiter
% is the last one in the citation list printed by \textcite or \textcites.
\newcommand*{\iffinalcitedelim}{\@secondoftwo}

我们可以让这个测试实际上做一些有用的事情:

\makeatletter
\renewcommand*{\iffinalcitedelim}{%
  \iflastcitekey
    {\@firstoftwo}
    {\@secondoftwo}}
\makeatother

其次,我注意到您已将命令的定义\textcite从默认的 中更改archaeologie.cbx。除其他外,您已将其替换\textcitedelimmultinamedelim,我认为这不是您想要的。

我让你自己决定到底需要更改这个宏的多少部分,但它会给出你想要的输出,而无需进行任何更改。尽管由于宏中的一个错误(也出现在你的问题中)(它包含cbx:parens而不是cbxyearinparens),它只适用于\textcites,而不适用于\textcite

这是一个完整的例子:

\documentclass[ngerman]{scrbook}
\usepackage{filecontents,babel}
\usepackage[           
backend=biber,
style=archaeologie,
inreferences,
lstabbrv,
lstlocations,
lstpublishers,
]{biblatex} 
\addbibresource{archaeologie-examples.bib}

\makeatletter
\renewcommand*{\iffinalcitedelim}{%
  \iflastcitekey
    {\@firstoftwo}
    {\@secondoftwo}}
\makeatother

\DeclareMultiCiteCommand{\textcites}{\textcite}{}

\begin{document}
Status quo: \textcites[12]{Mann2011}[23]{Arnolds2005}\par
Status desideratus: Mann (2011, 12) und Arnolds (2005, 23)\par\bigskip
Status quo: \textcites[12]{Mann2011}[23]{Arnolds2005}[34]{Emme2013}\par
Status desideratus: Mann (2011, 12), Arnolds (2005, 23) und Emme (2013, 34)
\end{document}

enter image description here

相关内容