The reader should be familiar with the contents of the "theamsrefsPackage User's Guide" [1] (amsrdoc.tex). This causes you to display a pointer to the user guide on the terminal and in the log file.
Field names for the \bib command
The package can be used either in conjunction with BibTEX or as a replacement for BibTEX. Deferred formatting This means that the style of the bibliography can be easily changed without re-importing everything from the original database.
Bibliography entry types
PrintEditorsB This is similar to \PrintEditorsA, but puts parentheses around the entire list of editors. PrintReviews This is similar to \AuthorList, but is used to print (possibly multiple) MR numbers given in the summary field.
Overview
Normal L A TEX processing of cites
A \bibitem{moo} command writes one line to the .aux file: \bibcite {moo}{9}, where 9 is the current item number. This often happens if the .aux file is incomplete due to a TEX error on the previous pass.
How cites are processed by amsrefs
The .aux file is actually processed twice, once at the beginning of the document and once at the end. If there was no\citationor\bibcite in the .aux file for a given key, the \cite command should find that\b@xyzis is undefined.
Data structures
When a \bibcite command occurs in the .aux file, it will normally detect that \b@whatever is already defined, if the bibliography appears after all \cite commands. In the latter case, \bibcit should give a warning if the backref list is empty, since this means that there were no \cite commands for the given key.
Preliminaries
Utilities
The first argument is the \count register which will receive the final count;. the second argument is the control sequence that separates the elements of the list, and the third argument is the list itself. get@numberof\@tempcnta\do\dospecials. would count the number of special characters in \dospecials and store the count in\@tempcnta. safe@set. Note the use of \@empty to anchor the slashed substring to the end of the string.
Declaring package options
The ? option
Loading auxiliary packages
The lite option
Key-value setup
Standard field names (the bib group)
The only concern is about compatibility if you want to share your data with other people. The transition key is used when we want to insert punctuation or other material at a given point in the sequence unconditionally.
Auxiliary properties (the prop group)
Bibliography type specifications
One way to do this is to keep a list of fields to clear and have \bib@appenditerate above the list after \endgroup. BibSpecAlias This is a\defrater than a\let, because using \let\BibSpecAlias would make statements order sensitive in a way that often seems to be a stumbling block for unwary package writers.
The standard bibliography types
The biblist environment
ResetCapSFCodes This is probably here because there was a problem in the past with packages changing the \cat codes for uppercase.
Processing bibliography entries
Resolving cross-references
Bib field preprocessing
Date setup
Language setup
Citation label setup
Printing the bibliography
Name, journal and publisher abbreviations
Processing .ltb files
The line might contain something like\DefineName, so we need to expand the first macro in the line and see if it starts with\bib. But first we check to make sure that the token we are going to expand is not imported.
Citation processing
- The \citesel structure
 - The basic \cite command
 - Fancier \cite commands
 - The \nocite command
 - Citation sorting
 - Range compression
 - Munging the .aux file
 - Back references
 - hyperref, showkeys and shaderef support
 
