2

I want to shorten my bibliography by adding et al. after a certain number of authors (e.g. 3) in my reference list, using the unsrt-Style.

In my preamble I add the cite package for superscript options:

\usepackage[superscript,biblabel]{cite}

And in my file the bibliography is created by

\bibliographystyle{unsrt}

This works fine, but the bibliography is way too long, since all authors are lister, no matter how many there are.

I tried to follow Mico's answer from (this question), but unfortunately completely failed. The original format.name function in my unsrt.bst file looks like this:

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

That's why I am confused where to change the lines. Wenn I change only the line like you wrote to

FUNCTION {format.names}
{ 's :=
  #1 'nameptr :=
  s num.names$ 'numnames :=
  numnames 'namesleft :=
    { namesleft #0 > }
    { s nameptr "{ff~}{vv~}{ll}{, jj}" format.name$ 't :=
      nameptr #1 >
        nameptr #3
          #1 + =
          numnames #1
          > and
            { "et al." 't :=
              #1 'namesleft := }
            'skip$
          if$
          namesleft #1 >
    }
    't
      if$
      nameptr #1 + 'nameptr :=
      namesleft #1 - 'namesleft :=
    }
  while$
}

it a) does not work and b) the connection of the references do not work anymore.

I know, that I don't have that much knowledge about this, this is why I ask how to solve the problem.

Thank you in advance!

der_user
  • 121

1 Answers1

2

Replace the below in your copy and try:

FUNCTION {format.names}
{ 's :=
  #1 'nameptr :=
  s num.names$ 'numnames :=
  numnames 'namesleft :=
    { namesleft #0 > }
    { s nameptr "{ff~}{vv~}{ll}{, jj}" format.name$ 't :=
      nameptr #1 >
    { nameptr #3 #1 + =
      numnames 
      #5 > and
      { "others" 't :=
        #1 
        'namesleft := }
        'skip$
      if$
    namesleft #1 >
        { ", " * t * }
        { numnames #2 >
        { "," * }
        'skip$
          if$
          t "others" =
        { " et~al." * }
        { " and " * t * }
          if$
        }
      if$
    }
    't
      if$
      nameptr #1 + 'nameptr :=
      namesleft #1 - 'namesleft :=
    }
  while$
}
Kumaresh PS
  • 1,267
  • Thank you very much. This works nicely, except some entries where this function does not work. But I think this is a problem in my bst-file.

    What I am a little worried about is, that the names are displayed differently, e.g. J Doe, J. Doe or John Doe.

    – der_user Aug 12 '16 at 08:59