16

I'm compiling a bibliography in which some author lists are very long (100+). I know about the "et al." option for BibTeX styles but instead of

One, Two, Three, et al. (2016)

or similar, I'd rather have something like

One, Two, Three, and 97 other authors (2016)

for a paper with 100 authors.

I've used latex makebst to create a custom bibliography style and I can just about see that the number of remaining authors for the "et al." is known to BibTeX (in format.names in my custom bst). But I'm not nearly knowledgeable enough about BibTeX to know how to get this into the citation.

Is there a way to get the desired output?

PS: Apologies if this is a duplicate but I could only turn up a lot of questions and answers for putting "et al." in the references.

7
  • 1
    Do you want to indicate which papers have to be mentioned in this format, or should this automatically be the case if the total number of authors supersedes a given number?
    – Karlo
    Commented May 10, 2016 at 10:36
  • 1
    I was hoping it could be done automatically, whenever BibTeX detects a long author list (that would normally be partially replaced with "et al.").
    – Warrick
    Commented May 10, 2016 at 10:41
  • Where I can download your .bst file ? Commented May 10, 2016 at 11:06
  • Does this link work? The function format.names starts at line 416 and seems to have a variable namesleft. But I might be misinterpreting the code. I almost never look at bst source.
    – Warrick
    Commented May 10, 2016 at 11:10
  • Okay, I think I've got something that works but I'll wait to see if there are any other answers first. In short, I found where the "et al." is added, then subtracted the number of printed names from the numnames variable (which is the total number of authors) and wrote that in the place of "et al.". So where I had " " * bbl.etal * on line 452 I now have " and " * numnames #15 - int.to.str$ * " others" *. Seems to work...
    – Warrick
    Commented May 10, 2016 at 14:09

3 Answers 3

9

