[Tex/LaTex] Displaying first author’s name in a bibliographic entry in the form: Surname, Initials and co-authors in the form: Initials, Surname

bibtex

I would like to format my references according to the following specifications:

Author: Surname, Initials, Co-authors: Initials, Surname

I am using natbib, abbrvnat for bibliography style and I guess I have to edit the .bst file (FUNCTION {format.names}).

I would appreciate if someone could help me with this or recommend something else.

Best Answer

To get the desired ordering of authors' first and last names, I suggest you do the following:

  • Find the file abbrvnat.bst in your TeX distribution. Make a copy of this file and name the copy, say, myabbrvnat.bst. (Don't edit a file from the TeX distribution directly.

  • Open the file myabbrvnat.bst in a text editor; the editor you use to edit your tex files will do fine.

  • Find the function format.names in the file. (In my copy of the file, this function starts on line 216. Delete all 27 or so lines of function; the last line will contain just a right curly brace, }.

  • Insert the following code chunk in the place of the deleted function:

    FUNCTION {format.names}
    { duplicate$ empty$ 'skip$ {
      's :=
      "" 't :=
      #1 'nameptr :=
      s num.names$ 'numnames :=
      numnames 'namesleft :=
        { namesleft #0 > }
        { s nameptr
          duplicate$ #1 >
            { "{f.~}{vv~}{ll}{, jj}" }
            { "{vv~}{ll}{, f.}{, jj}" }
          if$
          format.name$
          't :=
          nameptr #1 >
            {
              namesleft #1 >
                { ", " * t * }
                {
                  s nameptr "{ll}" format.name$ duplicate$ "others" =
                    { 't := }
                    { pop$ }
                  if$
                  "," *
                  t "others" =
                    { " et~al." * }
                    { " " * t * }
                  if$
                }
              if$
            }
            't
          if$
          nameptr #1 + 'nameptr :=
          namesleft #1 - 'namesleft :=
        }
      while$
      } if$
    }
    

    Do note that I've interpreted your specification as indicating that there should be no "and" connector word before the final author in the author list.

  • Save the file myabbrvnat.bst, either in the directory where your main tex file is located or in a folder that's searched by BibTeX. If you choose the latter method, be sure to udpate the filename database of your TeX distribution appropriately.

  • Start using the new bibliography style by replacing the instruction \bibliographystyle{abbrvnat} with \bibliographystyle{myabbrvnat}. Be sure to run LaTeX, BibTeX, and LaTeX twice more to fully propagate all changes.

Here's an example file:

enter image description here

\documentclass{article}
\usepackage[numbers]{natbib}
\bibliographystyle{myabbrvnat}

\usepackage{filecontents}
\begin{filecontents*}{mybib.bib}
@article{abc,
  author    = "Anna Anderson and Brenda Branson and Carla Carlson",
  title     = "Random thoughts",
  journal   = "Circularity Today",
  year      = 3001,
  volume    = 1,
  number    = 1,
  pages     = "1-100",
}
\end{filecontents*}

\begin{document}
\nocite{*}
\bibliography{mybib}
\end{document}