覆盖特定作者的 \maxbibnames

覆盖特定作者的 \maxbibnames

我正在使用 biblatex 和选项 maxbibnames=2 来强制将作者姓名替换为等人当它们的数量超过 maxbibnames 时。 \usepackage[style=numeric-comp,sorting=none,giveninits=true,maxbibnames=2,backend=biber]{biblatex}

但是,当特定作者在作者列表中时,我想抑制此行为。任何建议都将不胜感激。

编辑:调整下面的@Werner MWE,我希望文章“def”的参考书目输出打印前两位作者,然后是 et al,并将第二位作者加粗。

\documentclass{article}

\usepackage{filecontents}
\begin{filecontents*}{references.bib}
@article{abc,
  title    = {A title},
  author   = {A Author and B Bauthor and C Cauthor},
  year     = {2000}
  }
@article{def,
  title    = {A title},
  author   = {D Duthor and E Eauthor and F Fauthor},
  year     = {2000},
  options  = {maxbibnames = 2},
  AUTHOR+an = {2=highlight} % used to highlight an author's name, see @PLK suggestion http://tex.stackexchange.com/questions/73136/make-specific-author-bold-using-biblatex
  }
\end{filecontents*}

\usepackage[style=numeric-comp,sorting=none,giveninits=true,maxbibnames=2,backend=biber]{biblatex}

\addbibresource{references.bib}

\renewcommand*{\mkbibnamefamily}[1]{%
  \ifitemannotation{highlight}
    {\textbf{#1}}
    {#1}}

\begin{document}

\nocite{*}

\printbibliography

\end{document}

上面的代码不会产生所需的输出,而是会显示第一个作者,然后是 et al。如果使用 maxbibnames=3(作者数量或更大),它将显示所有作者,并突出显示第二个作者。另一个缺点是这些参数(Options 和 Author+an)需要为每个 bib 条目进行硬编码。有人能建议一个解决方案,执行类似以下伪代码的操作吗:

define authorsToBoldList = {E Eauthor; D Duthor}  
for each BibEntry {  
   foundAuthorIndex = find(authorsToBoldList,BibEntryAuthors)  
   If notEmpty(foundAuthorIndex) {  
     display BibEntryAuthors(1:max(foundAuthorIndex))% followed by et al if less than BibEntryAuthors   
     for each foundAuthorIndex {  
       highlight(BibEntryAuthors(foundAuthorIndex ))  
     }  
    }  
 }  

答案1

每个biblatex选项具有一定的范围。有些只能在“加载时”使用或作为“全局”引用,而其他选项可以基于“每个类型”或“每个条目”额外/专门设置。可以通过键值maxbibnames基于“每个条目”执行:options

在此处输入图片描述

\documentclass{article}

\usepackage{filecontents}
\begin{filecontents*}{references.bib}
@article{abc,
  title    = {A title},
  author   = {A Author and B Bauthor and C Cauthor},
  year     = {2000}
}
@article{def,
  title    = {A title},
  author   = {D Duthor and E Eauthor and F Fauthor},
  year     = {2000},
  options  = {maxbibnames = 4}
}
\end{filecontents*}

\usepackage[style=numeric-comp,sorting=none,giveninits=true,maxbibnames=2,backend=biber]{biblatex}

\addbibresource{references.bib}

\begin{document}

\nocite{*}

\printbibliography

\end{document}

范围参考:附录E 选项范围(第 253 页)biblatex文档)。

相关内容