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 putting together a CV in latex, and I am trying to get my list of publications to display in reverse chronological order. I can use \bibliographystyle{unsrt} as a workaround, and just order the entries manually, but I would naturally prefer if BibTeX did that for me.

Edit: Hmm... There seems to be no standard BibTeX style that does that, which is very surprising. I would expect that sorting publications in (reverse) chronological order is a common thing to do.

share|improve this question
    
If you cannot find an already-made solution, you may consider looking at ctan.org/tex-archive/macros/latex/contrib/custom-bib –  Willie Wong Oct 23 '10 at 18:46
add comment

5 Answers

up vote 7 down vote accepted

Google sprach: http://blog.plesslweb.ch/post/6628963116/bibtex-style-for-sorting-in-reverse-chronological-order

Haven't tested it myself. Good luck.

share|improve this answer
    
Der Website sprach auch: Not found... –  ℝaphink Sep 28 '11 at 15:38
    
add comment

Here's a solution using biblatex:

\documentclass{article}

\usepackage[sorting=ydnt]{biblatex}

\usepackage{filecontents}

\begin{filecontents}{\jobname.bib}
@misc{a01,
  author = {Author, A.},
  year = {2001},
  title = {Alpha},
}
@misc{b03,
  author = {Buthor, B.},
  year = {2003},
  title = {Bravo},
}
@misc{c02,
  author = {Cuthor, C.},
  year = {2002},
  title = {Charlie},
}
\end{filecontents}

\addbibresource{\jobname.bib}

\nocite{*}

\begin{document}

\printbibliography

\end{document}

enter image description here

See sections 3.1.2.1 and 3.5 of the biblatex documentation for details.

share|improve this answer
add comment

If you're willing to customise an existing style (any existing style which orders things in ascending date order), then take the corresponding .bst file, head to the bottom, and replace ITERATE {call.type$} with REVERSE {call.type$}.

Details: You can find the existing file with (on unixes) kpsewhich plain.bst (if you want to customize the plain style). Copy that file to, say, myplain.bst, edit it, and then use {myplain} as your bibliographystyle.

Edited to clarify which ITERATE call to change.

share|improve this answer
    
there are many lines with ITERATE like ITERATE {presort} or ITERATE {longest.label.pass} Which one is the good one? –  pedrosaurio Jun 23 '12 at 19:53
    
Good point. I edited the answer suitably. As Craig Finch's answer points out, to do a complete job would require adjusting the presort function to move the year field.or.null sortify line to the top of the function, but that's getting into more detailed .bst hacking. –  Norman Gray Jun 23 '12 at 21:19
add comment

The bibliography style plainyr is a good starting point if you don't want to (or cannot) use biblatex. This style is similar to plain, but sorts the references chronologically by year. To get reverse chronological order, copy plainyr.bst to another file (such as plainrevyr.bst). Edit the new file and replace every occurrence of ITERATE with REVERSE as described in the previous answer.

plainyr.bst is the best starting point because it is the only default style that uses date as the primary sorting field, as described in http://www.ee.ic.ac.uk/hp/staff/dmb/perl/b4w_using.html#Sort

If you attempt to replace ITERATE with REVERSE in any other style you will change the sort order, but not the primary sort field. For example, starting with ieeetr results in a bibliography that is mostly sorted in reverse chronological order...and mostly isn't good enough for your CV!

share|improve this answer
    
Simple yet awesome! –  Ivan Z. Xiao Dec 15 '11 at 23:35
add comment

I did this using the macro file makebst.tex, which takes you through a list of Q&A options, one of which is sort order.

I then copied over relevant chunks of code from the new .bst that macro made to the style file I actually wanted to use. The code copied:

FUNCTION {negate.year}
{ year empty$
    { "99999" }
    { year #1 #1 substring$ chr.to.int$ #105 swap$ - int.to.chr$
      year #2 #1 substring$ chr.to.int$ #105 swap$ - int.to.chr$ *
      year #3 #1 substring$ chr.to.int$ #105 swap$ - int.to.chr$ *
      year #4 #1 substring$ chr.to.int$ #105 swap$ - int.to.chr$ *
    }
    if$
}

I've now added month-based sorting (which is kind of ugly because the month three-letter abbreviations need to be parsed into #'s):

FUNCTION {sort.format.month}
{ 't :=
  t #1 #3 substring$ "l" change.case$ "jan" =
    { "01"  }
    { t #1 #3 substring$ "l" change.case$ "feb" =
      { "02"  }
      { t #1 #3 substring$ "l" change.case$ "mar" =
        { "03"  }
        { t #1 #3 substring$ "l" change.case$ "apr" =
          { "04"  }
          { t #1 #3 substring$ "l" change.case$ "may" =
            { "05"  }
            { t #1 #3 substring$ "l" change.case$ "jun" =
              { "06"  }
              { t #1 #3 substring$ "l" change.case$ "jul" =
                { "07"  }
                { t #1 #3 substring$ "l" change.case$ "aug" =
                  { "08"  }
                  { t #1 #3 substring$ "l" change.case$ "sep" =
                    { "09"  }
                    { t #1 #3 substring$ "l" change.case$ "oct" =
                      { "10"  }
                      { t #1 #3 substring$ "l" change.case$ "nov" =
                        { "11"  }
                        { t #1 #3 substring$ "l" change.case$ "dec" =
                          { "12"  }
                          { "00"  } % No match
                        if$
                        }
                      if$
                      }
                    if$
                    }
                  if$
                  }
                if$
                }
              if$
              }
            if$
            }
          if$
          }
        if$
        }
      if$
      }
    if$
    }
  if$
}

FUNCTION {negate.month}
{ month empty$
    { "999" }
    { 
      month sort.format.month #1 #1 substring$ chr.to.int$ #105 swap$ - int.to.chr$
      month sort.format.month #2 #1 substring$ chr.to.int$ #105 swap$ - int.to.chr$ *
    }
    if$
}

and bib.sort.order was replaced with:

FUNCTION {bib.sort.order}
{ sort.label
  "    "
  *
  negate.month field.or.null sortify
  swap$
  *
  negate.year field.or.null sortify
  swap$
  *
  "    "
  *
  title field.or.null
  sort.format.title
  *
  #1 entry.max$ substring$
  'sort.key$ :=
}

EDIT: Now sorts by year-then-month. I actually understand what all the code does now, too, which is an improvement.

share|improve this answer
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.