I have a bst file that shortens entries with more than 5 authors to et al. but I would like to modify it to do so for more than 4 authors. I believe this is the relevant code snippet but how can I change it to get the modified behavior?
This question is similar to Changing BibTeX "format.names" function in .bst file to force "et al." citations for entries with more than 3 authors but since this bst file already successfully performs a similar function, perhaps the probability of this question getting an answer will be higher.
This syntax really is a BeaST... If someone could even just explain to me what is going on here I'd greatly appreciate it.
FUNCTION {format.names}
{ 'bibinfo :=
duplicate$ empty$ 'skip$ {
's :=
"" 't :=
#1 'nameptr :=
s num.names$ 'numnames :=
numnames 'namesleft :=
{ namesleft #0 > }
{ s nameptr
"{vv~}{ll}{, f.}{, jj}"
format.name$
bibinfo bibinfo.check
't :=
nameptr #1 >
{
nameptr #1
#1 + =
numnames #5
> and
{ "others" 't :=
#1 'namesleft := }
'skip$
if$
namesleft #1 >
{ ", " * t * }
{
s nameptr "{ll}" format.name$ duplicate$ "others" =
{ 't := }
{ pop$ }
if$
t "others" =
{
" " * bbl.etal emphasize *
}
{
"\&"
space.word * t *
}
if$
}
if$
}
't
if$
nameptr #1 + 'nameptr :=
namesleft #1 - 'namesleft :=
}
while$
} if$
}
Source: http://mirror.unl.edu/ctan/macros/latex/contrib/nature/naturemag.bst
#5in the code, change it to#4and try that. When working with.bstfiles, one needs to remind oneself that these files use Reverse Polish Notation. – moewe Jan 02 '14 at 14:27et. al.is incorrect. It should beet al..etis not an abbreviation - it is just the Latin forand. – cfr Jul 01 '14 at 17:43