根据出版物的作者数量,我希望获得“bibstyle=alphabetic”选项和内联引用使用的标签,如下所示:
一位作者 -> [Doe 2016]
两位作者 -> [Doe1/Doe2 2016]
三位或更多作者-> [Doe1 et al. 2016]
我尝试使用 \DeclareLabelalphaTemplate 来实现这一点,但由于它似乎不支持条件表达式,所以没有成功。
这是我目前得到的:
\documentclass{article}
\usepackage{filecontents}
\begin{filecontents*}{\jobname.bib}
@document{one,
author = {Firstname1 Lastname1},
title = {One Author},
year = {2001},
}
@document{two,
author = {Firstname1 Lastname1 and Firstname2 Lastname2},
title = {Two Authors},
year = {2002},
}
@document{three,
author = {Firstname1 Lastname1 and Firstname2 Lastname2 and Firstname3 Lastname3},
title = {Three Authors},
year = {2003},
}
}
\end{filecontents*}
\usepackage[
backend=biber,
bibstyle=alphabetic,
citestyle=alphabetic,
maxcitenames=2,
maxbibnames=6
]{biblatex}
\addbibresource{\jobname.bib}
\renewcommand{\labelalphaothers}{\addspace et al.} %use et al. for more than maxcitenames=2 authors
\DeclareLabelalphaTemplate{
\labelelement{\field[ifnames=3,names=1]{labelname}}
\labelelement{\field[ifnames=2,names=1]{labelname}}
\labelelement{\field[ifnames=1]{labelname}
\literal{/}}
\labelelement{\field[ifnames=2,noalphaothers=true]{labelname}}
\labelelement{\literal{\addspace}}
\labelelement{\field{year}}
}
\begin{document}
\nocite{*}
\printbibliography
\end{document}
使用 biblatex v3.3 和 biber 2.4,结果如下
这显然不是我所希望的。任何建议都将不胜感激!
答案1
使用 biblatex 3.4/biber 2.5(现在位于 Sourceforge 上的开发文件夹中),只需执行以下操作:
\usepackage[style=alphabetic, maxalphanames=2, minalphanames=1]{biblatex}
\renewcommand{\labelalphaothers}{\addspace et al.}
\DeclareLabelalphaTemplate{
\labelelement{\field[namessep=/]{labelname}}
\labelelement{\literal{\addspace}}
\labelelement{\field{year}}
}