4

I am using biblatex with option maxbibnames=2 to enforce author names to be replaced with et al when their number exceeds maxbibnames. \usepackage[style=numeric-comp,sorting=none,giveninits=true,maxbibnames=2,backend=biber]{biblatex}

However, I want to supress this behaviour when a specific author is in the list of authors. Any suggestions would be much appreciated.

EDIT: Adapting @Werner MWE below I would like the bibliography output of article 'def' to print the first two authors followed by et al, with the second author bolded.

\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}

The code above won't yield the desired output, instead it will show the first author followed by et al. If maxbibnames=3 is used (the number of authors or greater) it will show all authors with the second one highlighted. Additional downside is that those parameters (Options and Author+an) need to be hard coded for each bib entry. Can anyone suggest a solution that does something like the following pseudocode:

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 ))  
     }  
    }  
 }  
0

1 Answer 1

6

Each biblatex option has a certain scope. Some can only be used "[at] load time" or as a "global" reference, while others may be set additionally/exclusively on a "per type" or "per entry" basis. maxbibnames can be executed on a "per entry" basis via the options key-value:

enter image description here

\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}

Scope reference: Appendix E Option Scope (p 253 of the biblatex documentation).

6
  • Thanks for the proposal @Werner. However, I notice that the behaviour overrides maxbibnames only if the value is equal or greater than the number of authors in the entry. If instead I set options = {maxbibnames =2} in your example, the output is the first author et al. So, it is a case of all or nothing.
    – Pheasdrus
    Commented Jan 19, 2017 at 21:35
  • @user380556: What about maxbibnames = 3?
    – Werner
    Commented Jan 19, 2017 at 21:52
  • as it is equal to the number of authors in the bib entry it will display them all
    – Pheasdrus
    Commented Jan 19, 2017 at 22:17
  • @user380556: Well, yes. Three authors is an odd case, since writing First, Second, et al, you might just as well write First, Second, Third. So you're correct, for three authors, it's all or "nothing".
    – Werner
    Commented Jan 19, 2017 at 22:19
  • Actually no, I get the same behaviour with 4 and 5. If maxbibnames is equal or greater than number of author, it displays all. else if smaller than number of author it will display only one followed by et al
    – Pheasdrus
    Commented Jan 19, 2017 at 22:27

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .