![从 [et al.] 中排除某一位作者](https://linux22.com/image/329646/%E4%BB%8E%20%5Bet%20al.%5D%20%E4%B8%AD%E6%8E%92%E9%99%A4%E6%9F%90%E4%B8%80%E4%BD%8D%E4%BD%9C%E8%80%85.png)
是否可以使用 biblatex 或任何其他包将特定作者从 [et al.] 中排除?
我的论文需要作者出版物列表。现在只需列出每篇出版物的所有作者即可解决问题,但我认为下面提到的格式更好。
第一作者,......,需要的作者[等]
答案1
对于以下biblatex
解决方案,您所需要的只是“特殊”名称的名称哈希值(这是 Biber 独有的功能),您可以在使用 biblatex 突出显示参考书目中的作者,并允许使用参考书目样式对其进行格式化。您必须使用,maxbibnames=999
以便可以处理所有名称。
解决方案是用省略号替换连续的不太重要的名称,如果我们省略了任何名称,则打印“[et al.]”。
\newcounter{namesnotimportant}
\newtoggle{ellipsis}
\DeclareNameFormat{first-last-etal}{%
\ifnumcomp{\value{listcount}}{=}{1}
{\setcounter{namesnotimportant}{0}%
\toggletrue{ellipsis}}
{}%
\ifboolexpr{test {\ifnumcomp{\value{listcount}}{=}{1}}
or test {\ifnumcomp{\value{listtotal}}{=}{2}}}
{\iffirstinits
{\usebibmacro{name:first-last}{#1}{#4}{#5}{#7}}
{\usebibmacro{name:first-last}{#1}{#3}{#5}{#7}}}%
{\iffieldequalstr{hash}{e06f6e5a8c1d5204dea326aa5f4f8d17}%% <----- put the correct hash here
{\toggletrue{ellipsis}%
\iffirstinits
{\usebibmacro{name:first-last}{#1}{#4}{#5}{#7}}
{\usebibmacro{name:first-last}{#1}{#3}{#5}{#7}}}
{\stepcounter{namesnotimportant}%
\iftoggle{ellipsis}
{\addcomma\space\textellipsis\togglefalse{ellipsis}\isdot}
{}}}%
\ifnumcomp{\value{namesnotimportant}}{>}{0}
{\toggletrue{abx@bool@more\currentname}}
{}%
\ifboolexpr{
test {\ifnumequal{\value{listcount}}{\value{liststop}}}
and
test \ifmorenames
}
{\andothersdelim\bibstring[\mkbibbrackets]{andothers}}
{}}
\DeclareNameAlias{sortname}{first-last-etal}
\DeclareNameAlias{author}{first-last-etal}
\DeclareNameAlias{editor}{first-last-etal}
\DeclareNameAlias{translator}{first-last-etal}
在示例中,特殊名称是“Anne Uthor”,对应的哈希是e06f6e5a8c1d5204dea326aa5f4f8d17
平均能量损失
\documentclass[british]{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{babel}
\usepackage{csquotes}
\usepackage[style=authoryear,backend=biber, maxnames=999]{biblatex}
\usepackage{filecontents}
\begin{filecontents*}{\jobname.bib}
@book{one,
author = {Anne Uthor},
title = {One Author},
year = {2001},
}
@book{twoa,
author = {Anne Uthor and Emma Ditor},
title = {Two Authors -- Important First},
year = {2002},
}
@book{twob,
author = {Emma Ditor and Anne Uthor},
title = {Two Authors -- Important Second},
year = {2002},
}
@book{threea,
author = {Anne Uthor and Emma Writer and William Riter},
title = {Three Authors -- Important First},
year = {2003},
}
@book{threeb,
author = {Emma Writer and Anne Uthor and William Riter},
title = {Three Authors -- Important Second},
year = {2003},
}
@book{threec,
author = {Emma Writer and William Riter and Anne Uthor},
title = {Three Authors -- Important Third},
year = {2003},
}
@book{foura,
author = {Anne Uthor and Emma Writer and William Riter and Catherine T. Ranslator},
title = {Four Authors -- Important First},
year = {2004},
}
@book{fourb,
author = {Emma Writer and Anne Uthor and William Riter and Catherine T. Ranslator},
title = {Four Authors -- Important Second},
year = {2004},
}
@book{fourc,
author = {Emma Writer and William Riter and Anne Uthor and Catherine T. Ranslator},
title = {Four Authors -- Important Third},
year = {2004},
}
@book{fourd,
author = {Emma Writer and William Riter and Catherine T. Ranslator and Anne Uthor},
title = {Four Authors -- Important Fourth},
year = {2004},
}
\end{filecontents*}
\addbibresource{\jobname.bib}
\newcounter{namesnotimportant}
\newtoggle{ellipsis}
\DeclareNameFormat{first-last-etal}{%
\ifnumcomp{\value{listcount}}{=}{1}
{\setcounter{namesnotimportant}{0}%
\toggletrue{ellipsis}}
{}%
\ifboolexpr{test {\ifnumcomp{\value{listcount}}{=}{1}}
or test {\ifnumcomp{\value{listtotal}}{=}{2}}}
{\iffirstinits
{\usebibmacro{name:first-last}{#1}{#4}{#5}{#7}}
{\usebibmacro{name:first-last}{#1}{#3}{#5}{#7}}}%
{\iffieldequalstr{hash}{e06f6e5a8c1d5204dea326aa5f4f8d17}%% <----- put the correct hash here
{\toggletrue{ellipsis}%
\iffirstinits
{\usebibmacro{name:first-last}{#1}{#4}{#5}{#7}}
{\usebibmacro{name:first-last}{#1}{#3}{#5}{#7}}}
{\stepcounter{namesnotimportant}%
\iftoggle{ellipsis}
{\addcomma\space\textellipsis\togglefalse{ellipsis}\isdot}
{}}}%
\ifnumcomp{\value{namesnotimportant}}{>}{0}
{\toggletrue{abx@bool@more\currentname}}
{}%
\ifboolexpr{
test {\ifnumequal{\value{listcount}}{\value{liststop}}}
and
test \ifmorenames
}
{\andothersdelim\bibstring[\mkbibbrackets]{andothers}}
{}}
\DeclareNameAlias{sortname}{first-last-etal}
\DeclareNameAlias{author}{first-last-etal}
\DeclareNameAlias{editor}{first-last-etal}
\DeclareNameAlias{translator}{first-last-etal}
\begin{document}
\nocite{*}
\printbibliography
\end{document}