如何使用 xpatch 更改“and”bibstring 的格式?

如何使用 xpatch 更改“and”bibstring 的格式?

当使用 的biblatex命令textcite来处理两位作者的参考文献时,我希望它们之间的“and”用斜体表示。我设法\bibstring使用以下基于xpatch包的代码片段为“et al.”获得了相同的效果(感谢这个很好的答案):

\xpatchbibmacro{name:andothers}{%
    \bibstring{andothers}%
}{%
    \bibstring[\emph]{andothers}%
}{}{}

但是,仅仅name:andothers用或替换name:andand不能实现这一点,正如从以下 MWE 中看到的那样:

\begin{filecontents}{\jobname.bib}
@book{test,
    author = {Uthor, A. and Uthor, B.},
    title = {And and Or or Or and And},
    year = {2014}}
\end{filecontents}

\documentclass{article}
\usepackage{biblatex}
\usepackage{xpatch}
\addbibresource{\jobname.bib}
%%%% This does not work %%%%
\xpatchbibmacro{name:and}{%
    \bibstring{and}%
}{%
    \bibstring[\emph]{and}%
}{}{}
%%%% %%%% %%%%
\begin{document}
This is how it looks like: \textcite{test} but the "and" should be italic, as in "Uthor \emph{and} Uthor"
\end{document}

不幸的是,我找不到在biblatex来源中哪里and \bibstring定义了。

答案1

只有一个name:andothers定义。不过,这可能会有所帮助:

\documentclass{article}
\usepackage{biblatex}

\renewcommand*{\finalnamedelim}{%
  \ifnumgreater{\value{liststop}}{2}{\finalandcomma}{}%
  \addspace\bibstring[\emph]{and}\space}

\addbibresource{\jobname.bib}
[...]

相关内容