Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I'm preparing a manuscript for submission to a journal that uses a citation format similar to natbib's authoryear, but that requires full author lists for in-text citations when there are three authors, as well as when there are two authors.

Is there a package or command that will do this automatically for me? The commands \citet* and \citep* from natbib are great, but they don't automatically identify cases where there are three or fewer authors. Furthermore it gets really tricky when I'm parenthetically citing multiple sources (in the same citation), some of which have three authors, and some of which have more authors.

share|improve this question
    
Welcome to TeX.SE! It would be helpful if you indicated which bibliography style (.bst) file you are using. The reason this would be helpful is because the natbib manual states that the "starred [citation command] versions can only list the full authors if the .bst file supports this feature; otherwise, the abbreviated list is printed." –  Mico Dec 15 '11 at 20:32
    
I'm using bes.bst. The BES here stands for British Ecological Society. But I'm pretty sure that this isn't really relevant. I'm not trying to use the starred citation format. The starred citation format works fine with this version of bst, but does not do what I want. What I want is something that will automatically identify citations with three authors, and expand those without messing with longer citation lists. –  Alex T. Dec 16 '11 at 16:05
    
Good news: "bes.bst" lends itself perfectly to the method I describe in my answer, viz., replacing the existing function "format.lab.names". The method works both with the ordinary and the starred versions of the \citet and \citep commands. The \citet and \citep commands will list all authors if there are fewer than four of them, and they'll generate a "FirstAuthor et al" citation in all other cases. –  Mico Dec 16 '11 at 16:21
add comment

1 Answer

Since you're submitting a paper to a journal that has certain formatting requirements for the paper's bibliography (and lots of other aspects of the paper too, no doubt!), you should ask (if you haven't already done so) for a BibTeX bibliography style (.bst) file that implements the journal's requirements. With any luck, this .bst file will be compatible with natbib and also implement the journal's house style (of making you cite the names of all authors of pieces that have three or fewer authors).

If you're not that lucky, there are three possibilities. First, if the .bst file is not compatible with natbib, you're obviously out of luck. (Fortunately, though, natbib is enormously robust and works with the overwhelming majority of .bst files.) Second, if the .bst file is compatible with natbib but does not contain a function called format.lab.names, you're also out of luck. That's what's meant, basically, by the statement in natbib's manual that "starred [citation command] versions can only list the full authors if the .bst file supports this feature." (Of course, such a .bst file must also provide a few functions that call the format.lab.names function...)

Third, if the .bst file does contain such a function but doesn't implement the journal's house style, i.e., if the \cite[pt]* macros output Adams et~al. for a piece has exactly three authors (and the first author's surname is "Adams"...), you are not out of luck. All you need to do is to replace the existing format.lab.names function with one that does obey the journal's house style. The existing format.lab.names function should (more or less...) look like:

FUNCTION {format.lab.names}
{ 's :=
  "" 't :=
  s #1 "{vv~}{ll}" format.name$
  s num.names$ duplicate$
  #2 >
    { pop$
      " " * bbl.etal *
    }
    { #2 <
        'skip$
        { s #2 "{ff }{vv }{ll}{ jj}" format.name$ "others" =
            {
              " " * bbl.etal *
            }
            { bbl.and space.word * s #2 "{vv~}{ll}" format.name$
              * }
          if$
        }
      if$
    }
  if$
}

You should replace this code with the following code:

FUNCTION {format.lab.names}
{'s :=
 "" 't :=
  #1 'nameptr :=
  s num.names$ 'numnames :=
  numnames 'namesleft :=
    { namesleft #0 > }
    { s nameptr
      "{vv~}{ll}" format.name$
      't :=
      nameptr #1 >
        {
          nameptr #2 =
          numnames #3 > and
            { "others" 't :=
              #1 'namesleft := }
            'skip$
          if$
          namesleft #1 >
            { ", " * t * }
            {
              s nameptr "{ll}" format.name$ duplicate$ "others" =
                { 't := }
                { pop$ }
              if$
                  t "others" =
                {
                  " " * bbl.etal *
                }
                {
                  numnames #2 >
                    { "," * }
                    'skip$
                  if$
                  bbl.and
                  space.word * t *
                }
              if$
            }
          if$
        }
        't
      if$
      nameptr #1 + 'nameptr :=
      namesleft #1 - 'namesleft :=
    }
  while$
}

After making this replacement, save the .bst file under a new name and adjust the \bibliographystyle command to point to the new file.

If you get complaints from BibTeX about nonexistent bbl.and and/or bbl.etal functions, just add the following code to the new .bst file (somewhere near the top of the file, soon after the start of the section in which the bibtex functions are defined):

FUNCTION {bbl.and}
{ "and"}
FUNCTION {bbl.etal}
{ "et~al." }
share|improve this answer
    
Okay, great!<br> I only had to make minor changes to your suggested replacement. In particular, the in-text citations use \& instead of bbl.and, and in order to not put a comma before the ampersand I changed the number of names after which to put a comma:<br> <code> numnames #3 > { "," * } 'skip$ if$ " \& " space.word * t * </code> –  Alex T. Dec 16 '11 at 16:30
    
In short, you found out how to get from "Eats, Shoots, and Leaves" to "Eats, Shoots & Leaves". :-) Congrats! –  Mico Dec 16 '11 at 17:18
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.