1

I am using a achemso.bst file for my bibliography. But I want to increase the number of authors shown before the et al. is used. Normally I would just increase this number numnames #15. But that only works when I decrease the number. When I increase the value to let's say 20. Nothing changes and the paper with 18 authors is still et abbreviated with et al.

You can find the complete file here: https://github.com/AlbertDeFusco/texmf/blob/master/bibtex/bst/jpc/achemso.bst

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

Actually, my initial Idea was correct. As Marjin pointed out there was an issue in my references which used and others

7
  • I didn't test it but I guess #15 > is postfix notation for #1 > 5, with #1 being the total number of names. So you would need something like #120 >.
    – Marijn
    Nov 27, 2022 at 12:53
  • numnames #15 > I think it refers to numnames > #15
    – Janosch
    Nov 27, 2022 at 14:44
  • You are right, I tested it now and indeed #15 refers to the number 15. However, when I increase it to 16, or 20, it does actually work and it shows more authors in the bibliography. Did you make sure to run BibTeX again, and does it actually use your modified style? A good way to make sure is to rename the bst to for example modachemso.bst and then call it using \bibliographystyle{modachemso}, this prevents the original style to be loaded in case BibTeX can't find the file for whatever reason. Also, what does your entry with 18 authors look like, maybe there is something strange there?
    – Marijn
    Nov 27, 2022 at 15:28
  • The function format.names doesn't look anything like that in the standard achemso release. I see you are using v1 from Mats Dahlgren in the late 1990s: was this deliberate?
    – Joseph Wright
    Nov 27, 2022 at 17:16
  • @JosephWright ah you could be correct I just copied one from the web. Maybe it is an older Vesion.
    – Janosch
    Nov 28, 2022 at 13:00

2 Answers 2

1

All that should be needed with the current release of achemso is to adjust the relevant user-exposed setting, which can be done from LaTeX if loading the achemso package:

\begin{filecontents*}[overwrite]{\jobname.bib}
@ARTICLE{Demo,
  author = {
    Author One and
    Author Two and
    Author Three and
    Authro Four and
    Author Five and
    Author Six and
    Author Seven and
    Author Eight and
    Author Nine and
    Author Ten and
    Author Eleven and
    Author Twelve and
    Author Thirteen and
    Author Fourteen and
    Author Fifteen and
    Author Sixteen and
    Author Seventeen and
    Author Eighteen},
  title = {A demo publciations},
  journal = {J.~Irrep.~Res.},
  year = {2022},
  pages = {1--18},
}
\end{filecontents*}

\documentclass{article}
\usepackage{achemso}
\setkeys{acs}{maxauthors = 18}
\begin{document}

\cite{Demo}
\bibliography{\jobname}

\end{document}

If you are not loading the package, you will need to create the appropriate control citation with a value for ctrl-etal-number.

5
  • When I use the control citation, nothing changes. However, the first reference in my bibliography is then an empty one. And the second reference I the one, that should be the first one
    – Janosch
    Nov 28, 2022 at 13:23
  • @Janosch Without an example, I can't really help: the MWE I've posted works properly with an up-to-date TeX system
    – Joseph Wright
    Nov 28, 2022 at 21:33
  • Yes sorry I provided the correct answer but it was not accepted and thus hidden. The problem was that some references included and others which will always result in the use of et al.. This often happens when you take the bib entry from scholar
    – Janosch
    Dec 1, 2022 at 9:20
  • @Janosch I've undeleted: it feels like an answer for your specific case, although as I've said in general one can adjust the behaviour without editing the .bst for release-achemso.
    – Joseph Wright
    Dec 1, 2022 at 9:33
  • Thanks, yes when I am using the default achemso.bst which is already provided by overleaf it also worked by including the control reference. bibliographystyle{achemso} However, when I am using my own style file: \bibliographystyle{achemsoNew.bst}the control reference will be treated as a regular reference
    – Janosch
    Dec 1, 2022 at 9:44
0

My originally mentioned solution of changing numnames #15to a larger value does work. However, you need to make sure that in your .bib file all others are actually listed and no and others is contained in the author field. As soon as and others is included achemso will only use the first author in combination with et al.

0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .