1

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.

Mico
  • 506,678
GioR
  • 113
  • 3

1 Answers1

1

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}
Mico
  • 506,678
  • Hi Mico, many thanks for your help. It works fine. I just added an and at ' { " " * t * } ' and now is ' { " and " * t * } ' in order to have the and before the last author. At last, do you know how I can specify the 'et al.' after a certain number of authors? Thanks a lot, Giorgos. – GioR Sep 04 '14 at 08:22
  • @gioR - Glad you found my answer useful. :-) On your follow-up question: Do you want to truncate the list of authors in the citation callout or in the bib entries? – Mico Sep 04 '14 at 11:19
  • I would like to truncate the list of authors in the citation callout. Giorgos – GioR Sep 04 '14 at 11:22
  • If you load the natbib citation management package, the styles abbrvnat and myabbrvnat will automatically truncate the citation callout to FirstAuthor et al for entries with three or more authors. – Mico Sep 04 '14 at 11:24
  • It seems that it doesn't work. When I compile my manuscript it prints all the authors in the references list. In particular, I would like to print 'et al.' after the 6th author. Giorgos – GioR Sep 04 '14 at 11:44
  • @gioR - So you do want truncation of the list of authors in the references rather than in the citations. For instructions on how to truncate the list of authors in a bib entry, see the answers to the posting BibTeX: How can I automatically reduce long author lists to "xxx et al."? The accepted answer works on the unsrt style, but the instructions apply to other styles as well, including abbrv and abbrvnat. – Mico Sep 04 '14 at 15:49
  • You are right, it's my fault. I meant the bib entries. I saw the post you recommended and now I have what I want. Many thanks for your help. – GioR Sep 05 '14 at 09:02
  • @Mico This is alsomost right for a question I got, but bibtex is complaining about a missing definition for bibinfo.check, not sure if the current abbrevnat.bst is newer than the version this question is made for. Any suggestions? – daleif Feb 27 '17 at 13:33
  • @daleif - It's been a while since I wrote this answer, and I can't quite remember what all I did. (I probably cribbed much of the code from a test run of the makebst utility.) Let me get back to you later today with a full answer. In the meantime, simply deleting the lines (strings) 'bibinfo := and bibinfo bibinfo.check should get you going -- assuming all author names are well-formed. I suspect the bibinfo.check function is there to issue an alert if one or more names are not well formed. I need to figure out what a suitable version of the function bibinfo.check should look like. – Mico Feb 27 '17 at 14:41
  • 1
    @daleif - I decided to make the temporary fix "official", i.e., to simply drop all uses of bibinfo and bibinfo.check in the replacement code. – Mico Feb 27 '17 at 18:34