2

I found this answer to a very similar question: BibTeX: How to reduce long author lists to “Firstauthor et al.”?

However, the proposed solution did not work for me. I have a style provided by the publisher who, at the same time explains that the reference authors should be truncated after the third author (followed by et al)

in the file I found the { namesleft #1 > and changed it as instructed in that reply but it did not work. Can you help me?

{ 'bibinfo :=
 duplicate$ empty$ 'skip$ {
 's :=
 "" 't :=
 #1 'nameptr :=
 s num.names$ 'numnames :=
 numnames 'namesleft :=
   { namesleft #0 > }
   { s nameptr
     "{vv~}{ll}{ f{}}{ jj}"
     format.name$
     remove.dots
     bibinfo bibinfo.check
     't :=
     nameptr #1 >
      % {
       %  namesleft #1 >
nameptr #1 >
        {
         nameptr #3
         #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 *
               }
               { " " * t * }
             if$
           }
         if$
       }
       't
     if$
     nameptr #1 + 'nameptr :=
     namesleft #1 - 'namesleft :=
   }
 while$
 } if$
} ```
Mico
  • 506,678
Fabio61
  • 21
  • Welcome to TeX.SE. Please tell us which bibliography style you employ at present. If it's a nonstandard style, please indicate if it's available online. – Mico Sep 09 '20 at 21:59
  • Are you sure you copied the instructions in this answer -- shameless self-citation alert! -- correctly? Looking at the code you posted, it looks like the second instance of nameptr #1 > doesn't belong. – Mico Sep 09 '20 at 22:07
  • you are right: the second instance of nameptr #1 > does not belong to the correct instructions: I realized it and corrected but still it does not wotk. The style is available on the Springer website in a zipfile at: https://resource-cms.springernature.com/springer-cms/rest/v1/content/20568/data/v8 – Fabio61 Sep 09 '20 at 22:33
  • The link you furnished provides three bst files: spbasic, spphys, and spmpsci. Which one do you employ? – Mico Sep 09 '20 at 22:40
  • spbasic, sorry: I should have specified it! – Fabio61 Sep 09 '20 at 22:44
  • Please also clarify what "did not work for me" entails. E.g., do you get an error message? If so, what does it say? – Mico Sep 09 '20 at 22:56
  • It just lists all the authors in the bibliography, rather than the first three followed by "et al": same problem that in the related question I linked – Fabio61 Sep 09 '20 at 23:15
  • summarizing: the publisher provides the style but says that we should indicate the first three authors followed by et al; the provided style, instead, lists all the authors instead of the first three followed by et al. – Fabio61 Sep 09 '20 at 23:18
  • Mico, you are great! Thank you – Fabio61 Sep 10 '20 at 15:38
  • If my answer has fully addressed the typesetting issue(s) you were looking to solve, feel free to give it an "accept" checkmark. ;-) – Mico Sep 10 '20 at 18:11

1 Answers1

1

The OP has indicated in a comment that he/she uses the spbasic bibliography style that's supplied by Springer.

To achieve the desired formatting -- to show the names of all authors if an entry has at most 4 authors, but to show the first three authors only followed by "et al." if the entry has more than 4 authors -- I suggest you proceed as follows.

  • Make a copy of spbasic.bst and call the copy, say, spbasic85.bst.

  • Open the file spbasic85.bst in a text editor. The program you use to edit tex files will be fine.

  • Locate the function format.names. (In my copy of the bst file, the function starts on line 455.)

  • In this function, locate the following 2 lines:

          nameptr #1 >
            {
    
  • Immediately after these two lines, and hence before the line that says namesleft #1 >, insert the following 8 lines of code:

              nameptr #3
              #1 + =
              numnames #4
              > and
                { "others" 't :=
                  #1 'namesleft := }
                'skip$
              if$
    
  • Save the file spbasic85.bst either in the folder that contains the main tex file or a in a folder that's searched by BibTeX. If you select the latter option, be sure to also apply a suitable update to the filename database of your TeX distribution. (If you're not sure you understand the preceding sentence, I strongly suggest you select option 1...)

  • In your main tex file, change \bibliographystyle{spbasic} to \bibliographystyle{spbasic85} and perform a full recompile cycle -- LaTeX, BibTeX, and LaTeX twice more -- to propagate all changes.


A full MWE:

enter image description here

\documentclass{article}
\begin{filecontents}[overwrite]{mybib.bib}
  @misc{abc,author="A and B and C",title="X",year=3000}
  @misc{abcd,author="A and B and C and D",title="Y",year=3001}
  @misc{abcde,author="A and B and C and D and E",title="Z",year=3002}
\end{filecontents}

\usepackage[authoryear]{natbib} \bibliographystyle{spbasic85}

\begin{document} \cite{abc}, \cite{abcd}, \cite{abcde} \bibliography{mybib} \end{document}

Mico
  • 506,678