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
.bst
file ?format.names
starts at line 416 and seems to have a variablenamesleft
. But I might be misinterpreting the code. I almost never look atbst
source.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...