[Tex/LaTex] natbib and abbrvnat: Reference per order of appearance

bibliographiesnatbib

I am using the package natbib with \bibliographystyle{abbrvnat} which produces almost exactly what I want (I can switch by between \cite , \citet …etc), however, I am facing the following two problems:

  1. References are not appearing in order of appearance. I can use \bibliographystyle{unsrtnat} but then, references will show the complet first and last name, which I don't want.
  2. References are shown in the format :

    L1. FamilyName1, L2. FamilyName2. Reference Tile. Journal Name, year.

    which I want to switch, so instead, I want to get:

    FamilyName1.L1 , FamilyName2.L2 . Reference Tile. Journal Name, year.

Does anyone have an idea?

Best Answer

You're posting contains two parts. The answers to both parts involve editing a copy of the bibliography style -- here, abbrvnat.bst. Begin by finding the file abbrvnat.bst in your TeX distribution and making a copy called, say, myabbrvnat.bst. (Do not edit a file from the TeX distribution directly.) Use any text editor you're familiar with to do the editing; the editor you use for your tex files will do fine. As I show below, the required edits happily to be minor and thus easy to apply.

  • Q1: How to change the listing of the bibliography items from being sorted alphabetically to being listed in the order they're cited in the body of the document?

    A1: In the file myabbrvnat.bst, find the two lines that start with SORT (uppercase is relevant). Comment out these lines -- or, if you prefer, just delete them.

  • Q2: How to change the typesetting of the author's name (or authors' names) from

    FirstNameInitial(s)1 FamilyName1[, FirstNameInitial(s)2 FamilyName2][, ...]

    to

    FamilyName1, FirstNameInitial(s)1[, FamilyName2, FirstNameInitial(s)2][, ...]

    A2: To invert the order of given names and surnames of authors, find the string

    "{f.~}{vv~}{ll}{, jj}" 
    

    (located in the function format.names, most likely on line 222) and change it to

    "{vv~}{ll}{, jj}{, f.}"
    

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

And, in your main tex file, change the instruction \bibliographystyle{abbrvnat} to \bibliographystyle{myabbrvnat} and run LaTeX, BibTeX, and LaTeX twice more to fully propagate all changes.

Related Question