2

If a bibliographic entry has more than three authors, I want to have only the first three authors' names written out, plus "et. al".

I found out that to achieve this I have to change the .bst file and therein the "format.names" function. I found this other site where basically my question is answered. However I don't know why this solution does not work in my case and therefore the following post:

To be more precise my original format.names function looks like:

FUNCTION {format.names}
{ 's :=
  #1 'nameptr :=
  s num.names$ 'numnames :=
  numnames 'namesleft :=
    { namesleft #0 > }
    { s nameptr "{f.~}{vv~}{ll}{, jj}" format.name$ 't :=
      nameptr #1 >
    { namesleft #1 >
        { ", " * t * }
        { numnames #2 >
        { "," * }
        'skip$
          if$
          t "others" =
        { " {\em et~al.}" * }
        { string.and * t * }
          if$
        }
      if$
    }
    't
      if$
      nameptr #1 + 'nameptr :=
      namesleft #1 - 'namesleft :=
    }
  while$
}

and the new one is

FUNCTION {format.names}
{ 
  nameptr #1 >
     {
      nameptr #3
      #1 + =
      numnames #5
      > and
        { "\bibinfo{person}{\bibinfo{person}{others}}" 't :=
          #1 'namesleft := }
        'skip$
      if$
      namesleft #1 >
}

With the new format.names function I get many errors when I apply BibTeX:

The top-level auxiliary file: thesis_main.aux
The style file: utphys_custom_threeAuthors.bst
function is an unknown function---line 415 of file utphys_custom_threeAuthors.bst
format.authors is an unknown function---line 415 of file utphys_custom_threeAuthors.bst
Curse you, wizard, before you recurse me:
function format.names is illegal in its own definition
---line 418 of file utphys_custom_threeAuthors.bst

Unfortunately I do not understand the language in which the .bst file is written and I might have a stupid mistake. It would be awesome if you could help me.

Mico
  • 506,678
  • 3
    If you use biblatex it is as simple as loading it with options [maxnames=3,minnames=3]. – Bernard Jul 04 '20 at 20:54
  • 1
    Welcome to TeX.SE. Is the original, i.e, unmodified version of utphys.bst available online? – Mico Jul 04 '20 at 21:06
  • 1
    Should the string "et al." (please, please not "et. al."!) be rendered in italics? – Mico Jul 04 '20 at 21:27
  • @Mico it is not available online, but I can put in in the post if you want? – jojo123456 Jul 04 '20 at 21:34
  • @Mico not necessarily. It can also be non italic – jojo123456 Jul 04 '20 at 21:35
  • 1
    @jojo123456 - I've looked over the most-upvoted answer -- the first solution, not the one labelled "Addendum May 2019" -- in the link you posted. To put it politely, you appear to have botched the instructions given in that answer. To be sure, I can see no reason why the answer I provided nearly 8 years ago shouldn't work for utphys.bst as well. The only thing you need to adapt is to replace numnames #5 with numnames #3, since you wish to apply truncation whenever there are more than 3 authors. Please do give it another try. – Mico Jul 05 '20 at 05:09
  • Thanks for your answers. I made it work with biblatex now! – jojo123456 Jul 06 '20 at 09:10
  • 5
    I’m voting to close this question because the problem is solved in the comments. – AndréC Jul 11 '20 at 18:45

0 Answers0