3

For aer.bst, citations with 3 or more authors are listed using et al. I need to modify the bibliography so that citations with 4 or more authors are listed using et al., but that citations with 3 authors have all the names written out. For example, I want "See Adams, Brown, and Clark (2003)" as opposed to "See Adams et al. (2003)." I'm using natbib with LaTex: \usepackage{natbib,har2nat}

In order to do that, I need to modify the function format.lab.names.abbr.

Might someone know how to do this?

FUNCTION {format.lab.names.abbr}
{ 'name.list :=
  name.list num.names$ 'numnames :=
  numnames #1 >
    { numnames #2 >
        { name.list #1 "{vv~}{ll}" format.name$ " et al." * }
        { name.list #2 "{ff }{vv }{ll}{ jj}" format.name$ "others" =
            { name.list #1 "{vv~}{ll}" format.name$ " et al." * }
            { name.list #1 "{vv~}{ll}" format.name$ " and " *
              name.list #2 "{vv~}{ll}" format.name$ *
            }
          if$
        }
      if$
      field.used editor.field = {", eds" *} {} if$
    }
    {
        name.list #1 "{vv~}{ll}" format.name$
        field.used editor.field = {", ed" *} {} if$
    }
  if$
}


FUNCTION {format.lab.names.full}
{ 'name.list :=
  #1 'nameptr :=
  name.list num.names$ 'numnames :=
  numnames 'namesleft :=
    { namesleft #0 > }
    { name.list nameptr "{vv~}{ll}" format.name$ 'temp :=
      nameptr #1 >
        { namesleft #1 >
            { ", " * temp * }
            { temp "others" =
                { " et~al." * }
                { " and " * temp * }
              if$
            }
          if$
        }
        'temp
      if$
      nameptr #1 + 'nameptr :=
      namesleft #1 - 'namesleft :=
    }
  while$
  numnames #1 > field.used editor.field = and {", eds" *} {} if$
  numnames #1 = field.used editor.field = and {", ed" *} {} if$
}
Mico
  • 506,678
  • Welcome to TeX.SE! Rather than hack an existing style file of unknown vintage and unknown interoperability with natbib, I suggest you run the makebst utility, which is a part of the custom-bib package, to create your own custom bibliography style file. The custom-bib package was created by the author of natbib, by the way. The process is really quite easy: it's a menu-driven set of queries, where each question comes with several choices. One of the questions will be about how you wish to truncate the number of authors shown in citation call-outs. – Mico Dec 04 '14 at 20:13
  • @Mico Thank you for your suggestion. For this task, I have the .bst file almost exactly as I need. This is the only tweak required. If possible, it would be ideal for me if it were possible to just slightly revise the .bst file. – user67403 Dec 04 '14 at 20:33
  • Depending on the internal structure of aer.bst, what you may call "tweaking" could turn out to be a bear of a job. Hence my recommendation to start from scratch. Incidentally, I'm an economist and have in the past tried to use the aer style, just for fun. I found it to be buggy, and hence I don't use it for my own working papers. If you happen to like the formatting that's produced by the aer style file, you'll find you're much better off in the long run spending five to ten minutes creating a new style file from scratch using the makebst utility. – Mico Dec 04 '14 at 20:38
  • @Mico Thanks a lot (and cool you are a fellow economist). For the link that you posted there, it has functions called "format.lab.names.abbr" and "format.lab.names.full", but no function called "format.lab.names." Any thought on what to do? – user67403 Dec 04 '14 at 20:52
  • Ah, I'd forgotten that the aer style generates a "full" call-out -- to the point of listing first names as well as surnames -- the first time a piece is cited and abbreviated call-outs thereafter. I believe the aer style is quite unique in this way. If you're adventurous and don't mind figuring out the how to do things using reverse polish notation (which is used by Bibtex's syntax), you could try to adapt the solution shown in the linked posting to both format.lab.names.full and format.lab.names.abbr. However, my main advice continues to be to be the same: run the makebst utility... – Mico Dec 04 '14 at 21:09
  • @Mico Thanks again. I know that the AER used to do that where an author's first and last name is given on first citation (e.g., Kenneth Arrow, 1973) and then just Arrow (1973) after that, but I don't think they do that anymore. It's strange that it would show up in the .bib file like that.

    If there's no way to edit the file, might you have any advice on using the makebst utility? Although I've been using LaTex for about 7 years, my knowledge is still fairly basic.The only thing I need to do is take the aer.bst file, and change from et al. starting on 3 authors to et al. starting on 4 authors.

    – user67403 Dec 05 '14 at 05:20
  • 1
    @Mico There is one other solution I noticed. I can use \cite. However, the issue with \cite is that it prints references as Berry, Levinsohn and Pakes (1995) instead of Berry, Levinsohn, and Pakes (1995) That is, it is missing the Oxford comma. This is strange because it seems to have it in the below link http://gking.harvard.edu/files/natnotes2.pdf. Any thoughts on how to get the comma back? – user67403 Dec 05 '14 at 06:54

1 Answers1

4

(This answer addresses only the matter of making the aer style insert an "Oxford comma". Since you're using the natbib citation management package, use \citet* and \citep* to generate citation call-outs that display the names of all authors/editors.)

To make the aer bibliography style insert an "Oxford comma" -- a comma just before the "and" particle that's inserted before the final item in the list of author/editor names, assuming the list contains three or more items -- you could apply the following edits:

  • Find the file aer.bst in your TeX distribution, make a copy of this file, and name the copy (say) aernc.bst. Don't edit an original file directly.

  • Open the file aernc.bst in a text editor, locate the function format.lab.names.full (which, in my copy of this file, starts on line 605), and in this function locate the line

                    { " and " * temp * }
    
  • Change this line to

                    { ", and " * temp * }
    
  • Save the file aernc.bst either to the directory where your main tex file is located or to a directory that's searched by BibTeX. If you choose the second option, be sure to update the filename database of your TeX distribution. Start using the new bibliography style by replacing \bibliographystyle{aer} with \bibliographystyle{aernc}. Be sure to run latex, bibtex, and latex twice more to fully propagate all changes.

Here's an MWE that uses \cite* for an entry with exactly three authors.

enter image description here

\documentclass{article}
\usepackage{filecontents}
\begin{filecontents*}{\jobname.bib}
@article{bbb,
  author = "Anna Andersen and Bert Branson",
  title  = "Thoughts",
  journal= "MyJournal",
  year   = 3002,
  volume = 1,
  number = 1,
  pages  = "1-100",
}
@article{ccc,
  author = "Anna Andersen and Bert Branson and Carla Carlsson",
  title  = "Thoughts",
  journal= "MyJournal",
  year   = 3003,
  volume = 1,
  number = 1,
  pages  = "1-100",
}
@article{ddd,
  author = "Anna Andersen and Bert Branson and Carla Carlsson and David Davies",
  title  = "Thoughts",
  journal= "MyJournal",
  year   = 3004,
  volume = 1,
  number = 1,
  pages  = "1-100",
}
\end{filecontents*}
\usepackage{natbib}
\bibliographystyle{aernc}
% \setcitestyle{aysep={}} % if you want to suppress the comma between author and year
\begin{document}
\cite{bbb}

\cite*{ccc}

\cite{ddd}
\bibliography{\jobname}
\end{document}
Mico
  • 506,678
  • I apologize, but I had an additional question. For formatting within parentheses, I need to eliminate the comma that comes before the year, e.g., "This paper draws on prior work (Berry, Levinsohn, and Pakes, 1995)." Specifically, I would like to eliminate the comma before 1995. Can that be done in aer.bst? – user67403 Dec 05 '14 at 23:48
  • @user67403 - Please take a few minutes to read and familiarize yourself with the natbib package's user guide. You'll find that the instruction \setcitestyle{aysep={}} will come in handy. – Mico Dec 06 '14 at 07:45