在我的文档中,我会写类似这样的内容(使用natbib
,但这不应该有太大关系):
\citet{reference} show that .....
这将呈现为
Jones 等人(1990)表明……
(\citet
创建\natbib
“作者列表(年份)”引用样式)
当然,如果{reference}
我是一个人,我应该写
\cite{reference} shows that ....
渲染为
琼斯(1990)表明……
由于我很懒,无法花额外的 5 秒钟来搜索参考资料以查看它是否是单个作者,那么是否有可能有一种自动化的方法来实现复数化?或者一些相对简单的宏,看起来像
\IfRefIsPlural{reference}{show}{shows}
答案1
可以biblatex
执行以下操作:
\documentclass{article}
\usepackage[style=authoryear,natbib=true]{biblatex}
\addbibresource{biblatex-examples.bib}
% Used in some citations
\newcounter{totalnames}
\DeclareNameFormat{labelname}{%
\setcounter{totalnames}{\value{author}}%
\ifcase\value{uniquename}%
\usebibmacro{name:family}
{\namepartfamily}
{\namepartgiven}
{\namepartprefix}
{\namepartsuffix}%
\or
\ifuseprefix
{\usebibmacro{name:given-family}
{\namepartfamily}
{\namepartgiveni}
{\namepartprefix}
{\namepartsuffixi}}
{\usebibmacro{name:given-family}
{\namepartfamily}
{\namepartgiveni}
{\namepartprefixi}
{\namepartsuffixi}}%
\or
\usebibmacro{name:given-family}
{\namepartfamily}
{\namepartgiven}
{\namepartprefix}
{\namepartsuffix}%
\fi
\usebibmacro{name:andothers}}
\newcommand{\IfRefIsPlural}[2]{%
\ifnum\thetotalnames=1
#1%
\else%
#2
\fi%
}
\begin{document}
\citet{bertram} \IfRefIsPlural{shows}{show}
\citet{angenendt} \IfRefIsPlural{shows}{show}
\printbibliography
\end{document}
(小警告:这不适用于\citet{bertram,angenendt}
)