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 am using natbib and started with apa-good.bst and was able to make minor modifications; for example use full-name instead of abbreviated :) But even after reading several tutorials on the "unnamed programming language" used to specify bst files, I can't figure the following out:

I currently have {ll}, {ff} for all authors with an & before the last; i.e.:

  Aurnague, Michel, Hickmann, Maya, & Vieu, Laure

But I want only the first to be {ll}, {ff} and after one comma all other authors should follow as {ff} {ll}; i.e.:

  Aurnague, Michel, Maya Hickmann & Laure Vieu

Any hints are greatly appreciated. My prof won't let me change the bibliography to anything consistent :|

Here is the current format.names:

FUNCTION {format.names}
{ 'bibinfo :=
  duplicate$ empty$ 'skip$ {
  's :=
  "" 't :=
  #1 'nameptr :=
  s num.names$ 'numnames :=
  numnames 'namesleft :=
    { namesleft #0 > }
    { s nameptr
      "{vv~}{ll}{, ff}{, jj}"
      format.name$
      bibinfo bibinfo.check
      't :=
      nameptr #1 >
        {
          namesleft #1 >
            { ", " * t * }
            {
              "," *
              s nameptr "{ll}" format.name$ duplicate$ "others" =
                { 't := }
                { pop$ }
              if$
              t "others" =
                {
                  " " * bbl.etal *
                }
                {
                  "\&"
                  space.word * t *
                }
              if$
            }
          if$
        }
        't
      if$
      nameptr #1 + 'nameptr :=
      namesleft #1 - 'namesleft :=
    }
  while$
  } if$
}
share|improve this question
    
Welcome to TeX.SE! Please indicate whether you use the natbib (or a related) citation management package. –  Mico Mar 11 '12 at 10:24
    
@Mico thanks for the hint! i fixed it. –  Evilein Mar 11 '12 at 12:18

2 Answers 2

up vote 3 down vote accepted

The bibliography style file apa-good.bst, by default, indeed does not provide for different ordering of first and last names depending on whether or not the author/editor is listed first. Fortunately, though, adding this functionality isn't too hard to achieve.

Make a copy the file apa-good.bst and name the copy, say, myapa-good.bst. Then, in the function format.names (which starts on line 365 of my system's copy of this file, search for the following block of lines:

numnames 'namesleft :=
  { namesleft #0 > }
  { s nameptr
    "{vv~}{ll}{, ff}{, jj}"
    format.name$
    bibinfo bibinfo.check

and replace it with

numnames 'namesleft :=
  { namesleft #0 > }
  { s nameptr
    duplicate$ #1 >
      { "{ff }{vv~}{ll}{, jj}" }
      { "{vv~}{ll}{, ff}{, jj}" }
    if$
    format.name$
    bibinfo bibinfo.check

In these code snippets, I've already replaced {, f.} in the original bst file with {, ff} because you've indicated that you do not wish to abbreviate the authors' first names.

With this patch, you're instructing BibTeX to perform a check to see if the number of names of authors/editors left to be processed is greater than 1. If yes, it uses the formatting string {ff }{vv~}{ll}{, jj}; if no, i.e., if there's only one name left to be processed (which, because of BibTeX's "Reverse Polish Notation" method of handling the stack, must be the first author/editor), it uses the string {vv~}{ll}{, ff}{, jj}.

You should next store the new .bst file in a directory that's searched automatically by your TeX distribution and, if necessary, run texhash (or whichever command is appropriate for your TeX distribution) to update the distribution's filename database. Finally, be sure to issue the command

\bibliographystyle{myapa-good}

instead of \bibliographystyle{apa-good}.

Happy BibTeXing!

share|improve this answer
    
thanks that worked! –  Evilein Mar 26 '12 at 8:30

I would suggest a switch to biblatex for two reasons. The first is the biblatx-apa attempts to be fully compliant with APA6. The second is that the formatting is defined with "standard" LaTex macros and not bst styles.

share|improve this answer
    
thanks, i will definitely switch to biblatex in the long run (this whole stackexchange seems to agree that it's just better and reasonably easy to switch, e.g.: tex.stackexchange.com/questions/5091/… ). i will accept your answer unless someone comes up with a code-fix the next days (i have to submit a chapter next week and won't be able to switch the whole project so quickly). –  Evilein Mar 11 '12 at 12:18
    
Also, amsrefs is quite nice (though it has fewer features than biblatex, it has a benefit of being completely written in TeX - no external programs required at all!) –  mbork Mar 11 '12 at 16:51
    
While it is indeed the case that the biblatex-apa package makes every effort to make formatted references conform to the APA's guidelines, I wonder if that's what the OP is actually trying to achieve. After all, reversing the order of authors' first and last names would not appear to be something that's APA-compliant... –  Mico Mar 11 '12 at 17:22

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.