#StackBounty: #bibliographies #acronyms #key-value #amsrefs The 'inverted' attribute is not recognized if a DefineName abbrevi…

Bounty: 50

In Section 8.1 of the AMSRefs package documentation, it is explained that to properly typeset author names that are to be written with the family name first, one should set the attribute inverted on that name; for example: author={Li, Lian Jie}*{inverted={yes}} will typeset correctly as ‘Li Lian Jie’ (and not as ‘Li, Lian Jie’ or ‘Lian Jie Li’). Trying to use author={Li Lian Jie} to force the correct name will not work if, for instance, the option initials or the option alphabetic is called.

In Section 8.4, it is explained that one can write DefineName{dmj}{Jones, David M.} and then use the abbreviation as author={dmj} in any bib entry.

However, when I use an abbreviation in a bib entry, the inverted attribute is not recognized. This happens even if there are multiple authors in a bib entry and any one name is entered using an abbreviation, and even if that name is not the one to which the inverted attribute is being passed. Here’s an MCVE:



DefineName{aut-f}{Author, First}
DefineName{aut-s}{Author, Second}




    author={Author, First}*{inverted={yes}},
    author={Author, Second}*{inverted={yes}},
    title={Title of the paper},
    journal={Journal of interesting results},
    pages={8ndash 11},



The output for the above example looks like this:

Author First and Author Second, Title of the paper, Journal of interesting results 10 (2021), no. 3, 8–11. MR12345

Now, if I write author={aut-f} instead of author={Author, First}, the output changes to:

First Author and Second Author, Title of the paper, Journal of interesting results 10 (2021), no. 3, 8–11. MR12345

That is, it behaves as if the inverted attribute is not passed to any of the entries. The output remains as above regardless of how I mix and match the inverted attributes with the abbreviations.

I also tried adding *{inverted={yes}} to the DefineName commands, but that throws out LaTeX Error: Missing begin{document}.

Question: How can I get the inverted attribute to work with the DefineName abbreviations?

I tried looking at the documented source, but I was not really able to gather anything of use on my own. I noticed that DefineSimpleKey{prop}{inverted} is defined on line 236, and we have on lines 2450–2461:


But, I’m not sure how to relate this to the definition of DefineName given on lines 1244–1246:


I also looked at the documentation for the rkeyval package to find out whether the key value option *{inverted={yes}} needs to somehow be added to the definition of the command DefineName, but once again I didn’t get much out of it (being far too much of a novice). For instance, on page 3 of the rkeyval documentation the following is mentioned:

Test for a trailing option marked by a star. Usage:


Arg 1 of star@ is the code to be run, arg 2 is the default value of the option (could be empty). If arg 1 is moo, this test discards a star and expands to moo if a star is found, or expands to moo{#2} if not. As the example shows, arg 1 need not be a single token.

10 defstar@#1#2{%
11     defstar@a##1{#1}%
12     defstar@b{#1{#2}}%
13     futurelet@let@tokenstar@test
14 }
16 defstar@test{ifx*@let@token letstar@bstar@afi star@b}

Perhaps this is relevant? I’m honestly quite lost.

I noticed that if I define a command called DefineInvertedName analogously to DefineName as


then adding

DefineInvertedName{aut-f1}{Author, First}
DefineInvertedName{aut-s1}{Author, Second}

to the preamble in the MCVE above, and using author={aut-f1} and author={aut-s1} in the bib entry gives as output:

First Author and Author Second, Title of the paper, Journal of interesting results 10 (2021), no. 3, 8–11. MR12345

That is, only the last author entry is inverted. The same happens when I create a bib entry with more than two authors: only the last author entry is inverted. This is possibly a byproduct of the way multiple author entries are strung together by AMSRefs, but I’m not able to pinpoint exactly why it is so.

Get this bounty!!!

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.