It may be the last element of the range, but we won't know until we look at the next quote. So store the current quote in\prev@cite, setprevnum:=number, and go to state 2. Case b) number 6=prevnum+ 1. It might be the last element of the range, but again, we won't know until we examine the following quote.
The previous quote was the end of a range and the current quote is the start of a new range. In other words, when we encounter an optional argument, we must complete the previous range, print the current quote, and then return to the initial state. Most of the time arg 1 will already be defined, from a previous command\citedest in the .auxfile.
Lexical structure of names
Text accents
Here are all the standard LATEX highlights, as well as some non-standard highlights from theathscinetpackage.
Text symbols
All the following macros behave somewhat like \edef, in the sense that they do. defines \foo as the result of expanding the name and applying a certain transformation to it. This allows us to extract the first n characters from the name using TEX's macro argument swallowing mechanism without worrying about the accent being separated from the base letter. We don't expect to find a bib in the middle of atabbing around (right?), so.
The first argument is a text symbol; the second argument is the lowercase variant of the symbol. If they are the same (ie the first argument is a small text symbol), we \auto@protectit. Otherwise, if the argument was originally enclosed in braces, process it recursively before processing the rest of the token stream.
Name parsing
To circumvent these problems, instead of blindly swallowing macro arguments, we use \futurels to look ahead at certain strategic moments so that we can take appropriate action (see \get@namepart@d–f). We really only care about saving braces at the beginning of names (page 66), which simplifies things somewhat. name@split \name@split parses a name into its three parts and stores them in lastname\bib. bib' given and \bib'jr. If the initials option is in effect, it also extracts the initials from the given name and stores them in \bib'initials.
It expects the name being parsed to end with\@niland and contain at least three commas. So the usual way to call it is. name@split simply uses \get@namepart to peel off the last name and then passes control to \name@split@given. Otherwise, we'll call \get@namepart@f to read out a non-empty name, leaving \@let@token untouched so that \get@namepart@f knows what's coming.
Extracting initials
The algorithm
The implementation
If \process@dotsis is used first, the parentheses around the second "Yu" are removed, so the result is "Yu.-Y.". One difference is that there is no explicit continuation: instead, we iterate by repeatedly calling \process@one@hyphen@duntil until \@nilmarker is encountered. Because we have to stick to the above as a delimiter, \process@one@hyphen will always generate unwanted code at the end of the name.
Without them, a hyphen at the end of a given name (.e.g. author={Doe, John-}) would produce a very cryptic error message. Since it is legal for names to end with periods, we may still have an unwanted space at the end of the name, so we delete that as well. Note that we enclose the first argument in double brackets to avoid retesting\@let@token inside\@extract@initial.
Generating alphabetic labels
The algorithm
Finally, if there is only one author and the author's last name is a single word, the first three characters of that name are used. If those2koptions are in effect, or if the year is less than 1901, the entire year is used. Otherwise, the last two digits of the year are used.7 The combination of the author part and the year part will be referred to as the root.
If two or more objects have the same trunk, a suffix consisting of a lowercase Latin letter will be added to each label to make it unique. Note that when checking for duplicate trunks, we assume that bibliography items are displayed sorted by tag, meaning that all items with the same trunk will be contiguous. This sorting is done automatically by amsxport, but it is the responsibility of the document author to ensure the proper order if amsxport is not used.
The implementation
Second, there is the existing practice (at least in English) of ignoring diacritics so that, for example, "Ahl1999" and "¨Ahl1999" are considered identical. So the first thing we want to do is create a safe environment and normalize the names. Now we count the number of authors in the list and call the appropriate macro to calculate the author portion of the reference label.
At this point, the \current@vote is complete and we are ready to determine what suffix (if any) is needed to distinguish it from the previous label. Under the alphabetical option \previous@year and \current@year will always be the same (namely both will be empty), but including the test also allows this code to work with the author-year option.
Generating short alphabetic labels
Formatting series
PrinteSeries@a For \PrintSeries@a, the first arg is the iterator function present in the list, which is arg 3. If there was also a penalty at the end of the hlys (presumably the result of a \line break at the end of a field value), it moves the penalty to the argument. The current space factor is equal to the \sfcode of the punctuation mark we're adding, which means the mark is already on the list.
The current space factor is equal to the special value\@nopunctsfcode, which means that\nopunctis specified. Plural takes one argument and prints it if there are two or more elements in the current list. SingularPlural takes two arguments and prints the first one if there was only one element, otherwise it prints the second arg.
Formatting names and series of names
The order of the last two arguments is reversed to make it moderately easier to use; cf.\PrintEditorsA, etc. The first name in a series is treated differently than other names in the author-year style, so we use a separate formatting macro for it. PrinteditorsA When we consider editor names, we have to think about some further complications.
First, in the case of a book that lists the editors' names instead of the authors' names, just copy the same style with a little text added at the end.
The partial field
Special formatting for other fields
We have taken some special care to parse the date information beforehand, so this function just discards arg 1 and uses the already parsed value. PrintYear You can use \PrintYear if you want to suppress month/day even when specified in the data.
B ib TEX support
Implementing package options
The alphabetic option
The shortalphabetic option
The backrefs option
The citation-order option
The initials option
The logical-quotes option
The non-compressed-cites option
The non-sorted-cites option
The short-journals option
The short-publishers option
The short-months option
The y2k option
The bibtex-style option
The msc-links option
The author-year option
Have to play around with the space factor otherwise the comma between name and year will not be applied. The usual \endinput to ensure that random garbage at the end of the file is not copied by docstrip. Numbers written in italics refer to the page where the corresponding entry is described; underlined numbers refer to the code line of the definition; numbers in Roman refer to the code lines where the entry is used.