First you define a number which is the number of authors you want to show, to do this add to ENTRY { in your .bst file nbr so it will become:

ENTRY
  { address
    author
    booktitle
    chapter
    edition
    editor
    eid
    howpublished
    institution
    journal
    key
    month
    note
    number
    organization
    pages
    publisher
    school
    series
    title
    type
    volume
    year
    nbr % added
  }

then search for FUNCTION {format.names} and replace it by

FUNCTION {format.names}
{ 'bibinfo :=
  duplicate$ empty$ 'skip$ {
  's :=
  "" 't :=
  #1 'nameptr :=
  s num.names$ 'numnames :=
  numnames 'namesleft :=
    { namesleft #0 > }
    { s nameptr
      "{f.~}{vv~}{ll}{, jj}"
      format.name$
      highlight.if.cv.author
      bibinfo bibinfo.check
      't :=
      nameptr #1 >
        {
          nameptr #1
          #3 + = %#15 + =     
          numnames #0
          #10 + %#30 +
          > and
            { "others" 't :=
              #1 'namesleft := }
            'skip$
          if$
          namesleft #1 >
            { ", " * t * }
            {
              s nameptr "{ll}" format.name$ duplicate$ "others" =
                { 't := }
                { pop$ }
              if$
              " " *  
              t "others" =
                {
                  * "and " * nbr " other authors" *    
                }
                { ", " * t * }
              if$
            }
          if$
        }
        't
      if$
      nameptr #1 + 'nameptr :=
      namesleft #1 - 'namesleft :=
    }
  while$
  } if$
}

and in your bib file add e.g nbr = {33} to have something like Author 1, Author 2, Author 3 and 33 other authors

N.B: This will show only 3 authors name (if the number of authors is superior than 10) followed by and nbr other authors, where nbr must be added to the BiTeX Entry in the same way you add the pages , journal ... etc . To change this just replace #3 and #10 by the number you want.

Update: As Warrick suggest you do not need to add nbr but instead just replace nbr in the above format.names with numnames #3 - int.to.str$

MWE:

\documentclass{article}
   \begin{filecontents*}{MWE.bib}
     @article{A,
      archivePrefix = {arXiv},
      arxivId = {hep-th/9605032},
      author = {AuthorI, A. and AuthorII, B. and AuthorIII, C.},
      eprint = {9605032},
      journal = {Journal of Bla bla},
      pages = {12},
      primaryClass = {hep-th},
      title = {{Title of the paper A}},
      volume = {123},
      year = {2016}
        }
     @article{B,
      archivePrefix = {arXiv},      
      author = {Author1, A and Author2, A and Author3, A and Author4, A and Author5, A and Author6, A
                 and Author6, A and Author7, A and Author8, A and Author9, Aand Author10, A and Author11, A
                 and Author12, A
                 },
      arxivId = {1512.00704},
      eprint = {1512.00704},
      journal = {Journal of bla bla},
      pages = {1233},
      title = {{Title of the paper B}},
      volume = {567},
      year = {2016},
      nbr = {9}
        }
     @article{C,
      archivePrefix = {arXiv},      
      author = {Author1, A and Author2, A and Author3, A and Author4, A and Author5, A and Author6, A
                 and Author6, A and Author7, A and Author8, A and Author9
                 },
      arxivId = {1512.00704},
      eprint = {1512.00704},
      journal = {Journal of bla bla},
      pages = {1233},
      title = {{Title of the paper B}},
      volume = {567},
      year = {2016}
        }   
  \end{filecontents*}
  \begin{document}

   ~\nocite{*}

 %Bibleography

 \bibliographystyle{example}
 \bibliography{MWE}
 \end{document} 

Which gives: enter image description here

3
  • 1
    This is very close to the desired behaviour, except that I'm pretty sure it can be done without creating the new variable nbr. In your example, if I replace nbr in your format.names with numnames #3 - int.to.str$, I think it automatically calculates the number of missing authors. Obviously the 3 is the hardcoded number for how many names are printed, which can be changed as you suggest.
    – Warrick
    Commented May 11, 2016 at 6:20
  • You're right !. Commented May 11, 2016 at 6:35
  • @Warrick feel free to edit the answer Commented May 11, 2016 at 6:47
8

Here is a solution using biblatex:

All one has to do is to define a new directive to format names:

\newcounter{namesleft}
\DeclareNameFormat{andNothers}{%
  \setcounter{namesleft}{\value{author}-\value{liststop}}%
  \nameparts{#1}%
  \namepartfamily
  \ifthenelse{\value{listcount}<\value{liststop}}
    {\addcomma\addspace}%
    {\ifmorenames{\printtext{ and other \thenamesleft{} authors}}{}}
}
\DeclareNameAlias{author}{andNothers}

In the snippet above first we create a new counter (names left) to store the number of names left to process. Such number is obtained from the difference of the number to be printed when a name is truncated (stored in the minames parameters to be given it the biblatex option and the total number of names in the list stored by the counter (author in this case). When we each the last name to be printed, we use the \ifmorenames conditional to check whether the list is going to be truncated; if so, it prints the value of namesleft.

Finally, we use \DeclareNameAlias to specify that we use the new format to print the list of authors.

The solution uses the calc package to simplify the computation of the counters, and the parameters of how many names are required before truncating the list and how many names are included when truncated are the standard maxnames and minnames. Thus,

\usepackage[minnames=3,maxnames=5]{biblatex}

specifies truncate name list if more that 5 names are present, but display only the first 3 names.

Here is the full MWE:

\documentclass{article}

\begin{filecontents*}{\jobname.bib}
     @article{A,
      archivePrefix = {arXiv},
      arxivId = {hep-th/9605032},
      author = {AuthorI, A. and AuthorII, B. and AuthorIII, C.},
      eprint = {9605032},
      journal = {Journal of Bla bla},
      pages = {12},
      primaryClass = {hep-th},
      title = {{Title of the paper A}},
      volume = {123},
      year = {2016}
        }
     @article{B,
      archivePrefix = {arXiv},      
      author = {Author1, A and Author2, A and Author3, A and Author4, A and Author5, A and Author6, A
                 and Author6, A and Author7, A and Author8, A and Author9, Aand Author10, A and Author11, A
                 and Author12, A
                 },
      arxivId = {1512.00704},
      eprint = {1512.00704},
      journal = {Journal of bla bla},
      pages = {1233},
      title = {{Title of the paper B}},
      volume = {567},
      year = {2016},
      nbr = {9}
        }
     @article{C,
      archivePrefix = {arXiv},      
      author = {Author1, A and Author2, A and Author3, A and Author4, A and Author5, A and Author6, A
                 and Author6, A and Author7, A and Author8, A and Author9
                 },
      arxivId = {1512.00704},
      eprint = {1512.00704},
      journal = {Journal of bla bla},
      pages = {1233},
      title = {{Title of the paper C}},
      volume = {567},
      year = {2016}
        }   
\end{filecontents*}

\usepackage{calc}
\usepackage[minnames=3,maxnames=5]{biblatex}
\addbibresource{\jobname.bib}

\newcounter{namesleft}
\DeclareNameFormat{andNothers}{%
  \setcounter{namesleft}{\value{author}-\value{liststop}}%
  \nameparts{#1}%
  \namepartfamily
  \ifthenelse{\value{listcount}<\value{liststop}}
    {\addcomma\addspace}%
    {\ifmorenames{\printtext{ and other \thenamesleft{} authors}}{}}
}


\DeclareNameAlias{author}{andNothers}

\begin{document}


\nocite{*}

\printbibliography  
\end{document}

Producing

enter image description here

0

I have an alternative solution to the problem. I modified/tweaked the Chicago style (Chicago.sty) and I replace "et al." with "and others" in the bibliography style (ChicagoFred.bst); below an example; it includes a .tex as an example.

github file

The reason I modified some lines in the Chicago style is because there was an issue with parentheses (if you use a colorful hyperlink, then you have a colorless parenthesis). I fixed it.

2
  • I would not change anything in chicago.sty. Better is add patch to it in your document preamble.
    – Zarko
    Commented Apr 18, 2020 at 11:56
  • Interesting reply. Could you do that? please free to take the files and do it. Thanks.
    – Freddyr
    Commented Apr 19, 2020 at 3:07

You must log in to answer this question.

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