Can I force the amsalpha bibliography style to sort papers by the same authors chronologically?

I am using amsrefs package with the alphabetic option, which gives each reference a label such as [GLS07], or [Hap88]. Essentially the rule is that for single author papers, the label will consist of the first three letters of the surname, plus the last two digits of the year, and for papers with multiple authors the label will be the complete list of last initials, plus the last two digits of the year.

The amsrefs package overrules the \bibliographystle command, so this is omitted; the package is being run with the options abbrev, alphabetic and msc-links (alphabetic being the option that produces the alpha-style labels).

In the output, the references are sorted alphabetically by label. There is a question asking how to force the bibliography to be sorted alphabetically by author - I agree that this is not a good thing to do, as it will make it potentially harder for the reader to find the right reference, particularly if there are lots of them. However, sorting purely alphabetically by label puts, for example, [FZ00] before [FZ99]. To me this seems confusing - I understand that the 00 refers to the year 2000 and 99 to 1999, so [FZ99] should come before [FZ00]. Can I change this, ideally without having to manually specify the entire order of the bibliography?

(I guess there is a small additional question - do most people agree that you would look for [FZ00] after [FZ99]? If it's just me, I should probably leave it alone. I suppose there's an argument to be made that just as the reader doesn't necessarily know what the initials are for in order to search alphabetically by author in the list of references, they also don't know whether 00 is 1900 or 2000; but I think in this case it's easier to guess.)

Update: If I don't use amsrefs, and instead specify the style using \bibliographystyle{amsalpha}, then the problem goes away. But then I don't know how to use the abbrev and msc-links options, which I still want. It does seem that there should be a way to get this to work through amsrefs.

  • As far as I can tell, [FZ00] will come later than [FZ99]. About sorting by author and not by label, I disagree.
    – egreg
    Jul 17, 2014 at 11:12
  • That's interesting - I picked that example from an actual document that I've compiled. (It also puts [Lus91] after [Lus00]). I'm not sure of the best way to provide a minimal example of my code in this situation is, but I will try to come up with something. Jul 17, 2014 at 11:17
  • I don't really want to get into a discussion about sorting by author - AMS's own style guide insists that the sorting is by label, and I don't disagree with them, although I appreciate that some people do. Jul 17, 2014 at 11:18
  • In my experiment, if the year in the [FZ00] reference is 1900, it will come before [FZ99] (with year 1999); if the year is 2000, it will come later.
    – egreg
    Jul 17, 2014 at 11:18
  • That's extremely strange, and suggests I've somehow modified the default behaviour. I added a sentence to the question to explain how the bibliography is implemented - I've stopped short of including extracts from the .bib file because I don't think they'll be useful, but I can include them if you like. Jul 17, 2014 at 11:34

2 Answers 2


the canonical order of bibtex sort fields is the following: author(s) (or sort keys if an alpha sort is requested), year, title.

whether the bibtex ordering is controlled by a plain or an alpha .bst file, if the year of publication is the same, the element that will control the sort is the title. so if the title of the earlier part begins with "z", only special handling can force that to sort before an item with a title starting with "a". if the year of publication is different, and the second part was published in a year earlier than the first, the same problem holds.

let's take an extreme case. part "a" was published in 2000 and part "b" in 1999. this will result in sort keys (if an alpha style is used) for which the two-digit years sort the entries "out of order". even fiddling with how the title is sorted won't help here. the most direct approach is to adjust the year field in a way that won't affect the output except for the order of the entries.

the fact that multiple works by the same author(s) don't necessarily sort in logical order was recognized by the author of bibtex , who provided this workaround in the manual (texdoc bibtex) on page 4.

in the .bib database, add this command:

@PREAMBLE{ "\newcommand{\noopsort}[1]{} " }

this will be passed along to the .bbl file, from which it will be applied in the latex run.

in the affected item entries in the .bib file, modify the date fields to do your dirty work:

year = "{\noopsort{1999b}}1999"
year = "{\noopsort{1999a}}2000"

of course, the artificial sort field should be chosen so that these entries (according to the manual)

come out in a reasonable spot relative to the author's other works.

although the \noopsort technique could be applied to the title, always using the date should not have any untoward effect in future processing; only if additional books by the same author are added to the .bib file would it even have to be checked.


I have come up with a workaround solution that is fairly bad, but not as bad (to me) as modifying the .bib file somehow.

Load amsrefs with the option y2k, and run BibTeX (the option alphabetic should also be used). Then remove the y2k option before running LaTeX.

The reason this works is that amsrefs runs BibTeX using the biblipgraphy style amsxprt, which is a container for several styles - which style is selected depends on the options that are specified when loading amsrefs. When you run BibTeX, a .bbl file is output with the references in an order compatible with the alphabetical ordering of the labels that amsrefs will create. The labels that would be created using alphabetic and y2k include the full year, so sorting these labels alphabetically is equivalent to the sorting I want. If you then remove the y2k option again before running LaTeX, the shorter labels with only two digits of the year are created, but the references still appear in the order they appear in the .bbl file, so I get the sorting I wanted.

I would be interested to know if there is a way to tell amsrefs to use the style in amsxprt corresponding to choosing the options alphabetic and y2k (which is called amsry apparently), without having to actually select these options.

The design of amsrefs seems to make it fairly clear that the ordering I want to use is not the same as the ordering AMS want to use - except that if I use the bibliography style amsalpha (without amsrefs), I get the same labels but with my preferred sorting.

  • i think you mean amsrefs, not amsrfs. and please do look into the modification (in the .bib file) of the year field; that should fix the ordering once and for all, and allow you to reuse the .bib file for other projects. since it's recommended in the manual, it shouldn't be considered "cheating". Jul 17, 2014 at 17:30
  • I did, thanks! I will have a look in the manual - cheating was too strong, but I'd rather not change too much in the .bib file in case I change style later and get strange behaviour. Jul 17, 2014 at 19:32

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .