BibTeX style for sorting in reverse chronological order
When preparing a list of my publications, I had the wish to sort the publications in reverse chronological order. While this seems like quite a common task to me, I couldn’t find any BibTeX style that will do this trick. There is however the plainyr.bst style which is similar to the standard plain.bst BibTeX style, but sorts the entries in ascending chronological order.
Based on this style I created plainyr-rev.bst which uses plain formatting, i.e., the references are simply numbered, and sorts the references with the most recent references first.
You can download this style from my latex-goodies git repository at github.com. If you are not a git user yet, you can get a tarball of the files by using the download button.
I hope you find this style useful.
Generally plainyr-rev.bst seems to work, but I think I may have found an exception or two where the bib items are a bit scrambled. In one case, with the same single-author name, I get 2008, 1998, 1992, 1983, 1991, 1984, 1987. It would be a lot easier to show you some examples as attachments; which I can’t do here.
It seams to work well… nevertheless, wouldn’t be possible for the sort procedure to consider the month?
It sorts well, but I would like that it writes, for instance, the publications from December before the publications from September of the same year.
@Joao: Thanks pointing out this shortcoming of plainyr-rev.bst and for sending me a patch that adds this functionality. I have just integrated your changes into my code and pushed an updated version to github.
Thanks for your support in tracking down this problem. The problem was caused by BibTeX entries of type @manual and @proceedings, which are sorted differently.
I have modified the BibTeX style to treat these entries like ordinary entries. I have just pushed an enhanced version of plainyr-rev.bst to github. This version seems can handle the @manual and @proceeding types correctly. However, I’m not an expert in writing BibTeX styles (yet), so is a chance that I have accidentally broken something else.
Nice job. Works great. Thank you.
Hi,
thanks for your efforts, but your bst is still not enough
As far as I can understand, you basically took plainyr.bst and changed ITERATE {call.type$} into REVERSE {call.type$}: I already tried this solution, however with this trick, also the names are in reverted order (if the published dates are identical)!
Any idea how to solve it?
I think the correct procedure is to reverse the sortify of the date, hence changing something in the presort or year.sort functions, but I don’t know how
@Luca: I don’t understand your problem. I have never noticed a situation where the order author names is changed. Can you provide a specific test case?
That said, my BibTeX style is by no means perfect, e.g., one known limitation is that the month is not considered. Patches and comments by BibTeX wizards are highly welcome.
I just sent you an email,
thanks,
Luca
Hi!
I agree with Luca that one needs to reverse the years, not the complete ordering. Here is a function that computes 9999-year to allow for reverse chronological ordering of BibTeX entries.
Best regards,
Hans Ekkehard Plesser
Thanks Hans, this is exactly what I was looking for!
How can I upload the full bst file?
Hi Luca
I forgot to mention this on the blog, the changes proposed by Hans have been integrated already into my bibstyle and have been published on github. The latest version is available from http://github.com/plessl/latex-goodies/tree/master
Wow, this works nicely. It took me hours to find this and so I’m glad that it exists!
Thanks! This mostly seems to work well. I am having some trouble with the BibTex entries of type @unpubished, which I use for patents. Any suggestions about how to get this class included?
Disregard my previous comment. The mistake was mine and I got it fixed. plainyr-rev.bst is working great for me, and has saved me a lot of time and trouble. I actually also pulled the “month sorting” patch out of this code and added it to plainyr.bst (while reversing the numbers) and it has worked to add month sorting capabilities to that package as well. Thanks all!
Great job. Thanks a lot Hans.
Bye.