我需要一个满足以下条件的引用命令 - 类似于\citeauthor
- 并且想知道如何定义它:
- 如果第一次引用某个作者或某个作者群体,则引用作者的全名。
- 如果第二次引用某个作者或某个作者群体,等等,则仅引用作者的姓氏。
例如:
\citeauthor{cit:howson1983SciRea} were the first who discussed this thesis. …
But today \citeauthor{cit:howson1983SciRea} refute this thesis.
这应该导致:
科林·豪森(Colin Howson)和彼得·乌尔巴赫(Peter Urbach)是第一批讨论这个论点的人。……但今天豪森和乌尔巴赫驳斥了这一论点。
我已经尝试过解决类似问题的方法:
\DeclareCiteCommand*{\citeauthortest}
{\defcounter{maxnames}{99}%
\defcounter{minnames}{99}%
\defcounter{uniquename}{2}%
\boolfalse{citetracker}%
\boolfalse{pagetracker}%
\usebibmacro{prenote}}
{\ifciteindex{\indexnames{labelname}}{}%
\printnames{labelname}}
{\multicitedelim}
{\usebibmacro{postnote}}
但我得到了
软件包 biblatex 错误:命令 '\citeauthortest' 未定义
答案1
这biblatex-dw 样式有一个选项(firstfullname
)。我必须承认,如果没有提供代码的 Philipp Lehman,我不可能实现它。但无论如何,我认为它可以适应任何风格:
\documentclass[english]{scrartcl}
\listfiles
\usepackage[T1]{fontenc}
\usepackage[latin1]{inputenc}
\usepackage{babel,csquotes}
\usepackage[
style=authortitle,
backend=biber
]{biblatex}
\addbibresource{biblatex-examples.bib}
\makeatletter
\newcommand*{\cbx@seennames}{}
\newrobustcmd*{\cbx@nameseen}[1]{%
\listxadd{\cbx@seennames}{\detokenize{#1}}}
\newrobustcmd*{\cbx@ifnameseen}[1]{%
\xifinlist{\detokenize{#1}}{\cbx@seennames}}
\DeclareNameFormat{citeauthor}{%
\cbx@ifnameseen{#1#3#5#7}
{\ifcase\value{uniquename}%
\usebibmacro{name:last}{#1}{#3}{#5}{#7}%
\or
\ifuseprefix
{\usebibmacro{name:first-last}{#1}{#4}{#5}{#8}}
{\usebibmacro{name:first-last}{#1}{#4}{#6}{#8}}%
\fi}%
{\usebibmacro{name:first-last}{#1}{#3}{#5}{#7}%
\cbx@nameseen{#1#3#5#7}}%
\usebibmacro{name:andothers}}
\DeclareCiteCommand{\citeauthor}
{\boolfalse{citetracker}%
\boolfalse{pagetracker}%
\usebibmacro{prenote}}
{\indexnames{labelname}%
\printnames[citeauthor]{labelname}}
{\multicitedelim}
{\usebibmacro{postnote}}
\makeatother
\begin{document}
\citeauthor{companion} were the first who discussed this thesis. \ldots{}
But today \citeauthor{companion} refute this thesis.
\printbibliography
\end{document}
我从 中截取了代码standard-dw.cbx
。结果如下:
答案2
如果您使用\DeclareCiteCommand*
,则生成的命令也必须以 a 为后缀*
(请参阅biblatex
文档)。因此,在您的情况下,请尝试\citeauthortest*{citekey}