summaryrefslogtreecommitdiff
path: root/macros/amstex/doc
diff options
context:
space:
mode:
Diffstat (limited to 'macros/amstex/doc')
-rw-r--r--macros/amstex/doc/amsguide.pdfbin0 -> 265147 bytes
-rw-r--r--macros/amstex/doc/amsguide.tex2098
-rw-r--r--macros/amstex/doc/amsppt.doc3399
-rw-r--r--macros/amstex/doc/amsppt.faq194
-rw-r--r--macros/amstex/doc/amsppt.txt1447
-rw-r--r--macros/amstex/doc/amstex.txt3468
-rw-r--r--macros/amstex/doc/amstinst.pdfbin0 -> 54708 bytes
-rw-r--r--macros/amstex/doc/amstinst.tex415
-rw-r--r--macros/amstex/doc/joyerr2.tex319
9 files changed, 11340 insertions, 0 deletions
diff --git a/macros/amstex/doc/amsguide.pdf b/macros/amstex/doc/amsguide.pdf
new file mode 100644
index 0000000000..e6f7307711
--- /dev/null
+++ b/macros/amstex/doc/amsguide.pdf
Binary files differ
diff --git a/macros/amstex/doc/amsguide.tex b/macros/amstex/doc/amsguide.tex
new file mode 100644
index 0000000000..1219dc1d6d
--- /dev/null
+++ b/macros/amstex/doc/amsguide.tex
@@ -0,0 +1,2098 @@
+%%% ====================================================================
+%%% @TeX-file{
+%%% filename = "amsguide.tex",
+%%% version = "2.2",
+%%% date = "2001/08/07",
+%%% time = "16:41:48 EDT",
+%%% checksum = "38601 2098 10156 78439",
+%%% filetype = "AMS-TeX: user documentation",
+%%% author = "American Mathematical Society",
+%%% copyright = "Copyright 2001 American Mathematical Society,
+%%% all rights reserved. Copying of this file is
+%%% authorized only if either:
+%%% (1) you make absolutely no changes to your copy,
+%%% including name; OR
+%%% (2) if you do make changes, you first rename it
+%%% to some other name.",
+%%% address = "American Mathematical Society,
+%%% Technical Support,
+%%% Publications Technical Group,
+%%% P. O. Box 6248,
+%%% Providence, RI 02940,
+%%% USA",
+%%% telephone = "401-455-4080 or (in the USA and Canada)
+%%% 800-321-4AMS (321-4267)",
+%%% FAX = "401-331-3842",
+%%% email = "tech-support@ams.org (Internet)",
+%%% codetable = "ISO/ASCII",
+%%% keywords = "amstex, ams-tex, tex",
+%%% supported = "yes",
+%%% abstract = "This file is the User's Guide describing the use of
+%%% AMS-TeX 2.2. Installation instructions are found
+%%% in appendix B, in file amstinst.tex.",
+%%% docstring = "The checksum field above contains a CRC-16 checksum
+%%% as the first value, followed by the equivalent of
+%%% the standard UNIX wc (word count) utility output of
+%%% lines, words, and characters. This is produced by
+%%% Robert Solovay's checksum utility.",
+%%% }
+%%% ====================================================================
+%
+% In addition to plain TeX and standard CM fonts, TeXing this file
+% requires the following files and fonts:
+%
+% amstex.tex (version 2.1 or later)
+% amsppt.sty (version 2.1 or later)
+% amsppt.sti (version 2.1 or later)
+% amssym.tex
+% msam10
+% msbm10
+% eufm10
+% cmex7
+% cmex8
+% cmbsy7
+% cmcsc8
+% amstinst.tex (Appendices B and C to this User's Guide)
+%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\input amstex
+\documentstyle{amsppt}
+
+\define\GuideVersion{2.2}
+\define\GuideDate{August 2001}
+
+\font\tenss=cmss10
+
+\long\def\usertype#1{\smallskip
+ \moveright2pc\vbox{\def\par{\crcr}\halign{%
+ \setbox0\hbox{\tt##}%
+ \hbox\ifdim\wd0<10pc to10pc\fi{\unhbox0\hfil}%
+ \kern1pc \it $\langle$return$\rangle$\hss
+ \cr#1\crcr}}%
+ \smallskip}
+\long\def\systype#1{{\rightskip=4pc\leftskip=4pc\noindent\tt #1\par}}
+
+% Change default dimensions and fonts
+\pageheight{49pc}
+\dropfoliodepth=2pc
+\hfuzz1pc % to suppress reporting of slightly overfull boxes.
+\aboveheadskip=2\bigskipamount
+\belowheadskip=\medskipamount
+\subheadskip=\bigskipamount
+\addto\tenpoint{\abovedisplayskip=6pt plus2pt minus3pt
+ \belowdisplayskip=\abovedisplayskip}
+\loadbold
+% Prevent hyphenation of "amsppt":
+\hyphenation{amsppt}
+
+% Macros for text substitution and for presentation of examples.
+%
+\define\Textures{{\it Textures\/}}
+\define\AMS{American Mathematical Society}
+\define\JAMS{{\it Journal of the \AMS}}
+\define\JoT{{\it The Joy of \TeX{}}}
+\define\Joy{{\it Joy}}
+
+\def\filnam#1{{\tt\ignorespaces#1\unskip}}
+\hyphenchar\tentt=-1 % to prohibit hyphenation in tt text
+
+\newdimen\exindent \exindent=2\parindent
+% Add a high penalty to discourage line breaks within an example
+% without absolutely prohibiting them.
+{\obeylines
+ \gdef^^M{\par\penalty9999}%
+ \gdef\beginexample#1{\medskip\bgroup %
+ \def~{\char`\~}%
+ \NoBlackBoxes\tt\frenchspacing %
+ \parindent=0pt#1\leftskip=\exindent\obeylines}
+}% end \obeylines
+\def\endexample{\endgraf\egroup\medskip}
+\newdimen\exboxwidth
+\exboxwidth=3in
+\def\exbox#1#2{\noindent \hangindent=\exboxwidth
+ \leavevmode\llap{\null\rm#1\unskip\enspace}%
+ \hbox to\exboxwidth{\tt\ignorespaces#2\hss}\rm\ignorespaces}
+\chardef\\=`\\ \chardef\{=`\{ \chardef\}=`\}
+\def\<#1>{{\it$\langle$#1\/$\rangle$}}
+\def\Dimen{\<dimen>}
+
+\catcode`\@=11
+\def\cs#1{\leavevmode
+% Save the previous skip and put it back after the penalty 0
+% so that the penalty0 won't cause a blank at the end of a line.
+ \skip@\lastskip\unskip\penalty\z@
+ \ifdim\skip@>\z@ \hskip\skip@\fi
+ {\tt\char`\\\ignorespaces#1\unskip}}
+
+% Redefine the \subhead macro to be on a line by itself and omit period.
+\outer\def\subhead#1\endsubhead{\par\penaltyandskip@{-100}\subheadskip
+ \noindent{\subheadfont@\ignorespaces#1\unskip\endgraf}\nobreak\noindent}
+
+% Define macros for presentation of tables of symbols.
+\def\BBB#1{\par\bigbreak
+ \leavevmode\llap{$\bullet$\enspace}{\bf#1}}
+\newdimen\biggest
+\setbox0\hbox{$\dashrightarrow$}\biggest=\wd0
+\def\1#1{\hbox to\biggest{\hfill$\csname#1\endcsname$\hfill}\ \ %
+ \cs{#1}}
+\def\fudge{\hbox to\biggest{}\ \ \hphantom{\tt\char'134 }}
+
+\def\getID@#1{\edef\next@{\expandafter\meaning\csname#1\endcsname}%
+ \expandafter\getID@@\next@0\getID@@}
+\def\getID@@#1"#2#3#4#5#6\getID@@{\def\next@{#6}%
+ \edef\msafam@{\the\msafam}\edef\msbfam@{\the\msbfam}%
+ \ifx\next@\empty
+ \edef\next@{\number"#2}%
+ \ifx\next@\msafam@
+ \def\ID@{10#3#4}%
+ \else
+ \ifx\next@\msbfam@
+ \def\ID@{20#3#4}%
+ \else\message{Invalid family IDs for msam/msbm fonts, path 2}%
+ \fi\fi
+ \else
+ \edef\next@{\number"#3}%
+ \ifx\next@\msafam@
+ \def\ID@{1#2#4#5}%
+ \else
+ \ifx\next@\msbfam@
+ \def\ID@{2#2#4#5}%
+ \else\message{Invalid family IDs for msam/msbm fonts, path 3}%
+ \fi\fi
+ \fi}
+\def\2#1{\hbox to.5\hsize
+ {\hbox to\biggest{\hfill$\csname#1\endcsname$\hfill}\ \ %
+ \getID@{#1}{\tt\ID@}\ \ \cs{#1}\hfill}}
+\def\3#1#2{\hbox to.5\hsize
+ {\hbox to\biggest{\hfil$\csname#1\endcsname$\hfil}\ \ %
+ \getID@{#1}{\tt\ID@}\ \ \cs{#1}, \cs{#2}\hss}}
+\def\4#1{\hbox to.5\hsize
+ {\hbox to\biggest{\hfill$\csname#1\endcsname$\hfill}\ \ %
+ \getID@{#1}{\tt\ID@}\ \ \cs{#1}\ \ {\eightpoint(U)}\hfill}}
+
+\catcode`\@=\active
+
+\define\thismonth{\ifcase\month % case 0 --- impossible!
+ \or January\or February\or March\or April\or May\or June%
+ \or July\or August\or September\or October\or November%
+ \or December\fi}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% TITLE PAGE
+
+% Quarantine the large fonts used for the title page
+\begingroup
+\font\fourtn=cmr10 scaled \magstep2
+\font\fourtnsy=cmsy10 scaled \magstep3
+\font\fourtnbf=cmbx10 scaled \magstep3
+\textfont2=\fourtnsy
+
+\shipout\vbox to\vsize{%
+\parindent=0pt
+\vskip5pc
+\rightline{\fourtnbf User's Guide to \AmSTeX{}}
+\bigskip
+\rightline{\fourtn Version \GuideVersion}
+\medskip
+\rightline{\fourtn \GuideDate}
+%\rightline{\fourtn {\thismonth} {\number\year}}
+
+\vfill
+
+\tenpoint
+
+This publication was typeset using \AmSTeX{}, the American
+Mathematical\newline \quad Society's \TeX{} macro system.
+
+Copyright \copyright{} 2001 by the \AMS{}.
+
+All rights reserved. Any material in this guide may be reproduced or
+duplicated for personal or educational use.
+
+\medskip
+\begingroup\obeylines
+\TeX{} is a trademark of the \AMS{}.
+\endgroup
+}% End of vbox being shipped out
+\endgroup
+
+%% END TITLE PAGE
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\topmatter
+\title\nofrills User's Guide to \AmSTeX{} Version 2.2\endtitle
+
+%\date {\thismonth} {\number\year}\enddate
+\date \GuideDate\enddate
+
+\toc
+\widestnumber\head{7}
+\head 1. Overview\endhead
+\head 2. Formatting Features\endhead
+\head 3. Mathematical Constructions\endhead
+\head 4. Fonts\endhead
+\head 5. Symbol Names\endhead
+\head 6. Other Things You Ought to Know\endhead
+\head 7. Getting Help\endhead
+\head {} References\endhead
+\head {} Appendix A. Sample Bibliography Input and Output\endhead
+\head {} Appendix B. Installation Procedures\endhead
+\head {} Appendix C. Before Installing \AmSTeX: Facts About Fonts\endhead
+\endtoc
+
+\endtopmatter
+\document
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\head 1. Overview\endhead
+
+\AmSTeX{} is a macro package for \TeX{}, designed to simplify the input
+of mathematical material and format the output according to preset style
+specifications. Although the \AMS{} holds the copyright for \AmSTeX{},
+its use is not restricted, but is encouraged for the preparation of
+manuscripts intended for publication both in the Society's books and
+journals, and also in other mathematical literature.
+
+Version 2.0 of \AmSTeX{} was released in 1990, concurrent with the
+publication of the second edition of \JoT{}. It contained numerous
+minor improvements and bug fixes, as well as some major changes
+involving additional fonts. Version 2.1 was first released in 1991;
+interim updates are identified by changes in release date. The present
+version 2.2 was released in August 2001. This User's Guide describes all
+the new and changed features from these versions and how to use them,
+with further additions and revisions pertaining to the current release.
+Topics are grouped by type, and then presented in roughly the same order
+as they appear in \JoT{}.
+
+This User's Guide assumes that you already have a copy of \JoT{}. It
+contains references to specific sections that won't help you much if you
+don't have a copy. It also assumes for the most part that you will be
+using the ``preprint style'', a set of macros that provides features
+specific to the formatting of a document, such as headings, page
+numbers, and the like. If you are planning to use the preprint style,
+you will also need to have a copy of AMSFonts Version~2.2. \JoT{} and
+AMSFonts 2.2 are available from the \AMS{} and other distributors.
+
+\subhead Files Comprising the \AmSTeX{} Version~2.2 package
+\endsubhead
+
+The following files are contained in the \AmSTeX{} Version~2.2 package
+distributed by the \AMS{}:
+\medskip
+\settabs\+\indent&\filnam{amsguide.tex}\qquad&\kern.6\hsize\cr
+\+&\filnam{amstex.tex}&
+ the \AmSTeX{} Version 2.2 macros\cr
+\+&\filnam{amstex.bug}&
+ a chronicle of bug fixes to \filnam{amstex.tex} and
+ \filnam{amsppt.sty},\cr
+\+&& as well as known open bugs\cr
+\+&\filnam{amssym.tex}&
+ macros defining the symbols in fonts \filnam{msam} and
+ \filnam{msbm}\cr
+\+&\filnam{amsppt.sty}&
+ the preprint style for \AmSTeX{} Version 2.2\cr
+\+&\filnam{amsppt.sti}&
+ initialization options for the \AmSTeX{} 2.2 preprint style\cr
+\+&\filnam{amsppt.doc}&
+ technical documentation for \filnam{amsppt.sty}\cr
+\+&\filnam{amsppt.faq}&
+ some frequently asked questions and answers about \AmSTeX{}\cr
+\+&\filnam{amsguide.tex}&
+ the source file for this User's Guide\cr
+\+&\filnam{amstinst.tex}&
+ the source file for Installation Procedures;\cr
+\+&& appendices to this User's Guide\cr
+\+&\filnam{amsppt1.tex}&
+ a backward compatibility file for use with documents\cr
+\+&& already completed using \AmSTeX{} versions earlier than 2.0\cr
+\+&\filnam{joyerr.tex}&
+ errata to \JoT{} (first edition)\cr
+\+&\filnam{joyerr2.tex}&
+ errata to \JoT{} (second edition)\cr
+\+&\filnam{amstex.ini}&
+ used in creating format files\cr
+\medskip
+
+The file \filnam{amsppt.doc} is an {\smc ascii} file, and is
+not intended to be processed with \TeX{}\null. This documentation file
+is arranged in the same order as the macro file that it describes, and
+explains the intent and mechanics of the macros in detail. A separate
+file (\filnam{amstex.doc}), documenting the file \filnam{amstex.tex},
+is available on request.
+
+In addition, other files are used during installation.
+For instructions on installing the \AmSTeX{} macros and preprint style,
+see Appendix B\null. This appendix describes the installation process
+for \TeX{} systems based on the \TeX{} Directory Structure (TDS), and
+also gives suggestions for installation on other systems.
+
+\subhead General Description of Changes\endsubhead
+
+\AmSTeX{} 2.0+, the preprint style, and their technical
+documentation are the result of a joint effort begun by Michael Spivak
+and extended by the Composition Technical Support group of the \AMS{}.
+
+In version 2.0 of \AmSTeX{}, the following changes were made:
+\widestnumber\item{10}
+\roster
+\item All known bugs were eliminated.
+\item Messages were added identifying the current versions of
+ \filnam{amstex.tex} and \filnam{amsppt.sty}, to be displayed on your
+ terminal screen and in the log file.
+\item Some error and help messages were changed for the sake of
+ clarity or to provide more information.
+\item Refinements were made to conserve memory space.
+\item The CM versions of the Computer Modern fonts were substituted for the
+ older AM versions.
+\item Support for additional fonts was added.
+
+ \itemitem{(a)} \filnam{amstex.tex} provides the mechanism for accessing
+ the Euler and extra symbol fonts of the AMSFonts collection.
+ \itemitem{(b)} The preprint style assumes that fonts \filnam{msam},
+ \filnam{msbm}, and \filnam{eufm} are installed and available.
+
+\item Changes were made to the preprint style to make it conform
+ more closely to the style of AMS publications, in particular, the \JAMS.
+
+ \itemitem{(a)} Running heads were made automatic; they can be suppressed
+ if desired.
+ \itemitem{(b)} Additional elements are recognized in both the top matter
+ and the body of a document, and the input syntax was regularized.
+ \itemitem{(c)} Footnotes were changed to have normal indentation.%
+ \footnote{Like this.}
+ \itemitem{(d)} The style of the references was changed considerably.
+
+\item The ability to produce roman-numeral page numbers using the
+ plain \TeX{} convention (negative \cs{pageno}) was added.
+\item In the preprint style, mathematics-oriented hyphenation exceptions
+ were added. (These follow American, not British, rules.)
+\item An option was added in the preprint style that
+ allows documents to be formatted
+ as chapters of a monograph rather than as separate papers.
+\item Finally, some optional formatting features requested by
+ \AmSTeX{} users were added to the preprint style.
+\endroster
+
+\medskip
+In version 2.1, the following changes were made:
+\roster
+\item \cs{curraddr}, \cs{rom}, and \cs{linespacing} were added.
+\item Additional error conditions were identified and supplied with more
+ informative messages.
+\item A sporadic line-breaking problem in the preprint style references
+ section was remedied.
+\item Some bugs introduced into the preprint style during the
+ version 2.0 changes were found and eliminated.
+\item Use of the Euler fonts other than medium Euler Fraktur was
+ made more convenient.
+\item The ability to use multiple \cs{thanks} commands was added.
+\item The \cs{proclaim} font was changed from slanted to italic, and
+ \cs{proclaimfont} provided so that users can change it if desired.
+\item \cs{nologo} was reinstated.
+\item The installation instructions were revised and augmented.
+\item The backward compatibility file \filnam{amsppt1.tex} was added.
+\endroster
+
+\medskip
+These changes were made in the January 1997 release:
+\roster
+\item Bugs reported since the release of version 2.1 were fixed.
+\item \cs{urladdr} was added; \cs{linespacing} was documented.
+\item Bibliographic elements were added for {\it Math.\ Reviews},
+ {\it CMP\/} and AMS preprint server references.
+\item Various changes were made to permit easier customization:
+
+ \itemitem{(a)} Command names were given to fonts and dimensions used
+ in various environments.
+ \itemitem{(b)} Changeable end-of-document processing was split out
+ and associated with a new command name.
+ \itemitem{(c)} The output routine was simplified.
+ \itemitem{(d)} Initialization options that a user might want to
+ suppress to save space were moved into a separate file,
+ \filnam{amsppt.sti}
+
+\item Page dimensions were changed in the preprint style to match the
+ current AMS publication specifications.
+\item The mechanism for loading AMSFonts was changed to make it easier
+ for a user to specify the use of a PostScript outline version.
+\item The installation instructions were updated and augmented.
+\endroster
+
+These changes were made in version 2.2:
+\roster
+\item Bugs reported since the release of version 2.1 were fixed.
+\item The requirement to acknowledge use of \AmSTeX{} was removed, and
+ the copyright statement and restriction notice is no longer printed
+ out on the terminal every time \AmSTeX{} starts up.
+\item The installation instructions were completely revised, and based
+ on the \TeX{} Directory Structure (TDS) used by most current \TeX{}
+ distributions.
+\item a \cs{subjclassyear} command was provided to allow a particular
+ version of the Mathematics Subject Classification to be cited.
+\endroster
+
+\subhead This User's Guide\endsubhead
+
+This User's Guide has been prepared using \AmSTeX{} Version~2.2 with the
+preprint style. Some changes have been made: font and dimension settings
+have been reset, the macros for headings have been redefined to produce a
+result more suited to documentation, and some {\it ad hoc\/} macros have
+been defined to simplify the presentation of particular information.
+However, in general, this document and the file from which it was produced
+illustrate the general appearance and input for a preprint with running
+heads. Printing the output of \TeX{} for this Guide requires AMSFonts
+Version~2.0 or later
+(users of AMSFonts Version~2.0 are strongly encouraged to upgrade to
+Version~2.2).
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\head 2. Formatting Features
+\endhead
+
+Formatting documents prepared with \AmSTeX{} is accomplished by a
+``style file''. The features described here are part of the preprint
+style. The \AmSTeX{} preprint style, Version~2.2, will format an input
+file in a manner suitable for a paper in a journal, unless the style of
+a \cs{Monograph} is explicitly selected. Unless noted otherwise,
+the journal style is the style described below.
+
+\setbox1=\hbox{\tt\\dedicatory...\\enddedicatory\ }
+\setbox0=\vbox{\hsize=\wd1\parindent=0pt\tt\obeylines
+ \strut\\title...\\endtitle
+ \\author...\\endauthor
+ \\affil...\\endaffil
+ \\address...\\endaddress
+ \\curraddr...\\endcurraddr
+ \\email...\\endemail
+ \\urladdr...\\endurladdr
+ \\thanks...\\endthanks
+ \\dedicatory...\\enddedicatory
+ \\date...\\enddate
+ \\translator...\\endtranslator
+ \\keywords...\\endkeywords
+ \\subjclass...\\endsubjclass
+ \strut\\abstract...\\endabstract\endgraf}
+\setbox1=\hbox{$\dsize\left\lbrace\,\vcenter{\vphantom{\copy0}}\right.
+ \nulldelimiterspace=0pt$}%
+\setbox2=\hbox{\kern-\wd1$\dsize\left\lbrace\,\vcenter{\copy0}\right\rbrace$}
+
+\subhead Top Matter\endsubhead
+
+Some commands affect the appearance of a whole document. Such commands
+should go at the top of your input file, right after the \cs{documentstyle}
+line and before the \cs{topmatter} line. This area will be referred to as
+the ``preamble''. Commands that should be in the preamble include
+\cs{define}, \cs{TagsOnRight} and the like,
+\cs{NoPageNumbers}, \cs{NoRunningHeads}, \cs{Monograph},
+\cs{pagewidth}, \cs{pageheight}, \cs{pageno},
+and commands that load fonts.
+The preamble is relevant to any document, whether paper or monograph.
+
+The beginning of an \AmSTeX{} file should look something like what
+is shown in Figure 1.
+
+\topinsert
+
+\beginexample{}
+\\input amstex
+\\documentstyle\{...\}
+\medskip
+\<preamble commands, such as \cs{define}, \cs{pageno}, \cs{Monograph},
+\leavevmode\hbox to20pt{}\cs{NoRunningHeads}, \cs{loadbold}, etc.>
+\medskip
+\\topmatter
+\indent\box2
+\strut\\endtopmatter
+\\document
+\endexample
+
+\botcaption {Figure 1} The beginning of an \AmSTeX{} file
+\endcaption
+\endinsert
+
+If any \cs{end...}\ tag is omitted (or misspelled), an error message will
+appear at \cs{endtopmatter} or at the next blank line: for example, if
+you misspell \cs{endtitle}, the message will be something like
+``{\tt !~Paragraph ended before \cs{title} was
+com\discretionary{-}{}{}plete}.'' If you omit \cs{endtopmatter}, there
+won't be any error message, but none of the topmatter material will
+print. %{\tolerance2000\par}
+Tags should be omitted for any top matter elements for which there is
+no data; if ``empty'' tags are included, empty footnotes may appear on
+the first page, or labels indicating addresses at the end of a paper.
+
+If you have documents that were prepared for versions of \AmSTeX{}
+earlier than version 2.0, you may find the file \filnam{amsppt1.tex}
+useful. By including the line \cs{input amsppt1} immediately after the
+\cs{documentstyle} line, the topmatter commands and the sectioning
+commands that changed in form will work in the original way. Other than
+that, there should be few incompatibility problems with previous
+versions. Note: The use of \filnam{amsppt1.tex} is discouraged except
+for processing preexisting files.
+
+For multi-line titles, affiliations, authors, or dedications (basically
+everywhere that lines are centered individually rather than being set in
+paragraphs), line breaks are obtained by using \cs{\\}. In other parts
+of the topmatter, which are set in paragraph form, line breaks are
+obtained by \cs{linebreak}.
+
+The title will be set in uppercase. To turn off the automatic
+uppercasing, use the \cs{nofrills} option:
+\cs{title\\nofrills...\\endtitle}.
+
+Each author is tagged separately, followed by address(es) and other
+information associated with that author.
+
+Normally, the address given with \cs{address} is the address of the
+author at the time the research was being done; if the author's
+address at the time of publication is different, the current address
+should be given with \cs{curraddr}. This should be entered immediately
+following the \cs{address} for the same author. If a \cs{curraddr} is
+not paired with an \cs{address}, the current address will not print.
+
+Electronic mail addresses can be tagged \cs{email...\\endemail}.
+Like \cs{curraddr}, every \cs{email} address must be paired with a regular
+\cs{address}, otherwise the e-mail address will not print.
+The \cs{email} address will be printed at the end of the paper, as
+``{\it E-mail address:\/} \<net-address>'', following the address (and
+current address, if present) with which it is paired.
+
+URLs, the addresses of ``home pages'' on the World Wide Web, can be
+included using \cs{urladdr...\\endurladdr}. They behave in the same
+manner as \cs{email} addresses.
+
+The \cs{thanks} command is provided for acknowledgments of grant support
+and other kinds of support for the author's research, or other general
+information not covered by one of the predefined tags such as
+\cs{keywords} or \cs{subjclass}. The information will be printed as an
+unnumbered footnote at the bottom of the first page. Like \cs{address},
+\cs{thanks} can be used more than once, and is associated with a
+particular author.
+
+In case a paper has not only an author but a translator, \cs{translator}
+is provided. This information will be printed at the end of the paper in
+eight-point roman, as ``Translated by'' followed by the translator's name
+in uppercase.
+
+The \cs{dedicatory} command is used for such things as
+``Dedicated to Professor X on the occasion of his eightieth birthday.''
+The dedication will appear in italics, before the abstract.
+
+The information for \cs{keywords} and \cs{subjclass} appears as
+unnumbered footnotes at the foot of the first page, as in AMS journals.
+In a monograph chapter they will not print at all, since they should be
+handled separately, as part of the front matter for the monograph.
+By default, for backward compatibility, the 1991 Mathematics Subject
+Classification will be cited; to specify the 2000 Mathematics Subject
+Classification, enter
+\beginexample{}
+\\subjclassyear\{2000\}
+\\subjclass ...\\endsubjclass
+\endexample
+
+The abstract heading ``{\eightpoint\smc Abstract.}''\ appears in caps
+and small caps, in the same size (eight point) as the abstract itself.
+
+A simple table of contents setup is available. Tables of contents
+are typed in the topmatter along with everything else (except for
+monographs---see the section {\bf Book Formatting} below), using
+\cs{toc...\\endtoc}.
+\beginexample{}
+\\toc
+\\specialhead...\\endspecialhead
+\\head...\\endhead
+\\subhead...\\endsubhead
+\\subsubhead...\\endsubsubhead
+\\endtoc
+\endexample
+\noindent
+The syntax of the parts is identical to the syntax used
+for headings within the document (see the sections {\bf Headings} and
+{\bf Book Formatting} below), so that for those who wish to do so
+and have a capable text editor, the table of contents can be constructed
+by extracting the relevant lines from the main text.\footnote{But note that
+the original line breaks in multi-line headings would not be appropriate
+for the table of contents, so you'd want to remove any \cs{\\}es that
+might be present.}
+
+Page numbers aren't usually appropriate for the short table of contents
+that might appear in a journal article, but if desired, page numbers can
+be entered in a manner similar to that for a monograph; see the section
+{\bf Book Formatting} below.
+
+The hanging indentation within a table of contents for \cs{head} and
+\cs{subhead} is preset to accommodate numbers of the form
+``1.''\ and ``1.1.''\ respectively; the amount of indentation can
+be adjusted by using \cs{widestnumber}:
+\beginexample{}
+\\toc
+\\widestnumber\\head\{10\}
+\\widestnumber\\subhead\{10.1\}
+...
+\endexample
+\noindent This can be done more than once within different sections of
+the table of contents, if desired.
+
+If the ``section number'' of a \cs{head} happens to be something like
+``Appendix'' (as actually happens in this User's Guide), a pair
+of empty braces should be entered before it, as follows:
+\beginexample{}
+\\head \{\}\ Appendix. Sample bibliography input ...\\endhead
+\endexample
+\noindent
+Insertion of {\tt\{\}} followed by a space at the beginning of the heading
+text will cause the entire entry to be set flush left as a unit.
+
+If you are preparing a monograph, the format and content of the top matter
+will be different. See the section below on {\bf Book Formatting} for
+details.
+
+
+\subhead Headings \endsubhead
+
+There are four levels of headings (not counting
+\cs{title}):
+\beginexample{}
+\\specialhead...\\endspecialhead
+\\head...\\endhead
+\\subhead...\\endsubhead
+\\subsubhead...\\endsubsubhead
+\endexample
+\noindent The heading of
+this section was typed as
+\beginexample{}
+\\head 2. Formatting Features
+\\endhead
+\endexample
+
+\noindent And the subheading for this subsection was typed as
+\beginexample{}
+\\subhead Headings\\endsubhead
+\endexample
+\noindent
+Ordinarily, subheadings in the preprint style are run into the text, but for
+this User's Guide, the style varies slightly.
+
+\indent\cs{specialhead} is for long articles that need extra divisions at
+a level above the \cs{head} level. In the preprint style
+\cs{specialhead} uses boldface type and is set ragged right; \cs{head}
+is small caps, centered; \cs{subhead} is boldface, flush left,
+run in with the following text; and
+\cs{subsubhead} is italic, indented as for an ordinary paragraph, and run
+into the text.
+
+Explicit line breaks are obtained by a \cs{\\} in a \cs{head} or a
+\cs{specialhead}, but for \cs{subhead} and \cs{subsubhead},
+which are part of their paragraph, just use \cs{linebreak} as
+you would in normal paragraphed text.
+
+If you are preparing a monograph, the styles of headings will be different.
+See the section below on {\bf Book Formatting} for details.
+
+
+\subhead Theorems and Proofs \endsubhead
+
+In addition to the usual proclamations and demonstrations, mathematicians
+may pose other kinds of propositions, which editors may prefer to see
+presented in different styles. The following have been provided in
+the preprint style.
+\beginexample{}
+\\definition...\\enddefinition
+\\example...\\endexample
+\\remark...\\endremark
+\endexample
+\noindent
+The proof of any proclamation is indicated by \cs{demo...}\cs{enddemo}.
+
+Note that all kinds of proclamations, demonstrations and propositions
+must be ended explicitly; a check for proper endings is included with
+all classes of proclamations and a missing \cs{end...} is reported.
+
+In the preprint style \cs{definition} and \cs{example} have
+the spacing and heading font of \cs{proclaim}, but are in roman.
+\cs{remark} resembles \cs{demo}
+except that extra space added at the end of a proof by \cs{enddemo}
+is not added by \cs{endremark}.
+
+In accordance with the style of the \JAMS, the labels on \cs{proclaim}s
+and similar constructions are now printed in boldface type (\cs{bf})
+and the text in italic (\cs{it}). (The command \cs{proclaimfont} is
+provided so that a user can change the text of a proclamation to
+slanted type if desired: \cs{redefine\\proclaimfont\{\\sl\}}.)
+
+It is conventional in mathematical publishing to use roman, upright
+numbers and punctuation even in the midst of
+italic text, to avoid visual conflicts with numbers and punctuation in
+adjacent math formulas. Since dedicated ``mathematical text italic''
+fonts containing roman numbers and punctuation are not currently
+available, the \filnam{amsppt} preprint style provides a command
+\cs{rom} to be applied inside theorems and other stretches of
+italic text, to give the desired results.
+For example, to~produce
+
+\proclaim{Proposition 2.5} Let $S_1,\dots,S_m$ be the components
+of a $J$-holomorphic cusp-curve $S$ and suppose that each
+component $S_i$ is \rom(a multiple covering of\rom) a regular
+curve and that Assumption \rom{(1.4a)} is satisfied. \dots
+\endproclaim
+
+\noindent you would use \cs{rom} in the following places:
+\beginexample{}
+each component \$S\char`\_i\$ is \\rom(a multiple covering of\\rom) a
+regular curve and that Assumption \\rom\{(1.4a)\} is satisfied
+\endexample
+
+As you can see, \cs{rom} is used like the math font command \cs{roman}:
+it applies to the next single character or the next group enclosed in
+braces.
+
+\subhead Other Devices \endsubhead
+
+For a list produced by \cs{roster}, the amount of indentation can be
+adjusted to accommodate wide item numbers. Just before beginning the
+\cs{roster}, type, for example, \cs{widestnumber\\item\{(viii)\}}.
+This adjustment is temporary. The default will be reinstated by
+\cs{endroster}.
+
+The command \cs{cite} produces
+a reference citation in roman type, within square brackets: \cite{21}.
+
+A structure \cs{block...}\cs{endblock} is provided for quotations.
+It is intended for use in the middle of a paragraph to quote an
+extract from another source.
+
+
+\subhead Book Formatting \endsubhead
+
+If you are preparing a monograph, several features are available in the
+preprint style that will make your output look like chapters rather than
+individual papers.
+
+First of all, you must signal your intentions by typing \cs{Monograph}
+in the preamble, right after the \cs{documentstyle} line.
+
+A typical topmatter section for a monograph chapter would be typed
+like this:
+\beginexample{}
+\\documentstyle\{amsppt\}
+\\Monograph
+\\topmatter
+\\title\\chapter\{4\} Matrix Algebras\\endtitle
+\\endtopmatter
+\endexample
+\noindent which produces a chapter heading that looks like this:
+\bigskip
+\vbox{
+\centerline{\eightpoint CHAPTER IV}
+\bigskip
+\centerline{\bf MATRIX ALGEBRAS}}
+\bigskip
+\noindent
+Notice that the number is converted automatically to roman numerals and
+the word ``{\eightpoint CHAPTER}'' is added. For a chapter title that
+needs a different sort of treatment, \cs{nofrills} can be used:
+
+\beginexample{}
+\\topmatter
+\\title\\chapter\\nofrills\{APPENDIX D\} The Poisson Integral\\endtitle
+\\endtopmatter
+\endexample
+\noindent This produces
+\bigskip
+\vbox{
+\centerline{\eightpoint APPENDIX D}
+\bigskip
+\centerline{\bf THE POISSON INTEGRAL}}
+\bigskip
+\noindent The replacement \cs{chapter} text will appear exactly as
+typed.
+
+Finally, for things like a preface or introduction which have no
+pretitle text at all, omit the \cs{chapter} command:
+\beginexample{}
+\\topmatter
+\\title Preface\\endtitle
+\\endtopmatter
+\endexample
+
+In monographs, the table of contents is usually treated as a separate
+chapter. Start by typing the title ``Contents'' as for a preface or
+introduction, and then use the \cs{toc...\\endtoc} structure as the
+body of the document (rather than putting it in the topmatter, as you
+would for a journal article).
+\beginexample{}
+\\topmatter
+\\title Contents\\endtitle
+\\endtopmatter
+\bigskip
+\\document
+\\toc
+\\title Preface\\page\{vii\}\\endtitle
+\\title\\chapter\{1\} Matrix Algebras\\page\{1\}\\endtitle
+\\head \{\} Continuous complex-valued functions\\page\{1\}\\endhead
+...
+\\title Bibliography\\page\{307\}\\endtitle
+\\endtoc
+\\enddocument
+\endexample
+
+The chapter titles listed in the table of contents are typed in the same
+way as in actual use. To get page numbers in the table of contents, use
+\cs{page} as shown, just before the ending of an element. This option
+is available for all levels of headings.
+
+In a monograph using the preprint style, the chapter title is used for
+the left running head and the text of section headings
+(from \cs{head}) appears as the right running head.
+It's not uncommon for the text of a heading to be too long to fit
+in the running head width; in such a case use \cs{rightheadtext} to
+specify a shortened form of the heading for use in the running heads:
+\beginexample{}
+\\head Fourier coefficients of continuous periodic functions
+of bounded entropy norm\\endhead
+\\rightheadtext\{Fourier coefficients of periodic functions\}
+\endexample
+\noindent This should follow immediately after the \cs{head}, to ensure
+that both take effect on the same page. If the chapter title is too long
+to fit as a running head, a shortened form can be supplied in a similar
+way with \cs{leftheadtext} immediately after the \cs{title}.
+See also the section~{\bf Running Heads}.
+
+The style for a chapter of a monograph differs in some particulars from the
+style for a paper. The text of a \cs{head} will be boldface instead of
+small caps; headings of theorems, propositions, definitions, remarks, etc\.
+will be small caps instead of boldface, and indented rather than flush
+left.
+
+
+\subhead Inserts with Captions \endsubhead
+
+Figures, tables, and some other kinds of objects are often handled as
+inserts. These objects may be prepared separately from the main document
+and pasted in, in which case space must be left for them.
+These objects usually have captions; a caption may be positioned above (for
+a table) or below (for a figure).
+
+An insert may be specified for the top or ``middle'' of a page, i.e.,
+right where the input for the insert occurs in the text. These are
+typed as \cs{topinsert} and \cs{midinsert} respectively.
+Furthermore, a caption may be placed at the top or the bottom of the insert,
+using the tags \cs{topcaption} and \cs{botcaption} respectively.
+
+The general structure used to specify an insert with a caption at the top is:
+\beginexample{}
+\\topinsert\quad{\rm or}\quad \\midinsert
+\cs{captionwidth}\{\Dimen\}\quad{\rm(optional)}
+\\topcaption\{\<caption label>\}
+\ \<optional caption text>
+\\endcaption
+\cs{vspace}\{\Dimen\}\quad{\rm or}\quad%
+ \<optional code for the insertion body>
+\\endinsert
+\endexample
+
+Here the notation \Dimen{} means a valid \TeX{} dimension as
+described in the {\bf Dimensions} section of \JoT{}.
+If a bottom caption was desired, \cs{topcaption} would be replaced by
+\cs{botcaption}, and
+the \cs{vspace} command (or the
+optional code for the insertion body) would be moved before the
+\cs{botcaption} macro.
+
+The \cs{vspace\{\Dimen\}} option would be used to leave blank space for
+an object to be pasted into place. The value of the \Dimen{} should be
+the exact height of the object to be pasted in, because extra space
+around the object and the caption are dependent on the document style,
+and will be provided automatically.
+
+The \cs{captionwidth\{\Dimen\}} option may be used to override the default
+caption width specified by the document style.
+
+The \<caption label> is something like ``Figure~1'' or ``Table~2a''.
+Do not type any final punctuation; it will be provided. The caption
+label will be set in caps and small caps.
+
+The \<optional caption text> is any descriptive text that may be desired.
+The preprint style will set this in roman. Even if there is no text, the
+\cs{endcaption} tag must be present.
+
+If you choose to include the \TeX{} code for a figure, table, or other
+captioned object in the input, then omit the \cs{vspace} command
+and type the code where appropriate (before \cs{botcaption}
+or after the \cs{endcaption} of \cs{topcaption}).
+
+Sometimes a table is small enough that it is not necessary to put it in an
+insert. If the caption is to appear above it, input can be typed as follows:
+\beginexample{}
+\\topcaption\{\<caption label>\}
+\ \<optional caption text>
+\\endcaption
+\ \<code for the table body>
+\endexample
+\noindent
+The form of the input would be the following if the caption is to appear below:
+\beginexample{}
+\ \<code for the table body>
+\\botcaption\{\<caption label>\}
+\ \<optional caption text>
+\\endcaption
+\endexample
+\noindent
+To avoid page-breaking problems,
+this form of ``insertion'' should be used only for very small objects.
+
+
+\subhead Page Numbers \endsubhead
+
+If you are using the preprint style, page numbers will appear in the running
+heads, at the outside margin, except for the first page, where the running head
+will be omitted and the page number will be centered at the bottom of the page.
+
+If you wish to omit page numbers, type \cs{NoPageNumbers} in the preamble
+of the document (after the \cs{documentstyle} line).
+The running head text will remain; see also {\bf Running Heads}.
+
+You can get roman numeral page numbers, e.g.\ for a table of contents or
+preface, using the normal \TeX{} convention of \cs{pageno} plus
+a negative number.
+
+
+\subhead Page Size and Line Spacing \endsubhead
+
+In the preprint style, the default page width is 30pc, and the default
+height is 50.5pc.
+You can change the size of the page by typing
+\beginexample{}
+\\pagewidth\{\Dimen\}\newline
+\\pageheight\{\Dimen\}
+\endexample
+\noindent using suitable \Dimen{}s, where by this notation we mean a
+valid \TeX{} dimension as described in the {\bf Dimensions} section of
+\JoT{}.
+
+The spacing between lines in the preprint style is ordinarily 2pt greater
+than the nominal type size. This can be changed by providing a multiplication
+factor to the command \cs{linespacing}; for example, \cs{linespacing\{1.5\}}
+gives the effect of typewritten doublespacing.
+
+
+\subhead QED \endsubhead
+
+In the preprint style, \cs{qed} gives an open box `$\square$',
+separated from what precedes it by a quad of space.
+
+
+\subhead Running Heads \endsubhead
+
+If you are using the preprint style, running heads similar to those in
+\Joy{} will appear, with text in the center and page numbers to the
+outside. (On the first page, as usual, the running head is omitted, and
+the page number is placed at the bottom.)
+
+If you do nothing to define the text of the running heads, the author's
+name will be used on the left-hand and the title on the right-hand pages.
+(This is the style for papers; for monographs, see below.)
+If you want some other values, say a shortened title, you
+can redefine the text to appear on left- and right-hand pages by typing
+\beginexample{}
+\\leftheadtext\{\<left running head text>\}
+\\rightheadtext\{\<right running head text>\}
+\endexample
+
+\noindent These instructions can appear anywhere after the
+\cs{documentstyle} command, but the most
+common place to use them is immediately after a \cs{title} or
+\cs{author} or \cs{head} to override the automatic running head text.
+If \cs{rightheadtext} or \cs{leftheadtext} is specified above the
+topmatter, \cs{title} and \cs{author} will not override them.
+
+If you are doing a monograph rather than a journal article, and use
+the \cs{Monograph} switch, it affects the running heads as follows:
+The chapter title appears in the left-hand running heads, and the text of
+the current section heading (from \cs{head}) appears in the right-hand
+running heads. In chapters that don't contain any \cs{head}s---for
+example, a foreword---both the left- and right-hand running heads
+will contain the chapter title.
+
+By default, running heads will be uppercase. This is a frill that
+can be turned off by \cs{nofrills}, e.g.,
+\beginexample{}
+\\rightheadtext\\nofrills\{Text of Running Head\}
+\endexample
+
+If for some reason you don't want running heads at all, type
+\cs{NoRunningHeads} in the preamble of the document (after the
+\cs{documentstyle} line). When running heads are omitted, page numbers
+will appear centered at the bottom of the page. (And even those can be
+turned off using \cs{NoPageNumbers}.)
+
+In a monograph, if you don't want
+the text from the section \cs{head}s to appear in the running heads
+you must redefine the internal command, \cs{headmark}, that is used
+by \cs{head} to set the right-hand running head. To do this, put the
+following line in your document file, after \cs{Monograph} and
+before \cs{topmatter}:
+\beginexample{}
+\\redefine\\headmark\#1\{\}
+\endexample
+\noindent (where the {\tt\#1} is an argument number as explained in \Joy,
+in the description of \cs{define} and related commands).
+
+\subhead Tables \endsubhead
+
+There are no special macros to support the creation of tables in
+\AmSTeX{}. Plain \TeX{}'s \cs{settabs}
+command and \cs{halign} can also be used (see {\it The \TeX{}book} for
+documentation of their usage). More sophisticated table macro packages
+are available from other sources. See also the section {\bf Inserts with
+Captions} above.
+
+\subhead Bibliographies \endsubhead
+
+The references section of a paper begins with \cs{Refs} and must have
+\cs{endRefs} at the end. Each entry in the references begins with
+\cs{ref} and ends with \cs{endref}. The individual elements between
+\cs{ref} and \cs{endref} can be specified in any order. However,
+following \cs{ref} is usually a number or other label identifying the
+particular reference. This label is produced using \cs{key}.
+The format of the labels is determined by the current
+{\it references style}, which is set by the \cs{refstyle}
+command. The preprint document style provides three reference
+styles denoted A, B, and C, corresponding to
+letter labels, no labels, and arabic numbers respectively.
+The form of the \cs{cite} and \cs{key} commands for each
+style, and the output they produce, is as follows:
+$$
+\vbox{\offinterlineskip\def\strut{\vrule depth.35\normalbaselineskip
+ width0pt height.75\normalbaselineskip}\tabskip0pt
+ \halign{{\tt\strut#}\hfil&\quad#\hfil&\quad\vrule\quad{\tt#}\hfil&
+ \quad#\hfil&\quad\vrule\quad{\tt#}\hfil&\quad#\hfil\cr
+\multispan2\strut depth.7\normalbaselineskip\cs{refstyle\{A\}}&
+ \multispan2\quad\vrule\quad\cs{refstyle\{B\}}&
+ \multispan2\quad\vrule\quad\cs{refstyle\{C\}}\cr
+%
+\noalign{\hrule}
+%
+ height1.1\normalbaselineskip\cs{cite\{DK\}}& [DK]&
+ \cs{cite\{Smith 1989\}}& [Smith 1989]&
+ \cs{cite\{19\}}& [19]\cr
+%
+\cs{key DK}& [DK]&
+ \omit\quad\vrule\quad(no key)\hfil & (no label)&
+ \cs{key 19}& 19.\cr
+}}$$
+The \cs{refstyle} command is normally placed in the preamble of
+a document.
+
+The references are set with hanging indentation. The amount of indentation
+is preset to accommodate the most common case, two-digit numbers.
+It can be increased (or decreased) by specifying the widest
+label used in the references. For example,
+\beginexample{}
+\\widestnumber\\key\{GHMR\} \% refstyle A
+\\widestnumber\\key\{999\} \% refstyle C --- 3 digits
+\endexample
+\noindent
+will increase the indentation to accommodate the key \hbox{[GHMR]}, or a
+three-digit number, respectively. You could also specify
+\cs{widestnumber}\cs{key\{9\}} to reduce the indentation from two digits'
+worth to one, if your bibliography has fewer than ten entries. As the
+examples show, you do not include square brackets, periods, font
+commands, or other such formatting when using \cs{widestnumber}. The
+indentation will be adjusted for these things automatically.
+
+For consecutive references by the same author(s), \cs{by} is used for
+the first reference, with the author name(s) given in full, and
+\cs{bysame} is used for subsequent ones---just the command \cs{bysame}
+without repetition of the name(s). The horizontal line produced by
+\cs{bysame} has a fixed length of three ems.
+
+Two variations, \cs{ed} and \cs{eds}, are provided for entering editor
+names, as with \cs{page} and \cs{pages}, because the note ``ed.''\ or
+``eds.''\ is part of the automatic formatting. If \cs{by} is absent,
+the editor name(s) will be used in place of the author name.
+
+For a proceedings volume, the place and date of the meeting can
+be recorded in the \cs{procinfo} field. Parentheses will be
+added.
+
+There are two options for miscellaneous notes at the end of a reference,
+\cs{finalinfo} and \cs{miscnote}. \cs{miscnote} differs only by
+automatically adding parentheses; it would typically be used for
+a note such as ``(preprint)'' or ``(submitted)'' or ``(to appear)''.
+Because it's fairly common, the latter has its own command \cs{toappear}
+that is equivalent to \cs{miscnote} {\tt to appear}.
+
+\cs{lang} is used to indicate the original language for papers where
+bibliographic information has been translated or there is some other reason
+to believe that the original language cannot be correctly identified from
+information in the reference.
+
+Sometimes several references are combined into one---for example, parts
+of a long paper that have been published separately. Another type of
+compound reference is a work cited both in the original and in
+translation. There are commands \cs{moreref} and \cs{transl} to handle
+such situations. After \cs{moreref} and \cs{transl}, any of the normal
+reference tags can be used again.
+
+\cs{moreref} is used for citing, e.g., ``part II'' of an article; the
+\cs{moreref} command is followed by the desired additional tags and
+data. For example:
+\beginexample{}
+...\\moreref\\paper\\rom\{II\}
+\\jour Comm. Pure Appl. Math. \\vol 36
+\\yr 1983 \\pages 571--594\\endref
+\endexample
+
+When using \cs{transl}, a note that describes the translation is
+normally entered between \cs{transl} and the next tag. The tags and data
+for the translated work then follow. For example:
+\beginexample{}
+...\\transl English transl. \\publ Birkh\\"auser
+\\publaddr Basel \\yr 1985 \\endref
+\endexample
+
+Automatic punctuation will be omitted if the pertinent field was
+included but left blank. Otherwise, the command \cs{nofrills} can be
+used to keep automatic punctuation from appearing. For example,
+\cs{bookinfo\\nofrills...}\ suppresses the comma or other punctuation
+that would normally be added at the end of the \cs{bookinfo}
+information. \cs{nofrills} also suppresses other automatic formatting
+such as the word ``eds.''\ for \cs{eds}, the word ``vol.''\ for book volumes,
+or the parentheses around the year for journal articles. The ending
+period of a reference can be suppressed with
+\cs{finalinfo}\cs{nofrills}.
+
+Some examples will illustrate the use of these tags. See Appendix~A for
+samples of input and output. See also Appendix~C of \JoT{} (first
+edition: Appendix~B) for more information on references.
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\head 3. Mathematical Constructions
+\endhead
+
+\subhead Wide Accents in Math Mode \endsubhead
+
+In version 2.0+ of the AMSFonts,
+there are wider versions of the \cs{widehat} and \cs{widetilde}
+accents; they appear on lines (5) and (6):
+\beginexample{}
+\exbox{(1)}{\$\\hat x, \\tilde x\$} $\hat x, \tilde x$
+\exbox{(2)}{\$\\widehat x, \\widetilde x\$} $\widehat x, \widetilde x$
+\exbox{(3)}{\$\\widehat\{xy\}, \\widetilde\{xy\}\$} %
+ $\widehat{xy}, \widetilde{xy}$
+\exbox{(4)}{\$\\widehat\{xyz\}, \\widetilde\{xyz\}\$} %
+ $\widehat{xyz}, \widetilde{xyz}$
+\exbox{(5)}{\$\\widehat\{xyzu\}, \\widetilde\{xyzu\}\$} %
+ $\widehat{xyzu}, \widetilde{xyzu}$
+\exbox{(6)}{\$\\widehat\{xyzuv\}, \\widetilde\{xyzuv\}\$} %
+ $\widehat{xyzuv}, \widetilde{xyzuv}$
+\endexample
+\noindent
+These wider accents are in the \filnam{msbm} family. If \filnam{msbm}
+has been loaded, \cs{widehat} and \cs{widetilde} will automatically
+select these wider versions when required; otherwise, the characters
+on line (4) will be the largest available. If you are using the
+preprint style, \filnam{msbm} is loaded automatically; otherwise,
+see the section entitled {\bf Fonts} for instructions on loading it.
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\head 4. Fonts\endhead
+
+\subhead Additional fonts for \AmSTeX{}\endsubhead
+
+A number of fonts were created for use with \AmSTeX{} 2.0+, both
+Computer Modern fonts in sizes not previously available and new fonts
+of alphabets and symbols intended to be used for mathematical notation.
+These fonts are in the collection AMSFonts Version~2.2. They must be
+installed on your computer before you can use \AmSTeX{}'s preprint style
+or otherwise refer to them.
+Note that AMSFonts Version~2.2 cannot be used with versions of \AmSTeX{}
+earlier than Version~2.0, and \AmSTeX{} Version~2.2 cannot be used with
+versions of AMSFonts earlier than Version~2.0
+(users of AMSFonts Version~2.0 are strongly encouraged to upgrade to
+Version~2.2).
+
+Several of these fonts are loaded automatically by the preprint
+style and others can be loaded on demand. The fonts available and the
+commands used to load them are described below.
+
+\subsubhead Fonts loaded with the preprint style
+\endsubsubhead
+Several fonts are loaded automatically for general use.
+\roster
+\item"--" \filnam{cmcsc8} is an additional size of the Computer Modern
+ small caps font.
+\item"--" \filnam{cmex8} and \filnam{cmex7} are additional sizes of the
+ Computer Modern math extension font. \filnam{cmex8} is used by the
+ preprint style in abstracts and other eight-point environments;
+ \filnam{cmex7} is used for all sub- and superscripts.
+\endroster
+If \cs{PSAMSFonts} is specified (see Appendix C), scaled versions of the
+10-point fonts are loaded instead (this is required for submission to
+AMS journals).
+
+
+\subsubhead Math fonts loaded with the preprint style
+\endsubsubhead
+\roster
+\item"--" \filnam{msam} and \filnam{msbm} contain extra symbols. The symbols
+ and the names that will produce them are shown in the section
+ {\bf Symbol Names} below. If you are not using the preprint style,
+ each can be loaded separately by \cs{loadmsam} or \cs{loadmsbm}
+ as appropriate.
+\item"--" \filnam{eufm} is the medium-weight Euler Fraktur (German) font.
+ It can also be loaded by \cs{loadeufm} if the preprint style is not
+ being used.
+\endroster
+
+
+\subsubhead Math fonts loaded by \cs{loadbold}
+\endsubsubhead
+See the sections below on {\bf Bold Characters in Math Mode} and
+{\bf Bold Greek Letters} for details on accessing particular characters
+in these fonts.
+\roster
+\item"--" \filnam{cmmib} is Computer Modern bold math italic.
+ It also contains bold Greek.
+\item"--" \filnam{cmbsy} contains Computer Modern bold math symbols.
+\endroster
+
+
+\subsubhead Additional Euler fonts, for use in math, loaded by
+\cs{loadeu...}\tt\endsubsubhead
+\roster
+\item"--" \filnam{eufb} is bold Fraktur (\cs{loadeufb}).
+\item"--" \filnam{eusm} is medium-weight script (\cs{loadeusm}).
+\item"--" \filnam{eusb} is bold script (\cs{loadeusb}).
+\item"--" \filnam{eurm} is medium-weight ``cursive roman'' (\cs{loadeurm}).
+\item"--" \filnam{eurb} is bold ``cursive roman'' (\cs{loadeurb}).
+\endroster
+
+
+\subsubhead Considerations and warnings\endsubsubhead
+The commands to load these font files should be typed in the preamble area
+between the
+\cs{documentstyle\{...\}} line and the \cs{topmatter}.
+Each \cs{load...} command loads the pertinent fonts (including
+subscript sizes), assigns a ``math
+family'' for them, and defines a math font command.
+The names of the commands are the same as the font names:
+\cs{eufm}, \cs{eufb}, \cs{eusm}, \cs{eusb}, \cs{eurm}, and
+\cs{eurb}. These are used in the same way as
+\cs{roman} or \cs{bold}, e.g., \cs{eufb\{M\}} or \cs{eufb M}@.
+\AmSTeX{} also defines a couple of synonyms,
+\cs{frak} and \cs{goth}, for \cs{eufm} (medium Euler Fraktur).
+
+\TeX{} can accommodate only sixteen font families in math mode; eight
+are already defined by plain \TeX{} before \AmSTeX{} begins, and the
+preprint style loads three more (\filnam{msam}, \filnam{msbm}, and
+\filnam{eufm}), for a total of eleven. For this reason, you should load
+additional fonts with care, requesting only those you know for certain
+you will need.
+
+All the fonts described here, and some others as well, are included in the
+collection AMSFonts Version~2.2, which is available from the AMS and other
+distributors. The math fonts mentioned here are all supplied in sizes from
+five through ten point, suitable for use in mathematical text.
+
+If you intend to use the AMSFonts in PostScript Type~1 outline form,
+see Appendix C.
+
+
+\subhead Bold Characters in Math Mode \endsubhead
+
+Bold letters are obtained by \cs{bold} as described in \Joy{}.
+In addition, bold symbols, italic, and lowercase Greek can be
+obtained once \cs{loadbold} appears in the file (this
+requires version 2.0+ of \AmSTeX{} and AMSFonts). Two control sequences
+are used for different kinds of bold symbols:
+\beginexample{\exboxwidth=1.25in}
+\exbox{}{\\boldkey} for symbols that actually appear on the keyboard
+\exbox{}{\\boldsymbol} for symbols specified by a single control sequence
+\endexample
+\noindent
+For example,
+$$\hbox{\tt\$\\bold x \\boldsymbol\\in \\boldsymbol\\varGamma\$}$$
+gives
+$$\bold x \boldsymbol\in \boldsymbol\varGamma$$
+[and {\tt\$\\boldsymbol\\lbrack a \\boldsymbol\\rbrack\$} gives
+$\boldsymbol\lbrack a \boldsymbol\rbrack$, if you need to use
+\cs{lbrack} and \cs{rbrack} instead of the {\tt[} and {\tt]} keys].
+
+More precisely, \cs{boldkey} can be used in math formulas in the
+following combinations:
+\roster
+\item"$\bullet$" With any of the symbols
+$$ +\ \ -\ \ =\ \ <\ \ >\ \ (\ \ )\ \ [\ \ ]\ \ |\ \ /\ \ *
+ \ \ .\ \ ,\ \ :\ \ ;\ \ !\ \ ?$$
+to give
+$$
+\boldkey+\ \ \boldkey-\ \ \boldkey=\ \ \boldkey<\ \ \boldkey>\ \
+\boldkey(\ \ \boldkey)\ \ \boldkey[\ \ \boldkey]\ \ \boldkey|\ \
+\boldkey/\ \ \boldkey*\ \ \boldkey.\ \ \boldkey,\ \ \boldkey:\ \
+\boldkey;\ \ \boldkey!\ \ \boldkey?
+$$
+But \cs{bold} cannot be used to get bold versions of these symbols.
+{\tt\$\\bold+\$} will give only the ordinary $+$, etc.
+
+The bold $\boldkey+$ and $\boldkey-$ will be binary operators,
+like the ordinary $+$ and $-$ symbols;
+the bold $\boldkey=$ will be a binary relation, like the ordinary $=$, etc.
+
+\medskip
+\item"$\bullet$" With letters:
+\beginexample{\exboxwidth=3.75in}
+\exbox{}{\$\\boldkey a\$, ..., \$\\boldkey z\$} %
+ $\boldkey a, \dots, \boldkey z$
+\exbox{}{\$\\boldkey A\$, ..., \$\\boldkey Z\$} %
+ $\boldkey A, \dots, \boldkey Z$
+\endexample
+\noindent
+Notice that these are $\fam\cmmibfam bold\ math\ italic$ letters, as
+opposed to the bold text letters $\bold a, \dots, \bold z$, $\bold A,
+\dots, \bold Z$ that you get by using \cs{bold} in math mode.
+
+\medskip
+\item"$\bullet$" With numerals:
+\beginexample{\exboxwidth=3.75in}
+\exbox{}{\$\\boldkey 0\$, ..., \$\\boldkey 9\$} %
+ $\boldkey 0, \dots, \boldkey 9$
+\endexample
+\noindent
+However, these combinations simply give the same numerals that you get with
+{\tt\$\\bold0\$}, \dots, {\tt\$\\bold9\$}.
+\endroster
+
+\medskip
+The \cs{boldsymbol} construction can be used in any of the following
+combinations:
+\roster
+\item"$\bullet$" With uppercase and lowercase Greek letters
+\beginexample{\exboxwidth=3.75in}
+\exbox{}{\$\\boldsymbol\\Gamma\$, ..., \$\\boldsymbol\\Omega\$} %
+ $\boldsymbol\Gamma$, \dots, $\boldsymbol\Omega$
+\exbox{}{\$\\boldsymbol\\varGamma\$, ..., \$\\boldsymbol\\varOmega\$} %
+ $\boldsymbol\varGamma$, \dots, $\boldsymbol\varOmega$
+\exbox{}{\$\\boldsymbol\\alpha\$, ..., \$\\boldsymbol\\omega\$} %
+ $\boldsymbol\alpha$, \dots, $\boldsymbol\omega$
+\endexample
+\noindent
+In versions of \AmSTeX{} earlier than 2.0, bold unslanted uppercase
+Greek letters $\boldsymbol\Gamma$, \dots, $\boldsymbol\Omega$ were
+specified by \cs{boldGamma}, \dots, \cs{boldOmega}; these control
+sequences have now disappeared.
+
+\medskip
+\item"$\bullet$"
+For convenience, \cs{boldsymbol} may also be followed by a letter (but
+not by a numeral or other character), giving the same result as
+\cs{boldkey}.
+
+\medskip
+\item"$\bullet$"
+You can also apply \cs{boldsymbol} to all the other standard symbols that
+are specified by single control sequences. For example, to get bold primes:
+\beginexample{\exboxwidth=3.75in}
+\exbox{}{\$\\boldsymbol\\prime\$} $\boldsymbol\prime$
+\exbox{}{\$\\boldsymbol A\^{ }\{\\boldsymbol\\prime\}\$} %
+ $\boldsymbol A^{\boldsymbol\prime}$
+\endexample
+\noindent
+(But \cs{boldsymbol'}, using the shorthand notation for \cs{prime},
+won't work.)
+
+\medskip
+\item"$\bullet$"
+You can apply \cs{boldsymbol} to ``delimiters'', such as
+\beginexample{\exboxwidth=3.75in}
+\exbox{}{\$\\boldsymbol\\\{ ... \\boldsymbol\\\}\$} %
+ $\boldsymbol\{ \dots \boldsymbol\}$
+\exbox{}{\$\\boldsymbol\\langle ... \\boldsymbol\\rangle\$} %
+ $\boldsymbol\langle \dots \boldsymbol\rangle$
+\exbox{}{\$\char`\|, \\boldkey\char`\|, \\\char`\|, \\boldsymbol\\\char`\|\$} %
+ $|,\ \boldkey|,\ \|,\ \boldsymbol\|$
+\exbox{}{\$\\vert, \\boldsymbol\\vert, \\Vert, \\boldsymbol\\Vert\$} %
+ $\vert,\ \boldsymbol\vert,\ \Vert,\ \boldsymbol\Vert$
+\endexample
+\noindent
+However, you can't use \cs{boldsymbol} after \cs{left} and \cs{right}.
+In particular, typing
+\hbox{\tt\\left\\boldsymbol\char`\|\ ...\ \\right\\boldsymbol\char`\|}
+will produce only error messages.
+
+\medskip
+\item"$\bullet$"
+Certain symbols on the bold fonts can't be accessed at all via \cs{boldkey}
+or \cs{boldsymbol}: These include bold versions
+${\fam\cmbsyfam A}$, \dots, ${\fam\cmbsyfam Z}$
+ of the ``calligraphic letters'' $\Cal A$,~\dots, $\Cal Z$ that you type
+as \cs{Cal A}, \dots, \cs{Cal Z},
+and bold versions {\tencmmib0}, \dots, {\tencmmib9}
+ of the oldstyle numbers
+\oldnos0, \dots, \oldnos9 that you get with \cs{oldnos}. If
+you really need to have these symbols, you will have to enlist the aid of a
+\TeX{}nician, or use \cs{pmb}.
+\endroster
+
+
+\subhead Fraktur Font \endsubhead
+
+The German Fraktur font, which is designed for use
+only in math mode, can be made
+available by typing \cs{loadeufm} in the preamble area
+of your paper. If you are using the preprint style,
+medium-weight Fraktur is loaded automatically.
+To produce a Fraktur letter, type
+\beginexample{\exboxwidth=3.75in}
+\exbox{}{\$\\frak g\$} $\frak g$
+\exbox{}{\$\\frak A\$, \\dots, \$\\frak Z\$} $\frak A$, \dots, $\frak Z$
+\endexample
+
+
+\subhead Blackboard Bold \endsubhead
+
+\AmSTeX{} has a ``blackboard bold'' font, \cs{Bbb}. Like \cs{Cal},
+it will work only in math mode, and only when applied to uppercase
+letters. This alphabet is part of the \filnam{msbm} font, and can be
+made available by typing \cs{loadmsbm} at the top of your file. (It is
+loaded automatically with the preprint style.)
+\beginexample{\exboxwidth=3.75in}
+\exbox{}{\$\\Bbb A, \\Bbb C, \\Bbb R\$, etc.} $\Bbb A, \Bbb C, \Bbb R$, etc.
+\endexample
+
+
+\subhead Poor Man's Bold \endsubhead
+
+\AmSTeX{} now has boldface versions of most math symbols. However, if you
+need only one or two bold symbols and have run out of \TeX{} capacity for
+new fonts or font families, you can always get a poor man's bold version
+of bold with \cs{pmb}, as described in \Joy{}.
+
+
+\subhead Bold Greek Letters \endsubhead
+
+Bold Greek letters, both lowercase and uppercase, can be obtained by
+using the \cs{boldsymbol} construction, as described in {\bf Bold
+Characters in Math Mode}. The upright uppercase bold Greek letters are
+part of the ordinary bold font and therefore extra font loading commands
+do not need to be used in order to get them. However, the lowercase and
+slanted uppercase bold Greek letters are not loaded automatically, so
+you must specify \cs{loadbold} before using them.
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\head 5. Symbol Names
+\endhead
+
+The symbols in the \filnam{msam} and \filnam{msbm} fonts have been
+assigned ``standard'' control sequence names as shown below. All
+the symbol names are loaded automatically by the preprint style; if
+you are not using the preprint style, the command \cs{UseAMSsymbols}
+will have the same effect.
+This will add about 200 new
+control sequences to \TeX{}'s internal table. If you are short on
+space, or need only a few of the symbols, you can use a different
+approach to access just the ones you need. See the section {\bf The
+\cs{newsymbol} command} below.
+
+
+\subhead Special Symbols and Blackboard Bold Letters
+\endsubhead
+
+Certain symbols from the \filnam{msam} family can be specified by
+control sequences that will be defined as soon as the command
+\cs{loadmsam} has appeared in the file.
+
+First there are four symbols that are normally used outside of math mode:
+$$\vcenter{\halign to\hsize{\1{#}\hfil\tabskip\centering&
+ \hbox to.5\hsize{\1{#}\hfil}\tabskip0pt\cr
+checkmark&circledR\cr
+maltese&yen\cr}}
+$$
+These symbols, like \P, \S, \dag, and \ddag, can also be used in
+math mode, and will change sizes correctly in subscripts and superscripts.
+
+Next are four symbols that are ``delimiters'' (although there are
+no larger versions obtainable with \cs{left} and \cs{right}), so they
+must be used in math mode:
+$$\vcenter{\halign to\hsize{\1{#}\hfil\tabskip\centering&
+ \hbox to.5\hsize{\1{#}\hfil}\tabskip0pt\cr
+ ulcorner&urcorner\cr
+ llcorner&lrcorner\cr}}$$
+
+Finally, two dashed arrows are constructed from symbols in this family.
+Note that one of them has two names; it can be accessed by either one:
+$$\vcenter{\halign to\hsize{\1{#}\hfil\tabskip\centering&
+ \hbox to.5\hsize{\1{#}\hfil}\tabskip0pt\cr
+ \omit\hbox to.5\hsize{\hbox to\biggest{\hfil$\dashrightarrow$\hfil}\ \ %
+ \cs{dashrightarrow}, \cs{dasharrow}\hss}&dashleftarrow\cr}}$$
+
+The Blackboard Bold letters $\Bbb A, \dots, \Bbb Z$
+appear in the \filnam{msbm} family. Once \cs{loadmsbm} has appeared
+in the file, they can be typed (in math mode) as \cs{Bbb A}, \dots,
+\cs{Bbb Z}.
+
+The \filnam{msbm} family also contains wider versions of the \cs{widehat}
+and \cs{widetilde} as shown above in {\bf Mathematical Constructions}.
+
+
+\subhead The \cs{newsymbol} Command\endsubhead
+
+All other symbols of the \filnam{msam} and \filnam{msbm} fonts must be named
+by control sequences so that they can be used (in math mode only) when the
+fonts are loaded. This can be done all at once by typing the instruction
+\cs{UseAMSsymbols}, which will load in the file \filnam{amssym.tex}\null.
+This instruction is included in the preprint style, so the names are
+assigned automatically, which requires over~200 control sequences.
+
+If you are very short on space for control sequence names, and need only
+a few of these symbols, you can omit \cs{UseAMSsymbols}. Instead,
+assign only the names you will need by using a new \AmSTeX{} control
+sequence \cs{newsymbol} to create a control sequence that will
+properly produce this symbol. The control sequence can be either the
+``standard'' name, as listed below, or one of your own choosing.
+
+The list of symbols below shows for each symbol the symbol itself, a
+four-character~``ID'', and the ``standard'' name of the symbol.
+(The first character of the ID identifies the font family in which a
+symbol resides. Symbols from the \filnam{msam} family have {\tt1} as the
+first character; symbols from the \filnam{msbm} family have {\tt2} as the
+first character.)
+For example, the symbol $\nleqslant$ appears as
+\medskip
+\noindent\kern2\parindent\2{nleqslant}
+\medskip
+\noindent
+To produce a control sequence with this name, the instruction
+\medskip
+\noindent\kern2\parindent\cs{newsymbol}\cs{nleqslant 230A}
+\medskip
+\noindent
+appears in the file \filnam{amssym.tex}\null. This same instruction can
+be typed by a user who is not using the preprint style and has chosen not
+to load all the symbol names by \cs{UseAMSsymbols}. Thereafter, the
+control sequence \cs{nleqslant} will produce the symbol $\nleqslant$
+(in math mode), and will act properly as a ``binary relation''.
+
+A few symbols in these fonts replace symbols defined in \filnam{plain.tex}
+by combinations of symbols available in the Computer Modern fonts. These
+are \cs{angle}~($\angle$) and \cs{hbar}~($\hbar$) from the group
+``Miscellaneous symbols'', and \cs{rightleftharpoons}~($\rightleftharpoons$)
+from the group ``Arrows'' below (and \Joy, Appendix~F). The new symbols will
+change sizes correctly in subscripts and superscripts, provided that you
+are using appropriate redefinitions. In order to use \cs{newsymbol} to
+replace an existing definition, the name must first be ``undefined''.
+Here are the lines you must put in your file if you are not using the
+preprint style or \cs{UseAMSsymbols} (which perform the redefinition
+automatically):
+\medskip
+\begingroup
+\parindent=2\parindent
+\obeylines
+\cs{undefine}\cs{angle}
+\cs{newsymbol}\cs{angle 105C}
+\cs{undefine}\cs{hbar}
+\cs{newsymbol}\cs{hbar 207E}
+\cs{undefine}\cs{rightleftharpoons}
+\cs{newsymbol}\cs{rightleftharpoons 130A}
+\endgroup
+\medskip
+\noindent
+These symbols are flagged in the tables below with a ``{\eightpoint(U)}''
+as a reminder that they must be undefined.
+
+Note in the tables that some symbols are shown with two names. In such
+cases, either one can be used to access the symbol.
+
+% since the symbol tables are set in displays, decrease the skip
+% above, so that the space between a section heading and table is
+% not so large.
+\abovedisplayskip=3pt plus 3pt minus 0pt
+
+\BBB{Lowercase Greek letters}
+$$\halign{\hbox to.5\hsize{\2{#}}&\2{#}\cr
+digamma&varkappa\cr}$$
+
+\BBB{Hebrew letters}
+$$\halign{\hbox to.5\hsize{\2{#}}&\2{#}\cr
+beth&gimel\cr
+daleth\cr
+}$$
+
+\BBB{Miscellaneous symbols}
+$$\halign{\hbox to.5\hsize{\2{#}}&\2{#}\cr
+\omit\4{hbar}&backprime\cr
+hslash&varnothing\cr
+vartriangle&blacktriangle\cr
+triangledown&blacktriangledown\cr
+square&blacksquare\cr
+lozenge&blacklozenge\cr
+circledS&bigstar\cr
+\omit\4{angle}&sphericalangle\cr
+measuredangle&\omit\cr
+nexists&complement\cr
+mho&eth\cr
+Finv&diagup\cr
+Game&diagdown\cr
+Bbbk&\omit\cr
+}$$
+
+\BBB{Binary operators}
+$$\halign{\hbox to.5\hsize{\2{#}}&\2{#}\cr
+dotplus&ltimes\cr
+smallsetminus&rtimes\cr
+\omit\3{Cap}{doublecap}&leftthreetimes\cr
+\omit\3{Cup}{doublecup}&rightthreetimes\cr
+barwedge&curlywedge\cr
+veebar&curlyvee\cr
+doublebarwedge\cr
+boxminus&circleddash\cr
+boxtimes&circledast\cr
+boxdot&circledcirc\cr
+boxplus&centerdot\cr
+divideontimes&intercal\cr}
+$$
+
+\BBB{Binary relations}
+$$\halign{\hbox to.5\hsize{\2{#}}&\2{#}\cr
+leqq&geqq\cr
+leqslant&geqslant\cr
+eqslantless&eqslantgtr\cr
+lesssim&gtrsim\cr
+lessapprox&gtrapprox\cr
+approxeq\cr
+lessdot&gtrdot\cr
+\omit\3{lll}{llless}&\omit\3{ggg}{gggtr}\cr
+lessgtr&gtrless\cr
+lesseqgtr&gtreqless\cr
+lesseqqgtr&gtreqqless\cr
+\omit\3{doteqdot}{Doteq}&eqcirc\cr
+risingdotseq&circeq\cr
+fallingdotseq&triangleq\cr
+backsim&thicksim\cr
+backsimeq&thickapprox\cr
+subseteqq&supseteqq\cr
+Subset&Supset\cr
+sqsubset&sqsupset\cr
+preccurlyeq&succcurlyeq\cr
+curlyeqprec&curlyeqsucc\cr
+precsim&succsim\cr
+precapprox&succapprox\cr
+vartriangleleft&vartriangleright\cr
+trianglelefteq&trianglerighteq\cr
+vDash&Vdash\cr
+Vvdash\cr
+smallsmile&shortmid\cr
+smallfrown&shortparallel\cr
+bumpeq&between\cr
+Bumpeq&pitchfork\cr
+varpropto&backepsilon\cr
+blacktriangleleft&blacktriangleright\cr
+therefore&because\cr}$$
+\bigbreak
+\BBB{Negated relations}
+$$\halign{\hbox to.5\hsize{\2{#}}&\2{#}\cr
+nless&ngtr\cr
+nleq&ngeq\cr
+nleqslant&ngeqslant\cr
+nleqq&ngeqq\cr
+lneq&gneq\cr
+lneqq&gneqq\cr
+lvertneqq&gvertneqq\cr
+lnsim&gnsim\cr
+lnapprox&gnapprox\cr
+nprec&nsucc\cr
+npreceq&nsucceq\cr
+precneqq&succneqq\cr
+precnsim&succnsim\cr
+precnapprox&succnapprox\cr
+nsim&ncong\cr
+nshortmid&nshortparallel\cr
+nmid&nparallel\cr
+nvdash&nvDash\cr
+nVdash&nVDash\cr
+ntriangleleft&ntriangleright\cr
+ntrianglelefteq&ntrianglerighteq\cr
+nsubseteq&nsupseteq\cr
+nsubseteqq&nsupseteqq\cr
+subsetneq&supsetneq\cr
+varsubsetneq&varsupsetneq\cr
+subsetneqq&supsetneqq\cr
+varsubsetneqq&varsupsetneqq\cr}$$
+
+\overfullrule=0pt
+
+\BBB{Arrows}
+$$\halign{\hbox to.5\hsize{\2{#}}&\2{#}\cr
+leftleftarrows&rightrightarrows\cr
+leftrightarrows&rightleftarrows\cr
+Lleftarrow&Rrightarrow\cr
+twoheadleftarrow&twoheadrightarrow\cr
+leftarrowtail&rightarrowtail\cr
+looparrowleft&looparrowright\cr
+leftrightharpoons&\omit\4{rightleftharpoons}\cr
+curvearrowleft&curvearrowright\cr
+circlearrowleft&circlearrowright\cr
+Lsh&Rsh\cr
+upuparrows&downdownarrows\cr
+% Some fancy tricks to avoid a lot of extra work. MJD
+upharpoonleft&upharpoonright}\setbox0\lastbox\unhbox0\unskip,\hfill{\cr
+downharpoonleft&\omit\kern7em \cs{restriction}\hfil\cr
+multimap&downharpoonright\cr
+leftrightsquigarrow&rightsquigarrow\cr}$$
+
+\BBB{Negated arrows}
+$$\halign{\hbox to.5\hsize{\2{#}}&\2{#}\cr
+nleftarrow&nrightarrow\cr
+nLeftarrow&nRightarrow\cr
+nleftrightarrow&nLeftrightarrow\cr}$$
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\head 6. Other Things You Ought to Know
+\endhead
+
+\subhead Errata to \JoT{} prior to \AmSTeX{} 2.0
+\endsubhead
+
+The file \filnam{joyerr.tex} contains the full list of errata for the
+first edition of \JoT{}, for versions of \AmSTeX{} earlier than
+version 2.0; \filnam{joyerr2.tex} contains the errata for the second
+edition. A user who desires a typeset copy of this file may run it
+through \TeX{} and print out the \filnam{.dvi} file. This will
+require Version~2.0+ of \AmSTeX{} and \filnam{amsppt.sty}, and also
+AMSFonts Version~2.0+ (users of AMSFonts Version~2.0 are strongly
+encouraged to upgrade to Version~2.2).
+
+
+\subhead Acknowledging the Use of \AmSTeX{}\endsubhead
+
+The following are suggested as appropriate statements of acknowledgment
+that \AmSTeX{} has been used to format a document for publication.
+It is not required that such an acknowledgment be made.
+
+\penalty-9000 % to encourage a break without absolutely forcing it.
+A single paper may include the following at the bottom of the first page:
+\beginexample{}
+\rm{}Typeset by \AmSTeX{}
+\endexample
+\noindent
+(This notation is provided automatically by the \AmSTeX{} preprint style.
+It can be suppressed by the command \cs{nologo} in the preamble.)
+
+If an entire journal or book is prepared with \AmSTeX{}, the following
+statement can be placed on its copyright page:
+\beginexample{}
+\rm{}This [journal/book] was typeset by \AmSTeX{}, the \TeX{} macro %
+system of the \AMS{}.
+\endexample
+
+If only selected papers in a journal or book are set with \AmSTeX{}, these
+papers may be identified as shown above, and the following may be placed
+on the copyright page:
+\beginexample{}
+\rm{}\AmSTeX{} is the \TeX{} macro system of the \AMS{}.
+\endexample
+
+
+\head 7. Getting Help
+\endhead
+
+If you should find any bugs in the macros or documentation,
+send a Problem Report to:
+\beginexample{\rm}
+Technical Support
+\AMS{}
+P. O. Box 6248
+Providence, RI 02940
+\vskip 2pt %
+Phone: 800-321-4AMS (4267) \quad or \quad 401-455-4080
+E-mail: tech-support\@ams.org
+\endexample
+
+A Problem Report should contain the following information:
+\roster
+\item version and date of \filnam{amstex.tex} and of \filnam{amsppt.sty}
+ with which the problem occurred;
+\item a detailed description of the problem;
+\item a brief input file which includes the input code for
+ one or more examples that illustrate the problem;
+\item a log file of the \TeX{} session for the input file showing the problem.
+\endroster
+
+\head References\endhead
+
+\noindent\hangindent2pc Knuth, Donald E. {\it The \TeX{}book}. Reading:
+ Addison Wesley, 1986.
+
+\noindent\hangindent2pc Spivak, Michael D. {\it The Joy of \TeX{}},
+ 2nd (revised) edition, \AMS{}, Providence, 1990.
+
+\noindent\hangindent2pc {\it Instructions for Preparation of Papers and
+ Monographs: \AmSTeX}, version 2.2, \AMS{}, Providence, 2001.
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\newpage
+
+% Arrange for the sample references to be set broadside, with the output
+% pasted up next to the corresponding input. The section heading should
+% be full-width, and the running heads should be the normal page width.
+% To accomplish the latter, we must redefine plain's \makeheadline.
+
+\begingroup % This will be ended after the broadside section
+
+% To suppress an unimportant `overfull vbox' message (0.8 points):
+\vfuzz=1pt
+
+% Retain headlines at usual width while decreasing \hsize.
+\newdimen\headlinewidth
+\headlinewidth=\hsize
+\def\makeheadline{%
+ \leftskip=0pt
+ \vbox{\vbox to\headlineheight{\vss
+ \hbox to\headlinewidth{\hskip0pt plus\headlinewidth\the\headline}%
+ \kern-\prevdepth}
+ \vskip\headlinespace \vskip-\topskip}%
+ \nointerlineskip}
+
+\head Appendix A.\quad Sample Bibliography Input and Output
+\endhead
+
+% This measurement includes the space for the running head.
+\pageheight{32pc}
+
+\pagewidth{23pc}
+\beginexample{\exindent=0pt}
+\\Refs
+\\ref\\key 4 \% assuming \\refstyle\{C\}
+\\by V. I. Arnol\$'\$d, A. N. Varchenko,
+\ and S. M. Guse\\u\\i n-Zade
+\\book Singularities of differentiable maps.~\\rom I
+\\publ ``Nauka'' \\publaddr Moscow \\yr 1982
+\\lang Russian
+\\endref
+\ {}
+\\ref\\key 5\\bysame
+\\book Singularities of differentiable maps.~\\rom\{II\}
+\\publ ``Nauka'' \\publaddr Moscow \\yr 1984
+\\lang Russian
+\\endref
+\ {}
+\\ref\\key 6
+\\by O. A. Ladyzhenskaya
+\\book Mathematical problems in the dynamics
+\ of a viscous incompressible fluid
+\\bookinfo 2nd rev. aug. ed.
+\\publ ``Nauka'' \\publaddr Moscow \\yr 1970
+\\lang Russian
+\\transl English transl. of 1st ed.
+\\book The mathematical theory of viscous
+\ incompressible flow
+\\publ Gordon and Breach \\publaddr New York
+\\yr 1963; rev. 1969
+\\endref
+\endexample
+
+\newpage
+
+\beginexample{\exindent=0pt}
+\\ref\\key 7
+\\by P. D. Lax and C. D. Levermore
+\\paper The small dispersion limit for the
+\ KdV equation.~\\rom I
+\\jour Comm. Pure Appl. Math. \\vol 36 \\yr 1983
+\\pages 253--290 \\finalinfo (overview)
+\\moreref\\paper \\rom\{II\}
+\\jour Comm. Pure Appl. Math.
+\\vol 36 \\yr 1983 \\pages 571--594
+\\moreref\\paper \\rom\{III\}
+\\jour Comm. Pure Appl. Math.
+\\vol 36 \\yr 1983 \\pages 809--829 \\endref
+\ {}
+\\ref\\key 10 \\by S. Osher
+\\paper Shock capturing algorithms for equations of
+\ mixed type
+\\inbook Numerical Methods for Partial Differential
+\ Equations \\eds S. I. Hariharan and T. H. Moulton
+\\publ Longman \\publaddr New York \\yr 1986
+\\pages 305--322
+\\endref
+\ {}
+\\ref\\key 17 \\by G. S. Petrov
+\\paper Elliptic integrals and their nonoscillatory
+\ behavior
+\\jour Funktsional. Anal. i Prilozhen.
+\\vol 20 \\yr 1986 \\pages 46--49
+\\transl\\nofrills English transl. in
+\\jour Functional Anal. Appl. \\vol 20\\yr 1986
+\\endref
+\endexample
+
+\newpage
+
+\beginexample{\exindent=0pt}
+\% switch to a different references style
+\\refstyle\{A\}
+\\widestnumber\\key\{GHMR\}
+\ {}
+\\ref\\key C1
+\\by B. Coomes
+\\book Polynomial flows, symmetry groups, and
+\ conditions sufficient for injectivity of maps
+\\bookinfo Ph.D. thesis, Univ. Nebraska--Lincoln
+\\yr 1988
+\\endref
+\ {}
+\\ref\\key C2
+\\bysame \% B. Coomes
+\\paper The Lorenz system does not have a
+\ polynomial flow
+\\jour J. Differential Equations
+\\toappear
+\\endref
+\ {}
+\\ref\\key GHMR
+\\by J. Guckenheimer, P. Holmes, M. Martineau,
+\ and L. P. Robinson
+\\book Nonlinear oscillations, dynamical systems,
+\ and bifurcations of vector fields
+\\bookinfo \% fields can be left blank
+\\publ Springer-Verlag \\publaddr New York
+\\yr 1983
+\\endRefs
+\endexample
+
+\newpage
+
+\begingroup
+\refstyle{C}
+\aboveheadskip=\abovedisplayskip
+
+\Refs
+\ref\key 4 % assuming \refstyle{C}
+\by V. I. Arnol$'$d, A. N. Varchenko, and S. M. Guse\u\i n-Zade
+\book Singularities of differentiable maps.~{\rm I}
+\publ ``Nauka'' \publaddr Moscow
+\yr 1982
+\lang Russian
+\endref
+
+\ref\key 5
+\bysame
+\book Singularities of differentiable maps.~{\rm II}
+\publ ``Nauka'' \publaddr Moscow
+\yr 1984
+\lang Russian
+\endref
+
+\ref\key 6
+\by O. A. Ladyzhenskaya
+\book Mathematical problems in the dynamics of a
+ viscous incompressible fluid
+\bookinfo 2nd rev. aug. ed.
+\publ ``Nauka'' \publaddr Moscow
+\yr 1970
+\lang Russian
+\transl English transl. of 1st ed.
+\book The mathematical theory of viscous
+incompressible flow
+\publ Gordon and Breach \publaddr New York
+\yr 1963; rev. 1969
+\endref
+
+\bigskip
+
+\ref\key 7
+\by P. D. Lax and C. D. Levermore
+\paper The small dispersion limit for the KdV equation.~{\rm I}
+\jour Comm. Pure Appl. Math.
+\vol 36 \yr 1983 \pages 253--290
+\finalinfo (overview)
+\moreref\paper {\rm II}
+\jour Comm. Pure Appl. Math.
+\vol 36 \yr 1983 \pages 571--594
+\moreref\paper {\rm III}
+\jour Comm. Pure Appl. Math.
+\vol 36 \yr 1983 \pages 809--829 \endref
+
+\ref\key 10 \by S. Osher
+\paper Shock capturing algorithms for equations of mixed type
+\inbook Numerical Methods for Partial Differential Equations
+\eds S. I. Hariharan and T. H. Moulton
+\publ Longman \publaddr New York \yr 1986 \pages 305--322
+\endref
+
+\ref\key 17 \by G. S. Petrov
+\paper Elliptic integrals and their nonoscillatory behavior
+\jour Funktsional. Anal. i Pri\-lo\-zhen.
+\vol 20 \yr 1986 \pages 46--49
+\transl\nofrills English transl. in \jour Functional Anal. Appl.
+\vol 20\yr 1986
+\endref
+
+\bigskip
+
+% switch to a different references style
+\refstyle{A}
+\widestnumber\key{GHMR}
+
+\ref\key C1
+\by B. Coomes
+\book Polynomial flows, symmetry groups, and conditions
+ sufficient for injectivity of maps
+\bookinfo Ph.D. thesis, Univ. Nebraska--Lincoln
+\yr 1988
+\endref
+
+\ref\key C2
+\bysame % B. Coomes
+\paper The Lorenz system does not have a polynomial flow
+\jour J. Differential Equations
+\toappear
+\endref
+
+\ref\key GHMR
+\by J. Guckenheimer, P. Holmes, M. Martineau, and L. P. Robinson
+\book Nonlinear oscillations, dynamical systems, and
+ bifurcations of vector fields
+\bookinfo % fields can be left blank
+\publ Springer-Verlag \publaddr New York
+\yr 1983
+\endref
+\endRefs
+
+\endgroup % end special value of \aboveheadskip
+
+
+\newpage
+\endgroup % end broadside section
+
+% Put the page number at the bottom of the page:
+\csname firstpage\string @true\endcsname
+% Turn off the "Typeset by AmSTeX" logo:
+%\expandafter\redefine\csname logo\string @\endcsname{}
+\nologo
+
+% Reset the page number because the broadside pages in
+% the previous section will become three pages instead of four.
+% 18-JAN-1991 mjd
+\advance\pageno by -1
+
+% The following file contains the installation instructions
+\input amstinst.tex
+
+\enddocument
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
diff --git a/macros/amstex/doc/amsppt.doc b/macros/amstex/doc/amsppt.doc
new file mode 100644
index 0000000000..2338453d28
--- /dev/null
+++ b/macros/amstex/doc/amsppt.doc
@@ -0,0 +1,3399 @@
+%%% ====================================================================
+%%% @AMSTeX-style-file{
+%%% filename = "amsppt.sty",
+\def\filename{amsppt.sty}
+% filename = "amsppt.doc",
+%%% version = "2.2",
+\def\fileversion{2.2}
+%%% date = "2001/08/07",
+\def\filedate{2001/08/07}
+%%% time = "13:47:28 EDT",
+%%% checksum = "45523 3399 17317 143562",
+%%% author = "American Mathematical Society",
+%%% copyright = "Copyright 2001 American Mathematical Society,
+%%% all rights reserved. Copying of this file is
+%%% authorized only if either:
+%%% (1) you make absolutely no changes to your copy
+%%% including name; OR
+%%% (2) if you do make changes, you first rename it
+%%% to some other name.",
+%%% address = "American Mathematical Society,
+%%% Technical Support,
+%%% Publications Technical Group,
+%%% P. O. Box 6248,
+%%% Providence, RI 02940,
+%%% USA",
+%%% telephone = "401-455-4080 or (in the USA and Canada)
+%%% 800-321-4AMS (321-4267)",
+%%% FAX = "401-331-3842",
+%%% email = "tech-support@ams.org (Internet)",
+%%% codetable = "ISO/ASCII",
+%%% supported = "yes",
+%%% keywords = "amstex, ams-tex, tex",
+%%% abstract = "This file is a documentstyle for use with
+%%% AMS-TeX 2.2. It exists in two forms: amsppt.doc,
+%%% which is the full form containing all technical
+%%% documentation, and amsppt.sty, which is identical
+%%% except that all lines beginning with a single percent
+%%% sign are removed, to make the file more rapid-loading
+%%% when processed by TeX.",
+%%% docstring = "The checksum field above contains a CRC-16 checksum
+%%% as the first value, followed by the equivalent of
+%%% the standard UNIX wc (word count) utility output of
+%%% lines, words, and characters. This is produced by
+%%% Robert Solovay's checksum utility.",
+%%% }
+%%% ====================================================================
+%
+% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% -0- CONTENTS
+% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% -0- Contents
+% -1- Preliminary
+% -2- Utility definitions
+% -3- Fonts
+% -4- Global variable settings
+% -5- Top matter definitions
+% -6- Section headings
+% -7- Theorem environments and similar structures
+% -8- Rosters
+% -9- Footnotes
+% -10- Tables
+% -11- Figure spaces and captions
+% -12- Miscellaneous formatting macros
+% -13- References/Bibliography
+% -14- End of document
+% -15- Output routine
+% -16- Hyphenation exceptions
+% -17- Notes
+% -18- Appendix: Notes on version 2.1
+% -19- Appendix: Notes on versions 2.1a, 2.1b, ...
+% -20- Appendix: Notes on versions 2.2
+%
+% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% -1- PRELIMINARY
+% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% AMSPPT.DOC contains all the code for AMSPPT.STY, with
+% additional comments. AMSPPT.STY is produced by removing from
+% AMSPPT.DOC all blank lines and lines beginning with a percent
+% sign. This is done to allow it to be loaded faster by TeX.
+%
+% For the most part the internals of AMSPPT.STY aren't closely
+% related to AMSTEX.TEX: AMSTEX.TEX handles mathematics,
+% AMSPPT.STY handles visual design and overall structure of
+% documents. But some parts of AMSTEX.DOC are relevant, e.g.,
+% the standard abbreviations \DN@, \RIfM@, etc., the description
+% of "compressed format", the remarks about the "K-method", and
+% the allocation of scratch registers and variables such as
+% \toks@@.
+%
+% The style produced by AMSPPT.STY is based on the style of the
+% Journal of the American Mathematical Society (as of December
+% 1990), but is not intended to reproduce it exactly. For one
+% thing, most users of AMSPPT.STY will probably have Computer
+% Modern fonts, while the Journal of the AMS in 1990 used Times
+% Roman fonts licensed from Autologic, Inc. This means that line
+% breaks and page breaks were sure to change when a paper was
+% submitted to the AMS. For another thing, preprints naturally
+% differ in some respects from articles in final published form:
+% published articles generally have the journal name, volume and
+% year of publication somewhere on the first page, a ``received
+% by the editors'' date, subject classification numbers, perhaps
+% key words and phrases, and an abstract, none of which are
+% necessary in a preprint (though the last few are sometimes
+% present). In addition, the Journal of the AMS has a few
+% idiosyncrasies such as placement of the abstract at the end of
+% an article rather than at the beginning, and a non-zero value
+% of \mathsurround, which were deemed inappropriate for inclusion
+% in the preprint style (in particular, a non-zero \mathsurround
+% would require the user to do extra work in certain situations
+% to cancel unwanted side effects). Since we are not matching
+% the style of the Journal of the AMS exactly, we sometimes have
+% rounded off measurements in AMSPPT.STY to convenient amounts
+% such as \bigskipamount and \medskipamount or the nearest whole
+% or half pica. For example \belowheadskip is 7pt in the Journal
+% of the AMS, but AMSPPT.STY uses 6pt (half a pica).
+%
+% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% Bug in amsppt.sty version 2.1 left \amsppt.sty = \endinput
+% after the file was loaded. This will fix it if amsppt.sty
+% was put in the format file.
+%
+\expandafter\ifx\csname amsppt.sty\endcsname\endinput
+ \expandafter\def\csname amsppt.sty\endcsname{2.2 (2001/08/07)}\fi
+%
+% Check to see if this file was previously loaded and, if so,
+% if the version numbers agree.
+%
+\xdef\fileversiontest{\fileversion\space(\filedate)}
+\expandafter\ifx\csname\filename\endcsname\fileversiontest
+% Then file is already loaded, and versions agree. Quit here.
+% \endinput and \fi MUST be on the same line:
+ \message{[already loaded]}\endinput\fi
+%
+% If the file versions disagree, we generate an error message,
+% but we don't do an \endinput: maybe the user will want to
+% continue, inputting the new version, and see what happens.
+%
+\expandafter\ifx\csname\filename\endcsname\relax % file not yet loaded
+ \else\errmessage{Discrepancy in `\filename' file versions:
+ version \csname\filename\endcsname\space already loaded, trying
+ now to load version \fileversiontest}\fi
+%
+% Since we are about to change the catcode of @, we define
+% \csname\filename\endcsname to set the catcode back to its previous
+% value. Furthermore, it then redefines itself to record the file
+% version number for future reference (e.g., the test above).
+%
+\expandafter\xdef\csname\filename\endcsname{%
+ \catcode`\noexpand\@=\the\catcode`\@
+ \expandafter\gdef\csname\filename\endcsname{%
+ \fileversion\space(\filedate)}}
+%
+% Add @ to the plain list of \dospecials, to make it behave
+% better in verbatim, e-mail addresses, and URL's.
+%
+\def\dospecials{\do\ \do\\\do\{\do\}\do\$\do\&%
+ \do\#\do\^\do\^^K\do\_\do\^^A\do\%\do\~\do\@}
+%
+% Enable the use of @ as letter in `private' control sequence names.
+% Cf. TeXbook, p. 344 (above the \mathcode table).
+%
+\catcode`\@=11
+%
+% For convenience in loading other files of definitions, provide
+% commands to save and restore the catcode value of any character,
+% most commonly @.
+%
+\def\savecat#1{%
+ \expandafter\xdef\csname\string#1savedcat\endcsname{\the\catcode`#1}}
+\def\restorecat#1{\catcode`#1=\csname\string#1savedcat\endcsname}
+%
+% Besides putting the file version on screen, this message also
+% records it in the transcript/log file (which is useful for
+% troubleshooting). The file name was already given on screen and in
+% the transcript file by TeX, as part of the automatic processing
+% surrounding file input.
+%
+\message{version \fileversion\space(\filedate):}
+%
+% If another documentstyle inputs amsppt.sty, it should define
+% \styname and \styversion appropriately. We use an `ifundefined'
+% test to avoid overriding the definitions, in that case.
+\expandafter\ifx\csname styname\endcsname\relax
+ \def\styname{AMSPPT}\def\styversion{2.2}
+\fi
+%
+% In AMSPPT.STY we follow the convention in amstex.tex of
+% appending @ signs at the end of control sequences, rather than
+% substituting @ signs for vowels as is frequently done in
+% plain.tex.
+%
+% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% -2- UTILITY DEFINITIONS
+% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\message{Loading utility definitions,}
+%
+% For several macros, e.g., \title, we want to allow the user the
+% following two options:
+%
+% \title xxx\endtitle
+% \title\nofrills xxx\endtitle
+%
+% In the first case, we want the text of the title to be stored
+% in a box for later use. In the second case, we want certain
+% parts of the typesetting to be omitted when constructing the
+% box. Internally this is done by prefixing them with \frills@,
+% which in the normal cases is simply an identity function
+% (\let\frills@\identity@), whereas in the nofrills case it
+% gobbles its argument (\let\frills@\eat@).
+%
+% In order to test for \nofrills we have to use \futurelet
+% (because if \nofrills is absent, we don't want to do anything
+% that might affect the actual text of the title, such as
+% stripping braces or adding an unwanted extra pair around the
+% first token or group).
+%
+\def\identity@#1{#1}
+%
+\def\nofrills@@#1{%
+% This extra step in defining \next@ is a precaution in case #1
+% might be more than one token.
+ \DN@{#1}%
+ \ifx\next\nofrills \let\frills@\eat@
+ \expandafter\expandafter\expandafter\next@\expandafter\eat@
+ \else \let\frills@\identity@\expandafter\next@\fi}
+%
+\def\nofrillscheck#1{\def\nofrills@{\nofrills@@{#1}}%
+ \futurelet\next\nofrills@}
+%
+% Typical use: if we want to execute a macro called \title, but
+% check to see if \nofrills is coming up next, we do this:
+%
+% ... \nofrillscheck\title
+%
+% If indeed the next thing is \nofrills, then we will execute
+% \nofrills@@ before calling \title again. This involves some
+% shuffling around in order for us to get back the ``real''
+% definition of \title afterwards and yet still be able to use a
+% control sequence named \title to read the argument. This is
+% important in giving the user a useful error message if they
+% accidentally omit or misspell the matching \endtitle or
+% whatever. We could use instead the trick used with \align of
+% adding a space onto the \csname with which we read the
+% argument, but that would increase the use of hash size.
+%
+% We define \usualspace to give a warning message if used in
+% a place where it's not intended to be used:
+%
+\Invalid@\usualspace
+%
+% Facility for adding to a token list, providing it was named
+% with the particular naming convention that we require: an
+% additional @ sign at the end of the control sequence name.
+% Usage: \addto\tenpoint{...}
+%
+\def\addto#1#2{\csname \expandafter\eat@\string#1@\endcsname
+ \expandafter{\the\csname \expandafter\eat@\string#1@\endcsname#2}}
+%
+% Fix Plain's \big, \Big, etc. macros so that they can scale with
+% size changes. The relations in \tenpoint are:
+%
+% total height above
+% height baseline
+% --------------------------------------------------------------
+% \big: 12pt 8.5 (12/2 = 6, + 2.5 (height of math axis))
+% \Big: 18pt 11.5 (18/2 = 9, + 2.5 (height of math axis))
+% \bigg: 24pt 14.5 (24/2 = 12, + 2.5 (height of math axis))
+% \Bigg: 30pt 17.5 (30/2 = 15, + 2.5 (height of math axis))
+%
+% In \tenpoint \bigsize@ will be set to 12pt, the height of an
+% ordinary parenthesis in the roman font, x 1.2
+\newdimen\bigsize@
+%
+% Using \vcenter automatically factors the height of the math
+% axis into our sizing. We set \nulldelimiterspace to zero,
+% since we only want the delimiterspace from the \left delimiter.
+%
+\def\big@#1#2{{\hbox{$\left#2\vcenter to#1\bigsize@{}%
+ \right.\nulldelimiterspace\z@\m@th$}}}
+\def\big{\big@\@ne}
+\def\Big{\big@{1.5}}
+\def\bigg{\big@\tw@}
+\def\Bigg{\big@{2.5}}
+%
+% Definition almost verbatim from TeXbook p. 317. This is used
+% in several places, currently (28-DEC-1989) including \head,
+% \title, \author, \dedicatory, \affil, and \topcaption.
+%
+\def\raggedcenter@{\leftskip\z@ plus.4\hsize \rightskip\leftskip
+ \parfillskip\z@ \parindent\z@ \spaceskip.3333em \xspaceskip.5em
+ \pretolerance9999\tolerance9999 \exhyphenpenalty\@M
+ \hyphenpenalty\@M \let\\\linebreak}
+%
+% We now define a version of \uppercase that sidesteps any math,
+% to prevent uppercasing math variables. In order to be handled
+% properly the $..$ must be on the outer level (not enclosed in
+% braces) but this is the usual case in our applications of
+% \uppercasetext@. Also we increase inter-word space in the
+% uppercase text. Footnotes are not handled by
+% \uppercasetext@---a footnote within a \title would have to be
+% done by using \footnotemark within the title and \footnotetext
+% after. In most cases footnotes within a title are something for
+% which the author should use \thanks or \affil or \address
+% instead.
+%
+% One other little problem: uppercasing of a few special
+% characters like the German "ss" and the undotted i and j (\i
+% and \j), used sometimes with accents. We do some reassignments
+% here to handle these. We don't worry about restoring the
+% lowercase special characters within math embedded in the text
+% being uppercased---it's conceivable that someone might want to
+% use them there, but too unlikely to need providing for.
+% (Undotted i and j in math would be typed as \imath and \jmath,
+% not as \i and \j.)
+%
+% This is what plain.tex has for the special characters:
+%
+% \chardef\ss="19 \chardef\ae="1A \chardef\oe="1B \chardef\o="1C
+% \chardef\AE="1D \chardef\OE="1E \chardef\O="1F
+% \chardef\i="10 \chardef\j="11 % dotless letters
+% \def\aa{\accent23a}
+% \def\AA{\leavevmode\setbox0\hbox{h}\dimen@\ht0\advance\dimen@-1ex%
+% \rlap{\raise.67\dimen@\hbox{\char'27}}A}
+% \def\l{\char32l}
+% \def\L{\leavevmode\setbox0\hbox{L}\hbox to\wd0{\hss\char32L}}
+%
+\def\uppercasetext@#1{%
+ {\spaceskip1.3\fontdimen2\the\font plus1.3\fontdimen3\the\font
+ \def\ss{SS}\let\i=I\let\j=J\let\ae\AE\let\oe\OE
+ \let\o\O\let\aa\AA\let\l\L
+ \skipmath@#1$\skipmath@$}}
+%
+\def\skipmath@#1$#2${\uppercase{#1}%
+ \ifx\skipmath@#2\else$#2$\expandafter\skipmath@\fi}
+%
+% Macro to check for missing \endsomething.
+\def\add@missing#1{\expandafter\ifx\envir@end#1%
+ \Err@{You seem to have a missing or misspelled
+ \expandafter\string\envir@end ...}%
+% It is useful to supply the necessary missing piece, especially
+% in the case of \endref.
+ \envir@end
+\fi}
+%
+% \revert@ and \envir@stack are for use by any environments that
+% don't enclose their text in a group, e.g., \proclaim,
+% \definition, \roster.
+%
+\newtoks\revert@
+%
+\def\envir@stack#1{\toks@\expandafter{\envir@end}%
+ \edef\next@{\def\noexpand\envir@end{\the\toks@}%
+ \revert@{\the\revert@}}%
+ \revert@\expandafter{\next@}%
+ \def\envir@end{#1}}
+%
+% Some special trickery is necessary to get around the outerness
+% of \enddocument
+\begingroup
+\catcode`\ =11
+\gdef\revert@envir#1{\expandafter\ifx\envir@end#1%
+% restore previous \envir@end:
+\the\revert@%
+% The space after \enddocument is significant:
+\else\ifx\envir@end\enddocument \Err@{Extra \string#1}%
+\else\expandafter\add@missing\envir@end\revert@envir#1%
+\fi\fi}
+% This definition can be made here because \enddocument has not
+% yet been declared \outer.
+% The space at the end of \enddocument is necessary:
+\xdef\enddocument {\string\enddocument}%
+% The space at the end of \enddocument is necessary here also:
+\global\let\envir@end\enddocument %%%%%% don't remove the final space!
+\endgroup\relax
+%
+\def\first@#1#2\end{#1}
+\def\true@{TT}
+\def\false@{TF}
+\def\empty@{}
+%
+% Test to see whether a given argument is empty or not. If the
+% argument = a single space, it will test the same as empty,
+% which is in fact what we want.
+%
+\begingroup \catcode`\-=3
+\long\gdef\notempty#1{%
+% \empty@ is needed if we want the case #1 = {} to work properly:
+ \expandafter\ifx\first@#1-\end-\empty@ \false@\else \true@\fi}
+\endgroup
+%
+%
+% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% -3- FONTS
+% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\message{more fonts,}
+% Load some fonts that are not loaded in plain.tex, or only
+% preloaded (which means that the font information is in TeX's
+% memory but a control sequence name for the font still needs to
+% be assigned). plain.tex only loads cmex10, because originally
+% that was the only size available. So we load cmex7 and later
+% cmex8, but we don't load any smaller sizes, in order to
+% conserve font memory; a need for the extension font in sizes
+% smaller than 7-point is most unusual. For subscript sums or
+% other extension symbols in eightpoint text we will use cmex7
+% rather than cmex6, to allow us to get away without loading
+% cmex6.
+%
+% We use \font@, not simply \font, so that these fonts will be
+% handled properly by AMS-TeX's syntax check.
+%
+\font@\tensmc=cmcsc10 \relax
+%
+% \sevenex, and \eightex below, must be able to be interpreted
+% as math fonts for certain initialization (e.g. establishing
+% the height of the strut in \eightpoint) that may be requested
+% before \topmatter is invoked, and the fonts are actually loaded.
+%
+\let\sevenex=\tenex % needs special handling in \PSAMSFonts
+%
+% We need cmti7 in case \italic is used in a subscript or
+% superscript. Once again we will conserve font space by not
+% loading cmti6 or cmti5, and declare the \scriptfont in
+% \eightpoint to be cmti7 rather than cmti6. At least until we
+% know that users actually are using \italic in sub-subscript
+% size.
+%
+\font@\sevenit=cmti7 \relax
+%
+% We have to load a lot of other fonts for eight-point text
+% (footnotes, abstracts, bibliography). Note that cmti and cmsl
+% in sizes 5, 6 don't get loaded, since they may not exist (cmti7
+% is one of the standard 75 Computer Modern fonts, but cmti5 and
+% cmti6 aren't, nor are any of cmsl5, cmsl6, cmsl7). AMSPPT
+% provides for ten-point and eight-point font sets;
+%
+\font@\eightrm=cmr8 \relax % preloaded in plain.tex
+\font@\sixrm=cmr6 \relax % preloaded in plain.tex
+\font@\eighti=cmmi8 \relax \skewchar\eighti='177 % preloaded
+\font@\sixi=cmmi6 \relax \skewchar\sixi='177 % preloaded
+\font@\eightsy=cmsy8 \relax \skewchar\eightsy='60 % preloaded
+\font@\sixsy=cmsy6 \relax \skewchar\sixsy='60 % preloaded
+\let\eightex=\tenex % needs special handling in \PSAMSFonts
+\font@\eightbf=cmbx8 \relax % preloaded in plain.tex
+\font@\sixbf=cmbx6 \relax % preloaded in plain.tex
+\font@\eightit=cmti8 \relax % preloaded in plain.tex
+\font@\eightsl=cmsl8 \relax % preloaded in plain.tex
+\font@\eighttt=cmtt8 \relax % preloaded in plain.tex
+\let\eightsmc=\nullfont % needs special handling in \PSAMSFonts
+%
+% Now we define \tenpoint and \eightpoint for regular text and
+% footnotes, similarly to the TeXbook, p. 414. We not only
+% change the \baselineskip, but also change the glue above and
+% below displayed formulas, in case an abstract or footnote
+% happens to have them. We also need to set not only \strutbox,
+% but also \strutbox@. The height of \strutbox@ is the height of
+% \strutbox, minus the value of \normallineskiplimit. And we
+% will set \ex@ in each case (for \tenpoint it is supposed to be
+% equivalent to 1pt, while for \eightpoint it will then
+% presumably be equivalent to .8pt).
+%
+% When \ifsyntax@ is true, so that we are checking syntax, then
+% we won't bother specifying fonts (since we would only change
+% them all to \dummyft@ anyway), and we simply let \big and its
+% variants gobble up things with the proper syntax, instead of
+% worrying about getting the right sizes.
+%
+% \tenpoint@ is a hook where new material can be added.
+% \topmatter makes use of this. Note that to change the
+% baselineskip to say 14pt, one should say
+%
+% \addto\tenpoint{\normalbaselineskip14pt\normalbaselines}
+%
+% rather than just \addto\tenpoint{\baselineskip14pt}
+%
+\newtoks\tenpoint@
+%
+\def\tenpoint{\normalbaselineskip12\p@
+ \abovedisplayskip12\p@ plus3\p@ minus9\p@
+ \belowdisplayskip\abovedisplayskip
+ \abovedisplayshortskip\z@ plus3\p@
+ \belowdisplayshortskip7\p@ plus3\p@ minus4\p@
+ \textonlyfont@\rm\tenrm \textonlyfont@\it\tenit
+ \textonlyfont@\sl\tensl \textonlyfont@\bf\tenbf
+ \textonlyfont@\smc\tensmc \textonlyfont@\tt\tentt
+ \ifsyntax@ \def\big##1{{\hbox{$\left##1\right.$}}}%
+ \let\Big\big \let\bigg\big \let\Bigg\big
+ \else
+ \textfont\z@\tenrm \scriptfont\z@\sevenrm
+ \scriptscriptfont\z@\fiverm
+ \textfont\@ne\teni \scriptfont\@ne\seveni
+ \scriptscriptfont\@ne\fivei
+ \textfont\tw@\tensy \scriptfont\tw@\sevensy
+ \scriptscriptfont\tw@\fivesy
+ \textfont\thr@@\tenex \scriptfont\thr@@\sevenex
+ \scriptscriptfont\thr@@\sevenex
+ \textfont\itfam\tenit \scriptfont\itfam\sevenit
+ \scriptscriptfont\itfam\sevenit
+ \textfont\bffam\tenbf \scriptfont\bffam\sevenbf
+ \scriptscriptfont\bffam\fivebf
+ \setbox\strutbox\hbox{\vrule height8.5\p@ depth3.5\p@ width\z@}%
+% The height of \strutbox@ is supposed to be the height of
+% \strutbox minus \normallineskip. We take half from the top and
+% half from the bottom.
+ \setbox\strutbox@\hbox{\lower.5\normallineskiplimit\vbox{%
+ \kern-\normallineskiplimit\copy\strutbox}}%
+% We set \bigsize@ to the height of a parenthesis, times 1.2.
+% \bigsize@ controls the height of \big, \Big, \bigg and \Bigg
+% delimiters.
+ \setbox\z@\vbox{\hbox{$($}\kern\z@}\bigsize@1.2\ht\z@
+ \fi
+% \ex@ is supposed to come out to 1pt; multiplication factor may
+% need to be changed if Computer Modern is not being used. \jot,
+% a dimen register usually used for extra spacing between lines
+% of a multi-line displayed equation or similar structure, is
+% reset to 3\ex@ (in plain.tex it is always 3pt, but in AMSPPT it
+% may be reduced by \eightpoint).
+ \normalbaselines\rm\dotsspace@1.5mu\ex@.2326ex\jot3\ex@
+ \the\tenpoint@}
+%
+% Like \tenpoint@, \eightpoint@ is a hook where extra material
+% can be added to the definition of \eightpoint.
+%
+\newtoks\eightpoint@
+%
+\def\eightpoint{\normalbaselineskip10\p@
+ \abovedisplayskip10\p@ plus2.4\p@ minus7.2\p@
+ \belowdisplayskip\abovedisplayskip
+ \abovedisplayshortskip\z@ plus2.4\p@
+ \belowdisplayshortskip5.6\p@ plus2.4\p@ minus3.2\p@
+ \textonlyfont@\rm\eightrm \textonlyfont@\it\eightit
+ \textonlyfont@\sl\eightsl \textonlyfont@\bf\eightbf
+ \textonlyfont@\smc\eightsmc \textonlyfont@\tt\eighttt
+ \ifsyntax@\def\big##1{{\hbox{$\left##1\right.$}}}%
+ \let\Big\big \let\bigg\big \let\Bigg\big
+ \else
+ \textfont\z@\eightrm \scriptfont\z@\sixrm
+ \scriptscriptfont\z@\fiverm
+ \textfont\@ne\eighti \scriptfont\@ne\sixi
+ \scriptscriptfont\@ne\fivei
+ \textfont\tw@\eightsy \scriptfont\tw@\sixsy
+ \scriptscriptfont\tw@\fivesy
+% The smallest size of the extension font currently available is
+% 7-point.
+ \textfont\thr@@\eightex \scriptfont\thr@@\sevenex
+ \scriptscriptfont\thr@@\sevenex
+ \textfont\itfam\eightit \scriptfont\itfam\sevenit
+ \scriptscriptfont\itfam\sevenit
+ \textfont\bffam\eightbf \scriptfont\bffam\sixbf
+ \scriptscriptfont\bffam\fivebf
+ \setbox\strutbox\hbox{\vrule height7\p@ depth3\p@ width\z@}%
+% The height of \strutbox@ is supposed to be the height of
+% \strutbox minus \normallineskip. We take half from the top and
+% half from the bottom.
+ \setbox\strutbox@\hbox{\raise.5\normallineskiplimit\vbox{%
+ \kern-\normallineskiplimit\copy\strutbox}}%
+% We set \bigsize@ to the height of a parenthesis, times 1.2.
+% \bigsize@ controls the height of \big, \Big, \bigg and \Bigg
+% delimiters.
+ \setbox\z@\vbox{\hbox{$($}\kern\z@}\bigsize@1.2\ht\z@
+ \fi
+% \ex@ is supposed to come out to .8pt; multiplication factor may
+% need to be changed if Computer Modern is not being used. \jot,
+% a dimen register usually used for extra spacing between lines
+% of a multi-line displayed equation or similar structure, is
+% reset to 3\ex@ (in plain.tex it is 3pt).
+ \normalbaselines\eightrm\dotsspace@1.5mu\ex@.2326ex\jot3\ex@
+ \the\eightpoint@}
+%
+% \linespacing command to introduce a factor by which
+% \normalbaselineskip will be multiplied. Multiplying by the
+% factor will cause any stretch or shrink to be lost; normally
+% that's not a problem.
+\def\linespacing#1{%
+ \addto\tenpoint{\normalbaselineskip=#1\normalbaselineskip
+ \normalbaselines
+% Reset the strut boxes.
+ \setbox\strutbox=\hbox{\vrule height.7\normalbaselineskip
+ depth.3\normalbaselineskip width\z@}%
+ \setbox\strutbox@\hbox{\raise.5\normallineskiplimit
+ \vbox{\kern-\normallineskiplimit\copy\strutbox}}%
+ }%
+ \addto\eightpoint{\normalbaselineskip=#1\normalbaselineskip
+ \normalbaselines
+% Reset the strut boxes.
+ \setbox\strutbox=\hbox{\vrule height.7\normalbaselineskip
+ depth.3\normalbaselineskip width\z@}%
+ \setbox\strutbox@\hbox{\raise.5\normallineskiplimit
+ \vbox{\kern-\normallineskiplimit\copy\strutbox}}%
+ }%
+}
+%
+\def\extrafont@#1#2#3{\font#1=#2#3\relax}
+%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% Postscript versions of the math fonts from the AMSFonts
+% package, done jointly by Blue Sky Research and Y&Y, come only
+% in sizes 10, 7 and 5, i.e. sizes 9, 8 and 6 are not included.
+%
+% \PSAMSFonts can be called in the initialization, or by a user
+% before \document and \topmatter, to specify that sizes 9,8,6 of
+% AMS fonts should be scaled from nearby PS sizes.
+%
+\newif\ifPSAMSFonts
+\def\PSAMSFonts{%
+ \def\extrafont@##1##2##3{%
+ \font##1=##2%
+% Concatenate the proper size spec to the preceding letters
+ \ifnum##3=9 10 at9pt%
+ \else\ifnum##3=8 10 at8pt%
+ \else\ifnum##3=6 7 at6pt%
+% Sizes other than 9, 8 or 6 are not expected, so this branch might
+% generate an error:
+ \else ##3\fi\fi\fi\relax}%
+ \font@\eightsmc=cmcsc10 at 8pt
+ \font@\eightex=cmex10 at 8pt
+ \font@\sevenex=cmex10 at 7pt
+ \PSAMSFontstrue
+}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% If the user has specified \loadeufb, \loadbold, \loadeusm,
+% \loadeusm, \loadeurm, \loadeurb, we need to add eightpoint
+% fonts. We do this in \topmatter, and the user documentation
+% instructs the user to include any \load... command between
+% \documentstyle and \topmatter.
+%
+% At the same time, if PSAMSFonts has not been specified, add the
+% regular versions of the three fonts that need special handling.
+%
+\def\loadextrasizes@#1#2#3#4#5#6#7{%
+ \ifx\undefined#1%
+ \else \extrafont@{#4}{#2}{8}\extrafont@{#6}{#2}{6}%
+ \ifsyntax@
+ \else
+ \addto\tenpoint{\textfont#1#3\scriptfont#1#5%
+ \scriptscriptfont#1#7}%
+ \addto\eightpoint{\textfont#1#4\scriptfont#1#6%
+ \scriptscriptfont#1#7}%
+ \fi
+ \fi
+}
+%
+% Provide a mechanism for delaying additional font loading, which
+% may be necessary for some publications.
+%
+\newtoks\loadextrafonts@@
+\def\loadextrafonts@{%
+ \loadextrasizes@\msafam{msam}%
+ \tenmsa\eightmsa\sevenmsa\sixmsa\fivemsa
+ \loadextrasizes@\msbfam{msbm}%
+ \tenmsb\eightmsb\sevenmsb\sixmsb\fivemsb
+ \loadextrasizes@\eufmfam{eufm}%
+ \teneufm\eighteufm\seveneufm\sixeufm\fiveeufm
+ \loadextrasizes@\eufbfam{eufb}%
+ \teneufb\eighteufb\seveneufb\sixeufb\fiveeufb
+ \loadextrasizes@\eusmfam{eusm}%
+ \teneusm\eighteusm\seveneusm\sixeusm\fiveeusm
+ \loadextrasizes@\eusbfam{eusb}%
+ \teneusb\eighteusb\seveneusb\sixeusb\fiveeusb
+ \loadextrasizes@\eurmfam{eurm}%
+ \teneurm\eighteurm\seveneurm\sixeurm\fiveeurm
+ \loadextrasizes@\eurbfam{eurb}%
+ \teneurb\eighteurb\seveneurb\sixeurb\fiveeurb
+ \loadextrasizes@\cmmibfam{cmmib}%
+ \tencmmib\eightcmmib\sevencmmib\sixcmmib\fivecmmib
+ \loadextrasizes@\cmbsyfam{cmbsy}%
+ \tencmbsy\eightcmbsy\sevencmbsy\sixcmbsy\fivecmbsy
+ \let\loadextrafonts@\empty@
+ \ifPSAMSFonts
+ \else
+ \font@\eightsmc=cmcsc8 \relax
+ \font@\eightex=cmex8 \relax
+ \font@\sevenex=cmex7 \relax
+ \fi
+ \the\loadextrafonts@@
+}
+%
+% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% -4- GLOBAL VARIABLE SETTINGS
+% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\message{page dimension settings,}
+% First we set up some basic parameters, which are different than
+% in plain. These values are the ones currently in use (November
+% 1989) in the Journal of the AMS.
+%
+\parindent1pc
+\newdimen\normalparindent \normalparindent\parindent
+\normallineskiplimit\p@
+%
+% We use a common indent value for setting left and right margins
+% for abstract, table of contents, figure captions, and block
+% environments. The name is chosen as if we are going to have
+% several levels of indent, called \indenti, \indentii, ...; such
+% names can be constructed using \csname and \romannumeral with a
+% count register, which might be useful some time.
+%
+\newdimen\indenti \indenti=2pc
+%
+% Change \magnification (from plain.tex) so that it doesn't reset the
+% page dimensions to 6.5 x 9 true inches.
+\let\magnification=\mag
+%
+\topskip10pt \relax
+%
+%
+% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% -5- TOP MATTER DEFINITIONS
+% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\message{top matter,}
+% After it's first called, since
+% we do not need \topmatter any longer, we define it to be empty,
+% to release the memory that the definition takes up.
+%
+\def\topmatter{\loadextrafonts@ \let\topmatter\relax}
+%
+% \chapter is used within \title...\endtitle to produce something
+% such as "CHAPTER II", centered above the main text of the
+% chapter title. We do a little trickery with \afterassignment so
+% that the user can remove not only the word "CHAPTER" but also
+% the uppercasing and romannumeralizing by \nofrills. Note that
+% we can't use \ignorespaces after \chapter@ in the usual way
+% because it would get in the way of the \count@ assignment. In
+% fact spaces will be ignored by the assignment operation, the
+% only problem would be when \nofrills is used.
+%
+\def\chapterno@{\uppercase\expandafter{\romannumeral\chaptercount@}}
+%
+\newcount\chaptercount@
+%
+% In order to avoid interfering with \topskip, we put the
+% \chapter material in the first line of the title, and do some
+% box and glue tricks to get it in position.
+%
+% Perhaps need a test to make sure #1 is a number---if the user
+% does \chapter{IV} instead of \chapter{4} they may not
+% understand the error message they get.
+%
+% \chaptercount@ assignment needs to be global because we are
+% working from inside the first line of \title.
+%
+\def\chapter{\let\savedef@\chapter
+ \def\chapter##1{\let\chapter\savedef@
+ \leavevmode\hskip-\leftskip
+% Put the \chapter stuff in an \rlap so it doesn't affect
+% centering of the title, and in an "uplap" so it is placed above
+% where we want it.
+ \rlap{\vbox to\z@{\vss\centerline{\eightpoint
+% We do a baselineskip of 2pc from the base of the "CHAPTER"
+% banner to the base of the first title line. (The baseline of
+% the \null will coincide with the baseline of the first title
+% line.)
+ \frills@{CHAPTER\space\afterassignment\chapterno@
+ \global\chaptercount@=}%
+ ##1\unskip}\baselineskip2pc\null}}\hskip\leftskip}%
+ \nofrillscheck\chapter}
+%
+% We store the title in a box using a \setbox. It could also be
+% done by defining \thetitle@. One advantage of \setbox is that
+% syntax errors within the title (say for math) are reported
+% immediately instead of during the processing of \endtopmatter.
+% The title box is always put on the page by \endtopmatter, even
+% if it's empty. (With other pieces of the topmatter we check
+% first to see whether there's any text to typeset and skip to
+% the next item if not.) The text of the title is stored up for
+% the running heads, unless \rightheadtoks is nonempty---then
+% presumably the user has already used \rightheadtext to set the
+% right-hand running head, in which case we leave it unchanged.
+%
+% The default for titles is uppercasing. From a design
+% standpoint it might be preferable to do titles in 14-point text
+% with initial caps, but since titles may potentially contain any
+% kind of math, doing this would require a full-fledged
+% \fourteenpoint analogous to \tenpoint. So to give the title
+% extra prominence we use uppercasing instead. The uppercasing
+% can be removed by \nofrills.
+%
+\newbox\titlebox@
+%
+\def\title{\let\savedef@\title
+% We use a \vtop here because we want to know the height of the
+% first line of the title when we start typesetting the
+% topmatter, in order to get the correct sinkage from the top of
+% the page.
+ \def\title##1\endtitle{\let\title\savedef@
+ \global\setbox\titlebox@\vtop{\tenpoint\bf
+ \raggedcenter@
+% Increased \baselineskip is because of the uppercasing. We do
+% it like this instead of putting it inside the \uppercasetext@
+% macro, because it only applies where an entire paragraph is
+% made up of uppercase text.
+ \baselineskip1.3\baselineskip
+ \frills@\uppercasetext@{##1}\endgraf}%
+% Check to see if right and left hand running heads have been
+% already assigned by the user---if so, don't override.
+ \ifmonograph@
+ \edef\next{\the\leftheadtoks}\ifx\next\empty@ \leftheadtext{##1}\fi
+ \fi
+ \edef\next{\the\rightheadtoks}\ifx\next\empty@ \rightheadtext{##1}\fi
+ }%
+ \nofrillscheck\title}
+%
+% Currently \author has no need for a \nofrills option, unlike
+% \title, since uppercasing is not done.
+%
+\newbox\authorbox@
+\def\author#1\endauthor{\global\setbox\authorbox@
+ \vbox{\tenpoint\smc\raggedcenter@ #1\endgraf}\relaxnext@
+ \edef\next{\the\leftheadtoks}%
+ \ifx\next\empty@\leftheadtext{#1}\fi}
+%
+\newbox\affilbox@
+\def\affil#1\endaffil{\global\setbox\affilbox@
+ \vbox{\tenpoint\raggedcenter@#1\endgraf}}
+%
+% Since \address can be used any number of times, we have to
+% store the different addresses in control sequences that we
+% manufacture as needed. We use \addresscount@ to store the
+% number of times \address is used.
+%
+\newcount\addresscount@
+\addresscount@\z@
+\def\addressfont@{\eightpoint}
+\def\address#1\endaddress{\global\advance\addresscount@\@ne
+% The first address is `\address1', the next is `\address2', etc.
+ \expandafter\gdef\csname address\number\addresscount@\endcsname
+% The unusually large shrinkability in the vskip before the
+% address is there because we don't want the addresses to fall on
+% a separate page at the end of a paper, and extra shrinkability
+% may help them to fit on the previous page in borderline cases.
+ {\nobreak\vskip12\p@ minus6\p@\indent\addressfont@\smc#1\par}}
+%
+% \curraddr was added in version 2.1. It uses the address count
+% without advancing it, to add to the most recent address macro.
+% Ignore empty element; all optional elements are ignored if empty.
+%
+\def\curraddr{\let\savedef@\curraddr
+ \def\curraddr##1\endcurraddr{\let\curraddr\savedef@
+ \if\notempty{##1}%
+ \toks@\expandafter\expandafter\expandafter{%
+ \csname address\number\addresscount@\endcsname}%
+ \toks@@{##1}%
+ \expandafter\xdef\csname address\number\addresscount@\endcsname
+ {\the\toks@\endgraf\noexpand\nobreak
+ \indent\noexpand\addressfont@{\noexpand\rm
+ \frills@{{\noexpand\it Current address\noexpand\/}:\space}%
+ \def\noexpand\usualspace{\space}\the\toks@@\unskip}}%
+ \fi}%
+ \nofrillscheck\curraddr}
+%
+% \email uses the same counter as \address, since they should
+% pair up.
+%
+% Email patch to get tt font
+\def\email{\let\savedef@\email
+ \def\email##1\endemail{\let\email\savedef@
+ \if\notempty{##1}%
+ \toks@{\def\usualspace{{\it\enspace}}\endgraf\indent\addressfont@}%
+ \toks@@{{\tt##1}\par}%
+ \expandafter\xdef\csname email\number\addresscount@\endcsname
+ {\the\toks@\frills@{{\noexpand\it E-mail address\noexpand\/}:%
+ \noexpand\enspace}\the\toks@@}%
+ \fi}%
+ \nofrillscheck\email}
+%
+% \urladdr the same as \email, with the addition that \tildechar
+% is provided for printing this character in a URL.
+\def\tildechar{{\tt\char`\~}}
+\def\urladdr{\let\savedef@\urladdr
+ \def\urladdr##1\endurladdr{\let\urladdr\savedef@
+ \if\notempty{##1}%
+ \toks@{\def\usualspace{{\it\enspace}}\endgraf\indent\eightpoint}%
+ \toks@@{\tt##1\par}%
+ \expandafter\xdef\csname urladdr\number\addresscount@\endcsname
+ {\the\toks@\frills@{{\noexpand\it URL\noexpand\/}:%
+ \noexpand\enspace}\the\toks@@}%
+ \fi}%
+ \nofrillscheck\urladdr}
+%
+\def\thedate@{}
+\def\date#1\enddate{\gdef\thedate@{\tenpoint#1\unskip}}
+%
+\def\thethanks@{}
+\def\thanks#1\endthanks{%
+ \if\notempty{#1}%
+ \ifx\thethanks@\empty@ \gdef\thethanks@{\eightpoint#1}%
+ \else
+ \expandafter\gdef\expandafter\thethanks@\expandafter{%
+ \thethanks@\endgraf#1}%
+ \fi
+ \fi}
+%
+\def\thekeywords@{}
+\def\keywords{\let\savedef@\keywords
+ \def\keywords##1\endkeywords{\let\keywords\savedef@
+ \if\notempty{##1}%
+ \toks@{\def\usualspace{{\it\enspace}}\eightpoint}%
+ \toks@@{##1\unskip.}%
+ \edef\thekeywords@{\the\toks@\frills@{{\noexpand\it
+ Key words and phrases.\noexpand\enspace}}\the\toks@@}%
+ \fi}%
+ \nofrillscheck\keywords}
+%
+% \subjclass is analogous to \keywords. We also need a year; only
+% certain years are valid, so we check and report an error if an
+% invalid year is entered. Default to 1991, so that archived
+% material will be processed correctly.
+% We should also check in case a LaTeX-style year change, [...], is
+% entered and report an error for that as well; however, that is
+% more complicated, and not implemented in this round. [2001/02/28]
+%
+\def\xci@{1991}
+\def\mm@{2000}
+\def\subjclassyear#1{%
+ \def\subjyear@{#1}%
+ \ifx\subjyear@\mm@
+ \else \ifx\subjyear@\xci@
+ \else \message{AmS-TeX warning: Unknown edition (#1) of
+ Mathematics Subject Classification; using 1991 edition}%
+ \def\subjyear@{1991}%
+ \fi\fi}
+\subjclassyear{1991}
+\def\thesubjclass@{}
+\def\subjclass{\let\savedef@\subjclass
+ \def\subjclass##1\endsubjclass{\let\subjclass\savedef@
+ \toks@{\def\usualspace{{\rm\enspace}}\eightpoint}%
+ \toks@@{##1\unskip.}%
+ \edef\thesubjclass@{\the\toks@
+ \frills@{{\noexpand\rm\noexpand\subjyear@\noexpand\space
+ {\noexpand\it Mathematics Subject Classification}.\noexpand\enspace}}%
+ \the\toks@@}}%
+ \nofrillscheck\subjclass}
+%
+% Put the abstract in a box with margins at each side equal to
+% \indenti, obtained by reducing \hsize within a vbox centered by
+% $$...$$. Notice that the \noindent is not erased by \nofrills
+% and that's what we want.
+%
+\newbox\abstractbox@
+\def\abstract{\let\savedef@\abstract
+ \def\abstract{\let\abstract\savedef@
+ \setbox\abstractbox@\vbox\bgroup\noindent$$\vbox\bgroup
+ \def\envir@end{\endabstract}\advance\hsize-2\indenti
+ \def\usualspace{\enspace}\eightpoint \noindent
+ \frills@{{\smc Abstract.\enspace}}}%
+ \nofrillscheck\abstract}
+%
+% Finish the box. The \unskip is here in case the abstract ends
+% with something that adds vertical space, such as a \proclaim.
+%
+\def\endabstract{\par\unskip\egroup$$\egroup}
+%
+% \widestnumber used to reset hanging indention in a table of
+% contents or bibliography. Other applications may also be added
+% later.
+%
+% The outerness of the heading macros causes problems. Therefore
+% we process \widestnumber in two stages: first, inside a group,
+% removing the outerness by letting the macros = \relax. Then,
+% using an \expandafter\endgroup trick, we read the arguments
+% while the macros are still nonouter, but process the arguments
+% after we have exited from the group.
+%
+% Now that \no is deprecated, provide for the possibility that
+% \refstyle C has been set before testing for \widestnumber,
+% and if so, don't reset it. [bnb, 1996/12/22]
+%
+\def\widestnumber{\begingroup \let\head\relax\let\subhead\relax
+ \let\subsubhead\relax \expandafter\endgroup\setwidest@}
+%
+\def\setwidest@#1#2{%
+ \ifx#1\head\setbox\tocheadbox@\hbox{#2.\enspace}%
+ \else\ifx#1\subhead\setbox\tocsubheadbox@\hbox{#2.\enspace}%
+ \else\ifx#1\subsubhead\setbox\tocsubheadbox@\hbox{#2.\enspace}%
+ \else\ifx#1\key
+ \if C\refstyle@ \else\refstyle A\fi
+ \setboxz@h{\refsfont@\keyformat{#2}}%
+ \refindentwd\wd\z@
+ \else\ifx#1\no\refstyle C%
+ \setboxz@h{\refsfont@\keyformat{#2}}%
+ \refindentwd\wd\z@
+ \else\ifx#1\page\setbox\z@\hbox{\quad\bf#2}%
+ \pagenumwd\wd\z@
+% We assume the default form for \item numbers rather than trying
+% to handle all the variations such as "..."
+ \else\ifx#1\item
+ \setboxz@h{(#2)}\rosteritemwd\wdz@
+ \else\message{\string\widestnumber\space not defined for this
+ option (\string#1)}%
+\fi\fi\fi\fi\fi\fi\fi}
+%
+% \Monograph is capitalized by analogy with \NoRunningHeads and
+% \UseAMSsymbols because of its global scope. We don't use
+% \global's because if the user puts \Monograph in the preamble
+% area as instructed it will automatically have global effect,
+% and in some special applications (e.g. documentation) it may be
+% nice to be able to localize the effect. \Monograph changes
+% paragraph indention from none to normal for certain structures
+% (subhead, proclaim, definition, ...) via \varindent@; it also
+% changes fonts for \head, \proclaim, \definition, \example,
+% \demo, and \remark.
+%
+% The \ifmonograph@ test is used to decide whether to save a \toc
+% in a box or typeset it immediately, as well as whether to
+% typeset \thanks, \subjclass, and \keywords footnotes .
+%
+\newif\ifmonograph@
+%
+\def\Monograph{\monograph@true \let\headmark\rightheadtext
+ \let\varindent@\indent \def\headfont@{\bf}\def\proclaimheadfont@{\smc}%
+ \def\remarkheadfont@{\smc}}
+%
+\let\varindent@\noindent
+%
+\newbox\tocheadbox@ \newbox\tocsubheadbox@
+\newbox\tocbox@
+%
+% Allocate a dimen register for the width of the page number
+% column in table of contents. The true value of \pagenumwd
+% is not assigned until \toc is actually called, to avoid
+% initialization complications.
+\newdimen\pagenumwd
+%
+\def\toc{\toc@{Contents}}
+%
+% We make a separate macro that just redefines \title, \chapter,
+% \specialhead, \head, \subhead, \subsubhead, to simplify the
+% code of \toc. This also makes it a little easier to work
+% around the outerness that most of them have.
+%
+\def\newtocdefs{%
+% The space after "\def" in these redefinitions is a convenience
+% for someone who wants to look for the main definitions---if
+% they search for "\def\title" the search will pass over "\def
+% \title" and find the main definition further down.
+ \def \title##1\endtitle
+ {\penaltyandskip@\z@\smallskipamount
+ \hangindent\wd\tocheadbox@\noindent{\bf##1}}%
+ \def \chapter##1{%
+ Chapter \uppercase\expandafter{%
+ \romannumeral##1.\unskip}\enspace}%
+ \def \specialhead##1\endspecialhead
+ {\par\hangindent\wd\tocheadbox@ \noindent##1\par}%
+ \def \head##1 ##2\endhead
+ {\par\hangindent\wd\tocheadbox@ \noindent
+ \if\notempty{##1}\hbox to\wd\tocheadbox@{\hfil##1\enspace}\fi
+ ##2\par}%
+% Since \subhead and \subsubhead change the \leftskip, we need to
+% do a \par before closing the group that localizes the change.
+% Unlike \head, we do not try to right-align the numbers.
+%
+ \def \subhead##1 ##2\endsubhead
+ {\par\vskip-\parskip {\normalbaselines
+ \advance\leftskip\wd\tocheadbox@
+ \hangindent\wd\tocsubheadbox@ \noindent
+ \if\notempty{##1}%
+ \hbox to\wd\tocsubheadbox@{##1\unskip\hfil}\fi
+ ##2\par}}%
+ \def \subsubhead##1 ##2\endsubsubhead
+ {\par\vskip-\parskip {\normalbaselines
+ \advance\leftskip\wd\tocheadbox@
+ \hangindent\wd\tocsubheadbox@ \noindent
+ \if\notempty{##1}%
+ \hbox to\wd\tocsubheadbox@{##1\unskip\hfil}\fi
+ ##2\par}}}
+%
+\def\toc@#1{\relaxnext@
+ \DN@{\ifx\next\nofrills\DN@\nofrills{\nextii@}%
+ \else\DN@{\nextii@{{#1}}}\fi
+ \next@}%
+ \DNii@##1{%
+% If we're doing a book table of contents, we avoid setting the
+% whole thing in a box because if it's several pages long we
+% might run out of memory.
+\ifmonograph@\bgroup\else\setbox\tocbox@\vbox\bgroup
+ \centerline{\headfont@\ignorespaces##1\unskip}\nobreak
+ \vskip\belowheadskip \fi
+% Redefine \page (it has another definition normally, for use in
+% references). The \hfilneg at the end is to cancel the
+% \parfillskip; the \penalty is to keep the \hfilneg from being
+% removed (normal processing at the end of a paragraph removes the
+% last skip).
+ \def\page####1%
+ {\unskip\penalty\z@\null\hfil
+ \rlap{\hbox to\pagenumwd{\quad\hfil####1}}%
+ \hfilneg\penalty\@M}%
+ \setbox\tocheadbox@\hbox{0.\enspace}%
+ \setbox\tocsubheadbox@\hbox{0.0.\enspace}%
+ \leftskip\indenti \rightskip\leftskip
+% Increase \rightskip to move in the right margin to leave room
+% for page numbers (which will hang over into the "right margin").
+% The \bf is for taking into account page numbers for chapter titles,
+% which are bold. A little extra width shouldn't hurt for toc's
+% without chapter titles.
+ \setboxz@h{\bf\quad000}\pagenumwd\wd\z@
+ \advance\rightskip\pagenumwd
+% Redefine all the heading macros to be their table-of-contents
+% versions.
+ \newtocdefs
+ }%
+ \FN@\next@}
+%
+% The \egroup closes the \vbox; or if we're in a monograph, just
+% matches the beginning \bgroup.
+%
+\def\endtoc{\par\egroup}
+%
+% \pretitle, ..., \prepaper are entry points between the other
+% parts of the \topmatter so that users can insert things if
+% necessary. If \pretitle is used to put any kind of box on the
+% page, it will throw off the sinkage of the title and everything
+% will have to be recalculated.
+%
+\let\pretitle\relax
+\let\preauthor\relax
+\let\preaffil\relax
+\let\predate\relax
+\let\preabstract\relax
+\let\prepaper\relax
+%
+% Now \dedicatory shows how to make use of the \pre... entry
+% points defined above.
+%
+\def\dedicatory #1\enddedicatory{\def\preabstract{{\medskip
+ \eightpoint\it \raggedcenter@#1\endgraf}}}
+%
+% A hook is provided for a translator name, for translations.
+% \eightpoint is used instead of just \eightrm, to be on the safe
+% side. For instance, in transliteration some Russian names have
+% a ``prime'' symbol to represent the Russian ``soft sign''. If
+% we didn't use \eightpoint we'd get a 10-point prime symbol.
+%
+\def\thetranslator@{}
+\def\translator{%
+ \let\savedef@\translator
+ \def\translator##1\endtranslator{\let\translator\savedef@
+ \edef\thetranslator@{\noexpand\nobreak\noexpand\medskip
+ \noexpand\line{\noexpand\eightpoint\hfil
+ \frills@{Translated by \uppercase}{##1}\qquad\qquad}%
+ \noexpand\nobreak}}%
+ \nofrillscheck\translator}
+%
+% \endtopmatter now puts all of these things together on the
+% page. We start by checking to see if the left-hand running head
+% has been defined; if not, presumably it's because \author has
+% not been used, and presumably that means we are in a book
+% chapter rather than in an article. So we define it to be the
+% same as the right-hand running head, which will usually be the
+% text of the title.
+%
+% When doing chapters in a book, \subjclass, \keywords and
+% \thanks should not print at the bottom of the page.
+%
+% The baseline of the title should always fall at a fixed
+% distance from the top of the page, so we do the spacing with
+% \topskip instead of \vskip.
+%
+% The spacing between elements of the topmatter in AMSPPT is
+% intended to be the same as in the Journal of the AMS; however
+% the actual spacing currently used in the latter is the rather
+% idiosyncratic result of a couple of years of piecemeal changes,
+% so that rather than follow it blindly we have opted to come as
+% close as possible by choosing whole or half-pica amounts. The
+% situation is further complicated by the fact that the
+% documentstyle for the Journal of the AMS uses a different
+% method for putting running heads on the page, so that we cannot
+% measure distance from the top of the page in the same way; and
+% the date, affiliation, and abstract are handled differently as
+% well.
+%
+% In this diagram the first measurement is from the top of the
+% type block to the baseline of the first line of the title. In
+% the Journal of the AMS the value is 5.5pc rather than 4pc,
+% because it's measured to the top of the running head (which
+% extends above the text block). The rest of the measurements are
+% approximate visual space, done in \endtopmatter by \vskip's;
+% the effective base-to-base distance is approximately half a
+% pica more than the amount of the \vskip.
+%
+% ______________________________ top of type area
+% | (according to \pageheight)
+% | 4pc baselineskip
+% | |----------------------|
+% __|___|_______ TITLE ________|__
+% | WHICH MAY BE SEVERAL |
+% | LINES LONG |
+% |----------------------|
+% 2.5pc
+% |--------|
+% | AUTHOR |
+% |--------|
+% 1pc
+% |--------|
+% | AFFIL |
+% |--------|
+% 1pc
+% |------|
+% | DATE |
+% |------|
+% 1pc
+% |------------|
+% | DEDICATORY |
+% |------------|
+% 1.5pc
+% |------------------------------|
+% | ABSTRACT |
+% |------------------------------|
+% 1.5pc
+% |------------------------------|
+% | TABLE OF CONTENTS |
+% |------------------------------|
+% 2pc
+% |-----------------------------------|
+% | START OF TEXT |
+% | |
+%
+%
+% Make this \outer to catch missing or misspelled \end... in the
+% topmatter. It doesn't work with \abstract though because that
+% uses the \setbox\vbox\bgroup ... \egroup mechanism, so we use
+% \add@missing to catch missing \endabstract's.
+%
+\outer\def\endtopmatter{\add@missing\endabstract
+ \edef\next{\the\leftheadtoks}%
+ \ifx\next\empty@
+ \expandafter\leftheadtext\expandafter{\the\rightheadtoks}%
+ \fi
+ \ifmonograph@\else
+ \ifx\thesubjclass@\empty@\else \makefootnote@{}{\thesubjclass@}\fi
+ \ifx\thekeywords@\empty@\else \makefootnote@{}{\thekeywords@}\fi
+% If \thanks given, treat it as a footnote text (with no footnote
+% mark).
+ \ifx\thethanks@\empty@\else \makefootnote@{}{\thethanks@}\fi
+ \fi
+ \inslogo@
+% We want a sinkage of 4pc from the top of the page (= the top of
+% the text area, not including the running heads) for articles,
+% and 7pc for monograph chapters.
+ \pretitle
+ \begingroup % to localize variant topskip
+ \ifmonograph@ \topskip7pc \else \topskip4pc \fi
+% We don't unvbox the titlebox because we don't expect footnotes
+% to ever appear in the title, so we don't need to worry about
+% allowing them to migrate to the outer level. (Some journals
+% use footnotes in titles to give acknowledgments of research
+% support; in AMSPPT this is an unnumbered footnote, done with
+% \thanks, outside of the title.)
+ \box\titlebox@
+ \endgroup
+ \preauthor
+ \ifvoid\authorbox@\else \vskip2.5pcplus1pc\unvbox\authorbox@\fi
+ \preaffil
+ \ifvoid\affilbox@\else \vskip1pcplus.5pc\unvbox\affilbox@\fi
+ \predate
+ \ifx\thedate@\empty@\else
+ \vskip1pcplus.5pc\line{\hfil\thedate@\hfil}\fi
+ \preabstract
+ \ifvoid\abstractbox@\else
+ \vskip1.5pcplus.5pc\unvbox\abstractbox@ \fi
+ \ifvoid\tocbox@\else\vskip1.5pcplus.5pc\unvbox\tocbox@\fi
+ \prepaper
+ \vskip2pcplus1pc\relax
+}
+%
+\newif\ifdocument@ \document@false
+\def\document{\document@true
+% We call \loadextrafonts@ here as well as in \topmatter; this is
+% to allow use of the extra sizes of the fonts in e.g. test documents
+% that don't include a full topmatter section. If \topmatter was
+% executed, \loadextrafonts@ will now be a harmless no-op.
+ \loadextrafonts@
+ \let\fontlist@\relax\let\alloclist@\relax
+% Start out in \tenpoint
+ \tenpoint}
+%
+%
+% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% -6- SECTION HEADINGS
+% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\message{section heads,}
+% In accordance with conventional design principles, the space
+% below headings is not given any stretchability or
+% shrinkability.
+%
+\newskip\aboveheadskip \aboveheadskip\bigskipamount
+\newdimen\belowheadskip \belowheadskip6\p@
+\def\headfont@{\smc}
+%
+% Since we often want to do a penalty and vskip, and since there
+% are extra complications involved if there is a preceding vskip
+% from something else, we define a macro to do it. Normally it
+% is used while we're working on the main vertical list, so we
+% have to use \removelastskip (which does a negative skip) rather
+% than \unskip (which REALLY removes the last skip). If the last
+% thing on the main vertical list is anything other than a vskip,
+% say a penalty from \pagebreak, the value returned by \lastskip
+% will be 0, but the potential complications are a whole other
+% subject. This macro handles the straightforward cases.
+%
+% In some cases we may not want to put a penalty at all.
+% We refrain from doing any penalty if the first argument of
+% \penaltyandskip@ is 0; the essential effect of an explicit
+% \penalty0 can be gotten by doing a penalty of 1 instead.
+%
+% We use \penalty@ instead of \penalty, so that we can redefine
+% \penalty@ in \nobreak, to prevent page breaks between certain
+% pairs such as \head \subhead or \head \proclaim or \nopagebreak
+% \proclaim ---for example, in
+%
+% "... which leads to this theorem:
+% \proclaim{Theorem 8.2} ..."
+%
+% a page break after the colon would be bad, and a user might
+% want to be able to add a \nopagebreak.
+%
+% The sequence
+%
+% \subhead Text...\endsubhead
+% \subsubhead Text...\endsubsubhead
+%
+% will still have the weakness of allowing a pagebreak between
+% the two headings, because \endsubhead doesn't do a \nobreak
+% (since it's a run-in heading.
+%
+\def\penaltyandskip@#1#2{\par\skip@#2\relax
+ \ifdim\lastskip<\skip@\relax\removelastskip
+ \ifnum#1=\z@\else\penalty@#1\relax\fi\vskip\skip@
+ \else\ifnum#1=\z@\else\penalty@#1\relax\fi\fi}
+%
+% The above code contains a bug: if \lastskip=\skip@ (as it does
+% between two adjacent theorems), and this point coincides with
+% a page break, the \lastskip will remain at the bottom of the
+% page. This could be corrected by reformulating the code, but
+% page breaks would change; therefore, no change has been made,
+% for reasons of backward compatibility. However, the following
+% code would `do the right thing':
+%
+% \def\penaltyandskip@#1#2{\par\skip@#2\relax
+% \ifdim\lastskip>\skip@
+% \ifnum#1=\z@\else\penalty@#1\relax\fi
+% \else\relax\removelastskip
+% \ifnum#1=\z@\else\penalty@#1\relax\fi\vskip\skip@
+% \fi}
+%
+% When a page ends with space from \lastskip, inserting \pagebreak
+% at the end of the text of the last element (before \end...) will
+% remove the space; \removelastskip before the beginning of the
+% next element has no lasting effect, as it inserts a negative skip
+% that is smaller than the new skip applied with \penaltyandskip@,
+% and is therefore removed.
+%
+\def\nobreak{\penalty\@M
+% Change the definition of \penalty@ so that the following number
+% will be gobbled (by assigning it to the scratch register
+% \count@@@).
+ \ifvmode\gdef\penalty@{\global\let\penalty@\penalty\count@@@}%
+% If the next piece of the document after \nobreak is something
+% like \subhead or \proclaim that calls \penaltyandskip@, then
+% \penalty@ will reset itself in the way that we want. But if
+% not, then we still want to reset \penalty@; so we use
+% \everypar. There are probably some unusual cases that will
+% still have problems, but at the moment this is the best
+% solution we have.
+ \everypar{\global\let\penalty@\penalty\everypar{}}\fi}
+%
+\let\penalty@\penalty
+%
+% We equate the old form of the headings to the new form, for
+% backward compatibility. It's easier to do this now rather than
+% later because \head and \subhead are going to be outer.
+%
+\def\heading#1\endheading{\head#1\endhead}
+\def\subheading{\DN@{\ifx\next\nofrills
+ \expandafter\subheading@
+ \else \expandafter\subheading@\expandafter\empty@
+ \fi}%
+ \FN@\next@
+}
+\def\subheading@#1#2{\subhead#1#2\endsubhead}
+%
+% One more heading level, for occasional use. This is the next
+% level ABOVE \head. The default style is ragged right;
+% otherwise it's the same as \head.
+%
+\newskip\abovespecialheadskip
+\abovespecialheadskip=\aboveheadskip
+\def\specialheadfont@{\bf}
+\outer\def\specialhead{%
+ \add@missing\endroster \add@missing\enddefinition
+ \add@missing\enddemo \add@missing\endexample
+ \add@missing\endproclaim
+ \penaltyandskip@{-200}\abovespecialheadskip
+ \begingroup\interlinepenalty\@M\rightskip\z@ plus\hsize
+ \let\\\linebreak
+ \specialheadfont@\noindent}
+\def\endspecialhead{\par\endgroup\nobreak\vskip\belowheadskip}
+%
+% penalty-200 is the penalty amount used by plain.tex's
+% \bigbreak.
+%
+\outer\def\head#1\endhead{%
+ \add@missing\endroster \add@missing\enddefinition
+ \add@missing\enddemo \add@missing\endexample
+ \add@missing\endproclaim
+ \penaltyandskip@{-200}\aboveheadskip
+ {\headfont@\raggedcenter@\interlinepenalty\@M
+ #1\endgraf}\headmark{#1}%
+ \nobreak
+ \vskip\belowheadskip}
+%
+% \headmark will be redefined to be \rightheadtext by \Monograph.
+%
+\let\headmark\eat@
+%
+% The purpose of \restoredef@ is to work around problems caused
+% by the outerness of things like \subhead. \relax at the
+% beginning prevents the \savedef@ (which may be \outer) from
+% being read prematurely in certain kinds of expansion.
+%
+\def\restoredef@#1{\relax\let#1\savedef@\let\savedef@\relax}
+%
+% \subhead and \subsubhead are simpler, though they allow
+% \nofrills. (\head, being centered, does not have automatic
+% punctuation put in at the end and so \nofrills doesn't have
+% anything to do.) The syntax of \subhead is changed from
+% \subheading{...} (version 1) to \subhead...\endsubhead (version
+% 2). This was done for the following reasons: (1) to be
+% consistent with \head...\endhead (we could have changed \head
+% instead of \subhead, but the \x...\endx syntax is the one
+% currently in use in AMS production); (2) if someone (perhaps
+% us) ever wants to do something tricky with the headings, having
+% the \end... may help them avoid technical complications.
+%
+\newskip\subheadskip \subheadskip\medskipamount
+\def\subheadfont@{\bf}
+\outer\def\subhead{%
+ \add@missing\endroster \add@missing\enddefinition
+ \add@missing\enddemo \add@missing\endexample
+ \add@missing\endproclaim
+ \let\savedef@\subhead \let\subhead\relax
+ \def\subhead##1\endsubhead{\restoredef@\subhead
+ \penaltyandskip@{-100}\subheadskip
+% Add italic correction in \usualspace, because \subheadfont@ is
+% italic, in case the substituted punctuation is something tall
+% like a question mark or exclamation point.
+ {\def\usualspace{\/{\subheadfont@\enspace}}%
+ \varindent@\subheadfont@\ignorespaces##1\unskip\frills@{.\enspace}}%
+ \ignorespaces}%
+ \nofrillscheck\subhead}
+%
+% In version 2.0 of amsppt.sty we also add a third level of
+% heading, \subsubhead.
+%
+\newskip\subsubheadskip \subsubheadskip\medskipamount
+\def\subsubheadfont@{\it}
+\outer\def\subsubhead{%
+ \add@missing\endroster \add@missing\enddefinition
+ \add@missing\enddemo
+ \add@missing\endexample \add@missing\endproclaim
+ \let\savedef@\subsubhead \let\subsubhead\relax
+ \def\subsubhead##1\endsubsubhead{\restoredef@\subsubhead
+ \penaltyandskip@{-50}\subsubheadskip
+% Add italic correction in \usualspace, because \subsubheadfont@
+% is italic, in case the substituted punctuation is something tall
+% like a question mark or exclamation point.
+ {\def\usualspace{\/{\subsubheadfont@\enspace}}%
+ \subsubheadfont@##1\unskip\frills@{.\enspace}}\ignorespaces}%
+ \nofrillscheck\subsubhead}
+%
+%
+% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% -7- THEOREM ENVIRONMENTS AND SIMILAR STRUCTURES
+% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\message{theorems/proofs/definitions/remarks,}
+%
+\def\proclaimheadfont@{\bf}
+% Make \proclaimfont a non-private control sequence, so that
+% users can change it back to \sl if desired without
+% complications.
+\def\proclaimfont{\it}
+%
+\newskip\preproclaimskip \preproclaimskip=\medskipamount
+\newskip\postproclaimskip \postproclaimskip=\medskipamount
+\outer\def\proclaim{%
+ \let\savedef@\proclaim \let\proclaim\relax
+ \add@missing\endroster \add@missing\enddefinition
+ \add@missing\endproclaim \envir@stack\endproclaim
+% penalty-100 is the penalty amount used by plain.tex's
+% \medbreak.
+ \def\proclaim##1{\restoredef@\proclaim
+ \penaltyandskip@{-100}\preproclaimskip
+ {\def\usualspace{\/{\proclaimheadfont@\enspace}}%
+ \varindent@\proclaimheadfont@\ignorespaces##1\unskip
+ \frills@{.\enspace}}%
+ \proclaimfont\ignorespaces}%
+ \nofrillscheck\proclaim}
+%
+% \endproclaim ends the paragraph, switches back to \rm and adds
+% spacing. (This means that if, for some strange reason, a whole
+% section of text happens to be in italics, then the user must
+% type \it again after each \endproclaim, but that seems too
+% special a case to need providing for.) Version 2.1 change:
+% removed \outer prefix, to simplify some programming related
+% to \add@missing and \revert@envir.
+%
+\def\endproclaim{\revert@envir\endproclaim \par\rm
+ \vskip\postproclaimskip}
+%
+% In \remark, we take the opportunity again to issue an error
+% message if a previous \proclaim has no matching \endproclaim.
+%
+\def\remarkheadfont@{\it}
+\def\remarkfont{\rm}
+\newskip\remarkskip \remarkskip=\medskipamount
+\def\remark{\let\savedef@\remark \let\remark\relax
+ \add@missing\endroster \add@missing\endproclaim
+ \envir@stack\endremark
+ \def\remark##1{\restoredef@\remark
+ \penaltyandskip@\z@\remarkskip
+ {\def\usualspace{\/{\remarkheadfont@\enspace}}%
+ \varindent@\remarkheadfont@\ignorespaces##1\unskip
+ \frills@{.\enspace}}%
+ \remarkfont\ignorespaces}%
+ \nofrillscheck\remark}
+%
+% \endremark is easy.
+%
+\def\endremark{\par\revert@envir\endremark}
+%
+% Assumption: \square is defined in initialization (normally via
+% \UseAMSsymbols).
+\def\qed{\ifhmode\unskip\nobreak\fi\quad
+ \ifmmode\square\else$\m@th\square$\fi}
+%
+% Proofs are the same as Remarks, except there is an additional
+% \medskip after a Proof. We don't have a runaway demo or remark
+% check until \enddocument because proofs within proofs (and
+% perhaps remarks within remarks) are possible.
+%
+\newskip\postdemoskip \postdemoskip=\medskipamount
+% Ensure that there is no lingering indication of a manual end-of-proof box.
+\newif\if@qedhere
+\def\demo{%
+ \@qedherefalse
+ \DN@{\ifx\next\nofrills
+ \DN@####1####2{\remark####1{####2}\envir@stack\enddemo
+ \ignorespaces}%
+ \else
+ \DN@####1{\remark{####1}\envir@stack\enddemo\ignorespaces}%
+ \fi
+ \next@}%
+\FN@\next@}
+%
+\def\enddemo{\par\revert@envir\enddemo \endremark\vskip\postdemoskip}
+%
+% \definition uses \proclaimheadfont@ because normally the two
+% use the same font for the head font, with \definition using \rm
+% for the text as opposed to the \it used for \proclaim.
+%
+\def\definitionfont{\rm}
+\newskip\predefinitionskip \predefinitionskip=\medskipamount
+\newskip\postdefinitionskip \postdefinitionskip=\medskipamount
+\def\definition{\let\savedef@\definition \let\definition\relax
+ \add@missing\endproclaim \add@missing\endroster
+ \add@missing\enddefinition \envir@stack\enddefinition
+% \proclaimheadfont@ comes after the period here because
+% sometimes we want the period to be roman rather than bold, e.g.
+% when the preceding thing is a math formula or a citation, set
+% in roman type.
+ \def\definition##1{\restoredef@\definition
+ \penaltyandskip@{-100}\predefinitionskip
+ {\def\usualspace{\/{\proclaimheadfont@\enspace}}%
+ \varindent@\proclaimheadfont@\ignorespaces##1\unskip
+ \frills@{.\proclaimheadfont@\enspace}}%
+ \definitionfont\ignorespaces}%
+ \nofrillscheck\definition}
+\def\enddefinition{\revert@envir\enddefinition
+ \par\vskip\postdefinitionskip}
+%
+\def\example{%
+ \DN@{\ifx\next\nofrills
+ \DN@####1####2{\definition####1{####2}\envir@stack\endexample
+ \ignorespaces}%
+ \else
+ \DN@####1{\definition{####1}\envir@stack\endexample\ignorespaces}%
+ \fi
+ \next@}%
+\FN@\next@}
+\def\endexample{\revert@envir\endexample \enddefinition }
+%
+%
+% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% -8- ROSTERS
+% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\message{rosters,}
+% In version 2 of amsppt we provide a more convenient way of
+% changing the indention of roster items.
+%
+\newdimen\rosteritemwd
+\rosteritemwd16pt % approximately the width of (iii) in 10 point text
+%
+% \roster uses \rostercount@ to store the \item number. The first
+% item is treated specially, because of the extra space before
+% it, so we need a flag \iffirstitem@ to identify it.
+%
+\newcount\rostercount@
+\newif\iffirstitem@
+%
+% Since \item in \roster differs from in \plain, we store plain's
+% \item in \plainitem@, so that we can restore the definition
+% after the \roster is over.
+%
+\let\plainitem@\item
+%
+% In order for our \roster's to work, we will also have to be
+% sure that \everypar is {}. Just in case \everypar already has
+% a value, as it might in some format, we store those values in
+% the token list \everypartoks@, so that we can restore them at
+% the end. \par@ does this storing, and sets \everypar{}.
+%
+\newtoks\everypartoks@
+\def\par@{\everypartoks@\expandafter{\the\everypar}\everypar{}}
+%
+\def\leftskip@{}
+%
+\def\roster{%
+ \envir@stack\endroster
+% We also have to store the \leftskip, since it will be changed.
+ \edef\leftskip@{\leftskip\the\leftskip}%
+ \relaxnext@
+ \rostercount@\z@% Initialize \rostercount@ to 0.
+ \def\item{\FN@\rosteritem@}% \item, now redefined, has
+% to look ahead for [ and ", since we allow optional and literal
+% arguments. \rosteritem@ itself is defined below. The following
+% \next@ (in \DN@) is the one called at the very end of this
+% \def.
+ \DN@{\ifx\next\runinitem\let\next@\nextii@
+ \else\let\next@\nextiii@
+ \fi\next@}%
+% First we look to see whether \roster is followed by \runinitem,
+% since this requires different processing.
+ \DNii@\runinitem% If \runinitem occurs, \nextii@ must kill it off.
+ {\unskip% This unskips any space before the original \roster.
+% Our definition of \nextii@\runinitem itself uses compressed
+% format and a \futurelet\next\next@, because we still have to
+% allow [ or " to come next.
+ \DN@{\ifx\next[\let\next@\nextii@
+ \else\ifx\next"\let\next@\nextiii@\else\let\next@\nextiv@\fi
+ \fi\next@}%
+% The following \nextii@ is the one created by
+% \nextii@\runinitem; there is no conflict of names, since the
+% first calls the second.
+ \DNii@[####1]{\rostercount@####1\relax
+ \enspace\therosteritem{\number\rostercount@}~\ignorespaces}%
+% If [...] comes next, we use (...) but we explicitly do this by
+% setting \rostercount@ equal to ... so that succeeding \item's
+% will have the right numbers (use of something other than a
+% number will give an error message).
+ \def\nextiii@"####1"{\enspace{\rm####1}~\ignorespaces}%
+% If "..." comes next, we use ... exactly as typed.
+ \def\nextiv@{\enspace\therosteritem1\rostercount@\@ne~}%
+% Otherwise just use (1).
+ \par@\firstitem@false% Before doing any of this we still change
+% \everypar, if necessary, which is normally done elsewhere, and
+% set \firstitem@false, since this \runinitem counts as the
+% first.
+ \FN@\next@}% End of definition of \nextii@\runinitem.
+% The following \nextiii@ will be used if we didn't have
+% \runinitem.
+ \def\nextiii@{\par\par@% End the present paragraph, change \everypar
+% if necessary, prohibit a break, add a small skip, but add
+% something to offset any \parskip, if there is any, which would
+% be contributed when the next paragraph is begun by the next
+% \item.
+ \penalty\@m\smallskip\vskip-\parskip
+% And set \firstitem@true for use with \item.
+ \firstitem@true}%
+ \FN@\next@}
+%
+% Remember that \rosteritem@ is called by
+% \futurelet\next\rosteritem@.
+%
+\def\rosteritem@{\iffirstitem@\firstitem@false
+ \else\par\vskip-\parskip\fi
+% Except at the first \item, we end the paragraph (consisting of
+% the previous \item), and subtract any space that might be added
+% by the next \item.
+ \leftskip\rosteritemwd \advance\leftskip\normalparindent
+ \advance\leftskip.5em \noindent
+ \DNii@[##1]{\rostercount@##1\relax\itembox@}%
+% If [...] follows \item, we use ... as the number, again by
+% setting \rostercount@, so that succeeding \items will have the
+% right number.
+ \def\nextiii@"##1"{\def\therosteritem@{\rm##1}\itembox@}%
+% If "..." follows \item, we use ... exactly as typed.
+ \def\nextiv@{\advance\rostercount@\@ne\itembox@}%
+% Otherwise we print the \rostercount@ in parentheses.
+ \def\therosteritem@{\therosteritem{\number\rostercount@}}%
+ \ifx\next[\let\next@\nextii@\else\ifx\next"\let\next@\nextiii@\else
+ \let\next@\nextiv@\fi\fi\next@}
+%
+\def\itembox@{\llap{\hbox to\rosteritemwd{\hss
+ \kern\z@ % kern to thwart \unskip in \rom
+ \therosteritem@}\enspace}\ignorespaces}
+%
+% \therosteritem is just a convenience for the user.
+%
+\def\therosteritem#1{\rom{(\ignorespaces#1\unskip)}}
+%
+% We want to save \Runinitem for last, but it is relevant even to
+% the definition of \endroster, since we have to worry whether
+% \endroster is followed by another \Runinitem. We will use a
+% flag \ifnextRunin@ to tell us.
+%
+\newif\ifnextRunin@
+%
+\def\endroster{\relaxnext@
+ \revert@envir\endroster % restore \envir@end
+ \par\leftskip@ % End the paragraph, and restore the \leftskip.
+ \global\rosteritemwd16\p@ % restore default value
+ \penalty-50 \vskip-\parskip\smallskip % Add a good break and
+% subtract any space that will be started by next paragraph, but
+% add a \smallskip.
+ \DN@{\ifx\next\Runinitem\let\next@\relax
+% Don't do anything else if \Runinitem comes next.
+ \else\nextRunin@false\let\item\plainitem@ % Otherwise, set
+% \nextRunin@false, and restore \item to its definition in plain;
+ \ifx\next\par % moreover, if \endroster is followed by \par,
+ \DN@\par{\everypar\expandafter{\the\everypartoks@}}%
+% delete that instruction (since we've already put in a \par),
+% and restore \everypar,
+ \else % but if the \endroster isn't followed by a new paragraph,
+ \DN@{\noindent\everypar\expandafter{\the\everypartoks@}}%
+% start the next paragraph unindented, and restore \everypar.
+ \fi\fi\next@}%
+ \FN@\next@}
+%
+% Finally, for \Runinitem ... \roster\runinitem we have the usual
+% junk for worrying about [ or " coming next, and then more
+% interesting things: We have to find out how many lines of text
+% we had before the \roster; we will store this in
+% \rosterhangafter@.
+%
+\newcount\rosterhangafter@
+\def\Runinitem#1\roster\runinitem{\relaxnext@
+ \envir@stack\endroster
+% Initialize \rostercount@ to 0.
+ \rostercount@\z@
+% Define \item as before.
+ \def\item{\FN@\rosteritem@}%
+% Store everything up to the roster in \runinitem@.
+ \def\runinitem@{#1}%
+ \DN@{\ifx\next[\let\next\nextii@\else\ifx\next"\let\next\nextiii@
+ \else\let\next\nextiv@\fi\fi\next}%
+ \DNii@[##1]{\rostercount@##1\relax
+% If [...] follows \runinitem, we proceed as before, except we
+% call this first instance \item@, and we let \nextv@, defined
+% below, take care of everything.
+ \def\item@{\therosteritem{\number\rostercount@}}\nextv@}%
+% If "..." follows \runinitem, we define \item@ to use it.
+ \def\nextiii@"##1"{\def\item@{{\rm##1}}\nextv@}%
+ \def\nextiv@{\advance\rostercount@\@ne
+% Otherwise, we use the proper \rostercount@. Now comes \nextv@,
+% which has to properly typeset things.
+ \def\item@{\therosteritem{\number\rostercount@}}\nextv@}%
+% First store things in \box0 .
+ \def\nextv@{\setbox\z@\vbox
+% Start unindented if we have \ifnextRunin@true. This will
+% happen only if we had \Runinitem...\endroster right before.
+ {\ifnextRunin@\noindent\fi
+% Add the stored things in \runinitem@, and then \item@.
+ \runinitem@\unskip\enspace\item@~\par
+% This sets \rosterhangafter@ to the number of lines in \box0 ,
+% i.e., of the material so far; see the TeXbook, p. 103. We need
+% to say \global since this is set within \box0. Now we're done
+% with \box0 !
+ \global\rosterhangafter@\prevgraf}%
+ \firstitem@false% Set \firstitem@false for future \item's.
+% End previous paragraph unless we had \Runinitem ...\endroster
+% right before. Now comes the good part: we
+% \hangindent3\parindent, as before, but we do it for
+% \rosterhangafter@ lines, the number that already appeared in
+% the material we set in \box0 .
+ \ifnextRunin@\else\par\fi
+ \hangafter\rosterhangafter@\hangindent3\normalparindent
+% Start unindented if we had a \Runinitem ... \endroster right
+% before.
+ \ifnextRunin@\noindent\fi
+ \runinitem@\unskip\enspace% Put in all the stored stuff
+ \item@~\ifnextRunin@\else\par@\fi% and the \item@, and
+% end the paragraph, unless we had a \Runinitem ... \endroster
+% before.
+ \nextRunin@true\ignorespaces}%% Here's where we set \nextRunin@true.
+ \FN@\next@}
+%
+%
+% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% -9- FOOTNOTES
+% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\message{footnotes,}
+% \footmarkform@ tells how to treat a general type of footnote
+% marker. And \thefootnotemark is for the user, analogous to
+% \thetag in AMSTEX.TEX.
+%
+\def\footmarkform@#1{$\m@th^{#1}$}
+\let\thefootnotemark\footmarkform@
+%
+% \makefootnote@ takes care of the general problem of creating a
+% footnote whose marker is #1 and whose text is #2, so that we
+% can concentrate separately on the problem of how the marker is
+% determined. It is essentially \vfootnote from the TeXbook, p.
+% 363, except that we don't do fancy things to worry about
+% category code changes, and instead of adding a \strut at the
+% end, we will just add the lower part of the strut.
+%
+\def\makefootnote@#1#2{\insert\footins
+ {\interlinepenalty\interfootnotelinepenalty
+ \eightpoint\splittopskip\ht\strutbox\splitmaxdepth\dp\strutbox
+ \floatingpenalty\@MM\leftskip\z@skip\rightskip\z@skip
+ \spaceskip\z@skip\xspaceskip\z@skip
+ \leavevmode{#1}\footstrut\ignorespaces#2\unskip\lower\dp\strutbox
+ \vbox to\dp\strutbox{}}}
+%
+% Before version 2.0 \footmarkcount@ was declared in amstex.tex.
+%
+\newcount\footmarkcount@
+\footmarkcount@\z@
+%
+% \footnotemark basically just advances \footmarkcount@ by 1 and
+% then uses \footmarkform@{\number\footmarkcount@}---we still
+% have to worry about the space factor as in the definition of
+% \footnote in the TeXbook, p. 363. However, we are allowing
+% both an `optional' argument [#1], where we instead use
+% \footmarkform@{#1}, and a `literal' argument "#1", where we
+% instead use #1 exactly as typed, so we need to use a \futurelet
+% to look at the next symbol. Compressed format is used.
+%
+\def\footnotemark{\let\@sf\empty@\relaxnext@
+ \ifhmode\edef\@sf{\spacefactor\the\spacefactor}\/\fi
+ \DN@{\ifx[\next\let\next@\nextii@\else
+ \ifx"\next\let\next@\nextiii@\else
+ \let\next@\nextiv@\fi\fi\next@}%
+ \DNii@[##1]{\footmarkform@{##1}\@sf}%
+ \def\nextiii@"##1"{{##1}\@sf}%
+ \def\nextiv@{\iffirstchoice@\global\advance\footmarkcount@\@ne\fi
+ \footmarkform@{\number\footmarkcount@}\@sf}%
+ \FN@\next@}
+%
+% \footnotetext essentially applies \makefootnote@ to the next
+% group, using \footmarkcount@ for the marker that goes before
+% the footnote text. However, we once again allow optional and
+% literal arguments. Compressed format is used.
+%
+\def\footnotetext{\relaxnext@
+ \DN@{\ifx[\next\let\next@\nextii@\else
+ \ifx"\next\let\next@\nextiii@\else
+ \let\next@\nextiv@\fi\fi\next@}%
+ \DNii@[##1]##2{\makefootnote@{\footmarkform@{##1}}{##2}}%
+ \def\nextiii@"##1"##2{\makefootnote@{##1}{##2}}%
+ \def\nextiv@##1{\makefootnote@{\footmarkform@%
+ {\number\footmarkcount@}}{##1}}%
+ \FN@\next@}
+%
+% Finally, \footnote is basically \footnotemark\footnote, but we
+% can't write it directly that way because it, too, can take
+% optional and literal arguments. Compressed format again.
+%
+\def\footnote{\let\@sf\empty@\relaxnext@
+ \ifhmode\edef\@sf{\spacefactor\the\spacefactor}\/\fi
+ \DN@{\ifx[\next\let\next@\nextii@\else
+ \ifx"\next\let\next@\nextiii@\else
+ \let\next@\nextiv@\fi\fi\next@}%
+ \DNii@[##1]##2{\footnotemark[##1]\footnotetext[##1]{##2}}%
+ \def\nextiii@"##1"##2{\footnotemark"##1"\footnotetext"##1"{##2}}%
+ \def\nextiv@##1{\footnotemark\footnotetext{##1}}%
+ \FN@\next@}
+%
+% \adjustfootnotemark just allows the user to change
+% \footmarkcount@.
+%
+\def\adjustfootnotemark#1{\advance\footmarkcount@#1\relax}
+%
+% We use the definition of \footnoterule provided by plain, but
+% change its width from 2 truein to 5pc.
+%
+\def\footnoterule{\kern-4\p@
+ \hrule width5pc\kern 3.6\p@}% the \hrule is .4pt high
+%
+%
+% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% -10- TABLES
+% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% At the present time no table macros are provided. Captions can
+% be gotten using \topcaption or \botcaption.
+%
+% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% -11- FIGURE SPACES AND CAPTIONS
+% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\message{figures and captions,}
+\def\captionfont@{\smc}
+%
+% These captions are designed for use within \topinsert's and
+% \midinsert's. \nofrills is not currently an option, though
+% probably it should be added eventually.
+%
+\def\topcaption#1#2\endcaption{%
+% The captionwidth may have been changed by the user so we don't
+% make the assumption that it is equal to \hsize - 2\indenti.
+ {\dimen@\hsize \advance\dimen@-\captionwidth@
+% \raggedcenter@ uses the em so we set the font before calling
+% it. \leftskip and \rightskip are changed by \raggedcenter so
+% the modifications of \leftskip and \rightskip must come after.
+ \rm\raggedcenter@ \advance\leftskip.5\dimen@ \rightskip\leftskip
+ {\captionfont@#1}%
+% Include period only if both caption number and text are present.
+ \if\notempty{#2}\if\notempty{#1}.\enspace\fi\ignorespaces#2\fi
+ \endgraf}\nobreak\bigskip}
+%
+% For whatever reason, the style in current AMS production has
+% figure captions (= \botcaption) set in a block while table
+% captions are set ragged center style.
+%
+\def\botcaption#1#2\endcaption{%
+% The previous vskip may be blank space for a figure, so we can't
+% use \penaltyandskip@ here, otherwise the \bigskip would not be
+% added (assuming the preceding vskip is greater than
+% \bigskipamount):
+ \nobreak\bigskip
+% Measure how wide the caption is. Maybe it's only "Figure 1",
+% or maybe it's "Figure 1. Blah blah blah ... for 10 lines." In
+% the first case center it, in the second case put it in
+% paragraph form. Include period only if both caption number and
+% text are present.
+ \setboxz@h{\captionfont@#1\if\notempty{#2}\if\notempty{#1}.\enspace\fi
+ \rm\ignorespaces#2\fi}%
+ {\dimen@\hsize \advance\dimen@-\captionwidth@
+ \leftskip.5\dimen@ \rightskip\leftskip
+% long caption---set it in a paragraph
+ \noindent \ifdim\wdz@>\captionwidth@
+% short caption---add \hfil to balance with \parfillskip.
+ \else\hfil\fi
+ {\captionfont@#1}%
+ \if\notempty{#2}\if\notempty{#1}.\enspace\fi\rm\ignorespaces#2\fi\endgraf}}
+%
+% Redefine plain TeX \@ins to add definition of \vspace (locally)
+% for use with caption macros. Also \captionwidth.
+%
+\def\@ins{\par\begingroup\def\vspace##1{\vskip##1\relax}%
+ \def\captionwidth##1{\captionwidth@##1\relax}%
+ \setbox\z@\vbox\bgroup} % start a \vbox
+%
+% CASE 1: \topcaption plus a table typed by the author.
+%
+% \topinsert
+% \topcaption{Table 1}This is a table caption.\endcaption
+% \halign{ ...
+% ...
+% }
+% \endinsert
+%
+% CASE 2: \topcaption plus some blank space.
+%
+% \midinsert
+% \topcaption{Table 2}This is another table caption.\endcaption
+% \vspace{13pc}
+% \endinsert
+%
+% CASE 3: \botcaption plus some blank space.
+%
+% \topinsert
+% \vspace{7pc}
+% \botcaption{Figure 1}\endcaption
+% \endinsert
+%
+% Use of \captionwidth:
+%
+% \topinsert
+% \captionwidth{14pc}
+% \topcaption{Table 1}Text ...
+% \endcaption
+% \endinsert
+%
+% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% -12- MISCELLANEOUS FORMATTING MACROS
+% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\message{miscellaneous,}
+% \block is intended for typing long quotes in a block, indented on
+% both margins. It is set up so that it can be used in either of two
+% ways:
+%
+% $$\block...\endblock\tag1.1$$
+%
+% or
+%
+% Normal text.
+% \block ... \endblock
+% Continue with more text.
+%
+% In the latter case, we use a TeX display to provide spacing above
+% and below the block. If we're in vertical mode when \block is
+% called, we use \noindent to avoid getting an extra blank line
+% before the display. But then we will get the short display skips
+% instead of the full display skips, so we set \predisplaysize
+% explicitly to ensure the full display skips.
+%
+\def\block{\RIfMIfI@\nondmatherr@\block\fi
+ \else\ifvmode\noindent$$\predisplaysize\hsize
+ \else$$\fi
+ \def\endblock{\par\egroup$$}\fi
+ \vbox\bgroup\advance\hsize-2\indenti\noindent}
+\def\endblock{\par\egroup}
+%
+% In version 1 of amsppt \cite did some parsing to locate a comma
+% in its argument and if one was found the font was switched from
+% \citefont to \rm. In version 2 we no longer do this because if
+% a \cite deviates too much from the expected form we run into
+% problems: The expected form was either \cite{13}, or \cite{13,
+% Theorem 2.2}. But if for example the user wants to cite two
+% references together, \cite{13,15}, we don't want to switch off
+% \citefont after the comma. And since authors tend to invent
+% even more imaginative variations than this, we just did away
+% with the parsing altogether.
+%
+% \m@th is in case the author uses subscripts in his citation
+% codes.
+%
+\def\cite#1{\rom{[{\citefont@\m@th#1}]}}
+%
+% In version 1 of amsppt \citefont was \bf.
+%
+\def\citefont@{\rm}
+%
+% \rom provides a way for getting roman punctuation and numerals
+% in italic text. It takes pains to handle italic corrections
+% reasonably nicely.
+%
+\def\rom#1{\leavevmode
+ \edef\prevskip@{\ifdim\lastskip=\z@ \else\hskip\the\lastskip\relax\fi}%
+ \unskip
+ \edef\prevpenalty@{\ifnum\lastpenalty=\z@ \else
+ \penalty\the\lastpenalty\relax\fi}%
+ \unpenalty \/\prevpenalty@ \prevskip@ {\rm #1}}
+%
+%
+% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% -13- BIBLIOGRAPHY
+% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\message{references,}
+%
+\def\refsfont@{\eightpoint}
+\def\refsheadfont@{\headfont@}
+%
+% \refindentwd controls the indention from the left margin of the
+% ref item numbers or key labels. The initial setting is to 2
+% decimal digits; numbers up to 99 will be aligned on the right
+% within a box the width of \refindentwd. \key labels will be
+% aligned on the LEFT within a box of the same width; but when
+% \key's are being used, the indention may need to be increased
+% if it's required that the labels remain clear from the text.
+% The \widestnumber macro can be used to do this:
+% \widestnumber\key{MNOPQ} will increase \refindentwd to the
+% width of a box containing "[MNOPQ]\enspace". \widestnumber can
+% also be used with \no: \widestnumber\no{000} for 3-digit
+% numbers, \widestnumber\no{0} for 1-digit numbers, and so on.
+% However, the use of \no, with or without \widestnumber, is
+% deprecated, and this use will not be documented in the user's
+% guide.
+%
+\newdimen\refindentwd
+\setboxz@h{\refsfont@ 00.\enspace}
+\refindentwd\wdz@
+%
+% Allow the default title for the references to be varied easily;
+% users will still be instructed to change it using \nofrills.
+\def\Refsname{References}
+\outer\def\Refs{\add@missing\endroster \add@missing\endproclaim
+ \let\savedef@\Refs \let\Refs\relax % because of \outer-ness
+ \def\Refs##1{\restoredef@\Refs
+% For a monograph where the title of the References section is
+% done using \title, we want to omit the normal "References"
+% heading and the vertical skips above and below. This can be
+% accomplished using \Refs\nofrills{}. As long as the vskip at
+% the end of \endtopmatter is not less than \aboveheadskip and
+% \belowheadskip, this will be accomplished by the fact that
+% \penaltyandskip@ doesn't add to a previous larger vskip, and
+% the ragged center part will simply vanish if #1 is empty.
+ \if\notempty{##1}\penaltyandskip@{-200}\aboveheadskip
+ \begingroup \raggedcenter@\refsheadfont@
+ \ignorespaces##1\endgraf\endgroup
+ \penaltyandskip@\@M\belowheadskip
+ \fi
+ \begingroup\def\envir@end{\endRefs}\refsfont@\sfcode`\.\@m
+ }%
+% This line here is a little tricky. If a \nofrills is found when
+% we look ahead, then \frills@ will become equal to \eat@ and it
+% will eat "References" before \Refs is allowed to read its
+% argument. Also we have to use a \csname trick to get around
+% the outerness of \Refs. MJD
+ \nofrillscheck{\csname Refs\expandafter\endcsname
+ \frills@{{\Refsname}}}}
+%
+\def\endRefs{\par % This will check for a missing \endref, also
+ \endgroup}
+%
+% These two conditionals are used for handling the logic of
+% typesetting book versus journal article versus proceedings
+% article references.
+\newif\ifbook@ \newif\ifprocpaper@
+%
+% The \else clause here is to handle the case when \nofrills is
+% used outside of the References section in an unexpected place
+% (i.e., not immediately after \proclaim, \definition, \head, or
+% the other things that have a \nofrills option).
+%
+\def\nofrills{%
+% Are we inside a \ref...\endref pair? If so, OK to continue.
+ \expandafter\ifx\envir@end\endref
+ \let\do\relax
+ \xdef\nofrills@list{\nofrills@list\do\curbox}%
+ \else\errmessage{\Invalid@@ \string\nofrills}%
+ \fi}%
+%
+\def\defaultreftexts{\gdef\edtext{ed.}\gdef\pagestext{pp.}%
+ \gdef\voltext{vol.}\gdef\issuetext{no.}}
+\defaultreftexts
+%
+\def\ref{\par
+ \begingroup \def\envir@end{\endref}%
+% Start the reference.
+ \noindent\hangindent\refindentwd
+% Change \par so that it will supply a (presumably) missing
+% \endref, with an error message.
+ \def\par{\add@missing\endref}%
+% Footnotes get lost in references on account of the extensive
+% boxing; change \footnote to emit a warning message.
+ \let\orig@footnote\footnote
+ \def\footnote{\message{AmS-TeX warning: \string\footnote\space within
+ a reference will disappear;^^J
+ use \string\footnotemark\space \string\footnotetext\space instead}%
+ \orig@footnote}%
+% \nofrills@list should always be assigned globally, to conserve
+% save stack.
+ \global\let\nofrills@list\empty@
+%
+% Change \linebreak and \mathbreak to work properly in the
+% special ref environment.
+ \refbreaks
+ \procpaper@false \book@false \moreref@false
+% Start an initial box, to match up properly with the first
+% upcoming \makerefbox; this will be discarded.
+ \def\curbox{\z@}\setbox\z@\vbox\bgroup
+}
+%
+% \keyhook@ is used for switching the style of reference labels
+% automatically behind the scenes. This is for phasing in,
+% without loss of backward compatibility, a \refstyle command to
+% implement the various reference styles currently used in AMS
+% production. [19-MAR-1991] See the definition of \refstyle.
+%
+\let\keyhook@\empty@
+%
+\def\endref{%
+% To wind up the preceding box it is convenient to call
+% \makerefbox again; it will also open a new box, however, so we
+% give it arguments \thr@@ and \endgraf\egroup that will cause
+% the new box to be closed immediately and discarded. But we must
+% first make sure box 3 is void or we'll trigger an error
+% message. This is done by dumping the current contents of
+% (global register) box 3 into (local register) box 2; the \box
+% command always makes its argument globally void. (Because box
+% 0 is used heavily in \makerefbox, it's easier to just use box 2
+% here, rather than try to verify that using box 0 would be safe
+% in all cases.)
+ \setbox\tw@\box\thr@@
+ \makerefbox?\thr@@{\endgraf\egroup}%
+% Then we call \endref@ to take all the saved material and
+% combine it into a paragraph, adding punctuation to separate
+% pieces.
+ \endref@
+% The \endgraf is done here rather than in \endref@ because in
+% \moreref or \transl cases \endref@ shouldn't do the \endgraf.
+ \endgraf
+% Finally, we need to close the group that was started by \ref.
+% This has the effect of killing the current definition of
+% \envir@end, among other things.
+ \endgroup
+ \keyhook@
+ \global\let\keyhook@\empty@ % \global to conserve save stack
+}
+%
+\def\key{\gdef\key{\makerefbox\key\keybox@\empty@}\key} \newbox\keybox@
+% \no is deprecated in favor of \key; it remains here only for the
+% purpose of compatibility with existing files.
+\def\no{\gdef\no{\makerefbox\no\keybox@\empty@}%
+ \gdef\keyhook@{\refstyle C}\no}
+\def\by{\makerefbox\by\bybox@\empty@} \newbox\bybox@
+\let\manyby\by % for backward compatibility
+\def\bysame{\by\hbox to3em{\hrulefill}\thinspace\kern\z@}
+\def\paper{\makerefbox\paper\paperbox@\it} \newbox\paperbox@
+\def\paperinfo{\makerefbox\paperinfo\paperinfobox@\empty@}%
+ \newbox\paperinfobox@
+\def\jour{\makerefbox\jour\jourbox@
+ {\aftergroup\book@false \aftergroup\procpaper@false}} \newbox\jourbox@
+\def\issue{\makerefbox\issue\issuebox@\empty@} \newbox\issuebox@
+\def\yr{\makerefbox\yr\yrbox@\empty@} \newbox\yrbox@
+\def\pages{\makerefbox\pages\pagesbox@\empty@} \newbox\pagesbox@
+\def\page{\gdef\pagestext{p.}\makerefbox\page\pagesbox@\empty@}
+\def\ed{\makerefbox\ed\edbox@\empty@} \newbox\edbox@
+\def\eds{\gdef\edtext{eds.}\makerefbox\eds\edbox@\empty@}
+% The \aftergroup\book@true here sets the \ifbook@ switch so that
+% later (in \endref@) we will know whether we are typesetting a
+% book, a journal article, or a proceedings article. Could use
+% \global instead of \aftergroup but avoiding \global is usually
+% safer when possible.
+\def\book{\makerefbox\book\bookbox@
+ {\it\aftergroup\book@true \aftergroup\procpaper@false}}
+ \newbox\bookbox@
+\def\bookinfo{\makerefbox\bookinfo\bookinfobox@\empty@}%
+ \newbox\bookinfobox@
+\def\publ{\makerefbox\publ\publbox@\empty@} \newbox\publbox@
+\def\publaddr{\makerefbox\publaddr\publaddrbox@\empty@}%
+ \newbox\publaddrbox@
+% See the above comment for \book about the \aftergroup
+\def\inbook{\makerefbox\inbook\bookbox@
+ {\aftergroup\procpaper@true \aftergroup\book@false}}
+\def\procinfo{\makerefbox\procinfo\procinfobox@\empty@}%
+ \newbox\procinfobox@
+\def\finalinfo{\makerefbox\finalinfo\finalinfobox@\empty@}%
+ \newbox\finalinfobox@
+\def\miscnote{\makerefbox\miscnote\miscnotebox@\empty@}%
+ \newbox\miscnotebox@
+\def\toappear{\miscnote to appear}
+\def\lang{\makerefbox\lang\langbox@\empty@} \newbox\langbox@
+\newbox\morerefbox@
+%
+% \vol is special because in AMS style it takes a different font
+% depending on whether it's a journal volume or a book volume.
+%
+\def\vol{\makerefbox\vol\volbox@{\ifbook@ \else
+ \ifprocpaper@\else\bf\fi\fi}}
+\newbox\volbox@
+%
+% \MR has to take its argument in braces in order to pick out the
+% volume number and make it bold. For consistency we do the same for
+% AMSPPS. [mjd,17-Aug-1995]
+% Provide an MR number for a bibliography item.
+\define\MR#1{\makerefbox\MR\MRbox@\empty@
+ \def\next@##1:##2:##3\next@{\ifx @##2\empty@##1\else{\bf##1:}##2\fi}%
+ MR \next@#1:@:\next@}
+%
+\newbox\MRbox@
+%
+% User-comand for citing a preprint on the AMS preprint server.
+% \MR and \AMSPPS are mutually exclusive (at least in normal use), so
+% we can use \MRbox@ here instead of allocating another box.
+%
+% Without the discretionary hyphen, AMSPPS would break as AM-SPPS.
+%
+\define\AMSPPS#1{\makerefbox\AMSPPS\MRbox@\empty@ AMS\-PPS \##1}
+%
+% Assume for the moment that \CMP and \MR commands won't occur in
+% the same ref. Too much heavy-duty programming required otherwise.
+% [mjd,1995/09/28]
+\define\CMP#1{\makerefbox\CMP\MRbox@\empty@ CMP #1}
+%
+\newbox\holdoverbox
+%
+% \makerefbox takes three arguments: the first is the name of
+% the calling macro, for use in error messages; argument 2
+% is the box used for storing data (note: some boxes are shared
+% by more than one calling macro); argument 3 is additional
+% material (optional---may be empty) that may be used to
+% affect the contents of the box.
+%
+\def\makerefbox#1#2#3{\endgraf
+% Set box 0 to the just-completed line of text.
+ \setbox\z@\lastbox
+% Although \holdoverbox will usually be void it still doesn't
+% hurt to \unhbox it here in every case, which simplifies the
+% programming.
+ \global\setbox\@ne\hbox{\unhbox\holdoverbox
+% \ifvoid test is necessary here to prevent a \linebreak at the
+% end of a field from being removed by the \unpenalty.
+ \ifvoid\z@\else\unhbox\z@\unskip\unskip\unpenalty\fi}%
+ \egroup
+% If box 1 is empty (width <= 0pt) then set the current box to
+% void (it might still have a baselineskip glue or something in
+% it at this point, for one thing). Otherwise set it to box 1.
+ \setbox\curbox\box\ifdim\wd\@ne>\z@ \@ne \else\voidb@x\fi
+% That finishes the previous box. Now let's start a new one
+% using the box given as arg 1 of \makerefbox. But first check
+% to see if it's void and if not give an error message.
+ \ifvoid#2\else\Err@{Redundant \string#1; duplicate use, or
+ mutually exclusive information already given}\fi
+ \def\curbox{#2}\setbox\curbox\vbox\bgroup \hsize\maxdimen \noindent
+ #3}
+%
+\def\refbreaks{%
+ \def\refconcat##1{\setbox\z@\lastbox \setbox\holdoverbox\hbox{%
+ \unhbox\holdoverbox \unhbox\z@\unskip\unskip\unpenalty##1}}%
+ \def\holdover##1{%
+ \RIfM@
+% Break the current line, adding \null to ensure proper spacing for
+% a preceding mathrel or mathbin. The blank line containing the
+% \null will be discarded by later processing.
+ \penalty-\@M\null
+% Put a temporary ending of the current math formula on the next
+% line, by itself.
+ \hfil$\clubpenalty\z@\widowpenalty\z@\interlinepenalty\z@
+ \offinterlineskip\endgraf
+% Now remove that unwanted extra line and the preceding \lineskip
+% (of 0pt) and any penalty. There shouldn't be any penalty,
+% actually, because the relevant penalties were set to 0 above;
+% but the \unpenalty is harmless and perhaps there is an
+% overlooked eventuality that it will catch.
+ \setbox\z@\lastbox\unskip \unpenalty
+ \refconcat{##1}%
+ \noindent
+% Since we did a temporary end of the current math formula there
+% remains some more math coming up; therefore we need to shift
+% into math mode again. By breaking immediately after the
+% beginning of the math formula we leave the unwanted extra
+% \mathon item in a line by itself; this will be ignored because
+% in the unpacking process we will only take the last line out of
+% the current \vbox.
+ $\hfil\penalty-\@M
+% No \null here because we don't need to do anything extra to
+% affect the math spacing of the following item. (Line breaks
+% in math formulas always occur after a \mathbin or \mathrel,
+% not before, according to AMS style.)
+ \else
+ \endgraf\refconcat{##1}\noindent
+ \fi}%
+ \def\break{\holdover{\penalty-\@M}}%
+ \let\vadjust@\vadjust
+ \def\vadjust##1{\holdover{\vadjust@{##1}}}%
+% It seems unlikely that \newpage will be needed inside of a
+% \ref...\endref construction (more likely it will occur between
+% references, if at all). So we provide only a very simple
+% alternate version using \vadjust.
+ \def\newpage{\vadjust{\vfill\break}}%
+}
+%
+\def\refstyle#1{\uppercase{%
+ \gdef\refstyle@{#1}%
+ \if#1A\relax \def\keyformat##1{[##1]\enspace\hfil}%
+ \else\if#1B\relax
+ \refindentwd\parindent
+ \def\keyformat##1{\aftergroup\kern
+ \aftergroup-\aftergroup\refindentwd}%
+ \else\if#1C\relax
+ \def\keyformat##1{\hfil##1.\enspace}%
+ \fi\fi\fi}% end of \uppercase
+}
+%
+% Make letters the default for ref labels. This is chosen over
+% refstyle C with a view to eventually phasing out \no in favor
+% of always using \key, with the formatting being determined by
+% the refstyle setting.
+\refstyle{A}
+%
+% You might think that \refbreak@ shouldn't be necessary here (it
+% executes a line break if the user specified \linebreak in the
+% last field of the reference), but: sometimes there will be a
+% language after the final period, and conceivably someone might
+% need to break the line after the period and before the
+% language.
+\def\finalpunct{\ifnum\lastkern=\m@ne\unkern\else.\spacefactor2000 \fi
+ \refquotes@\refbreak@}%
+\def\continuepunct#1#2#3#4{}%
+%
+% \endref@ is shared by \endref, \moreref, and \transl, therefore
+% some of the code needs to be circumspect.
+\def\endref@{%
+% Change the format of the reference label, if necessary:
+ \keyhook@
+% This variant definition of \nofrillscheck is embedded in
+% \endref@ despite the slight cost in extra execution time, in
+% order to allow, e.g., subheadings within a bibliography section
+% to have normal \nofrills action.
+ \def\nofrillscheck##1{%
+ \def\do####1{\ifx##1####1\let\frills@\eat@\fi}%
+ \let\frills@\identity@ \nofrills@list}%
+% If no author name was given, but editor name was given, then
+% transfer it to the author name box so that it will print at the
+% beginning of the reference. This would normally happen only
+% in the case of a proceedings volume or other such collection,
+% cited as a whole.
+ \ifvoid\bybox@
+ \ifvoid\edbox@
+ \else\setbox\bybox@\hbox{\unhbox\edbox@\breakcheck
+ \nofrillscheck\edbox@\frills@{\space(\edtext)}\refbreak@}\fi
+ \fi
+% \noindent \hangindent\refindentwd was done earlier by \ref, so
+% at this point we just need to put the reference label on the
+% page.
+%
+% Using this \ifvoid test is partly to prevent accessing \keybox@
+% in the \moreref and \transl cases:
+ \ifvoid\keybox@\else\hbox to\refindentwd{%
+ \keyformat{\unhbox\keybox@}}\fi
+ \ifmoreref@
+% Even though this reads ``\commaunbox@,'' a semicolon will be
+% substituted for the comma by the action of \punct@ if
+% \morerefbox@ is in fact not void. (And note that both \transl
+% and \moreref share \morerefbox@.)
+ \commaunbox@\morerefbox@
+ \else
+% Put in some special kerns to flag the beginning of a reference,
+% to avoid adding unwanted punctuation and space if \by is omitted.
+ \kern-\tw@ sp\kern\m@ne sp
+ \fi
+ \ppunbox@\empty@\empty@\bybox@\empty@
+ \ifbook@ % Case 1: \book etc.
+ \commaunbox@\bookbox@ \commaunbox@\bookinfobox@
+ \ppunbox@\empty@{ (}\procinfobox@)%
+ \ppunbox@,{ vol.~}\volbox@\empty@
+ \ppunbox@\empty@{ (}\edbox@{, \edtext)}%
+ \commaunbox@\publbox@ \commaunbox@\publaddrbox@
+ \commaunbox@\yrbox@
+ \ppunbox@,{ \pagestext~}\pagesbox@\empty@
+ \else
+ \commaunbox@\paperbox@ \commaunbox@\paperinfobox@
+ \ifprocpaper@ % Case 2: \paper ... \inbook
+ \commaunbox@\bookbox@
+ \ppunbox@\empty@{ (}\procinfobox@)%
+ \ppunbox@\empty@{ (}\edbox@{, \edtext)}%
+ \commaunbox@\bookinfobox@
+ \ppunbox@,{ \voltext~}\volbox@\empty@
+ \commaunbox@\publbox@ \commaunbox@\publaddrbox@
+ \commaunbox@\yrbox@
+ \ppunbox@,{ \pagestext~}\pagesbox@\empty@
+ \else % Case 3: \paper ... \jour
+ \commaunbox@\jourbox@
+ \ppunbox@\empty@{ }\volbox@\empty@
+ \ppunbox@\empty@{ (}\yrbox@)%
+ \ppunbox@,{ \issuetext~}\issuebox@\empty@
+% Although \publ and \publaddr will rarely be used with a journal
+% article, it doesn't really hurt to print them if provided, and
+% certain rare cases may benefit. E.g.:
+%
+% \paper \"Uber maximale Monotonie von Operatoren des Typs
+% $L^\ast \Phi\circ L$ \paperinfo Report 78-24 \publ Math. Inst.,
+% Univ. K\"oln \yr 1978 \moreref\jour published as Manuscripta
+% Math. \vol28 \yr1979\pages 305--316
+%
+ \commaunbox@\publbox@ \commaunbox@\publaddrbox@
+ \commaunbox@\pagesbox@
+ \fi
+ \fi
+ \commaunbox@\finalinfobox@
+ \ppunbox@\empty@{ (}\miscnotebox@)%
+% The final punctuation (usually a period) here is not part of a
+% \ppunbox@ clause because it is always inserted even if
+% \langbox@ and \MRbox@ are void.
+ \finalpunct
+% Tweak the spacefactor after langbox to suppress the comma that
+% would otherwise be added between lang and MR.
+ \ppunbox@\empty@{ (}\langbox@{)\spacefactor1001 }%
+% Print an MR or AMSPPS number
+ \ifnum\spacefactor>\@m \ppunbox@{}{ }\MRbox@\empty@
+ \else \commaunbox@\MRbox@
+ \fi
+% Restore defaults "ed.", "pp.", etc. in case they were changed.
+ \defaultreftexts
+}
+%
+% \punct@ is the same as \identity@, but we define it rather than
+% using \let, just in case the contents of amsppt.sty ever get
+% shuffled around in such a way that \identity@ is later in the
+% file.
+\def\punct@#1{#1}
+% \ppunbox@ takes 4 arguments. #1 is punctuation that should
+% precede ending quotes and/or a line breaking penalty, from the
+% previous item. #2 is material (usually a word space) that
+% should come after ending quotes or a penalty. #3 is the box
+% containing the next part of the current reference. #4 is other
+% material to follow box #3 (e.g., a closing parenthesis, in some
+% cases).
+%
+\def\ppunbox@#1#2#3#4{\ifvoid#3\else
+ \let\prespace@\relax
+% If nofrills was specified for the previous item, then it will
+% have been ended with a kern of -1sp. If we find such a kern,
+% we remove it and omit the normal punctuation (arg #1).
+ \ifnum\lastkern=\m@ne \unkern\let\punct@\eat@
+% A kern of -2sp here means we are at the very beginning of the
+% reference, after the key or number. In that case we need to
+% omit not only the punctuation, but also any following space.
+ \ifnum\lastkern=-\tw@ \unkern\let\prespace@\ignorespaces \fi
+ \fi
+ \nofrillscheck#3%
+ \punct@{#1}\refquotes@\refbreak@
+% Restore normal definition of \punct@:
+ \let\punct@\identity@
+ \prespace@
+% If \nofrills is not in effect, the \space will be eaten;
+% otherwise it will be substituted for the normal pre-item
+% frills.
+ \frills@{#2\eat@}\space
+% \refquotes@ and \refbreak@ will be emptied by \breakcheck
+% (unless of course there is a new line breaking penalty present
+% for next time around).
+ \unhbox#3\breakcheck
+ \frills@{#4\eat@}{\kern\m@ne sp}\fi}
+%
+\def\commaunbox@#1{\ppunbox@,\space{#1}\empty@}
+%
+% By putting the \ifnum here inside the \edef we get automatic
+% initialization of \refbreak@ for the next time around, instead
+% of needing an extra \let\refbreak@\empty@ step after \refbreak@
+% is used.
+\def\breakcheck{\edef\refbreak@{\ifnum\lastpenalty=\z@\else
+ \penalty\the\lastpenalty\relax\fi}\unpenalty}
+%
+% For quotes, the complication is that the ending quotes must
+% fall after a comma or other such punctuation that might come
+% next (we don't know yet what punctuation will be used, if any).
+% And in addition we have the usual possibility of a line break
+% to worry about at the same time. Therefore the special control
+% sequence \endquotes is provided, to be used like this, if let's
+% say you want book titles to appear in quotes:
+%
+% \ppunbox@,{ ``}\bookbox@\endquotes
+% \commaunbox@\bookinfobox@
+%
+% \endquotes defines the control sequence \refquotes@ to add the
+% ending quotes later, after we find out whether a comma, period,
+% or no punctuation at all will be added (not to mention maybe a
+% line breaking penalty that would need to be shuffled around).
+%
+\def\endquotes{\def\refquotes@{''\let\refquotes@\empty@}}
+\let\refquotes@\empty@
+\let\refbreak@\empty@
+%
+% We need a switch to handle certain complications with the moreref
+% case.
+%
+\newif\ifmoreref@
+%
+% \moreref ends the previous setbox operation, does \endref@ to
+% typeset any information gathered so far, and then prepares to
+% start the equivalent of a new \ref.
+%
+\def\moreref{%
+% To wind up the preceding box it is convenient to call
+% \makerefbox again; it will also open a new box, however, so we
+% give it arguments \thr@@ and \endgraf\egroup that will cause the
+% new box to be closed immediately and discarded. But we must first
+% make sure box 3 is void or we'll trigger an error message. This
+% is done by dumping the current contents of (global register) box
+% 3 into (local register) box 2; the \box command always makes its
+% argument globally void. (Because box 0 is used heavily in
+% \makerefbox, it's easier to just use box 2 here, rather than try
+% to verify that using box 0 would be safe in all cases.)
+ \setbox\tw@\box\thr@@
+ \makerefbox?\thr@@{\endgraf\egroup}%
+% This saved definition will be lost if something else in \endref@
+% uses \savedef@. Currently (14-MAR-1991) that is not the case,
+% however, so doing it this way allows us to save a bit of memory.
+ \let\savedef@\finalpunct \let\finalpunct\empty@
+ \endref@
+% The next time \punct@ is called by \ppunbox, it will change
+% ",\refquotes@" into "\refquotes@;" or similarly for
+% \empty@\refquotes@. Then \punct@ will be restored to its original
+% definition. Note that this definition does not need to be
+% global; it is local inside the \begingroup ...\endgroup of the
+% current \ref.
+ \def\punct@##1##2{##2;}%
+ \global\let\nofrills@list\empty@ % global, to conserve save stack
+% Now restore the normal definition of \finalpunct :
+ \let\finalpunct\savedef@
+ \moreref@true
+% Set any initial text between \moreref and the following
+% control sequence in \morerefbox@. This is typically used with
+% \transl to add a note such as "English transl."
+ \def\curbox{\morerefbox@}%
+ \setbox\morerefbox@\vbox\bgroup \hsize\maxdimen \noindent
+}
+% And \transl, for setting translation information,
+% doesn't need to be any different than \moreref:
+%
+\def\transl{\moreref}
+%
+% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% -14- END OF DOCUMENT
+% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\message{end of document,}
+%
+% Make sure that the primitive \end can be executed; \end may be redefined
+% for some purposes where input errors are likely to occur.
+\ifx\plainend\undefined \let\plainend\end \fi
+\outer\def\enddocument{\par% \par will do a runaway check for \endref
+ \add@missing\endRefs
+ \check@missing@document
+% Repeat these in case an article (or book chapter!) doesn't have
+% a references section:
+ \add@missing\endroster \add@missing\endproclaim
+ \add@missing\enddefinition
+ \add@missing\enddemo \add@missing\endremark \add@missing\endexample
+ \enddocument@text
+ \vfill\supereject\plainend}
+
+% One non-ending element that can be missing is \document.
+\def\check@missing@document{%
+ \ifdocument@
+ \else
+ \Err@{You seem to have a missing or misspelled \string\document}%
+ \fi}
+
+\def\enddocument@text{%
+% In a monograph we expect the translator name and author
+% addresses to be handled in the front matter rather than at the
+% end of the individual chapters:
+ \ifmonograph@ % do nothing
+ \else
+% No break between the References and the final matter.
+ \nobreak
+% The \address's get printed at the end of the paper. Also the
+% translator name, if any. We don't need to do an
+% \ifx\thetranslator@\empty@, as we did with \thesubjclass@ and
+% other items in \endtopmatter, because we're not constructing a
+% footnote, just slapping the material on the page.
+ \thetranslator@
+% Print all the \address's, including e-mail and url addresses if
+% present. If any of the \email's are undefined the \csname will
+% just evaluate to \relax.
+ \count@\z@
+ \loop\ifnum\count@<\addresscount@\advance\count@\@ne
+ \csname address\number\count@\endcsname
+ \csname email\number\count@\endcsname
+ \csname urladdr\number\count@\endcsname
+ \repeat
+ \fi
+}
+
+%
+%
+% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% -15- OUTPUT ROUTINE
+% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\message{output routine,}
+% We provide a \foliofont@ separate from \headlinefont@ because
+% it is not uncommon for documentstyles to have the folios in a
+% different font, although in our basic style this is not the
+% case. \foliofont@ is \eightrm instead of \eightpoint merely
+% for efficiency; we don't expect to need for example math family
+% assignments in order to typeset the folio. On the other hand
+% we need full math capability for \headlinefont@ since running
+% heads may contain math (from a title or a section head). From
+% a design standpoint it might be preferable to have seven-point
+% running heads (compare a small caps \head that falls at the top
+% of a page with the running head above it) but it is more
+% convenient to use the already available \eightpoint macro, and
+% this saves a bit of overhead.
+%
+\def\folio{\ifnum\pageno<\z@ \romannumeral-\pageno\else\number\pageno \fi}
+\def\foliofont@{\eightrm}
+\def\headlinefont@{\eightpoint}
+%
+% \leftheadline and \rightheadline use the method described in
+% the TeXbook, p. 260 for selecting different pieces of the
+% topmark or botmark. The necessary \else is inserted by
+% \leftheadtext and \rightheadtext. \foliofont@ is applied
+% within the headline (it was formerly included in \folio).
+% Thus \folio comprises only the page number, making it suitable
+% for compiling index terms for use with the non-AMS package
+% index.tex; there is no intention to add an indexing facility
+% to AMS-TeX.
+%
+\def\leftheadline{\rlap{\foliofont@\folio}\hfill \iftrue\topmark\fi \hfill}
+\def\rightheadline{\hfill \expandafter\iffalse\botmark\fi
+ \hfill \llap{\foliofont@\folio}}
+%
+\newtoks\leftheadtoks
+\newtoks\rightheadtoks
+%
+% \leftheadtext and \rightheadtext have a \nofrills option to
+% turn off uppercasing. They also set their argument in a box,
+% during a syntax check, because otherwise syntax errors in the
+% argument would not be caught (because the output routine, and
+% hence \headline, is never called during a syntax check).
+%
+\def\leftheadtext{\let\savedef@\leftheadtext
+ \def\leftheadtext##1{\let\leftheadtext\savedef@
+ \leftheadtoks\expandafter{\frills@\uppercasetext@{##1}}%
+ \mark{\the\leftheadtoks\noexpand\else\the\rightheadtoks}
+ \ifsyntax@\setboxz@h{\def\\{\unskip\space\ignorespaces}%
+ \headlinefont@##1}\fi}%
+ \nofrillscheck\leftheadtext}
+%
+\def\rightheadtext{\let\savedef@\rightheadtext
+ \def\rightheadtext##1{\let\rightheadtext\savedef@
+ \rightheadtoks\expandafter{\frills@\uppercasetext@{##1}}%
+ \mark{\the\leftheadtoks\noexpand\else\the\rightheadtoks}%
+ \ifsyntax@\setboxz@h{\def\\{\unskip\space\ignorespaces}%
+ \headlinefont@##1}\fi}%
+ \nofrillscheck\rightheadtext}
+%
+% In the running heads, we redefine \chapter so that it only does
+% a roman numeral (via \chapterno@) rather than "CHAPTER " +
+% roman numeral. In the \nofrills case, however, e.g. for
+% something like "Appendix A", the given text is printed without
+% modification. And we redefine \\ because if the running head
+% is taken from a title or section head it might possibly contain
+% a \\ from the line-breaking done in the original text.
+%
+\headline={\def\\{\unskip\space\ignorespaces}\headlinefont@
+ \def\chapter{%
+ \def\chapter##1{%
+ \frills@{\afterassignment\chapterno@ \chaptercount@=}##1.\space}%
+ \nofrillscheck\chapter}%
+ \ifodd\pageno \rightheadline \else \leftheadline\fi}
+%
+% Capitalization is used to indicate global scope of
+% \NoRunningHeads and \NoPageNumbers, as is done by amstex.tex
+% for \TagsOnLeft, etc.
+%
+\def\NoRunningHeads{\global\runheads@false\global\let\headmark\eat@}
+\def\NoPageNumbers{\gdef\folio{}}
+%
+% Finally, we are ready for the \output routine. It is based on
+% the \plainoutput routine, but the first page normally has the
+% `Typeset by AmS-TeX' logo attached, and we add a switch for
+% running heads. The default for running heads is "true".
+%
+\newif\iffirstpage@ \firstpage@true
+\newif\ifrunheads@ \runheads@true
+%
+\output={\output@}
+%
+\newdimen\headlineheight \newdimen\headlinespace
+\newdimen\dropfoliodepth
+
+% Distance of drop folio below the type block
+\dropfoliodepth=1pc
+% Actual height of normal running head text
+\headlineheight=5pt
+% Base-to-base distance from running head to first text line
+\headlinespace=24pt
+
+% Changing the page width with \pagewidth automatically adjusts the
+% caption width as well. \pagewidth is in AMSTEX.TEX but it sets the
+% caption width to a different value than the one we want.
+\def\pagewidth#1{\hsize#1%
+ \captionwidth@\hsize \advance\captionwidth@-2\indenti}
+%
+% Constraints on type block:
+% ---Total width x height (default) = 30pc x 50.5pc
+% ---Distance from running-head to first text line (base-to-base) is
+% 24pt.
+% ---Actual height of running head is approx. 5pt (height of cap
+% letters in seven-point font).
+% ---Drop folio on first page drops 1pc below the type block (i.e.,
+% below the 50.5pc measurement given above).
+
+\def\pageheight#1{%
+ \vsize=#1 % target height
+ \advance\vsize -\headlineheight % subtract height of running head
+ \advance\vsize -\headlinespace % subtract space below running head
+ \advance\vsize \topskip % but the 24pt is base-to-base, so we need to
+ % compensate for topskip
+}
+
+\pagewidth{30pc}\pageheight{50.5pc}
+
+% Copyright info at the bottom of article opening pages is done as
+% an insert separate from \footins because that is the natural way
+% to achieve the placement we want (below all footnotes, but inside
+% the text block).
+\newinsert\copyins
+% Space to allow for, between copyright info and preceding text:
+% *** Different from AMS-LaTeX value, which is 1.5pc fixed
+% *** (\bigskipamount=12pt plus 4pt minus 4pt; plain.tex)
+\skip\copyins=12\p@
+% Maximum height of copyright info: Doesn't really matter, since height
+% will always be controlled explicitly, but let's make sure this
+% value referred to by TeX is less than page height anyway.
+\dimen\copyins=40pc
+% Magnification factor (1000 = 1.000)
+\count\copyins=1000
+%
+% \inslogo@ is called in \endtopmatter (unlike the method of
+% amsppt.sty 2.1)
+\def\inslogo@{\insert\copyins{\logo@}}
+%
+\def\logo@{\rightline{\eightpoint Typeset by \AmSTeX}}
+% \nologo to turn off the `Typeset by AmS-TeX' note.
+\def\nologo{\let\logo@\empty@ \let\inslogo@\empty@}
+%
+% First-page left or right headline:
+\let\flheadline\hfil \let\frheadline\hfil
+%
+% Permit pages (e.g. book frontmatter) to be without headers or footers.
+\newif\ifplain@ \plain@false
+%
+\def\output@{%
+% Cancel possible junk from \ref if page break occurs between
+% \ref...\endref [mjd,17-Aug-1995]
+ \def\break{\penalty-\@M}\let\par\endgraf
+ \shipout\vbox{%
+ \ifplain@
+ \let\makeheadline\relax \let\makefootline\relax
+ \else
+ \iffirstpage@ \global\firstpage@false
+ \let\rightheadline\frheadline
+ \let\leftheadline\flheadline
+ \else
+ \ifrunheads@ \let\makefootline\relax
+ \else \let\makeheadline\relax \fi
+ \fi
+ \fi
+ \makeheadline \pagebody \makefootline
+ }%
+ \advancepageno \ifnum\outputpenalty>-\@MM\else\dosupereject\fi
+}
+%
+% Redefine \pagecontents to add \copyins material
+% *** \skip\footins=\bigskipamount (12pt plus 4pt minus 4pt; plain.tex)
+% *** In AMS-LaTeX, value = 7pt plus11pt
+\def\pagecontents{%
+ \ifvoid\topins\else\unvbox\topins\fi
+ \dimen@=\dp\@cclv \unvbox\@cclv % open up \box255
+ \ifvoid\footins
+ \else % footnote info is present
+ \vskip\skip\footins
+ \footnoterule
+ \unvbox\footins
+ \fi
+ \ifr@ggedbottom \kern-\dimen@ \vfil \fi
+% \skip\copyins is visual space between top of copyright info and
+% bottom of preceding text.
+ \ifvoid\copyins \else \vskip\skip\copyins \unvbox\copyins \fi
+}
+%
+% \makeheadline is called at the top of a vbox with the page body to
+% follow. Restore default \leftskip to avoid indentation when the
+% page builder activates in the middle of a roster
+\def\makeheadline{%
+ \leftskip=\z@
+ \vbox{%
+% We smash the running head inside a vbox of the target height, to
+% ensure that the base of the running head always falls at the same
+% height in relation to the type block.
+ \vbox to\headlineheight{\vss
+% If \headline is empty, the \hskip here prevents an `Underfull hbox'
+% message. If \headline contains an \hfil or \hfill, the \hskip here
+% will be ignored.
+ \hbox to\hsize{\hskip\z@ plus\hsize\the\headline}%
+ \kern-\prevdepth
+ }%
+ \vskip\headlinespace
+ \vskip-\topskip
+ }%
+ \nointerlineskip
+}
+%
+% Assumption: called in vmode after the box containing the page body;
+% thus the depth of the preceding box = depth of last line in the
+% main text (except in the raggedbottom case).
+\def\makefootline{%
+ \relax\ifdim\prevdepth>\z@ \ifdim\prevdepth>\maxdepth \else
+ \vskip-\prevdepth \fi\fi
+ \nointerlineskip
+ \vbox to\z@{\hbox{}%
+ \baselineskip\dropfoliodepth
+ \hbox to\hsize{\hskip\z@ plus\hsize\the\footline}%
+ \vss}}
+
+%
+% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% -16- HYPHENATION EXCEPTIONS
+% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\message{hyphenation exceptions (U.S. English)}
+% Add some common hyphenation exceptions, from TUGboat files,
+% 20-NOV-1989. For more details see TUGboat vol 10, no 3,
+% November 1989, pp. 336--341. Many words from the TUGboat list
+% that seemed less likely to occur in mathematical text have been
+% omitted because hyphenation exceptions use up memory (most
+% versions of TeX currently have a limit of 307 on hyphenation
+% exceptions; each added hyphenation exception uses up something
+% like 2 extra words of main memory as well). The list of
+% hyphenations for proper names could be expanded forever if room
+% permitted; we restrict ourselves to a rather short, extremely
+% arbitrary list.
+%
+% Note: The hyphenation rules of British English differ in some
+% particulars from the U.S. rules.
+%
+\hyphenation{acad-e-my acad-e-mies af-ter-thought anom-aly anom-alies
+an-ti-deriv-a-tive an-tin-o-my an-tin-o-mies apoth-e-o-ses
+apoth-e-o-sis ap-pen-dix ar-che-typ-al as-sign-a-ble as-sist-ant-ship
+as-ymp-tot-ic asyn-chro-nous at-trib-uted at-trib-ut-able bank-rupt
+bank-rupt-cy bi-dif-fer-en-tial blue-print busier busiest
+cat-a-stroph-ic cat-a-stroph-i-cally con-gress cross-hatched data-base
+de-fin-i-tive de-riv-a-tive dis-trib-ute dri-ver dri-vers eco-nom-ics
+econ-o-mist elit-ist equi-vari-ant ex-quis-ite ex-tra-or-di-nary
+flow-chart for-mi-da-ble forth-right friv-o-lous ge-o-des-ic
+ge-o-det-ic geo-met-ric griev-ance griev-ous griev-ous-ly
+hexa-dec-i-mal ho-lo-no-my ho-mo-thetic ideals idio-syn-crasy
+in-fin-ite-ly in-fin-i-tes-i-mal ir-rev-o-ca-ble key-stroke
+lam-en-ta-ble light-weight mal-a-prop-ism man-u-script mar-gin-al
+meta-bol-ic me-tab-o-lism meta-lan-guage me-trop-o-lis
+met-ro-pol-i-tan mi-nut-est mol-e-cule mono-chrome mono-pole
+mo-nop-oly mono-spline mo-not-o-nous mul-ti-fac-eted mul-ti-plic-able
+non-euclid-ean non-iso-mor-phic non-smooth par-a-digm par-a-bol-ic
+pa-rab-o-loid pa-ram-e-trize para-mount pen-ta-gon phe-nom-e-non
+post-script pre-am-ble pro-ce-dur-al pro-hib-i-tive pro-hib-i-tive-ly
+pseu-do-dif-fer-en-tial pseu-do-fi-nite pseu-do-nym qua-drat-ic
+quad-ra-ture qua-si-smooth qua-si-sta-tion-ary qua-si-tri-an-gu-lar
+quin-tes-sence quin-tes-sen-tial re-arrange-ment rec-tan-gle
+ret-ri-bu-tion retro-fit retro-fit-ted right-eous right-eous-ness
+ro-bot ro-bot-ics sched-ul-ing se-mes-ter semi-def-i-nite
+semi-ho-mo-thet-ic set-up se-vere-ly side-step sov-er-eign spe-cious
+spher-oid spher-oid-al star-tling star-tling-ly sta-tis-tics
+sto-chas-tic straight-est strange-ness strat-a-gem strong-hold
+sum-ma-ble symp-to-matic syn-chro-nous topo-graph-i-cal tra-vers-a-ble
+tra-ver-sal tra-ver-sals treach-ery turn-around un-at-tached
+un-err-ing-ly white-space wide-spread wing-spread wretch-ed
+wretch-ed-ly Brown-ian Eng-lish Euler-ian Feb-ru-ary Gauss-ian
+Grothen-dieck Hamil-ton-ian Her-mit-ian Jan-u-ary Japan-ese Kor-te-weg
+Le-gendre Lip-schitz Lip-schitz-ian Mar-kov-ian Noe-ther-ian
+No-vem-ber Rie-mann-ian Schwarz-schild Sep-tem-ber}
+%
+% Initializations
+%
+% A "style initialization" file, amsppt.sti, is loaded in, in order
+% to use the same version of amsppt.sty for both production and
+% distribution.
+%
+\input amsppt.sti
+%
+% Write an empty line on screen to tidy up:
+\W@{}
+%
+% Now we restore the catcode for @ that was in effect before this
+% file. Note that we do not use \filename here, even though we did
+% at the beginning of this file, because in the absence of a proper
+% filename stack mechanism, we cannot be sure (taking into account
+% possible future changes in the contents of amsppt.sty) that an
+% intervening input file did not change \filename to another value.
+%
+\csname amsppt.sty\endcsname
+%
+% And that's it.
+\endinput
+%
+%
+% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% -17- NOTES
+% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+ Abbreviations used in this file:
+
+ From plain.tex:
+
+ \p@ 1pt, dimen register
+ \z@ 0pt, dimen register, can be used also as a number
+ \m@ne -1, count register
+
+ Chardefs and mathchardefs (these control sequences can be used as
+ numbers):
+
+ \@ne 1
+ \tw@ 2
+ \thr@@ 3
+ \active 13
+ \sixt@@n 16
+ \@cclv 255
+ \@cclvi 256
+ \@m 1000
+ \@M 10000
+ \@MM 20000
+
+ Scratch registers:
+
+ \countdef\count@=255
+ \dimendef\dimen@=0
+ \dimendef\dimen@i=1 global only
+ \dimendef\dimen@ii=2
+ \skipdef\skip@=0
+ \toksdef\toks@=0
+
+ Other:
+
+ \m@th sets \mathsurround=0pt
+ \z@skip 0pt plus 0pt minus 0pt, skip register
+ \hideskip -1000pt plus 1fill, skip register
+ \centering 0pt plus 1000pt minus 1000pt, skip register
+ \voidb@x permanently void box register
+ \endgraf same as \par, but will be accepted in arguments where
+ \par would cause an error.
+
+ \space a macro whose expansion is a space token
+ \empty@ a defined macro with a null expansion
+ \null an \hbox with null contents
+
+ From amstex.tex:
+
+ \W@ \immediate\write16
+ \eat@ gobbles next token or group in braces
+ \strip@ gets rid of trailing space from given argument
+ \hashtoks@ token register, containing #
+ \centering@ skip register, 0pt plus 1000pt
+ \rightappend@ ... \to ... Append to a token list.
+ \space@ a space token (\let equal, not a macro like \space)
+ \relaxnext@ \let\next=\relax
+ \ex@ dimen, related to x-height, roughly equal to 1pt
+ \hexnumber@ convert hex digit from decimal form to hex equivalent
+ \font@ font assignment, like \font but modified to make
+ syntax check work
+ \macro@@ used for stripping off the first part of the result
+ of a \meaning command.
+
+ \def\FN@{\futurelet\next}
+ \def\DN@{\def\next@}
+ \def\DNii@{\def\nextii@}
+ \def\RIfM@{\relax\ifmmode}
+ \def\RIfMIfI@{\relax\ifmmode\ifinner}
+ \def\setboxz@h{\setbox\z@\hbox}
+ \def\wdz@{\wd\z@}
+ \def\boxz@{\box\z@}
+ \def\setbox@ne{\setbox\@ne}
+ \def\wd@ne{\wd\@ne}
+
+ More scratch registers:
+
+ \toks@@
+ \count@@
+ \count@@@
+%
+% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% -18- APPENDIX: NOTES ON VERSION 2.1
+% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+---\curraddr was added, for giving the current address of an author,
+if different from the address given in \address.
+
+---\rom was added, for preventing unwanted italicization of certain
+things such as parentheses or numbers, in theorems and other italic
+passages. \rom automatically inserts italic corrections.
+
+---The implementation of \nofrills was completely changed, to provide
+better error messages for a missing or misspelled \endkeywords or
+similar end command, when reading a delimited argument. The error
+message is now one of
+
+ ! Forbidden control sequence found while scanning use of \keywords.
+ ! Paragraph ended before \keywords was complete.
+
+Previously the message would have had the same form, but would have
+referred to a mysterious control sequence ``\next@'' instead of
+\keywords.
+
+This change also eliminates a longstanding, very minor bug
+(\usualspace@ didn't work if it was stored in something such as
+\keywords@ for later use, because of its dependence on the
+\ifnofrills@ switch).
+
+---Multiple \thanks commands in the top matter will now produce
+multiple acknowledgment footnotes instead of discarding all but the
+last one. A period is no longer added automatically at the end of a
+\thanks.
+
+---\subjclass was updated to use the date (1991) of the current
+Mathematics Subject Classification scheme.
+
+---\widestnumber\item now works as claimed in the User's Guide.
+
+---The missing \par in \penaltyandskip@ was added.
+
+---Additional checks were added for runaway \proclaim, \definition,
+\ref, \roster, etc. The internal macro \runaway@ was changed to make
+its usage more consistent and robust; in the process its name was
+changed to \add@missing (and as the name suggests, it now tries to
+recover by adding the missing \end... command).
+
+---The bibliography macros were substantially modified to correct
+another longstanding bug: line breaks after explicit hyphens,
+mathbins, and mathrels were inhibited. This also involved changing the
+\ref-specific version of \nofrills. Backward compatibility (with
+version 2.0) is not complete with respect to \nofrills in the
+bibliography macros. This seems best, however, not only to avoid
+extra implementation difficulties, but also because the user syntax in
+version 2.0 was inferior. \nofrills now should always follow
+immediately after the name of the field to which it applies, e.g.,
+\transl\nofrills, or \paper\nofrills. Note that this is more
+consistent with the usage of \nofrills outside of the references
+section. \nofrills will cause all the "frills" such as the parentheses
+around years in journal article citations, or words like "eds." or
+"vol." that are supplied automatically, to be omitted for the given
+field. In addition, it will suppress the automatic punctuation at the
+end of the field, if any.
+
+The macro \refdef@ is gone; instead, to define a new reference
+element, you need a definition of the form
+
+ \newbox\jourbox@
+ \def\jour{\makerefbox\jour\jourbox@{\it}}
+
+where \makerefbox is a macro with three arguments: #1 is the name of
+the calling macro (for use in error messages, if need be), #2 is the
+box in which the contents of the \jour field should be stored, and #3
+is formatting information (primarily font changes) to be inserted at
+the beginning of the box. However, as before, punctuation and words
+such as "pp.", "eds.", or "vol." that are to be inserted automatically
+are handled by \endref@.
+
+Therefore, to change such frills, or the ordering of the parts of a
+reference, you need to modify \endref@. The macros \ppunbox@ and
+\commaunbox@ should normally be used to unpack a box, because they
+automatically take care of complications like \nofrills, closing
+quotes, or line breaks. \ppunbox@ takes four arguments:
+
+ #1: punctuation that should come before a line break or
+ closing quotes of a previous field
+ #2: other material such as "(" or "vol." that should be added
+ at the beginning of the current field
+ #3: the name of the box to be unpacked
+ #4: other material such as ")" that should be added
+ at the end of the current field
+
+For example, the command to unpack the \yr field is:
+
+ \ppunbox@\empty@{ (}\yrbox@)%
+
+Note the use of \empty@ to specify no preceding comma or other
+punctuation.
+
+\commaunbox@ is merely an abbreviation for
+
+ \ppunbox@,\space\xxxbox@\empty@
+
+The switches \ifpaperquotes@ and \ifbookquotes@ are gone. If quotes
+are to be added around a particular part of a reference, it should be
+done in \endref@ using \ppunbox@ and \endquotes as follows:
+
+ \ppunbox@,{ ``}\xxxbox@\endquotes
+
+\endquotes does not typeset the ending quotes immediately (because we
+don't know yet whether to insert a comma or other punctuation before
+the ending quotes). Instead, it sets a flag to be used in subsequent
+processing.
+
+---A \refstyle command was added to allow users to specify one of the
+three different reference styles most commonly used in AMS
+publications: letter labels in square brackets; unnumbered; and
+numbered (denoted A, B, and C, respectively). The syntax is
+"\refstyle{A}". Style C, numbered with arabic numerals, is the default
+selected by amsppt.sty. Eventually, phasing in the \refstyle command
+will allow the formatting for cites in the main text to be
+automatically linked with the corresponding references in the
+bibliography. (Since the bibliography style could also affect the
+style of cites, the \refstyle command should be placed in the preamble
+of a document.) Also, eventually \key could be used for all reference
+labels, and the \no command will be unnecessary, because its current
+use is merely to indicate different formatting for the reference
+number.
+
+---\miscnote was added, and used in the implementation of \toappear,
+so that \toappear and \finalinfo would not be mutually exclusive.
+\miscnote might also be used for things like "preprint" or
+"submitted". Unlike \finalinfo, \miscnote automatically adds
+parentheses.
+
+---\procinfo was added, to give place and date where the meeting
+took place, for proceedings volumes.
+
+---\eds or \ed information will now be used in place of an author's
+name, if \by is absent. This would be for collections or proceedings
+volumes that are cited as a whole, instead of citing a single paper
+within the volume.
+%
+% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% -19- APPENDIX: NOTES ON VERSIONS 2.1a, 2.1b, ...
+% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+Users that have amsppt.sty built into their amstex format file will
+need to rebuild their format file if they get a newer version of
+amsppt.sty.
+
+Version 2.1a:
+
+---Added a test so that amsppt.sty will give an error message if it's
+about to be loaded and a different version of amsppt.sty was preloaded
+in the format file.
+
+---Added code to compensate for a bug in version 2.1 that left
+\amsppt.sty = \endinput. Probably not necessary---unless the error
+message described above is changed in the future to just a warning
+message.
+
+---Added \loadmsam and \loadmsbm before the call to \UseAMSsymbols,
+so that amsppt.sty 2.1 will work even with an AMSTeX 2.0 format file.
+
+---Changed the definition of \magnification (from plain.tex) so that
+it won't reset the page dimensions to 6.5 by 9 true inches if
+it is used but will behave in a way that's more appropriate
+for the amsppt page dimensions.
+
+---Switched to using box 0 instead of \keybox@ for measuring a \key
+given with the \widestnumber command. This prevents a misnumbering
+problem that occurred in rare cases (e.g., an unnumbered reference
+following numbered references).
+
+---Changed erroneous \proclaimfont@ to \proclaimheadfont@ and
+\demofont@ to \remarkheadfont@ in the definition of \Monograph. Note:
+This means that fonts used for \remark, \demo, \proclaim \definition,
+\example, were wrong for any document that used \Monograph with amsppt
+2.1; switching to amsppt version 2.1a will make the fonts correct
+according to AMS standard monograph style, but with a slight chance of
+changing line breaks.
+
+---Added \pagenumwd and put the table-of-contents definition of
+\page inside the \toc group so that it will not conflict with
+the normal definition of \page if a single document contains
+both \toc (with \widestnumber\page used) and \Refs.
+
+---Added default definition for \leftskip@ to handle rare cases.
+Added \envir@stack\endroster in \Runinitem to prevent spurious
+"missing \endroster" error every time it's used.
+
+---Change handling of \key and \no to better handle the complications
+related to \refstyle and the need to maintain backward compatibility.
+(I.e., \refstyle should automatically be reset to C if \no is used.)
+
+---Added \procpaper@false and \book@false where appropriate in \book,
+\jour, \inbook to handle (rare?) \moreref cases where the additional
+ref is not the same type as the first ref. Switched around \moreref
+and \transl, a cosmetic change but makes the code easier to
+understand. (It seems reasonable for \transl to be based on \moreref,
+but rather odd for \moreref to be based on \transl, as in version
+2.1.)
+
+---Added \ifvoid test in \makerefbox to give an error message
+if the same tag is used twice or mutually exclusive tags (e.g.,
+\book and \inbook) are used.
+
+---Added some code to print out editors and pages information
+if given even when according to AMS style it should normally
+be omitted.
+
+Version 2.1b:
+
+---Restored the old \nologo command by popular demand.
+
+---Added \linespacing command to facilitate changing line spacing
+globally: \linespacing{2.0} increases line spacing by a factor of 2,
+similarly \linespacing{1.5} or \linespacing{2.3} for arbitrary
+factors.
+
+---Italic font is now used instead of slanted throughout (for e.g.
+\proclaim).
+
+---Omitting \by in a \ref is now possible without getting unwanted
+punctuation at the very beginning after the key.
+
+---\rom now handles preceding ~, not just preceding space.
+
+---\subsubheadfont@ added to facilitate font switching.
+
+---\document does some font setup if \topmatter is omitted.
+
+---Fixed a problem with running heads and \chapter\nofrills.
+
+---Eliminated spurious error message from \roster \widestnumber inside
+a \proclaim.
+
+Version 2.1c:
+
+---Fixed a bug introduced in version 2.1b: lost punctuation and space
+at the beginning of a \moreref.
+
+
+Version 2.1d:
+
+---Minor corrections to \PSAMSFonts, documentation
+
+---Fixed \linespacing bug: the vrule inside \strutbox did not have
+zero width.
+
+Version 2.1e:
+
+---Added \MR, \AMSPPS commands
+
+---Added some code to \output@ to reset \break, \par in case output
+routine is invoked inside \ref ... \endref *and* something added by the
+output routine (e.g., journal logo on first page) uses them.
+
+Version 2.1f:
+
+---Moved MR and AMSPPS numbers after final period.
+
+---Split part of \enddocument into separate \enddocument@text for easier
+customization.
+
+Version 2.1g (January 1997 distribution):
+
+---Added code to initialize PSAMSFonts-sensitive fonts correctly regardless
+of which fonts are being used.
+
+---Moved loading of AMSFonts and symbol names to initialization block at
+end of file.
+
+---In \makeheadline, added \leftskip=\z@ to avoid indentation of journal
+logo when end of page 1/beginning of page 2 contains a roster.
+
+---Added \urladdr to other author addresses.
+
+---Added \refsheadfont@ to permit font change without redefinition.
+
+---Added \refstyle@ to permit correct initialization of indent with
+\widestnumber when \refstyle C is used.
+
+---Added \inslogo@ to \endtopmatter to drop in insert with AMS-TeX logo or
+copyright notice.
+
+---Added \preproclaimskip, \postproclaimskip, \remarkskip, \postdemoskip,
+\predefinitionskip, \postdefinitionskip to permit spacing variations without
+redefinitions.
+
+---Revamped calculation of \pageheight to derive \vsize from known dimensions.
+
+---Revamped output routine for simplicity, and to accept AMS-TeX logo /
+copyright block as a bottom insertion rather than as an element between the
+page body and the footline; this makes it possible to use a single \pageheight
+on all pages.
+
+---Redefined \pagecontents to include logo/copyright insert, \copyins.
+
+---Redefined \makeheadline to reset formatting parameters (\leftskip, etc.)
+to avoid problems if page makeup occurs in the middle of (say) a \roster,
+and to ensure that the running head is always the same height, regardless
+of the presence of accents or math.
+
+---Redefined \makefootline for similar reasons of consistency.
+
+---Moved initialization of AMSFonts to end of file.
+
+---Adjusted indentation of code to clarify structure and nesting.
+
+---Added test for the presence of a local initialization file (amsppt.sti);
+if present, input it, and if not, carry out initialization suitable for the
+use of this style by general users.
+
+Version 2.1h (January 1997 distribution):
+
+---Added a link for an initialization file, amsppt.sti; this permits easier
+tailoring of certain features (e.g. use of PSAMSFONTS, documented in the
+AMS-TeX User's Guide), as well as use in AMS production of publication-time
+local features, without requiring a separate version of amsppt.sty.
+
+---Added \Refsname to permit publication-specific initialization of variant
+references title without requiring full redefinition of \Refs.
+
+---Added \remarkfont and \definitionfont instead of \rm to allow flexibility.
+
+---Removed ninepoint; if this were to be needed, it's likely that enough
+other changes would also be needed that the result would be a different style.
+%
+% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% -20- APPENDIX: NOTES ON VERSIONS 2.2
+% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+Version 2.2 (August 2001 distribution):
+
+---Added @ to the plain list of \dospecials, to make it behave better in
+verbatim, e-mail addresses, and URL's.
+
+---Added commands \savecat and \restorecat to make it easy to save and
+restore the catcode value of any character, most commonly @.
+
+---Replaced explicit font for addresses by \addressfont@.
+
+---Check address fields, thanks and subject classification for presence of
+data, and omit if empty.
+
+---Added \subjclassyear to identify version of classification scheme; check
+for valid years (1991, 2000), default to 1991 for backward compatibility
+
+---Added a check for the presence of \document line; report at \enddocument
+if missing.
+
+---Documented a bug in the application of space between two adjacent theorems;
+didn't fix it (compatibility: would change page breaks).
+
+---Added \if@qedhere to support feature in AMS document styles that permits
+location of end-of-proof box to be varied.
+
+---Removed period at end of caption if it is not followed by text.
+
+---Added a warning to \footnote inside references; footnotes inside references
+disappear, taking with them the reference element to which they are attached.
+
+---Removed \foliofont@ from definition of \folio and added it instead to the
+running heads, permitting "clean" page numbers to be output with indexing
+terms when an auxiliary package such as index.tex (from texsis) is used.
diff --git a/macros/amstex/doc/amsppt.faq b/macros/amstex/doc/amsppt.faq
new file mode 100644
index 0000000000..0f6811d03b
--- /dev/null
+++ b/macros/amstex/doc/amsppt.faq
@@ -0,0 +1,194 @@
+%% @txtfile{
+%% filename = "amsppt.faq",
+%% version = "2.2",
+%% date = "2001/08/07",
+%% time = "13:53:55 EDT",
+%% checksum = "02733 194 1367 9268",
+%% filetype = "AMS-TeX: user documentation",
+%% author = "American Mathematical Society",
+%% copyright = "Copyright 2001 American Mathematical Society,
+%% all rights reserved. Copying of this file is
+%% authorized only if either:
+%% (1) you make absolutely no changes to your copy
+%% including name; OR
+%% (2) if you do make changes, you first rename it
+%% to some other name.",
+%% address = "American Mathematical Society,
+%% Technical Support,
+%% Publications Technical Group,
+%% P. O. Box 6248,
+%% Providence, RI 02940,
+%% USA",
+%% telephone = "401-455-4080 or (in the USA and Canada)
+%% 800-321-4AMS (321-4267)",
+%% FAX = "401-331-3842",
+%% email = "tech-support@ams.org (Internet)",
+%% codetable = "ISO/ASCII",
+%% keywords = "amstex, ams-tex, tex",
+%% abstract = "This file contains frequently asked questions and
+%% answers concerning AMS-TeX, and in particular how
+%% to cope with ``missing'' features and features of
+%% the preprint documentstyle (amsppt) that are
+%% specifically tailored to AMS publication style.",
+%% docstring = "The checksum field above contains a CRC-16 checksum
+%% as the first value, followed by the equivalent of
+%% the standard UNIX wc (word count) utility output of
+%% lines, words, and characters. This is produced by
+%% Robert Solovay's checksum utility.",
+%% }
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+Frequently asked questions about AMS-TeX and amsppt.sty.
+
+ 1) Why does the bottom of every page get cut off when \magnification
+ is used?
+ 2) How can I prepare a two-column index for a book using AMS-TeX?
+ 3) I need 12pt type in my paper. How do I get it?
+ 4) I need to put a footnote in my bibliography, but it disappears.
+ How do I get it to print out?
+ 5) A page ending with a theorem is shorter than other pages. Why?
+ 6) Why am I getting a label ``E-mail address'' at the end of my paper
+ with no data?
+ 7) I need diagonal arrows in my commutative diagrams. How do I
+ get them?
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+1) Why does the bottom of every page get cut off when \magnification
+ is used?
+
+Version 2.1 of amsppt.sty was modified (in January 1997) to make the
+output dimensions the same as those for the majority of AMS publications,
+in particular journals. This made it possible to simplify quite radically
+the AMS ``author packages'' for particular publications, thus (in the
+long run) avoiding questions that were demanding scarce support time.
+
+One of the January 1997 changes consisted in positioning the running
+head, i.e. the top of the type block, at the exact top of the normal
+print area, rather than ``above'' the print area as is the default in
+plain TeX. Although the default setting for laser printers starts the
+printing 1in down from the top edge of the paper, on a typesetter, that
+setting is traditionally 0 (to avoid wasting the expensive photographic
+medium), and unless special measures are taken, the running heads would
+print ``above'' the top, often overprinting something else or being lost
+off the edge, resulting in even greater waste of materials and time.
+In addition, running heads ``above'' the print area could not be checked
+in the previewers used at AMS.
+
+The earlier behavior can be restored by specifying
+ \voffset-2pc
+when processing a document with amsppt.sty. This command is present,
+but commented out, in the file amsppt.sti, a file intended for the
+specification of local defaults. Since amsppt.sti is automatically
+read in by amsppt.sty, uncommenting the relevant command would adjust
+the position of output on paper sufficiently to accommodate magnification
+up to \magstep 1.
+
+Note that no AMS publication uses magnification as a technique for
+providing larger type; if larger type is desired, that is encoded into
+the relevant author package by providing additional fonts.
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+2) How can I prepare a two-column index for a book using AMS-TeX?
+
+AMS-TeX was originally intended to provide only features to make it
+easier to typeset mathematical content -- display equations, theorems,
+and similar material. Niceties of formatting were to be provided by
+other packages such as LaTeX. Things didn't quite turn out that way,
+and AMS-TeX and LaTeX didn't merge as readily as was once hoped.
+
+It is still not planned to add advanced formatting features, including
+double columns, to AMS-TeX. However, some simple macros can be defined
+and used in an AMS-TeX source file to produce an .idx file, which can
+then be processed by the makeindex program. (Makeindex is included
+with all standard TeX distributions.) The resulting .ind file can be
+processed separately through (AMS-)LaTeX to create a two-column index.
+
+Macros compatible with makeindex and plain TeX (and therefore AMS-TeX)
+can be found on CTAN, in the area
+ /tex-archive/macros/texsis/index/
+
+Read the documentation that comes with makeindex and the comments in
+the file index.tex for instructions.
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+3) I need 12pt type in my paper. How do I get it?
+
+This size isn't needed in most AMS publications, but when it is, it is
+defined for the author packages that need it. In particular, \twelvepoint
+is defined in the file ams-spec.sty, which is used with monographs and
+book proceedings. (\elevenpoint is also defined in ams-spec.sty.)
+
+The file amsspec.sty can be obtained as part of the gen-m (generic book)
+author package from the AMS web server:
+ http://www.ams.org/tex/author-info.html
+
+Create a file called myfonts.tex. Begin that file with the line
+ \savecat @
+and end it with the line
+ \restorecat @
+Copy the definition of \twelvepoint and all associated \font@ commands
+from amsspec.sty into myfonts.tex. Then include the command
+ \input myfonts
+in the preamble of your document file.
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+4) I need to put a footnote in my bibliography, but it disappears.
+ How do I get it to print out?
+
+Not only the footnote disappears, but also the element of the reference
+to which the footnote is attached. This happens because the parts of
+the footnote are boxed during processing, and footnotes disappear from
+boxed material. The solution is to use \footnotemark in the reference,
+and \footnotetext{...} after \endref.
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+5) A page ending with a theorem is shorter than other pages. Why?
+
+If a page break occurs between two theorems, or between any combination
+of adjacent theorem or proof (\proclaim or \demo), the space following
+the first one will fall before a favorable penalty and will not be
+removed at the bottom of the page. This is due to a bug, in which the
+vertical space preceding a theorem or proof will be removed only if it
+is less than the space to be added In AMS style, the space above is
+the same as the space below, so what should have been done is test for
+a space less than or equal to the space to be added; however, to change
+this now could cause changes in the paging of existing documents.
+
+In order to get rid of the extra space, put \pagebreak immediately
+before the \endproclaim or \enddemo at the bottom of the page; this
+should, of course, be done only for the final run.
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+ 6) Why am I getting a label ``E-mail address'' at the end of my paper
+ with no data?
+
+In the topmatter templates for AMS author packages, all possible tags
+for subject and author information are included for convenience. If
+any of these are left in your file with no data, ``empty'' footnotes
+can appear on the first page (for \subjclass or \keywords), or labels
+associated with author addresses can appear at the end of a paper with
+no data. Checking for ``empty'' tags isn't easily accomplished, so an
+author should make sure that any tag that doesn't have data is removed
+or commented out.
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+ 7) I need diagonal arrows in my commutative diagrams. How do I
+ get them?
+
+The \CD structure of AMS-TeX provides only vertical and horizontal
+connectors. To get diagonal connectors, it is necessary to use another
+package. XY-pic, by Kristoffer Rose, provides many more facilities
+than \CD, and it is compatible with AMS-TeX. XY-pic can be found on
+CTAN, in the area
+ /tex-archive/macros/generic/diagrams/xypic/
+Be sure to read the excellent documentation, xyguide, which is available
+in dvi, PostScript and PDF form, ready to print.
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
diff --git a/macros/amstex/doc/amsppt.txt b/macros/amstex/doc/amsppt.txt
new file mode 100644
index 0000000000..87023e00e7
--- /dev/null
+++ b/macros/amstex/doc/amsppt.txt
@@ -0,0 +1,1447 @@
+% AMSPPT.STY VERSION 2.0
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% %%
+%% This is the documentation for AMSPPT.STY, the AmS-TeX `preprint style'. %%
+%% It contains all the code for AMSPPT.STY, with additional comments. All %%
+%% such comments begin with %%, making it easy to recognize single % signs %%
+%% that sometimes appear in AMSPPT.STY. %%
+%% %%
+%% Some explanations given earlier in the file will be required at later %%
+%% points. Boxes like this are sometimes used for such explanations. %%
+%% %%
+%% Material from AMSTEX.DOC, the documentation file for AMSTEX.TEX may also %%
+%% be used. %%
+%% %%
+%% As in AMSTEX.DOC, TB refers to The Texbook. %%
+%% %%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\catcode`\@=11
+
+%% We record the style name in \styname and the version in \styversion,
+!!!%% and then report them to the screen and log file.
+
+\def\styname{amsppt}
+\def\styversion{2.0}
+{\W@{}\W@{AMSPPT.STY - Version \styversion}\W@{}}
+
+%% It probably isn't necessary to prevent reading in amsppt.sty twice, but
+%% we do it anyway, just to save time if it happens to be called twice.
+
+\ifx\amspptloaded@\relax\catcode`\@=\active
+ \endinput\else\let\amspptloaded@\relax\fi
+
+%% First we set up some basic parameters, which are different than in
+%% plain. The values are common to several AMS journals, including the
+%% Journal of the AMS.
+
+\parindent1pc \hsize30pc \vsize47.5pc \normallineskiplimit\p@
+
+%% As mentioned in AMSTEX.DOC, \captionwidth@ has to be reset for the new
+%% \hsize.
+
+\def\setcaptionwidth@{\captionwidth@\hsize \advance\captionwidth@-6pc}
+\setcaptionwidth@
+
+!!%% Provide a way to change the page height and width; changing the page
+!!%% width automatically adjusts the caption width as well. (\pagewidth
+!!%% in AMSTEX.TEX resets the caption width to a different value than is
+!!%% used in AMS journals.)
+!!
+!!\def\changepageheight#1{\vsize=#1}
+!!\def\changepagewidth#1{\hsize=#1\setcaptionwidth@}
+
+%% We need the cmcsc10 font. Although \tensmc appears in AMSTEX.TEX, it
+%% never actually got declared. Supply the cmcsc8 font too; it will be
+%% included in the AMSFonts collection. We use \font@, not simply \font,
+%% as already explained in AMSTEX.DOC.
+
+\font@\tensmc=cmcsc10
+\font@\eightsmc=cmcsc8
+
+%% We have to load a lot of other fonts for the eight-point footnotes. Note
+%% that cmti and cmsl in sizes 5, 6, 7 don't get loaded, since they may not
+%% exist (cmti7 is one of the standard 75 Computer Modern fonts, but cmti5
+!!%% and cmti6 aren't, nor are any of cmsl5, cmsl6, cmsl7). Instructions for
+!!%% loading nine-point fonts are present, but commented out, as they are not
+!!%% required in the preprint style; however, if a user wishes to use nine-point
+!!%% fonts, the comment characters can be removed and \ninepoint defined on the
+!!%% model of \tenpoint and \eightpoint below.
+
+%\font@\ninerm=cmr9
+\font@\eightrm=cmr8
+\font@\sixrm=cmr6
+%\font@\ninei=cmmi9 \skewchar\ninei='177
+\font@\eighti=cmmi8 \skewchar\eighti='177
+\font@\sixi=cmmi6 \skewchar\sixi='177
+%\font@\ninesy=cmsy9 \skewchar\ninesy='60
+\font@\eightsy=cmsy8 \skewchar\eightsy='60
+\font@\sixsy=cmsy6 \skewchar\sixsy='60
+%\font@\ninebf=cmbx9
+\font@\eightbf=cmbx8
+\font@\sixbf=cmbx6
+%\font@\nineit=cmti9
+\font@\eightit=cmti8
+%\font@\ninesl=cmsl9
+\font@\eightsl=cmsl8
+
+%% We will load the basic sizes of the msam, msbm and eufm fonts as well
+%% as the names of all the symbols. If these are really not needed, or
+%% space is a problem, a user can comment out these lines without making
+%% any other changes.
+
+\loadmsam
+\loadmsbm
+\loadeufm
+\UseAMSsymbols
+
+%% We will only load the additional point sizes for the msam, msbm, and
+%% eufm families if the flags \ifmsamloaded@, etc., are true (since
+%% presumably this was done by a user who has the proper families).
+%% As above, instructions for nine-point fonts are present but commented out.
+
+\ifmsamloaded@
+% \font@\ninemsa=msam9
+ \font@\eightmsa=msam8
+ \font@\sixmsa=msam6
+\fi
+ \ifmsbmloaded@
+% \font@\ninemsb=msbm9
+ \font@\eightmsb=msbm8
+ \font@\sixmsb=msbm6
+\fi
+
+\ifeufmloaded@
+% \font@\nineeufm=eufm9
+ \font@\eighteufm=eufm8
+ \font@\sixeufm=eufm6
+\fi
+
+%% In order to be able to load additional sizes of the Euler fonts that
+%% are not included automatically, we need to be able to test whether the
+%% basic sizes have been loaded, and if they haven't, create a new switch.
+%% Since this will be performed inside another macro, we need a \newif that
+%% isn't outer. We repeat the definition of \@if from plain, for completeness.
+
+% from plain.tex; we need a \newif that isn't outer.
+\def\@newif#1{\count@\escapechar \escapechar\m@ne
+ \expandafter\expandafter\expandafter
+ \edef\@if#1{true}{\let\noexpand#1=\noexpand\iftrue}%
+ \expandafter\expandafter\expandafter
+ \edef\@if#1{false}{\let\noexpand#1=\noexpand\iffalse}%
+ \@if#1{false}\escapechar\count@} % the condition starts out false
+\def\@if#1#2{\csname\expandafter\if@\string#1#2\endcsname}
+
+%% We define a test that will determine whether or not a \cs is defined
+%% (TB, p. 308).
+
+\def\ifundefined#1{\expandafter\ifx\csname#1\endcsname\relax }
+
+%% We define a routine to create a new \if... if a tested \if... name
+%% is not already defined, and apply it to all the Euler fonts that are
+%% not loaded automatically.
+
+\def\makeflag#1{\expandafter\@newif\csname if#1\endcsname
+ \csname #1false\endcsname}
+\ifundefined{ifeufbloaded@}\makeflag{eufbloaded@}\fi
+\ifundefined{ifeusmloaded@}\makeflag{eusmloaded@}\fi
+\ifundefined{ifeusbloaded@}\makeflag{eusbloaded@}\fi
+\ifundefined{ifeurmloaded@}\makeflag{eurmloaded@}\fi
+\ifundefined{ifeurbloaded@}\makeflag{eurbloaded@}\fi
+
+%% Now we define \tenpoint and \eightpoint for regular text and footnotes,
+%% similarly to TB, p. 414. We keep track of the point size in a control
+%% sequence \pointsize@, because a couple of constructions need to know the
+%% point size we are in (and other constructions added later, or in other
+%% styles, might need this). We not only change the \baselineskip, but also
+%% change the glue above and below displayed formulas, in case the footnotes
+%% happen to have them. We also need to set not only \strutbox, but also
+%% \strutbox@. And we will set \ex@ in each case (for \tenpoint it is
+%% supposed to be equivalent to 1pt, while for \eightpoint it will then
+%% presumably be equivalent to .8pt).
+
+%% When \ifsyntax@ is true, so that we are checking syntax, then we won't
+%% bother specifying fonts (since we would only change them all to \dummyft@
+%% anyway), and we simply let \big gobble up things with the proper syntax,
+%% instead of worrying about getting the right sizes. In general, \big is
+%% \tenbig or \eightbig, which are defined immediately afterwards.
+
+\def\tenpoint{\def\pointsize@{10}%
+ \normalbaselineskip12\p@
+ \abovedisplayskip12\p@ plus3\p@ minus9\p@
+ \belowdisplayskip12\p@ plus3\p@ minus9\p@
+ \abovedisplayshortskip\z@ plus3\p@
+ \belowdisplayshortskip7\p@ plus3\p@ minus4\p@
+ \textonlyfont@\rm\tenrm
+ \textonlyfont@\it\tenit
+ \textonlyfont@\sl\tensl
+ \textonlyfont@\bf\tenbf
+ \textonlyfont@\smc\tensmc
+ \ifsyntax@\def\big##1{{\hbox{$\left##1\right.$}}}\else
+ \let\big\tenbig@
+ \textfont\z@=\tenrm \scriptfont\z@=\sevenrm \scriptscriptfont\z@=\fiverm
+ \textfont\@ne=\teni \scriptfont\@ne=\seveni \scriptscriptfont\@ne=\fivei
+ \textfont\tw@=\tensy \scriptfont\tw@=\sevensy \scriptscriptfont\tw@=\fivesy
+ \textfont\thr@@=\tenex \scriptfont\thr@@=\tenex
+ \scriptscriptfont\thr@@=\tenex
+ \textfont\itfam=\tenit %% \scriptfont and \scriptscriptfont for \itfam
+ %% are already set by AMSTEX.TEX, and there's no point trying to make
+ %% changes, since we probably don't have the right sizes.
+ \textfont\slfam=\tensl %% Similarly for \slfam.
+ \textfont\bffam=\tenbf \scriptfont\bffam=\sevenbf
+ \scriptscriptfont\bffam=\fivebf
+ \ifmsamloaded@
+ \textfont\msafam=\tenmsa \scriptfont\msafam=\sevenmsa
+ \scriptscriptfont\msafam=\fivemsa
+ \fi
+ \ifmsbmloaded@
+ \textfont\msbfam=\tenmsb \scriptfont\msbfam=\sevenmsb
+ \scriptscriptfont\msbfam=\fivemsb
+ \fi
+ \ifeufmloaded@
+ \textfont\eufmfam=\teneufm \scriptfont\eufmfam=\seveneufm
+ \scriptscriptfont\eufmfam=\fiveeufm
+ \fi
+ \ifeufbloaded@
+ \textfont\eufbfam=\teneufb \scriptfont\eufbfam=\seveneufb
+ \scriptscriptfont\eufbfam=\fiveeufb
+ \fi
+ \ifeusmloaded@
+ \textfont\eusmfam=\teneusm \scriptfont\eusmfam=\seveneusm
+ \scriptscriptfont\eusmfam=\fiveeusm
+ \fi
+ \ifeusbloaded@
+ \textfont\eusbfam=\teneusb \scriptfont\eusbfam=\seveneusb
+ \scriptscriptfont\eusbfam=\fiveeusb
+ \fi
+ \ifeurmloaded@
+ \textfont\eurmfam=\teneurm \scriptfont\eurmfam=\seveneurm
+ \scriptscriptfont\eurmfam=\fiveeurm
+ \fi
+ \ifeurbloaded@
+ \textfont\eurbfam=\teneurb \scriptfont\eurbfam=\seveneurb
+ \scriptscriptfont\eurbfam=\fiveeurb
+ \fi
+ \ifcmmibloaded@
+ \textfont\cmmibfam=\tencmmib \scriptfont\cmmibfam=\sevencmmib
+ \scriptscriptfont\cmmibfam=\fivecmmib
+ \fi
+ \ifcmbsyloaded@
+ \textfont\cmbsyfam=\tencmbsy \scriptfont\cmbsyfam=\sevencmbsy
+ \scriptscriptfont\cmbsyfam=\fivecmbsy
+ \fi
+ \fi %% Matches \ifsyntax@.
+ \setbox\strutbox\hbox{\vrule height8.5\p@ depth3.5\p@ width\z@}%
+ \setbox\strutbox@\hbox{\vrule height8\p@ depth3\p@ width\z@}%
+ \normalbaselines\tenrm\ex@=.2326ex}
+
+%% For \eightpoint we don't change the assignments of \scriptscriptstyle,
+%% since these don't change from \tenpoint (and we call \tenpoint near the
+%% end). \textfont3 also doesn't change (an \eightex font will be included
+%% in the AMSFonts collection, and can be added by the user).
+
+\def\eightpoint{\def\pointsize@{8}%
+ \normalbaselineskip10\p@
+ \abovedisplayskip10\p@ plus2.4\p@ minus7.2\p@
+ \belowdisplayskip10\p@ plus2.4\p@ minus7.2\p@
+ \abovedisplayshortskip\z@ plus2.4\p@
+ \belowdisplayshortskip5.6\p@ plus2.4\p@ minus3.2\p@
+ \textonlyfont@\rm\eightrm
+ \textonlyfont@\it\eightit
+ \textonlyfont@\sl\eightsl
+ \textonlyfont@\bf\eightbf
+ \textonlyfont@\smc\eightsmc
+ \ifsyntax@\def\big##1{{\hbox{$\left##1\right.$}}}\else
+ \let\big\eightbig@
+ \textfont\z@=\eightrm \scriptfont\z@=\sixrm
+ \textfont\@ne=\eighti \scriptfont\@ne=\sixi
+ \textfont\tw@=\eightsy \scriptfont\tw@=\sixsy
+ %% Although we don't have smaller fonts for \itfam or \slfam, we reset
+ %% the \scriptfont and \scriptscriptfonts to the text size so that they
+ %% won't appear in ten-point if they are used.
+ \textfont\itfam=\eightit \scriptfont\itfam=\eightit
+ \scriptscriptfont\itfam=\eightit
+ \textfont\slfam=\eightsl \scriptfont\slfam=\eightsl
+ \scriptscriptfont\slfam=\eightsl
+ \textfont\bffam=\eightbf \scriptfont\bffam=\sixbf
+ \ifmsamloaded@
+ \textfont\msafam=\eightmsa \scriptfont\msafam=\sixmsa
+ \fi
+ \ifmsbmloaded@
+ \textfont\msbfam=\eightmsb \scriptfont\msbfam=\sixmsb
+ \fi
+ \ifeufmloaded@
+ \textfont\eufmfam=\eighteufm \scriptfont\eufmfam=\sixeufm
+ \fi
+ \fi
+ \setbox\strutbox\hbox{\vrule height7\p@ depth3\p@ width\z@}%
+ \setbox\strutbox@\hbox{\vrule height6.5\p@ depth2.5\p@ width\z@}%
+ \normalbaselines\eightrm\ex@.2326ex}
+
+%% Fix Plain's \bigl, \Bigl, etc. macros so that they try to scale with
+%% size changes. This uses the fact that \tenpoint and \eightpoint
+%% set \ht\strutbox to be 70% of the normal unstretched baselineskip.
+%% from John Hobby
+
+\def\big#1{{\hbox{$\m@th
+ \left#1\vcenter to1.428\ht\strutbox{}\right.\n@space$}}}
+\def\Big#1{{\hbox{$\m@th
+ \left#1\vcenter to2.142\ht\strutbox{}\right.\n@space$}}}
+\def\bigg#1{{\hbox{$\m@th
+ \left#1\vcenter to2.857\ht\strutbox{}\right.\n@space$}}}
+\def\Bigg#1{{\hbox{$\m@th
+ \left#1\vcenter to3.571\ht\strutbox{}\right.\n@space$}}}
+
+%% Although the counter \footmarkcount@ is declared in AMSTEX.TEX, the rest
+%% of \footnote has to be done here. \footmarkform@ tells how to treat a
+%% general type of footnote marker. And \thefootnotemark is for the user,
+%% analogous to \thetag in AMSTEX.TEX.
+
+\def\footmarkform@#1{$\m@th^{#1}$}
+\let\thefootnotemark\footmarkform@
+
+%% \makefootnote@ takes care of the general problem of creating a footnote
+%% whose marker is #1 and whose text is #2, so that we can concentrate
+%% separately on the problem of how the marker is determined. It is
+%% essentially \vfootnote from TB, p. 363, except that we don't do fancy
+%% things to worry about category code changes; our footnotes will begin
+%% unindented, and instead of adding a \strut at the end, we will just add
+%% the lower part of the strut. (And, of course, we will be in eight point
+%% type.)
+
+\def\makefootnote@#1#2{\insert\footins
+ {\interlinepenalty\interfootnotelinepenalty
+ \eightpoint\splittopskip\ht\strutbox\splitmaxdepth\dp\strutbox
+ \floatingpenalty\@MM\leftskip\z@\rightskip\z@\spaceskip\z@\xspaceskip\z@
+ \noindent{#1}\footstrut\ignorespaces#2\unskip\lower\dp\strutbox
+ \vbox to\dp\strutbox{}}}
+
+%% We need a counter for footnotes; initialize it.
+
+\newcount\footmarkcount@
+\footmarkcount@\z@
+
+%% \footnotemark basically just advances \footmarkcount@ by 1 and then uses
+%% \footmarkform@{\number\footmarkcount@}---we still have to worry about the
+%% space factor as in the definition of \footnote in TB, p. 363. However, we
+%% are allowing both an `optional' argument [#1], where we instead use
+%% \footmarkform@{#1}, and a `literal' argument "#1", where we instead use #1
+%% exactly as typed, so we need to use a \futurelet to look at the next
+%% symbol. Compressed format is used.
+
+\def\footnotemark{\let\@sf\empty\relaxnext@
+ \ifhmode\edef\@sf{\spacefactor\the\spacefactor}\/\fi
+ \DN@{\ifx[\next\let\next@\nextii@\else
+ \ifx"\next\let\next@\nextiii@\else
+ \let\next@\nextiv@\fi\fi\next@}%
+ \DNii@[##1]{\footmarkform@{##1}\@sf}%
+ \def\nextiii@"##1"{{##1}\@sf}%
+ \def\nextiv@{\global\advance\footmarkcount@\@ne
+ \footmarkform@{\number\footmarkcount@}\@sf}%
+ \FN@\next@}
+
+%% \footnotetext essentially applies \makefootnote@ to the next group, using
+%% \footmarkcount@ for the marker that goes before the footnote text.
+%% However, we once again allow optional and literal arguments. Compressed
+%% format is used.
+
+\def\footnotetext{\relaxnext@
+ \DN@{\ifx[\next\let\next@\nextii@\else
+ \ifx"\next\let\next@\nextiii@\else
+ \let\next@\nextiv@\fi\fi\next@}%
+ \DNii@[##1]##2{\makefootnote@{\footmarkform@{##1}}{##2}}%
+ \def\nextiii@"##1"##2{\makefootnote@{##1}{##2}}%
+ \def\nextiv@##1{\makefootnote@{\footmarkform@{\number\footmarkcount@}}{##1}}%
+ \FN@\next@}
+
+%% Finally, \footnote is basically \footnotemark\footnote, but we can't write
+%% it directly that way because it, too, can take optional and literal
+%% arguments. Compressed format again.
+
+\def\footnote{\let\@sf\empty\relaxnext@
+ \ifhmode\edef\@sf{\spacefactor\the\spacefactor}\/\fi
+ \DN@{\ifx[\next\let\next@\nextii@\else
+ \ifx"\next\let\next@\nextiii@\else
+ \let\next@\nextiv@\fi\fi\next@}%
+ \DNii@[##1]##2{\footnotemark[##1]\footnotetext[##1]{##2}}%
+ \def\nextiii@"##1"##2{\footnotemark"##1"\footnotetext"##1"{##2}}%
+ \def\nextiv@##1{\footnotemark\footnotetext{##1}}%
+ \FN@\next@}
+
+%% \adjustfootnotemark just allows the user to change \footmarkcount@.
+
+\def\adjustfootnotemark#1{\advance\footmarkcount@#1\relax}
+
+%% The \topmatter ... \endtopmatter syntax was created to go along with
+%% LaTeX, but \topmatter actually has no function.
+
+\let\topmatter\relax
+
+!!!!!!!!!!
+
+%% The constructions \title, \author, \affil and \heading use `\z@\filhss@'
+%% instead of \hfil or \hss glue explicitly, so that if they are followed by
+%% \overlong they can let \filhss@ be `plus1000pt minus1000pt' (so that a
+%% line longer than \hsize will just be centered outside the margins), but
+%% otherwise they let \filhss@ simply be `plus1000pt' (so that a line longer
+%% than \hsize will actually be reported as Overfull). Like \vspace, etc.,
+%% in AMSTEX.TEX, this should give an error message when used incorrectly,
+%% and we abbreviate the proper definition. The definition involves \next@
+%% and \nextii@, because \overlong@ is always used in constructions with
+%% compressed format that end \futurelet\next\next@, use \overlong to define
+%% \next@, and then define \nextii@ appropriately.
+
+
+\Invalid@\overlong
+\def\overlong@{\DN@{\ifx\next\overlong
+ \def\filhss@{plus\@m\p@ minus\@m\p@}\DN@\overlong{\nextii@}%
+ %% When \overlong appears [the new value of] \next@ must
+ %% kill \overlong and then call \nextii@.
+ \else\def\filhss@{plus\@m\p@\relax}\let\next@\nextii@\fi
+ \next@}}
+
+%% We need a box to store the title. We make it empty if no title appears,
+%% so that at least some space appears for the title (presumably the author
+%% simply hasn't decided on the title yet).
+
+\newbox\titlebox@
+\setbox\titlebox@\vbox{}
+
+%% Although we use the syntax \author ... \endauthor, we simply use
+%% \endauthor as a delimiter for the argument, as with \align, rather than
+%% doing \bgroup and \egroup tricks, as with \aligned. And we simply say
+%% \let\\=\cr, since we shouldn't have to worry about any of the problems
+%% that make \Let@ necessary. But there is a particular reason, beyond
+%% convenience, for writing things this way. If one wanted to have a \TITLE
+%% construction, that applied \uppercase to everything, then \TITLE would
+%% have to be written this way. [\TITLE is a nice idea, because then the
+%% title can appear in upper- and lowercase in the input file (for automatic
+%% indexing, for example), but all uppercase in the paper. However, there
+%% would actually be some horrible problems involved in writing TITLE
+%% correctly. For example, math formulas might appear in a title, and we'd
+%% have to arrange not to uppercase them. Moreover, footnotes might appear,
+%% since some styles use footnotes on authors for the affiliation, etc., and
+%% then the footnotes mustn't be uppercased either! Any one who wants this
+%% can do it Eirself.]
+
+\def\title{\relaxnext@
+ \DNii@##1\endtitle{{\let\\=\cr
+ \global\setbox\titlebox@\vbox{\tabskip\z@\filhss@
+ \halign to\hsize{\tenpoint\bf\hfil\ignorespaces####\unskip\hfil\cr##1\cr}}}}%
+ \overlong@
+ \futurelet\next\next@}
+
+%% \author@ is almost exactly the same, except that instead of having
+%% \authorbox@ empty when no \author appears, we have a flag to tell if it
+%% appears.
+
+\newif\ifauthor@
+\newbox\authorbox@
+\def\author{\relaxnext@
+ \DNii@##1\endauthor{{\let\\=\cr
+ \global\setbox\authorbox@\vbox{\tabskip\z@\filhss@
+ \halign to\hsize{\tenpoint\smc\hfil\ignorespaces####\unskip\hfil\cr##1\cr
+ }}}}\overlong@\global\author@true
+ \futurelet\next\next@}
+
+%% \affil, on the other hand, is written in the \bgroup ... \egroup style,
+%% since one presumably wouldn't ever want to uppercase everything here.
+
+\newif\ifaffil@
+\newbox\affilbox@
+\def\affil{\relaxnext@
+ \DNii@{\bgroup\let\\=\cr
+ \global\setbox\affilbox@\vbox\bgroup\tabskip\z@\filhss@
+ \halign to\hsize\bgroup\tenpoint\hfil\ignorespaces####\unskip\hfil\cr}%
+ \overlong@
+ \global\affil@true
+ \futurelet\next\next@}
+
+\def\endaffil{\cr\egroup\egroup\egroup}
+
+%% Since \address can be used any number of times, we have to store the
+%% different addresses in control sequences that we manufacture as needed. We
+%% use \addresscount@ to store the number of times \address is used.
+
+\newcount\addresscount@
+\addresscount@\z@
+
+\def\address#1{\global\advance\addresscount@\@ne
+ \expandafter\gdef\csname address\number\addresscount@\endcsname
+ %% The first address is `\address1', the next is `\address2', etc.
+ {\noindent\eightpoint\ignorespaces#1\par}}
+
+%% We use flags to tell if \date and \thanks have been used, in which case
+%% \date@ and \thanks@, respectively, have been defined.
+
+\newif\ifdate@
+
+\def\date#1{\global\date@true\gdef\date@{\tenpoint\ignorespaces#1\unskip}}
+
+\newif\ifthanks@
+
+\def\thanks#1{\global\thanks@true
+ \gdef\thanks@{\eightpoint\ignorespaces#1\unskip}}
+
+%% \nofrills and \usualspace are subsidiary features that some constructions
+%% can have, but which should give error message if used otherwise.
+
+\Invalid@\nofrills
+\Invalid@\usualspace
+
+%% \nofrills@ is the control sequence that does the work of making \nofrills
+%% work correctly. \nofrills@ will take two arguments; the first represents
+%% the text that should be typeset `without frills', while the second is just
+%% a convenient control sequence name, which we put at the beginning of the
+%% construction in question. This control sequence will be defined to be the
+%% first argument of \nofrills@ if \nofrills follows the construction, but
+%% simply \relax otherwise. (We choose different control sequences for each
+%% construction in case one occurs within another.)
+
+%% Like \overlong, \nofrills@ is defined in terms of \next@ and \nextii@
+%% because it is used in constructions that end \futurelet\next\next@, use
+%% \nofrills@ to define \next@, and then define \nextii@ appropriately.
+%% \nofrills@ also sets a flag \ifnofrills@, for use with \usualspace@.
+
+\newif\ifnofrills@
+\def\nofrills@#1#2{\DN@{\ifx\next\nofrills\nofrills@true\let#2\relax
+ \DN@\nofrills{\nextii@}%
+ %% When \nofrills appears, the control sequence #2 is just relax, and
+ %% \next@ must kill off \nofrills before calling \nextii@.
+ \else\nofrills@false
+ \def#2{#1}%
+ %% When \nofrills doesn't appear, the control sequence #2 is #1.
+ \let\next@\nextii@\fi\next@}}
+
+%% \usualspace@ simply defines \usualspace when no frills have been specified
+%% (and otherwise does nothing).
+
+\def\usualspace@#1{\ifnofrills@\def\usualspace{#1}\fi}
+
+%% As an example of all this, consider \keywords, which creates
+%% \thekeywords@. Normally \keywords makes \thekeywords@ begin with {\it
+%% Keywords.\enspace}. But \keywords\nofrills{...} makes it begin with ...
+%% instead. Moreover, \usualspace will then be defined as {\it\enspace}.
+
+\def\thekeywords@{}
+\def\keywords{\relaxnext@
+ \nofrills@{{\it Keywords.\enspace}}\keywords@
+ \DNii@##1{\def\thekeywords@{\usualspace@{{\it\enspace}}\noindent
+ \eightpoint\keywords@\ignorespaces##1\par}}%
+ \futurelet\next\next@}
+
+%% \subjclass is exactly analogous.
+
+\def\thesubjclass@{}
+\def\subjclass{\relaxnext@
+ \nofrills@{{\rm1980 {\it Mathematics subject
+ classifications\/}: }}\subjclass@
+ \DNii@##1{\def\thesubjclass@{\usualspace@
+ {{\rm\spacefactor2000 \space}}\noindent\eightpoint
+ \subjclass@\ignorespaces##1\par}}%
+ \futurelet\next\next@}
+
+%% \proclaim and \endproclaim have a special problem: We want them to be
+%% allowed within \abstract{...} but we want them to be \outer afterwards. So
+%% we will actually define \innerproclaim@ and \innerendproclaim@ (later) and
+%% temporarily use these for \proclaim and \endproclaim, until \endtopmatter
+%% (which naturally should appear after any \abstract), which will make them
+%% outer again.
+
+\def\proclaim{\innerproclaim@}
+\def\endproclaim{\innerendproclaim@}
+
+%% \abstract is similar to the constructions above, but we need a \long\def
+%% since an abstract can be more than one paragraph.
+
+\newif\ifabstract@
+\def\abstract{\relaxnext@
+ \nofrills@{{Abstract.\enspace}}\abstract@
+ \long\DNii@##1{\long\gdef\theabstract@{\usualspace@
+ {{\eightpoint\enspace}}\eightpoint\abstract@\ignorespaces##1\par}}%
+ \global\abstract@true
+ \futurelet\next\next@}
+
+%% We create empty entries \pretitle, ..., \prepaper among the other parts of
+%% the \topmatter so that users can insert things between them if necessary.
+
+\let\pretitle\relax
+\let\preauthor\relax
+\let\preaffil\relax
+\let\predate\relax
+\let\preabstract\relax
+\let\prepaper\relax
+
+%% \endtopmatter now puts all of these things together on the page.
+
+\def\endtopmatter{\hrule height\z@\vskip-\topskip %% Go to very top of page.
+ \pretitle
+ \vskip24\p@ plus12\p@ minus12\p@
+ \unvbox\titlebox@ %% Title (or empty box).
+ \preauthor
+ \ifauthor@\vskip12\p@ plus6\p@ minus3\p@\unvbox\authorbox@\fi
+ %% Put in \author, and spacing, if specified.
+ \preaffil
+ \ifaffil@\vskip10\p@ plus5\p@ minus2\p@\unvbox\affilbox@\fi
+ %% Put in \affil, and spacing, if specified.
+ \predate
+ \ifdate@\vskip6\p@ plus2\p@ minus\p@\hbox to\hsize{\hfil\date@\hfil}\fi
+ %% Put in \date, and spacing, if specified.
+ \preabstract
+ \ifthanks@\makefootnote@{}{\thanks@}\fi
+ %% If \thanks given, treat it as a footnote text (with no footnote mark).
+ \ifabstract@\vskip15\p@ plus12\p@ minus12\p@
+ %% If \abstract given, put in spacing and then print \theabstract@ with
+ %% 24pt margins at each side. In order for \tag's to come out at the
+ %% new margins, we have to have \displaywidth decreased by 48pt and
+ %% \displayindent set to 24pt (see the rules in TB, pp. 188--189). Since
+ %% \displaywidth and \displayindent are normally set at each $$, we
+ %% have to use \everydisplay to get the desired values.
+ {\leftskip24\p@\rightskip24\p@
+ \everydisplay{\advance\displaywidth-48\p@\displayindent20\p@}
+ \noindent\theabstract@}\fi
+ \prepaper
+ %% Now make \proclaim and \endproclaim \outer.
+ \outer\def\proclaim{\innerproclaim@}%
+ \outer\def\endproclaim{\innerendproclaim@}%
+ \vskip18\p@ plus12\p@ minus6\p@\tenpoint}
+
+%% The \address's get printed at the end of the paper, so we take care of this
+%% with \enddocument.
+
+\outer\def\enddocument{\nobreak %% No break between the References and
+ %% the final matter.
+ \sfcode`\.=3000 %% Return space factor code of period (changed by \Refs).
+ \vskip12\p@ minus6\p@
+ \thekeywords@\thesubjclass@ %% Keywords and subject classifications,
+ %% if they exist.
+ \nobreak\vskip12\p@ minus6\p@
+ \count@\z@
+ \loop\ifnum\count@<\addresscount@\advance\count@\@ne
+ \csname address\number\count@\endcsname\repeat
+ %% Print all the \address's.
+ \vfill\supereject\end}
+
+%% \heading ... \endheading is similar to \affil .. \endaffil, except that
+%% \bigbreak is added at the beginning, and \endheading actually prints the
+%% \headingbox@, followed by \nobreak\medskip. We \unvbox the \headingbox@,
+%% so that a footnote within it will migrate properly.
+
+\newbox\headingbox@
+
+\outer\def\heading{\relaxnext@
+ \DNii@{\bigbreak\bgroup\let\\=\cr
+ \global\setbox\headingbox@\vbox\bgroup\tabskip\z@\filhss@
+ \halign to\hsize\bgroup\tenpoint\smc\hfil\ignorespaces####\unskip\hfil\cr}%
+ \overlong@
+ \futurelet\next\next@}
+
+\def\endheading{\cr\egroup\egroup\egroup\unvbox\headingbox@
+ \nobreak\medskip}
+
+%% \subheading is simpler, though it allows \nofrills.
+
+\def\subheading{\relaxnext@
+ \nofrills@{.\enspace}\subheading@
+ \DNii@##1{\medbreak\noindent{\usualspace@{{\bf\enspace}}%
+ \tenpoint\bf\ignorespaces##1\unskip\subheading@}\ignorespaces}%
+ \futurelet\next\next@}
+
+%% \innerproclaim@ (the guy behind \proclaim), sets a flag so that we can
+%% give an error message if a previous \proclaim has occurred without an
+%% \endproclaim (surely an error, since the \endproclaim would be needed to
+%% turn off the \sl font). If we are in eight point type (probably because we
+%% are in the abstract, rather than in a footnote), we replace the \smc font
+%% by \uppercase{\rm...} as the nearest substitute. Instead of writing the
+%% test as \ifnum\pointsize@=8 we use a construction that will work even if
+%% \pointsize@ has other values (say, for fractional point sizes) in other
+%% formats.
+
+%% Note that in the error message we say \string\\proclaim instead of
+%% \string\proclaim. That is because \proclaim will usually be \outer, so
+%% can't appear in \Err@, while \\ always can. We then have to \eat@ the
+%% first \ of the \\, requiring an \expandafter\eat@\string\\ construction.
+
+\newif\ifproclaim@
+
+\def\innerproclaim@{\relaxnext@
+ \nofrills@{.\enspace}\proclaim@
+ \DNii@##1{\medbreak\noindent
+ \DN@{8}\ifx\pointsize@\next@ %% If \pointsize@ is 8,
+ \uppercase{\usualspace@{{\rm\enspace}}\rm\ignorespaces##1\unskip\proclaim@}%
+ %% use an \uppercase construction.
+ \else
+ \usualspace@{{\smc\enspace}}\smc\ignorespaces##1\unskip\proclaim@\fi
+ %% After printing the name of the theorem, switch to \sl.
+ \sl
+ \ifproclaim@\Err@{Previous \expandafter\eat@\string\\proclaim
+ has no matching \expandafter\eat@\string\\endproclaim}\else
+ \proclaim@true\fi\ignorespaces}%
+ \futurelet\next\next@}
+
+%% \innerendproclaim@ (the guy behind \endproclaim) resets the \ifproclaim@
+%% flag, ends the paragraph, switches back to \rm and adds spacing. (This
+%% means that if, for some strange reason, a whole section of text happens to
+%% be in italics, then the user must type \it again after each \endproclaim,
+%% but that hardly seems a problem worth worrying about.)
+
+\def\innerendproclaim@{\proclaim@false\par\rm
+ \ifdim\lastskip<\medskipamount\removelastskip\penalty55 \medskip\fi}
+
+%% \demo, like \innerproclaim@, replaces the \smc font by \uppercase{\rm...}
+%% (I didn't expect any one to use \demo in eight point type, but some one
+%% has already claimed that he did). We also take the opportunity again to
+%% issue an error message if a previous \proclaim has no matching
+%% \endproclaim.
+
+\def\demo{\relaxnext@
+ \nofrills@{:\enspace}\demo@
+ \DNii@##1{\par\ifdim\lastskip<\smallskipamount\removelastskip
+ \smallskip\fi\noindent
+ \DN@{8}\ifx\pointsize@\next@
+ \uppercase{\usualspace@{{\rm\enspace}}\rm\ignorespaces##1\unskip\demo@}%
+ \else
+ \usualspace@{{\smc\enspace}}\smc\ignorespaces##1\unskip\demo@\fi
+ \rm
+ \ifproclaim@\Err@{Previous \expandafter\eat@\string\\proclaim
+ had no matching \expandafter\eat@\string\\endproclaim}\fi
+ \ignorespaces}%
+ \futurelet\next\next@}
+
+%% \enddemo is easy.
+
+\def\enddemo{\par\smallskip}
+
+%% \qed adjusts the spacing for use within a displayed formula (the proper
+%% usage when the displayed formula ends the \demo). However, it looks as if
+%% the proper spacing won't be made when we use \qed as the last line of an
+%% \align, so something should probably be done about this.
+
+\def\qed{\ifhmode\unskip\nobreak\fi\ifmmode\ifinner\else\hskip5\p@\fi\fi
+ \hbox{\hskip5\p@\vrule width4\p@ height6\p@ depth1.5\p@\hskip\p@}}
+
+%% \cite has to see if a comma appears.
+
+\def\cite#1{\DNii@##1,##2\end@{{\rm[{\bf##1}, ##2]}}%
+ \in@,{#1}\ifin@\DN@{\nextii@#1\end@}\else
+ \DN@{{\rm[{\bf#1}]}}\fi\next@}
+
+%% \roster uses \rostercount@ to store the \item number. The first item is
+%% treated specially, because of the extra space before it, so we need a flag
+%% \iffirstitem@ to identify it.
+
+\newcount\rostercount@
+\newif\iffirstitem@
+
+%% Since \item in \roster differs from in \plain, we store plain's \item in
+%% \plainitem@, so that we can restore the definition after the \roster is
+%% over.
+
+\let\plainitem@\item
+
+%% In order for our \roster's to work, we will also have to be sure that
+%% \everypar is {}. Just in case \everypar already has a value, as it might
+%% in some format, we store those values in the token list \everypartoks@, so
+%% that we can restore them at the end. \par@ does this storing, and sets
+%% \everypar{}.
+
+\newtoks\everypartoks@
+\def\par@{\everypartoks@=\expandafter{\the\everypar}\everypar{}}
+
+%% Compressed format is used for \roster, and even for one of the \def's made
+%% within the \def of \roster !
+
+\def\roster{\edef\leftskip@{\leftskip\the\leftskip}%
+ %% We also have to store the \leftskip, since it will be changed.
+ \relaxnext@
+ \rostercount@\z@ %% Initialize \rostercount@ to 0.
+ \def\item{\futurelet\next\rosteritem@}% %% \item, now redefined,
+ %% has to look ahead for [ and ", since we allow optional and literal
+ %% arguments. \rosteritem@ itself is defined below.
+ %% The following \next@ is the one called at the very end of this \def.
+ \DN@{\ifx\next\runinitem\let\next@\nextii@\else
+ \let\next@\nextiii@\fi\next@}%
+ %% First we look to see whether \roster is followed by \runinitem,
+ %% since this requires different processing.
+ \DNii@\runinitem %% If \runinitem occurs, \nextii@ must kill it off.
+ {\unskip %% This unskips any space before the original \roster.
+ %% Our definition of \nextii@\runinitem itself uses compressed format
+ %% and a \futurelet\next\next@, because we still have to allow
+ %% [ or " to come next.
+ \DN@{\ifx\next[\let\next@\nextii@\else
+ \ifx\next"\let\next@\nextiii@\else\let\next@\nextiv@\fi\fi\next@}%
+ %% The following \nextii@ is the one created by \nextii@\runinitem;
+ %% there is no conflict of names, since the first calls the second.
+ \DNii@[####1]{\rostercount@####1\relax
+ \enspace{\rm(\number\rostercount@)}~\ignorespaces}%
+ %% If [...] comes next, we use (...) but we explicitly do this by
+ %% setting \rostercount@ equal to ... so that succeeding \item's
+ %% will have the right numbers (use of something other than a
+ %% number will give an error message).
+ \def\nextiii@"####1"{\enspace{\rm####1}~\ignorespaces}%
+ %% If "..." comes next, we use ... exactly as typed.
+ \def\nextiv@{\enspace{\rm(1)}\rostercount@\@ne~}%
+ %% Otherwise just use (1).
+ \par@\firstitem@false %% Before doing any of this we still change
+ %% \everypar, if necessary, which is normally done elsewhere, and set
+ %% \firstitem@false, since this \runinitem counts as the first.
+ \futurelet\next\next@}% %% End of definition of \nextii@\runinitem.
+ %% The following \nextiii@ will be used if we didn't have \runinitem.
+ \def\nextiii@{\par\par@ %% End the present paragraph, change \everypar
+ %% if necessary, prohibit a break, add a small skip, but add something
+ %% to offset any \parskip, if there is any, which would be contributed
+ %% when the next paragraph is begun by the next \item.
+ \penalty\@m\smallskip\vskip-\parskip
+ \firstitem@true}% %% And set \firstitem@true for use with \item.
+ \futurelet\next\next@}
+
+%% Rember that \rosteritem@ is called by \futurelet\next\rosteritem@.
+
+\def\rosteritem@{\iffirstitem@\firstitem@false\else\par\vskip-\parskip\fi
+ %% Except at the first \item, we end the paragraph (consisting of the
+ %% previous \item), and subtract any space that might be added by the
+ %% next \item.
+ \leftskip3\parindent\noindent %% Set the indentation.
+ \DNii@[##1]{\rostercount@##1\relax
+ \llap{\hbox to2.5\parindent{\hss\rm(\number\rostercount@)}%
+ \hskip.5\parindent}\ignorespaces}%
+ %% If [...] follows \item, we use ... as the number, again by setting
+ %% \rostercount@, so that succeeding \items will have the right number.
+ \def\nextiii@"##1"{%
+ \llap{\hbox to2.5\parindent{\hss\rm##1}\hskip.5\parindent}\ignorespaces}%
+ %% If "..." follows \item, we use ... exactly as typed.
+ \def\nextiv@{\advance\rostercount@\@ne
+ \llap{\hbox to2.5\parindent{\hss\rm(\number\rostercount@)}%
+ \hskip.5\parindent}}%
+ %% Otherwise we print the \rostercount@ in parentheses.
+ \ifx\next[\let\next@\nextii@\else\ifx\next"\let\next@\nextiii@\else
+ \let\next@\nextiv@\fi\fi\next@}
+
+%% \therosteritem is just a convenience for the user.
+
+\def\therosteritem#1{{\rm(\ignorespaces#1\unskip)}}
+
+%% We want to save \Runinitem for last, but it is relevant even to the
+%% definition of \endroster, since we have to worry whether \endroster is
+%% followed by another \Runinitem. We will use a flag \ifnextRunin@ to tell
+%% us.
+
+\newif\ifnextRunin@
+
+\def\endroster{\relaxnext@
+ \par\leftskip@ %% End the paragraph, and restore the \leftskip.
+ \penalty-50 \vskip-\parskip\smallskip %% Add a good break and
+ %% subtract any space that will be started by next paragraph,
+ %% but add a \smallskip.
+ \DN@{\ifx\next\Runinitem\let\next@\relax
+ %% Don't do anything else if \Runinitem comes next.
+ \else\nextRunin@false\let\item\plainitem@ %% Otherwise, set
+ %% \nextRunin@false, and restore \item to its definition in plain;
+ \ifx\next\par %% moreover, if the \endroster is followed by a new paragraph,
+ \DN@\par{\everypar=\expandafter{\the\everypartoks@}}%
+ %% delete that instruction (since we've already put in a \par), and
+ %% restore \everypar,
+ \else %% but if the \endroster isn't followed by a new paragraph,
+ \DN@{\noindent\everypar=\expandafter{\the\everypartoks@}}%
+ %% start the next paragraph unindented, and restore \everypar.
+ \fi\fi\next@}%
+ \futurelet\next\next@}
+
+%% Finally, for \Runinitem ... \roster\runinitem we have the usual junk for
+%% worrying about [ or " coming next, and then more interesting things: We
+%% have to find out how many lines of text we had before the \roster; we
+%% will store this in \rosterhangafter@.
+
+\newcount\rosterhangafter@
+
+\def\Runinitem#1\roster\runinitem{\relaxnext@
+ \rostercount@\z@ %% Initialize \rostercount@ to 0.
+ \def\item{\futurelet\next\rosteritem@}% %% Define \item as before.
+ \def\runinitem@{#1}% %% Store everything up to the roster in \runinitem@.
+ \DN@{\ifx\next[\let\next\nextii@\else\ifx\next"\let\next\nextiii@
+ \else\let\next\nextiv@\fi\fi\next}%
+ \DNii@[##1]{\rostercount@##1\relax
+ \def\item@{{\rm(\number\rostercount@)}}\nextv@}%
+ %% If [...] follows \runinitem, we proceed as before, except we call
+ %% this first instance \item@, and we let \nextv@, defined below, take
+ %% care of everything.
+ \def\nextiii@"##1"{\def\item@{{\rm##1}}\nextv@}%
+ %% If "..." follows \runinitem, we define \item@ to use it.
+ \def\nextiv@{\advance\rostercount@\@ne
+ \def\item@{{\rm(\number\rostercount@)}}\nextv@}%
+ %% Otherwise, we use the proper \rostercount@.
+ %% Now comes \nextv@, which has to properly typeset things.
+ \def\nextv@{\setbox\z@\vbox %% First store things in \box0 .
+ {\ifnextRunin@\noindent\fi %% Start unindented if we have
+ %% \ifnextRunin@true. This will happen only if we had
+ %% \Runinitem...\endroster right before.
+ \runinitem@\unskip\enspace\item@~\par %% Add the stored things in
+ %% \runinitem@, and then \item@.
+ \global\rosterhangafter@\prevgraf}% %% This sets \rosterhangafter@
+ %% to the number of lines in \box0 , i.e., of the material so far; see
+ %% TB, p. 103. We need to say \global since this is set within \box0 .
+ %% Now we're done with \box0 !
+ \firstitem@false %% Set \firstitem@false for future \item's.
+ \ifnextRunin@\else\par\fi %% End previous paragraph unless
+ %% we had \Runinitem ...\endroster right before.
+ %%
+ %% Now comes the good part: we \hangindent3\parindent, as before,
+ %% but we do it for \rosterhangafter@ lines, the number that already
+ %% appeared in the material we set in \box0 .
+ \hangafter\rosterhangafter@\hangindent3\parindent
+ \ifnextRunin@\noindent\fi %% Start unindented if we had a
+ %% \Runinitem ... \endroster right before.
+ \runinitem@\unskip\enspace %% Put in all the stored stuff \Runinitem@
+ \item@~\ifnextRunin@\else\par@\fi %% and the \item@, and
+ %% end the paragraph, unless we had a \Runinitem ... \endroster before.
+ \nextRunin@true\ignorespaces}% %% Here's where we set \nextRunin@true.
+ \futurelet\next\next@}
+
+%% \Refs is supposed to allow \nofrills to allow a different heading to be
+%% printed. We use the same general scheme as before, but can't use
+%% \nofrills@ directly, since now we want one thing to appear when \nofrills
+%% isn't used, and something else when it is.
+
+%% Beyond that, \Refs will change to eight point type, in which all the
+%% references will be set, and change the space factor code of a period to
+%% 1000, so that normal interword spaces occur after periods. In addition,
+%% \refskip@ will be defined as \hskip 1sp \hskip-1sp. Recall that \refskip@
+%% appears in the definition of \nolinebreak in AMSTEX.TEX, although it
+%% simply has the value \relax there. The exact reasons for redefining
+%% \refskip@ will appear later, but the main point is that it is easy to
+%% recognize, since presumably no user would actually use an \hskip-1sp.
+%% The change to eight point type is preceded by a \bgroup, which will be
+%% closed by an \egroup in \endRefs.
+
+\outer\def\Refs{\relaxnext@\def\refskip@{\hskip\@ne sp\hskip\m@ne sp}%
+ %% The next two lines are the substitute for \nofrills@.
+ \DN@{\ifx\next\nofrills\DN@\nofrills{\nextii@}\else
+ \DN@{\nextii@{References}}\fi\next@}%
+ \DNii@##1{\bigbreak\hbox to\hsize{\hfil\tenpoint
+ \smc\ignorespaces##1\unskip\hfil}\nobreak
+ \bigskip\bgroup\eightpoint\sfcode`.=\@m}%
+ \futurelet\next\next@}
+
+%% The following macros to set the references are perhaps more of a tour de
+%% force than anything else. Various people dislike them for various reasons,
+%% and some one will always be able find some special kind of reference
+%% formatting that isn't included here. However, one can always simply type
+%% out a reference as one wants it to appear as a last resort. The value of
+%% these macros is that they at least do allow the various parts of the
+%% reference to be specified without having to worry about the particular way
+%% the style file will format them, and thus they can easily be modified for
+%% other style files.
+
+%% The real TeXnical finesse was to allow the various parts of the reference
+%% to be specified in an arbitrary order.
+
+%% We begin by allocating boxes to hold the various possible bits of
+%% information. A few of these can be used by different constructions:
+%% \bybox@ holds the author, whether called by \by or by \manyby; \bookbox@
+%% holds the book title, whether called by \book, or by \inbook; \pagesbox@
+%% holds the pages, whether called by \pages or by \page.
+
+\newbox\nobox@
+\newbox\keybox@
+\newbox\bybox@
+\newbox\paperbox@
+\newbox\paperinfobox@
+\newbox\jourbox@
+\newbox\volbox@
+\newbox\issuebox@
+\newbox\yrbox@
+\newbox\pagesbox@
+\newbox\bookbox@
+\newbox\bookinfobox@
+\newbox\publbox@
+\newbox\publaddrbox@
+\newbox\finalinfobox@
+
+%% We also need a box to store the author's name for later use when
+%% it has been called by \bymany.
+
+\newbox\bysamebox@
+
+%% Next we define flags to tell if various bits of information have been
+%% specified.
+
+\newif\ifno@
+\newif\ifkey@
+\newif\ifby@
+\newif\ifmanyby@
+\newif\ifbysame@
+\newif\ifpaper@
+\newif\ifpaperinfo@
+\newif\ifjour@
+\newif\ifvol@
+\newif\ifissue@
+\newif\ifyr@
+\newif\iftoappear@
+\newif\ifpages@
+\newif\ifpage@
+\newif\ifbook@
+\newif\ifinbook@
+\newif\ifbookinfo@
+\newif\ifpubl@
+\newif\ifpubladdr@
+\newif\iffinalinfo@
+
+%% In addition, certain other flags will be needed to get the processing
+%% right.
+
+%% \ifafterbook@ is needed to tell if we've just finished typesetting a book
+%% title, so that right double quotes '' should go after it; we can't put in
+%% the '' immediately, because we will need either a period or comma,
+%% depending on whether any other information follows. (Of course, things
+%% would be much easier if we used `logical' punctuation and typed things
+%% like:
+%% ``Title of Book'', pg. 367. Publisher.
+%% But most journals prefer having the punctuation inside the right quotes,
+%% and since this is the harder case we might as well do it, to show how it's
+%% done.
+
+\newif\ifafterbook@
+
+%% Other flags are needed because of the \moreref construction, which
+%% requires subsequent parts of the \ref to be treated somewhat differently.
+
+\newif\iffirstref@
+\newif\iflastref@
+\newif\ifprevjour@
+\newif\ifprevbook@
+\newif\ifprevinbook@
+\newif\ifnojourinfo@
+
+%% When \bysame is used, the author's name will be replaced by a rule having
+%% the same width as the author's name that was specified by the previous
+%% \manyby. However, we want to put a maximum limit on this size, which we
+%% store in \maxbysamerule@.
+
+\newdimen\maxbysamerule@
+\maxbysamerule@1in
+
+%% Each \ref has to initialize various things; we abbreviate all these by
+%% \ref@, which will also add a \bgroup, whose role we will see later.
+
+\def\ref@{\global\no@false \global\key@false \global\by@false
+ \global\bysame@false \global\paper@false \global\paperinfo@false
+ \global\jour@false \global\vol@false \global\issue@false
+ \global\yr@false \global\toappear@false \global\pages@false \global\page@false
+ \global\book@false \global\inbook@false
+ \global\bookinfo@false \global\publ@false \global\publaddr@false
+ \global\finalinfo@false
+ \bgroup\ignorespaces}
+
+%% \moreref should have a meaning only if used properly within a \ref.
+
+\Invalid@\moreref
+
+%% Each \ref will be \outer. We start with \begingroup, just to be on the
+%% safe side, and make things easy; begin a nonindented paragraph; initialize
+%% \iffirstref@ and \iflastref@, which are special, and aren't handled by
+%% \ref@, but specially by \moreref and \endref; and then do the
+%% initializations of \ref@ --- remember that this adds \bgroup\ignorespaces.
+
+\outer\def\ref{\begingroup
+ \noindent\hangindent20\p@\hangafter\@ne\firstref@true
+ \lastref@false\def\moreref{\egroup\endref@\global\firstref@false\ref@}\ref@}
+
+%% Note that \moreref is practically the same as \endref, defined below,
+%% followed by \ref again, except that certain flags are set differently, and
+%% we don't start another group or a new noindented paragraph.
+
+%% The basic idea behind all the following constructions is the following.
+%% If we type \no 3 \anothercontrolsequence, then this must somehow set
+%% \ifno@ true and set \nobox@ to be \hbox{3}. (The \endref will then take
+%% all these various boxes, and unbox them, in the proper order.) To get the
+%% box set, we let \no end with \setbox\nobox@\bgroup, and let
+%% \anothercontrolsequence contribute the closing \egroup. (The important
+%% point here is that a construction like \hbox\bgroup ... \egroup is allowed
+%% [even though something like \toks0=\bgroup ... \egroup isn't]. That is
+%% because \hbox\bgroup causes tokens to be expanded, since the material
+%% actually has to be typeset, so the \egroup can be noticed when it occurs.)
+%% Of course, \no itself must therefore begin by contributing an \egroup.
+%% That is why \ref@ starts with \bgroup\ignorespaces, so that the first of
+%% the control sequences called simply creates an empty group.
+
+%% Instead of typing lots of definitions that all look almost exactly alike,
+%% we have a general construction \refdef@ which can be applied to most. The
+%% first argument of \refdef@ will be a control sequence, like \no, \key,
+%% etc., and it will have to set \no@true, \key@true and boxes \nobox@,
+%% \keybox@, etc. So we have to use plenty of \csname's to define \refdef@.
+%% The second argument of \refdef@ will be either \relax or a font change,
+%% like \it, for those cases where this new font is to be used for the
+%% element in question.
+
+\def\refdef@#1#2{\def#1{\egroup
+ \csname\expandafter\eat@\string#1@true\endcsname
+ \expandafter\setbox
+ \csname\expandafter\eat@\string#1box@\endcsname\hbox\bgroup#2}}
+
+%% \no and \key are defined immediately by \refdef@.
+
+\refdef@\no\relax
+\refdef@\key\relax
+
+%% \by, \manyby and \bysame are all a little different. In order to get them
+%% to work together, they each have to set certain other flags.
+
+%% In \manyby, the \by@true isn't made \global, since it is needed only by
+%% the current \ref, but the \manyby@true is needed by the succeeding \ref's,
+%% so it must be \global.
+
+\def\manyby{\egroup\global\manyby@true\by@true\setbox\bybox@\hbox\bgroup}
+
+%% Similarly, in \by, the \bysame@false is needed by the current \ref, while
+%% the \global \manyby@false is needed by the succeeding \ref's.
+
+\def\by{\egroup\by@true\bysame@false\global\manyby@false
+ \setbox\bybox@\hbox\bgroup}
+
+%% All \bysame has to do is set \bysame@true for the current \ref.
+
+\def\bysame{\egroup\bysame@true\bgroup}
+
+%% \paper and \paperinfo are straightforward \refdef@'s.
+
+\refdef@\paper\it
+\refdef@\paperinfo\relax
+
+%% \jour is a little more complicated because it has to set \prevjour@true
+%% (this is used for \moreref, for a succeeding paper in the same journal).
+
+\def\jour{\egroup\jour@true\prevjour@true\setbox
+ \jourbox@\hbox\bgroup}
+
+%% \vol, \issue, \yr are straightforward.
+
+\refdef@\vol\bf
+\refdef@\issue\relax
+\refdef@\yr\relax
+
+%% \toappear doesn't set a box, but only sets \toappear@true.
+
+\def\toappear{\egroup\toappear@true\bgroup}
+
+%% \pages is straightforward.
+
+\refdef@\pages\relax
+
+%% \page, for just a single-page reference, uses the same box \pagesbox@, as
+%% \pages, but sets a different flag.
+
+\def\page{\egroup\page@true\setbox\pagesbox@\hbox\bgroup}
+
+%% \book is straightforward.
+
+\refdef@\book\relax
+
+%% \inbook uses the same box, \bookbox@, but has to set an extra flag.
+
+\def\inbook{\egroup\inbook@true\previnbook@true\setbox
+ \bookbox@\hbox\bgroup}
+
+%% \bookinfo, \publ, \publaddr, \finalinfo are all straightforward.
+
+\refdef@\bookinfo\relax
+\refdef@\publ\relax
+\refdef@\publaddr\relax
+\refdef@\finalinfo\relax
+
+%% The worst problems are caused by the commas that come after various bits
+%% of information, since the comma mustn't be supplied if something happens to
+%% be the last element. We elect instead to supply the commas that come
+%% BEFORE things. To do this, instead of simply \unbox'ing the relevant
+%% \box's (and then \unskip'ing, in case extra spaces crept in), we will
+%% usually `\ppunbox@' them (prepunctuate and then \unbox and \unskip).
+
+\def\ppunbox@#1{\prepunct@\unhbox#1\unskip}
+
+%% Here \prepunct@ will be \relax when we have just typeset elements that
+%% shouldn't have commas after them, and will then be changed when we get to
+%% other elements. The construction that changes them will be called
+%% \setpunct@, which is defined below.
+
+%% There are two special problems in having \setpunct@ define \prepunct@
+%% correctly. The first involves the penalties \linebreak and \nolinebreak,
+%% which the user might want to type at certain points. These \penalty's
+%% will of course generally be absorbed into various boxes, but since these
+%% boxes get unboxed, they will appear again in the proper places. However,
+%% if a line break is specified after an element that gets a comma after it,
+%% we'd better be sure that the comma gets put in before the penalty! The
+%% second problem involves book titles, as previously mentioned.
+
+\def\setpunct@{\def\prepunct@{\ifnum\lastpenalty<\z@
+ %% If \linebreak, and hence a negative penalty appears,
+ \edef\penalty@{\penalty\the\lastpenalty}%
+ %% first save the penalty in \penalty@,
+ \unpenalty,% %% then delete the penalty and add the comma.
+ \ifafterbook@''\fi %% If we've just finished a book title, add the quotes.
+ \penalty@\relax\space %% Finally, put back the penalty, and then a space;
+ %% \relax added after \penalty@ since \the\lastpenalty is just a number.
+ \else %% If a negative penalty doesn't appear, we still want to check
+ %% for \nolinebreak. If it was typed, it has contributed
+ %% \penalty10000 \hskip1sp\hskip-1sp. However, the \hskip-1sp has
+ %% been removed by the previous \unskip (in \ppunbox@ or \unbox\unskip),
+ %% so \lastskip is 1sp.
+ \ifdim\lastskip=\@ne sp\unskip\unskip
+ %% In this case, \unskip the \hskip-1sp also, and then any previous space.
+ \edef\penalty@{\penalty\the\lastpenalty}\unpenalty,\ifafterbook@''\fi
+ \penalty@\relax\space
+ %% Then proceed as before.
+ \else,\ifafterbook@''\fi\space %% Otherwise just add the comma
+ %% (and quotes) and a space.
+ \fi\fi\afterbook@false}} %% And reset \ifafterbook@.
+
+%% Now all \endref has to do is add the final \egroup, globally set
+%% \lastref@true again, for succeeding \ref's, call \endref@, to put things
+%% together, reset certain flags used by \moreref, end the paragraph, and
+%% then the group.
+
+\def\endref{\egroup\global\lastref@true\endref@ \global\prevjour@false
+ \global\previnbook@false\par\endgroup}
+
+%% Here is how \endref@ puts things together.
+
+\def\endref@{\let\prepunct@\relax %% No commas added to begin with.
+ \iffirstref@ %% (I) First assume we're not doing a \moreref.
+ \ifno@\hbox to20\p@{\hss\unhbox\nobox@\unskip. }\else\hbox to10\p@{}\fi
+ %% A \no gets put into a box of width 20pt. Otherwise add 10pts of space.
+ \ifkey@\unhbox\keybox@\unskip\ \fi
+ %% Add the key, if any, followed by a space.
+ \ifmanyby@ %% (1) Suppose this is one of the papers governed by \manyby.
+ \ifby@ %% (1a) Suppose we're at the first one.
+ \hbox{\unhcopy\bybox@\unskip}%
+ %% Then we add a box with the author's name (we keep the author's name
+ %% in a box so that the glue can't stretch or shrink, so that the
+ %% subsequent rules will be exactly the right length),
+ \global\setbox\bysamebox@\hbox{\unhcopy\bybox@\unskip}%
+ %% and we set \bysamebox@ to this box,
+ \setpunct@ %% and we \setpunct@, since commas will subsequently be needed.
+ \else %% This \else goes with \ifby@, giving the alternative for (1a).
+ %% Suppose instead we're at a subsequent instance of a \bymany.
+ \ifbysame@ %% (1ai) If we still have \bysame,
+ \ifdim\wd\bysamebox@>\maxbysamerule@
+ \hbox to\maxbysamerule@{\leaders\hrule\hfill}\else
+ \hbox to \wd\bysamebox@{\leaders\hrule\hfill}\fi
+ %% we add a rule the length of \bysamebox@, unless this is too long,
+ %% in which case we use \maxbysamerule@ as the length.
+ \setpunct@ %% and we \setpunct@
+ \fi %% This \fi matches \ifbysame@, finishing (1ai).
+ \fi %% This \fi matches the \ifby@, finishing (1a).
+ \else %% This \else goes with \ifmanyby@, giving the alternative for (1).
+ %% Suppose instead this paper isn't governed by \manyby.
+ \ifby@ %% Suppose, however, that there is a \by.
+ \unhcopy\bybox@\unskip\setpunct@ %% Then just use \bybox@ and \setpunct@.
+ \fi %% This \fi matches \ifby@.
+ \fi %% This \fi matches \ifmanyby@, finishing (1).
+ \fi %% This \fi [which could also be written \else\fi]
+ %% matches \iffirstref@, and finishes (I).
+ %% [None of this is done for \moreref's.]
+ %% Having done the first stuff, involving the author, we can now get to
+ %% the paper.
+ \ifpaper@\ppunbox@\paperbox@\setpunct@\fi
+ %% If there's a \paper, put it in, with proper punctuation before it, and
+ %% get set up for commas on next element.
+ \ifpaperinfo@\ppunbox@\paperinfobox@\setpunct@\fi
+ %% Similarly for \paperinfo.
+ %% The journal is a little more complicated.
+ \ifjour@ %% (2) Suppose there's a \jour.
+ \ppunbox@\jourbox@\setpunct@ %% Put in journal name.
+ \ifvol@\ \unhbox\volbox@\unskip\setpunct@\fi %% Then volume, if given.
+ \ifissue@\ \unhbox\issuebox@\unskip\setpunct@\fi %% Then issue, if given.
+ \ifyr@\ (\unhbox\yrbox@\unskip)\setpunct@\fi %% Then year, if given, but
+ %% don't put comma before it.
+ \iftoappear@\ (to appear)\setpunct@\fi %% If \toappear was given instead,
+ %% typeset `(to appear)'.
+ \ifpages@\ppunbox@\pagesbox@\setpunct@\fi %% Then \pages, if given.
+ \ifpage@\prepunct@ p.~\unhbox\pagesbox@\unskip\setpunct@\fi
+ %% If \page given instead, type p.~ before it.
+ \else %% This \else goes with \ifjour@, giving the alternative to (2).
+ %% Suppose instead there's no \jour.
+ \ifprevjour@ %% (2a) But suppose there's a \prevjour@ (because
+ %% this part comes from \moreref).
+ \unskip\nojourinfo@false %% Begin by assuming there is
+ %% additional journal information to be set (\nojourinfo@false).
+ \ifvol@\else\ifissue@\else\ifyr@\else\nojourinfo@true\fi\fi\fi
+ %% If \vol, \issue or \yr was specified in this \moreref, nothing
+ %% changes (hence \nojourinfo@false). But if none were specified, there
+ %% is no additional journal information to be set (\nojourinfo@true).
+ \ifnojourinfo@\else,\fi
+ %% If there is additional journal information to be set, first put
+ %% in the comma.
+ %% Then put in volume, issue, etc., as before.
+ \ifvol@\ \unhbox\volbox@\unskip\setpunct@\fi
+ \ifissue@\ \unhbox\issuebox@\unskip\setpunct@\fi
+ \ifyr@\ (\unhbox\yrbox@\unskip)\setpunct@\fi
+ \iftoappear@\ (to appear)\setpunct@\fi
+ \ifpages@\ppunbox@\pagesbox@\setpunct@\fi
+ \ifpage@\prepunct@ p.~\unhbox\pagesbox@\unskip\setpunct@\fi
+ \fi %% This \fi [which could also be written \else\fi]
+ %% matches \ifprevjour@, and finishes (2a).
+ \fi %% This \fi mathces \ifjour@, and finishes (2).
+ %% Having finished worrying about journals, we tackle books.
+ \ifbook@\prepunct@``\unhbox\bookbox@\unskip\afterbook@true\setpunct@\fi
+ %% If there was a \book, set it with `` at the beginning,
+ %% and preceded by punctuation and penalties as already determined; also
+ %% set \afterbook@true, so we'll know that we've just typeset a book title.
+ \ifinbook@\prepunct@\unskip\ in ``\unhbox\bookbox@\unskip\afterbook@true
+ \setpunct@\global\book@true\fi
+ %% If \inbook, (which will initially have \ifbook@false), set the book
+ %% title preceded by in ``; also set \book@true so that subsequent
+ %% information will be printed. (It's \global, since it might be needed
+ %% later for a \moreref.)
+ \ifbookinfo@\ppunbox@\bookinfobox@\setpunct@\fi
+ %% Put in any \bookinfo.
+ \ifpubl@\ppunbox@\publbox@\setpunct@\fi
+ %% Put in \publ.
+ \ifpubladdr@\ppunbox@\publaddrbox@\setpunct@\fi
+ %% Put in \publaddr.
+ \ifbook@ %% (3) Moreover, if there was a book, we also add other things.
+ \ifyr@\prepunct@\unhbox\yrbox@\unskip\setpunct@\fi
+ %% Add the \yr, if any.
+ \iftoappear@\ifafterbook@''\fi\ (to appear)\afterbook@false
+ \setpunct@\fi
+ %% If \toappear appears, and we haven't typeset anything after the
+ %% title, so that \ifafterbook@ is still true, add the '' and then
+ %% `(to appear)'.
+ \ifpages@\prepunct@ pp.~\unhbox\pagesbox@\unskip\setpunct@\fi
+ %% If there is \pages, add pp.~and the pages.
+ \ifpage@\prepunct@ p.~\unhbox\pagesbox@\unskip\setpunct@\fi
+ %% If there is \page, add only p.~ before it.
+ \else %% This \else goes with \ifbook@, giving the alternative to (3).
+ %% Even if there wasn't a \book, we might want to add things.
+ \ifprevinbook@ %% (3a) Suppose we have \previnbook@true.
+ \unskip %% Then we still have to add all this information.
+ \ifyr@\prepunct@\unhbox\yrbox@\unskip\setpunct@\fi
+ \iftoappear@\ (to appear)\setpunct@\fi
+ \ifpages@\prepunct@ pp.~\unhbox\pagesbox@\unskip\setpunct@\fi
+ \ifpage@\prepunct@ p.~\unhbox\pagesbox@\unskip\setpunct@\fi
+ \fi %% This \fi matches \ifprevinbook, and finishes (3a).
+ \fi %% This \fi matches \ifbook@ and finishes (3).
+ %% Now we add the finishing touches.
+ \iffinalinfo@.\ifafterbook@''\fi\afterbook@false
+ \spacefactor3000\relax\space\unhbox\finalinfobox@
+ %% (4) If there is \finalinfo, add a period, and quotes if still setting
+ %% the title, and then add a space and the final info, first setting
+ %% \spacefactor to 3000, so that the space before the final info will be
+ %% an intersentence space. (However, if the final info has more than one
+ %% sentence, it will still be necessary to use @. instead of . at ends
+ %% of sentences for proper spacing.)
+ \else %% This \else goes with \iffinalinfo@, giving alternative to (4).
+ \iflastref@.\ifafterbook@''\fi\afterbook@false
+ %% (4a) If we're at the last ref (i.e., there isn't a \moreref),
+ %% add a period, and quotes if still setting the title.
+ \else;\ifafterbook@''\fi\afterbook@false\space
+ %% but if we're not at the last ref (i.e., there's a \moreref),
+ %% add a semicolon, and quotes if necessary, and a space.
+ \fi %% This \fi matches \iflastref@ and finishes (4a)
+ \fi} %% This \fi matches \iffinalinfo@ and finishes (4).
+
+%% The Refs are ended with an \egroup, in case some ordinary text follows them.
+
+\def\endRefs{\egroup}
+
+%% We use \iflogo@ as a flag to tell if the user has typed \nolog.
+
+\newif\iflogo@
+\def\nologo{\logo@false}
+\logo@true
+
+%% Finally, we are ready for the \output routine. It is hardly different from
+%% the \plainoutput routine, except that the first page normally has the
+%% `Typeset by AmS-TeX' logo attached.
+
+\output={\output@}
+
+\def\output@{%
+ \ifnum\pageno=\@ne\shipout\vbox{\makeheadline\vbox to\vsize
+ {\boxmaxdepth\maxdepth\pagecontents}\baselineskip2pc
+ \iflogo@\hbox to\hsize{\hfil\eightpoint Typeset by \AmSTeX}\fi
+ \makefootline}%
+ \else
+ \shipout\vbox{\makeheadline\pagebody\makefootline}%
+ \fi
+ \advancepageno
+ \ifnum\outputpenalty>-\@MM\else\dosupereject\fi}
+
+%% We begin with ten point type.
+
+\tenpoint
+
+%% Now we make @ active once again.
+
+\catcode`\@=\active
+
+%% And that's it.
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% %%
+%% HERE IS A SUMMARY OF ALL PLACES WHERE SPECIFIC VALUES USED IN THIS FILE %%
+%% MIGHT NEED TO BE REPLACED, BECAUSE OF DIFFERENT FONTS, STYLES, ETC. %%
+%% %%
+%% \parindent %%
+%% \hsize %%
+%% \vsize %%
+%% \normalbaselineskip, \normallineskip, \normallineskiplimit %%
+%% \abovedisplayskip, \belowdisplayskip, \abovedisplayshortskip , %%
+%% \belowdisplayshortskip (for different point sizes) %%
+%% \big (for different point sizes) %%
+%% \strutbox, \strutbox@ (for different point sizes) %%
+%% \ex@ (for different point sizes) %%
+%% \footmarkfrom@ %%
+%% \makefootnote format %%
+%% \title, \author, \affil, \address, \date, \thanks, %%
+%% \keywords, \subjclass, \innerproclaim@, \innerendproclaim@, \abstract %%
+%% (including the \nofrills and \usualspace for these) %%
+%% spacing, and order, in \endtopmatter %%
+%% \leftskip, \rightskip (and then the \everydisplay) for \abstract %%
+%% spacing, and order, in \enddocument %%
+%% \heading (including the \nofrills and \usualspace) %%
+%% \subheading %%
+%% \demo (including the \nofrills and \usualspace) %%
+%% \enddemo %%
+%% \qed %%
+%% \cite %%
+%% spacing and formatting of the \items in \roster %%
+%% \Refs (including the default heading) %%
+%% order and formatting of elements in each \ref %%
+%% \logo (probably eliminated) %%
+%% \output routine %%
+%% %%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% %%
+%% Finally, style files meant for journals, etc., rather than for %%
+%% preprints, probably ought to disable some of the constructions from %%
+%% AMSTEX.TEX that allow style changes. For example, one might %%
+%% %%
+%% \def\taboo@#1{\errmessage %%
+%% {Sorry, \string#1 can't be used in this style}} %%
+%% \def\default@#1{\immediate\write\sixt@@n %%
+%% {\string#1\space is unnecessary; it is the default for this style.}} %%
+%% %%
+%% and then type things like %%
+%% %%
+%% \taboo@\pageheight %%
+%% \taboo@\TagsOnRight %%
+%% \default@\TagsOnLeft %%
+%% %%
+%% The constructions in question are %%
+%% %%
+%% \pageheight, \pagewidth %%
+%% \hcorrection, \vcorrection %%
+%% \LimitsOnSums, \NoLimitsOnSums %%
+%% \LimitsOnInts, \NoLimitsOnInts %%
+%% \LimitsOnNames, \NoLimitsOnNames %%
+%% \ChangeBuffer, \ResetBuffer %%
+%% \TagsOnLeft, \TagsOnRight %%
+%% \CenteredTagsOnSplits, \TopOrBottomTagsOnSplits %%
+%% \MultlineGap %%
+%% %%
+%% \TagAsMath and \TagsAsText probably should be allowed, because they %%
+%% don't change the style, only the input. %%
+%% %%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
diff --git a/macros/amstex/doc/amstex.txt b/macros/amstex/doc/amstex.txt
new file mode 100644
index 0000000000..243b77ee3a
--- /dev/null
+++ b/macros/amstex/doc/amstex.txt
@@ -0,0 +1,3468 @@
+AMSTEX.DOC (FOR AMSTEX.TEX VERSION 2.0)
+COPYRIGHT (C) 1989 BY MICHAEL SPIVAK
+
+THIS COPYRIGHTED MATERIAL MAY BE REPRODUCED, EITHER IN PRINTED FORM,
+OR AS A COMPUTER FILE, WHICH MAY THEN BE PLACED ON ANY COMPUTER OR
+COMPUTER NETWORK, PROVIDED THAT THE FIRST TWO LINES OF THIS FILE, AS
+WELL AS THIS PARAGRAPH, ARE ALSO REPRODUCED. IT MAY NOT BE SOLD,
+EXCEPT FOR A NOMINAL FEE NOT TO EXCEED $5.00 PER COPY; CHARGES FOR
+SHIPPING MAY BE ADDED, BUT ADDITIONAL CHARGES FOR PACKAGING,
+HANDLING, ETC., ARE EXPRESSLY FORBIDDEN.
+
+
+This is the documentation for AmS-TeX, specifically the file
+AMSTEX.TEX.
+
+
+**********************************************************************
+Comments of the form %1, %2, etc., accompany the %1, etc., that occur
+within the file AMSTEX.TEX in the definition of the construction in
+question.
+**********************************************************************
+
+
+**********************************************************************
+Some explanations given earlier in the file will be required at later
+points. Such material is often set off by lines of *'s, like this.
+TB refers to The TeXbook.
+**********************************************************************
+
+
+\def\fmtname ...
+----------------
+We record the format name in \fmtname, overriding the definition that
+comes from plain. But we store the format version for plain in
+\plainfmtversion, in case someone needs to look at that, and record
+the version of AmS-TeX in \fmtversion.
+
+
+**********************************************************************
+\catcode`\@=11
+--------------
+We make @ a letter, so that we can make private control sequences,
+which we won't have to worry about users wanting to define
+themselves. The private control sequences from plain, like \p@,
+\@ne, etc., are also used extensively. Most of the time optional =
+signs are omitted. (Note, however, that in a test like \ifnum< >=< >
+the = is NOT optional.)
+**********************************************************************
+
+
+\ifx\amstexloaded@
+------------------
+We have to prevent AMSTEX.TEX from being read in twice; see TB,
+p. 382 (and the definition of \/). The code didn't fit on one line;
+it was imperative that the \endinput...\fi was all on one line,
+however.
+
+
+\W@, \CR@
+---------
+\W@ writes to screen and log file.
+
+\CR@, the copyright notice, is defined as a sequence of \W@'s. We
+use \fmtversion so that the first line doesn't have to be changed.
+
+
+\CR@
+----
+Then we print the copyright notice.
+
+
+\everyjob{\CR@}
+---------------
+Then we make sure it's printed even if a format file is made.
+
+
+**********************************************************************
+\toksdef\toks@@
+---------------
+We will need a second scratch token, in addition to \toks@ (TB,
+p. 346); \toks@@ is set to \toks2, rather than \toks1, in accordance
+with rule (3) on that page.
+**********************************************************************
+
+
+\rightappend@ is \rightappend from TB, p. 378.
+
+
+\def\alloclist@
+----------------
+We modify the allocation routines from TB, Appendix B, so that
+nothing is written to the log file. But we collect all information
+that might go there, so that it can be written later if
+\showallocations appears in the input file. \alloclist@ will be the
+list of things that previously went to the log file, in the form of
+TB, p. 378.
+
+
+\showallocations writes each thing in \alloclist@, and sets a flag
+\ifalloc@ for any later things to be written.
+
+
+\alloc@ is redefined from TB, p. 347. Near the end, it will be redefined
+once again. We \edef\next@ to be the token list that we want added to
+\alloclist@ by \rightappend@, so that \the\allocationnumber will be
+expanded out to the actual number.
+
+
+**********************************************************************
+We will be using the scratch tokens \next, \next@, \nextii@,
+\nextiii@, etc. In order to keep the number down, many definitions
+will, for example, define \nextiv@ back in terms of \next@, \nextii@,
+etc. There is only one problem that we have to guard against:
+Sometimes our definitions have clauses like \def\next@{ ... \next
+...}. The definitions of \next@ won't be made until these
+definitions are invoked, and at that time \next might be \outer (!!)
+because some previous \futurelet may have \let\next be something that
+is \outer; this error will only be encountered at that time, not when
+the definitions are read by AmS-TeX, because \next isn't outer when
+AmS-TeX is making the definition! So we could end up with a pretty
+incomprehensible error message at some point when AmS-TeX is being
+used. Similarly, an outer \next might cause a problem if it is used
+in some \if... construction, since outer control sequences aren't
+allowed while TeX is skipping conditional text. To guard against
+this, we will, first of all, always reserve \next for \futurelet
+constructions. That is why \next@ is used instead of \next in our
+redefinition of \alloc@. Later we will mention the other thing we
+have to do to guard against the problem.
+**********************************************************************
+
+
+\newcount\count@@, \newcount\count@@@
+-------------------------------------
+We will need two more counters. Since \count@, \count@@, and
+\count@@@ will all be used only for local assignments, we don't
+bother with rule (3) of TB, p. 346.
+
+
+\FN@, \DN@, \DNii@, \RIfM@, \RIfMIfI@, \setboxz@h, \wdz@,
+ \boxz@, \setbox@ne, \wd@ne
+---------------------------------------------------------
+These definitions abbreviate combinations that occur sufficiently
+often to make it worthwhile using up control sequence names.
+
+
+\iterate, from plain, is redefined using the method of Kabelschacht,
+see TUGboat, Volume 8, No. 2, p. 184.
+
+
+**********************************************************************
+It is assumed that the user of this documentation already understands
+why it is often necessary to use constructions like
+
+ \if...\def\next{\csa}\else\def\next{\csb}\fi\next
+
+instead of simply \if...\csa\else\csb\fi.
+
+Kabelschacht's method also replaces this by the construction
+
+ \if...\expandafter\csa\else\expandafter\csb\fi.
+
+We will call this the ``K-method''. The K-method will often be used
+without explicit mention; however, it is not always valid or
+practicable, as we will mention later.
+**********************************************************************
+
+
+^^J is made the \newlinechar for help messages, and also for use in
+the definition of \comment later on.
+
+
+\err@ is the standard form for AmS-TeX error messages.
+
+
+\newhelp\defaulthelp@
+---------------------
+We make a standard default help, equivalent to the usual second level
+help message you get with TeX (so that there won't be an error
+message from TeX saying that it doesn't know how to give help).
+
+
+\Err@ is the standard form for AmS-TeX error messages with default
+help.
+
+
+\eat@ is used to gobble tokens.
+
+
+\in@ tests whether string #2 contains token #1; see TB, p. 379,
+setting a flag \ifin@.
+
+
+**********************************************************************
+\def\space@
+-----------
+We frequently need a token that is \let equal a space. The % after
+`\space@. ' insures that the space isn't deleted.
+**********************************************************************
+
+
+\athelp@
+--------
+Now comes the mechanism by which @<token> will be defined, when @ is
+made active, at the end. \athelp@ is a help message.
+
+
+{\catcode`\@=\active
+--------------------
+Now we have to define how @ will work when it will be active. This
+whole mechanism occurs within a group in which @ is active, so most
+\defs are \gdefs.
+
+
+\lccode`\Z=`\@, \lccode`\I=`\I
+------------------------------
+We want any auxiliary control sequences that are mentioned in this
+process to have the letter @ as part of their name, even though
+@ is now active, so we have to use the \lowercase trick: we set
+the \lccode of Z to be @, name such control sequences as
+\csname...Z\endcsname, and then \lowercase the whole thing. This
+often requires \expandafter. For example, we have to say
+
+ \expandafter\gdef\csname ...\endcsname,
+not
+ \gdef\csname...\endcsname.
+
+Finally, we also set the \lccode of I to I, since I appears in some
+error messages that we will be defining in this process, and we don't
+want this I changed to lowercase!
+
+Things are so complicated here, that we won't even contemplate using
+the K-method!
+
+%1 The very first thing we want to do is make @ mean
+ \futurelet\next\at@ (and then we will define \at@ in terms of
+ \next). Trying to say all that with \csname seems a hopeless
+ muddle, so we first create \futureletnextat@ to stand for that.
+
+%2 \at@ will call \at@@ if the next token is a letter or number, but
+ \at@@@ if it is a control sequence (we allow @\Vert, for example)
+ and \at@@@@, which will be an error message, otherwise.
+
+%3 \at@@ <token> will be the control sequence `\<token>@at' (created
+ by \atdef@) if this control sequence has actually been created,
+ otherwise an error message with the \athelp@ help message.
+
+%4 \at@@@\cs will be the control sequence `\\cs@@at' (created by
+ \atdef@@) or an error message.
+
+%5 \at@@@@ is an error message, which also swallows up the next
+ input.
+
+%6 The last right brace in this line matches the left brace in
+ `{\catcode`\@=\active'. The previous right brace closes the
+ `\lowercase{'.
+
+
+\atdef@<token> creates the control sequence `\<token>@at'; we don't
+test for whether this already exists, since \atdef@ isn't for the
+user.
+
+
+\atdef@@\cs creates the control sequence `\\cs@@at'. \atdef@@ can
+also be used with active characters.
+
+
+\newhelp\defahelp@, \newhelpf\defbhelp@
+---------------------------------------
+Next comes the mechanism for \define. \defahelp@ is the help message
+when the wrong syntax is used; \defbhelp@ is the help message when an
+already defined control sequence appears after the \define.
+
+
+\define gives an error message if it isn't followed by a control
+sequence, and we add the tokens \def\nextii@@ so that what follows
+gets swallowed up into the definition of \nextii@. We are using the
+K-method here, hence \expandafter\define@@ in line %1 and
+\expandafter\def\expandafter\nextii@ in line %2. Note that this
+method clearly becomes impractical when many tokens are present in
+one of the cases.
+
+
+\def\undefined@@@@@@@@@@, \def\preloaded@@@@@@@@@@, \def\next@@@@@@@@@@
+-----------------------------------------------------------------------
+We want \define@@#1 to detect whether #1 has already been \def'd.
+The idea is to use \csname\expandafter\eat@\string#1\endcsname to
+reproduce #1; since \csname...\endcsname is given the value \relax if
+it produces an undefined control sequence, using an \ifx test between
+\relax and this new control sequence tells us whether it already
+exists. But that won't work for \relax, nor for the control
+sequences \undefined and \preloaded, which we want to remain
+undefined. Moreover, we don't want the user to be able to
+\define\next, since this scratch token is often redefined by various
+macros. So first we test for \relax, and then for \undefined,
+\preloaded, or \next. For the latter, we first define
+\undefined@@@@@@@@@@, \preloaded@@@@@@@@@@, and \next@@@@@@@@@@ as {};
+these are the only control sequences with 10 @'s (in fact, there are
+none with even 5 @'s, but we might as well be on the safe side). Then
+we use \csname to construct a new control sequence `#1@@@@@@@@@@' and
+test this with \ifx against \preloaded@@@@@@@@@@; we will get true
+only for \preloaded, \undefined, and \next.
+
+One of the nice features of all this is that a control sequence \cs
+becomes undefined, and thus available to be \define'd, simply by saying
+\let\cs\undefined.
+
+There is one additional subtle point. The final test recreates #1 with
+\csname...\endcsname, and causes \def#1 to be invoked if this is \relax.
+But when \csname...\endcsname creates a new control sequence and gives it
+the value \relax, it does this GLOBALLY; more precisely, it makes it equal
+to an internal control sequence that always has the value of \relax, see
+TeX, The Program, pp. 156 and 93. If \define is being used within a group,
+we want #1 to be undefined once this group is over, so we add
+\global\let#1\undefined before we invoke the \def#1.
+
+We don't use the K-method here, since things are already so complicated.
+
+%1 Give error message if #1 is relax.
+%2 Give error message if #1 is \undefined, \preloaded, or \next.
+%3 Do \def#1 if #1 is previously undefined, otherwise give error message.
+
+
+\redefine, \predefine, should be obvious. Note that
+\predefine\cs{...} works, since the braces get removed by TeX.
+
+
+\undefine was added recently. It seems even better than \redefine: to
+redefine an already defined control sequence \cs, you just have to
+say \undefine\cs to first make it undefined.
+
+
+\captionwidth@ is used to store the default width for captions.
+It is made 1.5 inches less than \hsize. If a style file resets
+\hsize, it should use \pagewidth, to automatically reset
+\captionwidth@.
+
+
+\pagewidth,...,\vcorrection
+---------------------------
+\pagewidth resets \captionwidth@ automatically. \relax added for safety.
+
+
+\tie is a synonym for ~ but is defined slightly differently, because
+spaces are automatically ignored after \tie, but not after ~ , which
+is defined a little later on.
+
+
+\graveaccent, ..., \underscore are substitute names for some control
+symbols.
+
+\B, \D are AmS-TeX substitutes for \= and \. (\. will be redefined
+later and \= will later be made undefined).
+
+
+\let\ic@\/, \def\/
+------------------
+We want \/ to ignore spaces before it. It is this definition that
+makes it necessary to prevent AMSTEX.TEX from being read in twice.
+
+
+\textfonti, and later \textfontii, are introduced not for purposes of
+abbreviation, but because their values will sometimes be reset by
+\text.
+
+
+\t is redefined using \textfonti. It is also made a control sequence
+with two arguments for consistency (now a space is allowed before the
+second letter).
+
+
+~ differs from in plain; spaces are allowed on either side.
+
+
+\. gives a non-end-of-sentence period by specifically setting
+\spacefactor.
+
+
+\atdef@ is used to make @; and @: and @? have desired values. (But @, and
+@! are defined later, since they differ in math mode.) Just in case
+these are ever used at the beginning of a paragraph (unlikely, of
+course!), we put \leavevmode at the beginning.
+
+If some macro package makes ! active [for French punctuation,
+say], then \atdef@@! would have to be used instead of \atdef@!.
+
+
+\@ is defined directly as \char64 , since we will have @ active at
+the end (64 takes fewer tokens than '100).
+
+
+**********************************************************************
+\def\relaxnext@
+---------------
+The construction \let\next\relax, abbreviated \relaxnext@, is needed
+whenever we have a definition, like the ones to follow, where we have
+a \futurelet\next, or \ifx\next, or anything else involving \next,
+within a \def that is itself within a \def. As discussed before,
+this could lead to havoc if \next happened to be \outer, so we add
+\relaxnext@ at the beginning to protect ourselves.
+**********************************************************************
+
+
+\atdef@-
+--------
+We want @-, @-- and @--- to create \hbox{-} or \hbox{--} or
+\hbox{---}, respectively, using as many \futurelet's as needed to
+find out how many -'s there are (TeX won't hyphenate around boxes).
+
+**********************************************************************
+It would be more transparent to write the succeeding definitions as:
+
+\atdef@-{\leavevmode\futurelet\next\hyphen@}
+\def\hyphen@{\relaxnext@\ifx\next-\def\next@-{\futurelet\next
+ \hyphen@@}%
+ \else\def\next@{\leavevmode\hbox{-}}\fi\next@}
+\def\hyphen@@{\ifx\next-\def\next@-{\leavevmode\hbox{---}}\else
+ \def\next@{\leavevmode\hbox{--}}\fi\next@}
+
+But this uses up two new control sequences, \hyphen@ and \hyphen@@,
+and such constructions appear frequently, so we save control sequence
+names by using a `compressed format': the same names \next@,
+\nextii@, etc., are used within different constructions, and
+redefined within each construction. This makes things go a little
+slower, since \next@, etc., have to be redefined all the time, but
+seems worth it, especially since most such constructions are major
+formatting ones that introduce a lot of space anyway. Notice that
+the `first' clause \futurelet\next\next@ has to be made last, after
+all the subsidiary definitions have been made.
+
+In this situation, where the symbol - is made part of the syntax for
+one of \next@'s (to swallow up this -), the K-method would not work.
+**********************************************************************
+
+
+\srdr@ ...
+----------
+The kerns to put between single right-double right quotes, etc., are
+recorded in control sequences, so that they can easily be changed for
+different fonts.
+
+These values are used in defining @", which has to look ahead to see
+if it is followed by ' or '' or ` or `` . Also \lq or \rq might be
+used instead of ` or '. Finally, we also have to skip over any space
+that follows @".
+
+**********************************************************************
+AmS-TeX always does this by using a \futurelet to find out if the
+next token is a space (testing with \ifx\next\space@), and calling
+either `\next@. ' or `\next@.' The . after the \next@ makes the
+space `visible' to TeX.
+**********************************************************************
+
+Compressed format is used in \atdef@". The K-method would be
+hopelessly complicated.
+
+
+\flushpar doesn't confuse the user by having no effect if it doesn't
+happen to be used after a paragraph has ended.
+
+
+\textfontii has been mentioned previously, with \textfonti.
+
+
+\lbrace@, \rbrace@ are defined directly as delimiters, so that we can
+have \{ and \} work in math mode or outside it.
+
+
+\{, \} outside of math mode specify the actual font the character
+comes from (but as \textfontii, so it can be changed by \text), and
+we also let the \spacefactor work correctly with them. The \@sf
+construction is taken from TB, p. 363. The \relax after \@sf is
+needed (a digit might follow \}).
+
+
+\lbrace, \rbrace are made synonyms for the new \} and \{.
+
+
+\AmSTeX is now defined using \textfontii instead of math mode.
+
+
+\vmodeerr@, \mathmodeerr@ are two error messages that we will use
+frequently, with various arguments. For example, \vmodeerr@\linebreak
+gives an error message about not using \linebreak between paragraphs.
+
+
+\linebreak gives error messages unless in horizontal mode; we add an
+\unkern in case a \kern appeared at the end of previous text (for
+example, an \enspace at the end of a \proclaim).
+
+
+\slash differs from in plain; a space before it is ignored.
+
+
+**********************************************************************
+\saveskip@ is used to record previous space, given by \lastskip,
+before we \unskip to get rid of it (and then put it back with
+\saveskip@). We only \hskip\saveskip@ if \saveskip@ is non-zero,
+because a zero skip does change things---it allows breaks. Notice
+that \saveskip@\lastskip is an abbreviation for \saveskip@=\lastskip.
+Abbreviations of this sort are always used, and should be borne in
+mind.
+**********************************************************************
+
+
+\allowlinebreak uses \saveskip@.
+
+
+\refskip@ plays no role now; but after \Refs, in AMSPPT.STY, there
+will be reasons to have \refskip@ in \nolinebreak.
+
+
+\nolinebreak also uses \saveskip@.
+
+
+\newline allows \newline\par not to give an Underfull \hbox message,
+but it probably wasn't worth it to do this, since you can still
+manage to get the message if you do something weird enough, like
+\newline\newline\par. The \null keeps the \hfill from disappearing
+at the break. Compressed format is used. Within the definition of
+\next@, the K-method is used (for a conditional within a
+conditional). Although this works, the K-method doesn't work in
+general in the multi-case situation.
+
+
+\dmatherr@, ..., \nonmatherr@ are error messages that are used
+frequently.
+
+
+\mathbreak, ..., \allowmathbreak are for breaks in math mode, which
+have been arranged to require different commands than for breaks
+outside it. The main reason for this arrangement was that LaTeX-like
+features, like [...] to indicate desirability of a break, might
+later be implemented for breaks outside of math. But AmS-TeX
+definitely shies away from such use of brackets in math mode, since
+brackets are so frequently used as text in math mode, so one
+would want different commands (and different additional syntax to
+indicate desirability) for math breaks.
+
+
+\pagebreak means \removelastskip\break between paragraphs,
+\vadjust{\break} within paragraphs (to break after current line), and
+\postdisplaypenalty-10000 in display math (see TB, p. 189). The
+\removelastskip is needed in case there is already a \vskip, say from
+an \endproclaim.
+
+
+\nopagebreak is similar.
+
+
+\vnonvmodeerr@ is another useful error message.
+
+
+\vnonvmode@#1#2 does #1 if in vertical mode, otherwise #2, except
+that we are considered to be in vertical mode if a \par comes next.
+This is because users will naturally consider certain constructions
+to be `between' paragraphs if they stick them at the end of the
+paragraph, just as they count as between paragraphs if they go at the
+beginning. Compressed format is used in the definition.
+
+
+\newpage, ..., \bigpagebreak all use \vnonvmode@.
+
+
+\NoBlackBoxes, \BlackBoxes use capitals, to tell user they are global.
+
+
+
+**********************************************************************
+\Invalid@, \Invalid@@
+---------------------
+Many control sequences in AmS-TeX, like \caption and \captionwidth,
+don't have real meanings themselves, but are only indicators for
+other control sequences to take appropriate action. \Invalid@ is
+used to make their meaning an error message when they are encountered
+at unexpected times. This is more than a mere convenience for the
+user, however. If \caption, for example, were actually undefined,
+the \ifx test involving \caption could fail for unexpected reasons,
+including the misspelling of \caption in the input file.
+
+Although things like \Invalid@\caption take up little room in the
+input file, they would expand to a lot if the error message was
+always spelled out, so we abbreviate most of the error message with
+\Invalid@@.
+**********************************************************************
+
+
+\smallcaptionwidth@ is the caption width that will actually be used.
+(It may be smaller than \captionwidth@ if the caption is not that wide.)
+
+
+\topspace and \midspace are defined together, like \topinsert and
+\midinsert of plain, using a flag \ifmid@. The definition is made in
+terms of \ins@, which is similar to plain's \@ins.
+
+
+\captionfont@ is the font used for captions; it is inserted here so
+that style files that want a different font for captions can simply
+redefine \captionfont@, instead of redefining \ins@, which follows.
+
+
+\ins@ saves its argument as \thespace@, and looks ahead (skipping
+spaces) for \caption, with its argument saved as \thecaption@, and
+then for \captionwidth, with its argument saved as
+\smallcaptionwidth@ (initially set to \captionwidth@). An additional
+complication occurs because we have to skip over spaces after the }
+at the end of \caption{...} or \captionwidth{...}. The caption is
+set in a box, and centered within \smallcaptionwidth@ if smaller than
+this amount, otherwise reset into a paragraph of this \hsize. The
+\allowbreak is specifically introduced because we have no reason not
+to allow a break before the insert, and this \allowbreak may help TeX
+to find the best placement. [Cf. TB, p. 116: ``There is a slight
+.... processing text ahead of the current page. You may want to say
+`\goodbreak' just before \midinsert.'' The point is that \allowbreak
+in the definition is much better, because it causes TeX to see if a
+page break is feasible, so a break will definitely be taken if it has
+already processed too much for the current page.] Compressed format is
+used.
+
+
+\def\newcodes@ ...
+------------------
+Next comes the mechanism for \comment ... \endcomment. There are
+probably some unnecessary things here, left over from the old TeX,
+since we now use \futurelet, rather than a macro argument, to see
+what's coming, but it works, so why fool with it.
+
+
+Now we start on math constructions.
+
+
+\def\pr@m@s ...
+---------------
+\pr@m@s is changed from plain (TB, p. 357), because we don't want the
+'^ mechanism to work (since you can't get ^' to work similarly). We
+also surround the prime character with empty boxes to make sure there
+is no extra kerning around it---this character does kern with
+characters on the symbol font, because it is the \skewchar for its
+font and the kern contains information for the math accents (TB, pp.
+351 and 443). The whole construction is put inside another group, so
+that ^\prime will still work.
+
+
+\let\dsize ...
+--------------
+Now we set up AmS-TeX alternate names, and also allow \, and \! and
+\; to be used both in math mode and in text. There is an important
+reason for doing this, besides mere convenience: \, or \; might be
+used within a \format...\\ line for a \matrix (see below) to specify
+spacing. Although the user would naturally think that this spacing
+is in math mode, it actually isn't! We also make plain's \thinspace
+and \negthinspace the same as \, and \! respectively, for maximum
+consistency. Since plain's \> is almost never used we make it
+undefined (at the end), and provide \medspace instead. So we also
+add \negmedspace and \thickspace and \negthickspace.
+
+
+@, and @! will be 1/10 of \, and \! in math mode.
+
+
+@. is special in math mode, because it leaves a blank space where a
+horizontal arrow should go in commutative diagrams (see \CD below).
+
+
+\and, \implies, \impliedby are similar to plain's \iff; the \DOTSB
+are added so that \dots will know they are binary operators (see
+\dots, later).
+
+
+\frac, ..., \tfrac should be obvious.
+
+
+\ex@ is a dimension that is essentially 1 point, but that will change
+properly with changes of fonts. For cmr10, .2326ex is 1pt.
+
+
+\thickness is one of the syntax pieces \thickfrac looks for.
+
+
+\thickfrac, if followed by \thickness{<number>}, should make a
+fraction made with \above <number>\ex@. Otherwise, we want to use
+\above 1\ex@ (i.e., 1 point) for the thickness.
+
+
+\fracwithdelims, \thickfracwithdelims are strictly analogous.
+
+
+\binom, ..., \tbinom should be obvious.
+
+
+\: is for constructions like f:A --> B. Spacing was specified by AMS.
+The symbol before the \: could be a \mathbin or \mathrel (e.g.,
++\:R\times R\to R or <\:R\times R\to\{T,F\}), or even a \mathop
+(e.g., \sum\:2^R\to R). In all cases, it should be replaced by a
+\mathord, so far as the spacing in this formula is concerned. There
+is naturally no way that we can get back to the symbol preceding \:
+so we first put in a \mathpunct{}. The spacing between a \mathop or
+\mathrel and a \mathpunct is 0, and when a \mathbin precedes a
+\mathpunct, it is changed to a \mathord, so the spacing is again 0.
+Then, since the spacing between the \mathpunct{} and the \mathord {:}
+that we want to add is \nonscript\mskip\thinmuskip, we want to
+subtract this space before the {:}.
+
+
+\snug deletes the \mathsurround space, so that $n$\snug- won't have
+space between the n and the - even if \mathsurround is non-zero.
+
+
+\topsmash and \botsmash are needed in addition to just \smash from
+plain. We use a procedure similar to that used in plain for
+\phantom, which has the variants \hphantom and \vphantom (TB, p.
+360); we use much of the plain mechanism for \smash (TB, p. 360),
+using flags \iftop@, \ifbot@, mainly changing \finsm@sh. We also
+add \leavevmode before the \box\z@, in case this comes at the
+beginning of a paragraph.
+
+
+\def\LimitsOnSums ...
+---------------------
+Now we come to the modifications for the big operators like \sum. In
+each case we introduce a subsidiary name for the operator, and then
+the definition has this name followed by \slimits@, which will be
+equivalent to either \displaylimits or \nolimits, depending on the
+style. We also introduce \LimitsOnSums and \NoLimitsOnSums to allow
+the user to set the value of \slimits@. The default is \LimitsOnSums.
+The \DOTSB are added for the sake of \dots, as explained later.
+
+
+\def\LimitsOnInts ...
+---------------------
+\int and \oint are treated similarly, using \ilimits@, except that
+\intop and \ointop are already available from plain, to have
+\ilimits@ after them. We introduce \LimitsOnInts and \NoLimitsOnInts
+to allow the user to set the value of \ilimits@. The default is
+\NoLimitsOnInts. We also use \DOTSI, which is explained later.
+
+
+\def\intic@ ...
+---------------
+Next come multiple integrals. The main problem here is the proper
+positioning of a limit when limits are set above and below. For
+example, with \iint (double integral sign), the lower limit should be
+centered between the bottoms of the two integral signs, not centered
+in the whole region they make up. In such cases we basically need
+
+ \hskip-.5em\mathop{\hskip.5em\intop\intop}\limits
+
+---the \hskip.5em on the left of the two integral signs places the
+center of this symbol in the right place, and the \hskip-.5em
+corrects for it. (For a different font than cmex10, .5em might have
+to be changed.)
+
+A different correction is needed when we are not in \displaystyle, so
+\intic@, the proper correction, is defined as a \mathchoice. The
+negative amounts are stored in \negintic@, another \mathchoice, since
+it seems nearly impossible to get out the negatives of dimensions
+stored in a \mathchoice.
+
+We also need to move the integral signs closer together, by an amount
+stored in \intkern@, also a \mathchoice.
+
+Finally, the dots to be used in \idotsint (two integral signs
+separated by dots) are defined in \intdots@, again a \mathchoice.
+This uses \plaincdots@, defined later, which is basically \cdots as
+in plain (\cdots itself will be redefined later also).
+
+
+\newcount\intno@ ...
+--------------------
+To define all multiple integrals together, we store the number of
+integral signs in \intno@ (with \intno@ arbitrarily set to 0 for
+\idotsint), and then use \ints@ after a \futurelet construction,
+which is needed to see if \limits or \nolimits happened to have been
+typed after the control sequence.
+
+
+\def\ints@
+----------
+\ints@ first calls \findlimits@, which uses \iflimits@ to record
+whether or not limits should be used. Limits are used if the next
+token is \limits, or if \ilimits@ is set to \displaylimits and we are
+in displaystyle and the next token is not \nolimits. We also use
+\iflimtoken@ to record whether or not the next token was either
+\limits or \nolimits---we need this information, since we will have
+to \eat@ the \limits or \nolimits token if it occurs.
+
+
+\multint@ and \multintlimits@ produce the basic symbol---the proper
+number of integral signs, dots and spacing---based on \intno@.
+
+%1 If we are making \intdotsint, put in the dots.
+%2 Otherwise, put in kern before next integral sign.
+%3 If \intno@ >= 3, add second kern and int.
+%4 If \intno@ =4, add third kern and int.
+%5 Then add final int sign.
+
+\multintlimits@ uses \intop, because the result will be put inside a
+\mathop later.
+
+
+\ints@@, finally, uses \multint@ or a construction involving
+\multinlimits@ for the final result, which also depends on the value
+of \iflimtoken@.
+
+%1 If there was a \limits or \nolimits afterwards:
+%2 when we are using limits, use a special construction,
+%3 but when we're not, use the simple construction;
+%4 and then discard the \limits or \nolimits token.
+%5 Otherwise, do the same thing, but don't discard the next token.
+
+
+\def\LimitsOnNames ...
+----------------------
+We also have \nlimits@ to tell whether limits should be used on
+operator names, like \max and \min. We introduce \LimitsOnNames and
+\NoLimitsOnNames. The default is \LimitsOnNames.
+
+
+\def\nolimits@
+--------------
+Certain operator names, like \sin, should NEVER have limits, even if
+\limits has been typed afterwards, so instead of \nolimits we use
+\nolimits@, which replaces a \limits token that follows with
+\nolimits. Compressed format is used in that definition.
+
+
+\def\newmcodes@
+---------------
+When we make a new operator, with \operatorname or
+\operatornamewithlimits, we want ' and * and - and / to be treated as
+ordinary text, not as math symbols. The same is true for . and :
+except that we would like a little space after them, so we have
+\newmcodes@ to temporarily change the \mathcode's of these symbols.
+
+
+\operatorname and \operatornamewithlimits both make \mathop's, using
+the new \mathocode's from \newmcodes@. \operatorname has \nolimits@
+at the end, to defeat any \limits typed after it, while
+\operatornamewithlimits simply has \nlimits@, which will be set
+either to \displaylimits or \nolimits@, depending on the style. The
+\kern 0pt is added because the argument might be just one symbol, and
+TeX's rules (TB, p. 443) imply that this symbol would be centered
+vertically around the axis.
+
+In all cases we use \fam\z@ instead of plain's \rm, since we will
+later change the meaning of \rm.
+
+
+\qopname@ and \qopnamewl@ are quick constructions, used to redefine
+\sin, \cos, etc., to have either \nlimits@ or \nolimits@ after them.
+
+
+\def\arccos, ..., \def\tanh redefine things using \qopname@ and
+\qopnamewl@.
+
+\inflim and \projlim are new; they are not in plain.
+
+
+\varinjlim, ..., \varlimsup are more complicated. Adjustments for
+\varinjlim, \varprojlim and \varliminf were made by eye. We don't
+bother about making these change size in subscripts, since they
+should never be used that way---the symbols would be too cramped to
+see. Notice that the \rm before the lim is NOT being used in math mode,
+so it is OK.
+
+
+\newdimen\buffer@ ...
+---------------------
+\ChangeBuffer allows the user to change \fontdimen13 \tenex. Since
+changes to \fontdimen's are global, the only way to allow the user to
+restore the original value, with \ResetBuffer, is to keep it in an
+inaccessible place, \buffer@. We also want \buffer as a place to
+store the current value of \fontdimen13 \tenex, since it is used in
+\shave and its relatives; the user is also supposed to be able to
+access \buffer, so it has no @.
+
+
+\def\shave ...
+--------------
+To shave the buffer space off the top and bottom of a symbol like
+\sum_{i=1}^n, we reset it with \fontdimen13 \tenex = 0pt, make a
+\mathop of this new symbol, and then reset \fontdimen13 to current
+value, stored in \buffer. To shave off the top buffer space only, we
+\topsmash the symbol, which leaves the bottom buffer space alone, add
+\vphantom{\shave{#1}} to get the right height, and make a \mathop of
+the whole thing.
+
+%1 We need \m@th from plain to shut off any \mathsurround. \m@th is
+ used similarly in many places, without further comment.
+
+\Invalid@\\
+-----------
+The \Sp...\endSp and \Sb...\endSb constructions, for multiline
+limits, is the first of many constructions based on \halign where we
+want to use \\ for line breaks, instead of the usual TeX primitive
+\cr.
+
+**********************************************************************
+\def\Let@
+---------
+This involves a TeXnical trick. In such constructions, we want to
+say \let\\=\cr. [Note that we want a \let here, and not simply
+\def\\{\cr}, because there is a big difference between a control
+sequence defined to be \cr, and \cr itself or something \let=\cr: a
+\cr (or & or \span) is immediately intercepted by TeX's scanner even
+when it is not expanding macros (TB, p. 248), while something defined
+as \cr will not indicate the end of a row until macros are expanded
+out. We will mention later one of the problems this can cause.]
+
+But if we happen to use \let\\=\cr within another such construction,
+as we certainly will want to do, then \\ will already be equivalent
+to \cr, and because of the way TeX parses things in an \halign, this
+\\ will immediately be used to stop the scanning of the element,
+leaving \let all by itself somewhere, and horrible error messages.
+As explained in TB, p. 386, the construction
+
+ \iffalse{\fi\let\\=\cr\iffalse}\fi
+
+circumvents this difficulty, because the { } hide the \let\\=\cr from
+the \halign, yet doesn't actually put it inside a group. Of course we
+need \relax first, in case this occurs at the beginning of an \halign
+(TB, p. 240). Since this is used so often, we have a special
+abbreviation for it.
+**********************************************************************
+
+
+\Invalid@\vspace, \def\vspace@
+------------------------------
+We want \vspace to be used only within certain constructions (all
+based on \halign). So we make it invalid in general, and let these
+constructions give the proper definition of \vspace. Since this
+happens so often, we abbreviate the definition of \vspace. We add
+\crcr before the \noalign in case the user forgets the \\.
+
+
+\def\multilimits@, ..., \def\endSp
+----------------------------------
+\Sb...\endSb and \Sp...\endSp will translate to ^{...} and _{...} for
+the very same construction {...}, which we call \multilimits@.
+
+This \multilimits@ construction is similar to many other
+constructions, like those for \matrix, \align, etc. We begin with
+\bgroup, which is almost like {, except that the matching \egroup,
+which is almost like }, needn't be in the same definition, but can
+actually be contributed by the \endSb or \endSp; then we define
+\vspace for use within this construction, and then we properly make
+\\ the same as \cr.
+
+Then comes something special. We want to get the same result from
+\Sb i\\ j\endSb as we would get with _{\scriptstyle i\atop
+\scriptstyle j}. The rules for making an \atop are somewhat
+complicated. They are stated in TB, p. 444, rule 15. For \atop, we
+have the parameters u=\fontdimen10 of the relevant math italic font,
+\scriptfont2; v=\fontdimen12 \scriptfont2; and phi=3\fontdimen8 of
+the corresponding symbol font, \scriptfont3. \atop is normally set
+with the numerator moved up by u and the denominator moved down by v,
+i.e., with \baselineskip=u+v. But if this makes them less than phi
+apart, they are set phi apart. This will be obtained by making
+\lineskiplimit and \lineskip equal to phi.
+
+
+\def\spreadlines
+----------------
+\Sp and \Sb are special sorts of alignments, but now we start the
+main ones. First of all, we want \spreadlines to be like \openup,
+except for consistency we want it to work as a macro taking an
+argument, rather than using the TeX assignment syntax. Also we want
+it to be used only in display mathematics; this means, in particular,
+that its effect will always be local to the display in which it
+appears.
+
+
+\def\Mathstrut@...
+------------------
+\Mathstrut@ is like \mathstrut, but only for \textstyle, the style we
+will be using it for in all our alignments. Whenever you trace
+through macros that involve \mathstrut, you get screens full of
+uninteresting stuff; it got so depressing that I decided to make
+\Mathstrut@ instead. We first make \Mathstrutbox@ an empty box, but
+with height and depth set to that of a ( in math mode.
+
+
+\newdimen\spreadmlines@ ...
+---------------------------
+In plain TeX, \matrix uses \normalbaselines to overrule any \openup's
+that have been used. We want to have a more general way of adjusting
+the spacing in a \matrix also. So we use \spreadmlines@ to store the
+desired amount to \openup in a \matrix. Like \spreadlines,
+\spreadmatrixlines should be used only in displayed mathematics; thus
+it will be local to the display in which it appears.
+
+
+\matrix is very much like \multilimits@, used before. However, now
+there are two \bgroups, corresponding to the {'s for \vcenter{ and
+\halign{; and \endmatrix contributes two \egroups. The combination
+\normalbaselines\openup\spreadmlines@ means that the \baselineskip is
+the normal one, unless \spreadmlines has been used (within the
+display the \matrix appears in) to change things. The effect of
+\Mathstrut@\crcr\noalign{\kern-\baselineskip} in \matrix is to insure
+that the first row is as tall as \Mathstrut@, and the one in
+\endmatrix makes the last row as deep. The purpose of this is to make
+sure that the height or depth of a matrix won't depend, for example,
+on whether the first row has tall letters, like A, or only short
+ones, like x --- so two similar matrices will usually line up right
+in formulas like <matrix1> = <matrix2>.
+
+There are two other new features. First, we put \, around the
+\vcenter; this looks better, especially with delimiters. The second
+feature is the \null before the first \, This is because of the rule
+regarding numbered formulas on TB, p. 189---if a very wide \matrix is
+used in a formula with a \tag, we don't want TeX to assume that we
+put glue before the \matrix in order to control its positioning with
+respect to that tag!
+
+
+\format...\\ is the construction that is used to allow a different
+preamble to be used in the \matrix. In all other AmS-TeX
+constructions, where such optional syntax is used, we use a
+\futurelet to see if this syntax is present. But it would be fatal
+to
+
+ \def\matrix{\futurelet\next\matrix@}
+
+because the \matrix might be used within another \matrix, and a \let
+within an \halign can cause havoc. This is hinted at in the
+next-to-last paragraph of TB, p. 248, although the viewpoint is
+different. The real problem arises when you have a \matrix
+containing another \matrix that happens to begin with & (because the
+first entry is blank). Just what does happen is complicated and
+interesting, but there's no point going into it here, since we are
+not going to be using a \futurelet. What we do instead is simply let
+\format end the \matrix (giving an empty matrix), and then start a
+new \matrix, with the appropriate preamble.
+
+**********************************************************************
+However, at this point we have to pull another TeXnical trick,
+somewhat like the one for \Let@, but different (see TB, p. 385). The
+construction
+
+ \iffalse{\fi\ifnum`}=0 \fi
+
+has balanced braces, so can appear within a \def. The same is true of
+
+ \ifnum`{=0 \fi\iffalse}\fi.
+
+As far as \halign is concerned, however, the first begins a group and
+the second ends one, so \format ... \\ looks to \halign like
+
+ \crcr\egroup [begin a new group] \format@ ...\\
+
+and thus as
+
+ \crcr\egroup [begin a new group]
+ make definitions [end the group] ...
+
+This is important, since otherwise the \\ will be interpreted as \cr
+if the \matrix is inside another \matrix, leading to havoc.
+**********************************************************************
+
+
+\newtoks\hashtoks@, ..., \def\format@
+-------------------------------------
+Having circumvented this difficulty, the idea is that \l&\r\\, for
+example, should be interpreted as $#$\hfil&\hfil$#$. Since #'s can
+usually appear only in special constructions, we want them to pop up
+as tokens, so we make a new token \hashtoks@ whose value is #. Then,
+if we define \preamble@ to be \l&\r, and define \l as
+{$\the\hashtoks@$\hfil}, etc., we can \edef\Preamble@{\preamble@} and
+\Preamble@ will have the desired result.
+
+Once the desired preamble is stored in \Preamble@, we still have to
+say \span\Preamble@ to have it be expanded (TB, p. 238, last two
+paragraphs). Notice that the \span\Preamble@ construction works when
+it is being used within a \def, even though we have single #'s
+instead of ##'s (normally an \halign within a \def needs ##'s instead
+of #'s). By the way, \show\hashtoks@ will actually give the result
+`##', but this is due to TeX's convention for printing token lists,
+see TB, p. 205, Exercise 20.7.
+
+
+\smallmatrix is a lot simpler, since we don't allow \spreadmlines,
+but essentially use \baselineskip=9pt (suitably adjusted using \ex@),
+don't worry about correcting the height of the first line or the
+depth of the last (since \smallmatrix'es aren't meant to be used
+together in formulas), and don't allow \format.
+
+
+\pmatrix, etc., are trivial.
+
+
+\hdots, for use within a \matrix, is plain's \ldots (which we change
+later).
+
+
+\newmuskip\dotsspace@
+---------------------
+The spacing in the \spacehdots...\for... macro will be a new mu-unit
+\dotsspace@, which we set to 1.5mu.
+
+
+\def\strip@, ..., \def\hdotsfor
+-------------------------------
+\spacehdots#1\for#2 macro should normally be used as
+
+ \spacehdots<number1>\for<number2>
+
+but it's quite conceivable that someone will type
+
+ \spacehdots{<number>}\for...
+
+even though the braces are unnecessary; in such a case TeX will
+actually consider the first argument to be {<number>}. So we don't
+want to specify the spacing simply as \mkern#1\dotsspace@, since this
+will be a syntactical error if #1 has braces around it. The macro
+\strip@ solves this problem. When argument #1 of \spacehdots is
+passed to \strip@, the braces are removed, but the space that
+delimits the argument is explicitly added. So if #1 is `3' or `{3}'
+or `{3 }' then we end up with `\strip@3 ' or possibly
+`\strip@3|_||_|' so we finally get `3\dotsspace@' or `3 \dotsspace@'.
+
+
+\multispan@ is just like \multispan from plain (TB, p. 243), except
+that we have an \unskip so that & \spaceinnerhdots ... will ignore
+the space after the &.
+
+
+\spaceinnerhdots needs the \strip@ trick for #2 also, since braces in
+\mscount={<number>} would be an error.
+
+
+\cases is easy since it is just made up of a \matrix, with a particular
+\format; we also want to \spreadmlines@\jot, and we put this inside a
+group, so that it will effect only the \cases, not another \matrix in the
+display.
+
+
+\newif\ifinany@
+---------------
+The line spacing in \aligned, \alignedat, \gathered, and \split is
+different from that in \matrix, because we want to \openup\jot. The
+problem, however, is that any of these might occur within one of the
+constructions \align, \alignat, \xalignat, \xxalignat, \gather,
+\multline, which already \openup\jot. So we need a flag, \ifinany@, to
+tell whether the construction is in any of these.
+
+
+\newif\ifinalign@
+-----------------
+For the purpose of deciding whether to \openup\jot, we also need a
+flag, \ifinalign@, to tell \split whether or not it is in an \align.
+
+
+\newif\ifingather@
+------------------
+Finally, because we allow a very special construction where \align
+appears in \gather (but within curly braces), we also need a flag,
+\ifingather@, to tell \align whether or not it is in a \gather.
+
+
+\strut@ is used as a quicker alternative for \strut, just as
+\Mathstrut@ was introduced as a shorter alternative to \mathstrut.
+We use \copy\strutbox@ rather than \unhcopy\strutbox@, because we
+will be using \strut@ in situations where we don't have to worry
+about entering horizontal mode. The dimensions of \strutbox@
+are determined by taking the baselineskip (we assume 12pt)
+and subtracting the lineskiplimit (1pt, set in AMSPPT.STY).
+
+
+\topaligned, \botaligned, and \aligned are practically the same, the
+first being a \vtop, the second a \vbox, and the third a \vcenter.
+
+
+\aligned@ is similar to \matrix, except we \openup\jot if we are not
+in a construction that sets \inany@true. Note that we put \strut@ in
+every line, since this is actually easier than putting it in only the
+first and last lines, and won't make any difference because of the
+\openup\jot. The main purpose of the \strut@'s in all the following
+constructions is so that when some of them are placed vertically
+above others (as they will be by certain other constructions) the
+spacing will still be correct. (Actually, the spacing won't always
+be exactly correct, if some lines contain extra tall or deep
+characters, but the discrepancies will be small, and in these cases
+one often has to add some extra spacing by hand anyway.)
+
+
+\alignedat is similar to \aligned, except that the preamble depends
+on the argument; we use \doat@ to produce this preamble, as
+\preamble@@, which we then reproduce, using \span\preamble@@.
+
+
+\newcount\atcount@, \def\doat@
+------------------------------
+\doat@, with argument n, first makes the token list \toks@ be
+
+ \hfil\strut@$\displaystyle{\the\hashtoks@}$&
+ $\displaystyle{{}\the\hashtoks@}$\hfil
+
+and then adds another n-1 copies of
+
+ &\hfil$\displaystyle{\the\hashtoks@}$&
+ $\displaystyle{{}\the\hashtoks@}$\hfil
+
+(the \strut@ isn't needed for these copies, only for the first one),
+using the method of TB, p. 373. This involves a \loop, and we use
+the counter \atcount@ to keep track of the number of iterations. If
+we then \xdef\preamble@{\the\toks@}, the resulting \preamble@ isn't
+yet the desired result, since we have \the\hashtoks@ appearing
+everywhere that # should appear, so we \xdef\preamble@@{\preamble@}
+to get the right result in \preamble@@.
+
+%1 Initialize \toks@.
+%2 Set \atcount@ to 1 less than #1.
+%3 Add \atcount@ copies of the other tokens.
+
+
+\gathered is much easier.
+
+
+This completes the aligned constructions that are treated as
+individual symbols, but leaves things like \align, in which each
+formula can have a \tag. So first we have to deal with \tag itself.
+
+
+\newif\iftagsleft@ ...
+----------------------
+Basically, \tag is supposed to mean \leqno or \eqno, depending on
+whether the flag \iftagsleft@ has been set. \TagsOnLeft sets
+\tagsleft@true, \TagsOnRight sets \tagsleft@false. The default is
+\TagsOnLeft. It seems reasonable to make these global, so their
+names have capitals in them.
+
+
+\newif\ifmathtags@ ...
+----------------------
+\tag has another slight problem, because \eqno and \leqno treat their
+arguments as math formulas, which isn't convenient when - is used as
+a hyphen; normally, it is better to have the argument treated as
+text. We will allow the argument to be treated both ways, depending
+on the flag \ifmathtags@. \TagsAsMath sets \mathtags@true, while
+\TagsAsText sets \mathtags@false, with the default being
+\TagsAsText. Again it seems reasonable to make these global, so
+their names have capitals in them.
+
+
+\tagform@ describes the formatting of tags desired by the style (more
+precisely the formatting desired when tags are treated as text). The
+default is to put tags in parentheses.
+
+[NOTE: TeX puts an \eqno or \leqno on a separate line unless the space
+between the tag and the formula is at least as wide as the tag
+itself, i.e., the formula plus a box twice the width of the tag
+should fit on the line. By diddling with \tagform@, this rule could
+be changed. For example, if the rule is that the space between the
+tag and the formula should be at least 1em (seems to be used by
+Cambridge University Press) we could
+
+ \def\tagform@#1{\setbox0\hbox{\rm(\ignorespaces#1\unskip)}%
+ \dimen0=\wd0 \advance\dimen0 1em \divide\dimen0 by 2
+ \wd0=\dimen0 \box0 }
+
+Then twice the width of \tagform@{#1} would be the `real' width of
+the tag plus 1em.]
+
+
+\thetag allows a fastidious user who wants to refer to `equation (3)',
+without being sure whether the style will use this particular format,
+to do so by typing `equation \thetag3'; the definition of \thetag has
+\leavevmode at the beginning, since \tagform@ is often an \hbox, and
+might begin a paragraph.
+
+
+\def\tag, \def\maketag@, ...
+----------------------------
+Finally, given a displayed formula $$ .... \tag ...$$, \tag has to be
+replaced by \leqno or \eqno, and ... has to be replaced by the proper
+formatting for this expression. The argument ... is everything from
+\tag to $$.
+
+\maketag@#1\maketag@ is basically just \tagform@{#1} (if tags are
+treated as text), but we also provide a mechanism for overriding the
+default formatting, by typing \tag "..." to get ... as the tag,
+exactly as typed. (This fits in with the scheme used in AMSPPT.STY
+for `literal' arguments to \footnote and \item in \roster's.)
+Compressed format isn't used since \tag's are used so often.
+
+%1 Let \tag be \leqno or \eqno.
+%2 Replace #1 by \maketag@#1\maketag@.
+%3 Finish off the displayed formula.
+
+%1 Here #2 is a possible space after the second " symbol; this
+ possible space is the reason for using the syntax where the
+ argument is delimited by a second \maketag@.
+
+
+\interdisplaylinepenalty from plain is used as a counter to store
+penalties for page breaks in alignments, but is initially set to
+10000, thus completely inhibiting such breaks.
+
+
+\allowdisplaybreaks should be used only within a displayed formula to
+set \interdisplaylinepenalty to 0 (perhaps a value like plain's 100
+would be better).
+
+
+\Invalid@\allowdisplaybreak, ..., \def\displaybreak@
+----------------------------------------------------
+We also want to use \allowdisplaybreak and \displaybreak to allow or
+force a break after a particular line of an alignment, but we want
+these control symbols to make sense only within these alignments, so
+we handle them like \vspace, etc.
+
+
+\Invalid@\intertext, \def\intertext@
+------------------------------------
+We want \intertext to produce \noalign'ed text, and again want this
+to make sense only with these alignments. The problem here is that
+when more than one line of text is produced, the height of the \vbox
+will be so large that only \lineskip glue would be used, not the
+proper amount to make the baseline of the first line of the \vbox the
+proper distance from the previous line. So instead of
+\vbox{\noindent##1} we use
+
+ \vbox{\null\noindent##1}
+
+Within this \vbox, the glue between the \null and the \noindent'ed
+paragraph will be just enough to make the space between the \null and
+the top line of the \vbox be \baselineskip. So we just have to put
+the \vbox on the list preceded by \nointerlineskip, to suppress any
+extra space.
+
+
+\centering@ is like plain's \centering, except that no shrinking of
+glue will be allowed, because we will regard such cases as overfull
+boxes that will either give error messages or be treated specially.
+
+
+\def\align
+----------
+$$\align... will essentially be an
+
+ $$\halign to\displaywidth{...
+
+unlike $$\aligned... which is essentially
+
+ $$\vcenter{\halign{ ... .
+
+Since the construction \halign to\displaywidth... without $$ at the
+beginning is actually allowed in TeX, but is quite different, we want
+to guard against errors by having \align give an error message if it
+is not being used within a displayed formula. However, we do allow
+the special construction {\align...\endalign} within a \gather. So
+we have \align give one construction in a \gather, but \align@ in
+display math mode, and an error message otherwise.
+
+**********************************************************************
+There is a special problem with \align, which has \endalign as part
+of its syntax, and so will all similar constructions. Basically,
+\align@ is supposed to call one control sequence, originally called
+\lalign@, if tags are on the left, another control sequence,
+originally called \ralign@, if tags are on the right, and yet a third
+control sequence, originally called \galign@, when it is in a
+\gather. Moreover, orginally these choices were made by setting
+\let\next@\lalign@, etc., and calling \next@. But if the user typed
+$$\align ... $$ without the \endalign, then at the end of the
+paragraph there would be an error message
+
+ ! Paragraph ended before \next@ was complete.
+
+which is totally incomprehensible (and the same for all such
+constructions). So, first of all, in such cases we use \def\next@
+instead of \let\next@. Moreover, we want the control sequence
+appearing in the error message to be known to the user. We will use
+
+ \csname align \endcsname
+
+as a substitute for \lalign@, which shows up on the screen as \align
+with only one extra space, and
+
+ \csname align \space\endcsname
+
+as a substitute for \ralign@, which shows up with two extra spaces.
+For the special case of \align with \gather, we use
+
+ \csname align (in \expandafter\eat@\string\\gather)\endcsname
+
+which just shows up as
+
+ \align (in \gather)
+
+(This happens to bomb in the special case
+
+ $$\gather {\align }\endgather$$
+
+with nothing on either side of the {\align}, but seems to work in
+most reasonable cases.)
+**********************************************************************
+
+In the definition of \align we \let\next@\align@, since \align@ will
+then call the other control sequences.
+
+
+\newhelp\andhelp@, ..., \def\align@
+-----------------------------------
+\align@ will set the flags \ifinalign@ and \ifinany@, and properly
+define \vspace, \allowdisplaybreak, \displaybreak, and \intertext.
+It will reduce to \align|_| when tags are on the left, otherwise
+\align|_||_|. These latter will essentially be \halign's, with two
+&'s per line; a line `lhs & =rhs \tag 3' will really be `lhs & =rhs &
+3'.
+
+In the special case of `lhs \tag 3', however, this line must become
+`lhs && 3'. So we will use a counter \and@ to record the number of
+&'s in the current line, and define \tag in terms of this number
+(\everycr will be used to set \and@ back to 0 at the beginning of
+each line).
+
+Moreover, if the user types `lhs &= rhs &= rhs', with or without a
+following \tag, then we want a more informative error message than
+`Misplaced alignment tab'. So we will let \tag set a flag \iftag@
+(with \everycr setting \tag@false), and have the tag part of the
+preamble give an error message if the flag hasn't been set. An extra
+& in a row will usually lead to chaos, and there's no point relying
+on TeX's decision to change the & to \cr; so we make the message
+strong, and add a help message, reiterating this.
+
+It is important to note that because we are \def'ing \tag to be
+something, and not simply \let'ing \tag=&, TeX's scanning mechanism
+would generally not properly intercept these hidden &'s as needed.
+Fortunately, that isn't a problem in this case, because the first two
+parts of the preambles for \measure@ and \align|_| and \align|_||_|
+do not involve # as an argument to a macro; so TeX isn't swallowing
+tokens blindly as it reads in the first two elements of each row of
+the \halign.
+
+
+\def\Tag@, ..., \def\measure@
+-----------------------------
+A whole new level of complication for \align is introduced by the
+fact that we want a tag automatically to be set on a separate line if
+it needs to be. There is no way to figure this out on a line-by-line
+basis, because the position of a line is influenced by all the other
+lines. So we will first `\measure@' our \align, to obtain three
+quantities: \maxlwidth@, the maximum length of the left hand side of
+all lines; \maxrwidth@, the maximum length of the right hand side of
+all lines; and \totwidth@ = \maxlwidth@ + \maxrwidth@.
+
+As we proceed through the lines, \lwidth@ and \rwidth@ will be used
+for the left hand length and right hand length of the current line.
+We apply \measure@ to everything up to the \endalign.
+
+Since \measure@ is used before anything else, we must catch the error
+of an extra & at that point. For convenience later on (in defining
+\alignat and \xalignat), we abbreviate the construction that
+supplies the error message, as \Tag@.
+
+%1 Initialize widths and \and@ to 0pt.
+%2 We just set a box, which we will not use.
+%3 We set \tag@false and reset \and@ to 0 at each \\ (which is
+ \let=\cr); \global needed since \noalign material is in
+ restricted vertical mode.
+
+%4 Each left hand side is just set in \displaystyle. \@lign is required
+ to make sure that if any such formula involves an \halign, the current
+ \everycr won't affect it.
+
+%5 Store width of entry in \lwidth@; \global needed since each entry
+ is essentially in its own group.
+
+%6 \maxlwidth@ is always largest of the \lwidth@'s found so far.
+
+%7 \and@ will be 1 at next entry.
+
+%8 \@lign needed here, as in %4.
+
+%9 Treat the right hand side similarly, getting maximum in
+ \maxrwidth@.
+
+%10 \and@ will be 2 at next entry.
+
+%11 The second &, if it is supplied by \tag, will simply throw away
+ the tag. But if it wasn't supplied by \tag, it will give an
+ error message.
+
+%11 Finally, make \totwidth@ = \maxlwidth@ + \maxrwidth@.
+
+
+**********************************************************************
+WARNING: Because \align processes its argument twice, you have to be
+careful if you are using an ad hoc construction in the form of a \box
+that just been set. This box must be used as \copy, rather than as
+\box, or it will be emptied out by the time \measure@ has gotten
+through with it!
+**********************************************************************
+
+
+\displ@y@ is just like plain's \displ@y, except that it also sets
+\and@ to 0 and \tag@false at each \cr (we need the \tag@false for
+certain later constructions, even though \align no longer needs it).
+
+
+\def\black@
+-----------
+Alignments do not show an overfull black box on any of their overfull
+rows (TB, p. 303). Since \align is just an \halign, this means that
+no black boxes would be shown when a row is overfull. To alleviate
+this problem, we at least arrange for a black box to show up at the
+last line of the alignment, by adding \black@\totwidth@ at the end.
+\black@#1, with any argument #1, simply backs up a line, and then
+adds some extra non-aligned empty material, which is specified as
+
+ \vbox{\noindent\hbox to#1{\strut@\hfill}}.
+
+This makes a \vbox that contains a paragraph starting (and containing
+only) a box of width #1 and height and depth of \strut@; if #1 >
+\hsize, then this paragraph has an overfull box in it, which will
+produce the desired black line, of height and depth of \strut@
+(unless \NoBlackBoxes has been specified). However, we will add this
+box only if #1 > \displaywidth (which could conceivably be larger
+than \hsize).
+
+%1 Save \prevdepth in \dimen@, and then inhibit interline glue with
+ \nointerlineskip (which just sets \prevdepth=-1000pt).
+
+%2 Back up enough to put in line with height of \strut@.
+
+%3 Put in the overfull \vbox.
+
+%4 Restore \prevdepth.
+
+
+\expandafter\def\csname align \space ...
+----------------------------------------
+Since \align|_||_| is created with \csname ... \endcsname, we have to
+use an \expandafter\def construction. \align|_||_| produces the
+\align when tags are on the right. We first \measure@ to find
+\maxrwidth@ and \totwidth@. Our display will be centered within a
+region of width \displaywidth,
+
+
+ <---------------------------\displaywidth------------------------>
+ | xxxxxxxxxxxxxx = yyyyyyyyy |
+ | xxxxxx = yyyyyyyyyyyyyyyyy |
+ | xxxxxxxxx = yyyyy<------------L------------>|
+ |
+ <------------\totwidth@---------->
+
+ <--left margin-> <-right margin->
+
+
+so the left and right margins will each be
+
+ 1/2(\displaywidth-\totwidth@).
+
+The tag for a line (say line 3 in the above picture) can go on that
+line if the length L is at least twice as big as the tag's length.
+We have
+
+ L = (right margin) + \maxrwidth@ - (\rwidth@ for this line).
+
+So we need
+
+ 1/2(\displaywidth-\totwidth@)+\maxrwidth@-(\rwidth@ for the line)
+ >= (twice tag length).
+
+When the tag has to be put on a separate line, we basically just
+replace the tag by a two-line box with an empty first line and the
+tag on the second line.
+
+[NOTE: Diddling with \tagform@ (and hence with \maketag@) will
+change the rules for the tags here just as with \tag itself.]
+
+[NOTE: Since \align computes \lwidth@ and \rwidth@ at each line, it
+is easy to add commands that use knowledge of these widths. For
+example, suppose that one wants formulas like
+
+ a = xxxxxxxxxxxxxxxxxxxxxxxxxxxx
+ + yyyyyyyyyyyyyyy
+
+where the y...y is set flush right with the x...x instead of being
+indented some fixed amount. To type this as
+
+ \align a & = xxxxxxxxxxxxxxxxxxxxxxxxxxxx \\
+ & \flushright {+yyyyyyyyyyyyyyy} \\
+
+we could introduce a new dimension \prevrwidth@ to store the \rwidth@
+of the previous line and let \flushright#1 mean
+
+ \hbox to\prevrwidth@{\hfil#1}}
+
+(To get this to work correctly, we would probably need to add
+
+ \global\prevrwidth@\rwidth@
+
+to the \everycr{\noalign{...}} clause.)]
+
+%1 \measure@, set \and@=0.
+
+%2 Use \displ@y@, except if in a \gather just set \and@=0 at each
+ \cr.
+
+%3 Left hand formulas in the \halign to\displaywidth will have
+ \tabskip\centering@ glue before them to push them to the right.
+
+%4 \@lign required so that an \halign in a left hand formula will
+ not have the \tabskip\centering@ affect it.
+
+%5 As we go through the lines once again, we set \lwidth@ to the
+ length of the current left hand side, as before, except now we
+ also print this left hand side (\box0 ).
+
+%6 Tabskip glue is zero between the two sides.
+
+%7 \@lign needed here, as in %4.
+
+%8 We set \rwidth@ to the length of the current right hand side,
+ but now also print right hand side.
+
+%9 Right hand formulas have \tabskip\centering@ glue after them to
+ push them to the left.
+
+%10 First we store the \tag in \box0. \@lign required in case the tag
+ involves an \halign!
+
+%11 Let dimen0 = 1/2(\displaywidth-\totwidth@)+\maxrwidth@ - \rwidth@.
+
+%12 If not enough space for tag on this line, we \llap a two-line box
+ with first line empty, and tag on the second line.
+
+%13 If there is enough space we just \llap the tag.
+
+%14 \tabskip glue is 0 after the tag.
+
+%15 Now do all the lines.
+
+%16 Finally, add black box if \totwidth@ > \displaywidth.
+
+
+\newdimen\lineht@, \expandafter\def\csname align \endcsname ...
+---------------------------------------------------------------
+\align|_| is similar, except that our calculations for whether the
+tag fits will involve \maxlwidth@ and \lwidth@. Moreover, when the
+tag has to be set on a separate line, we need to replace it by a
+two-line box with the tag on the first line and an empty second line.
+This empty second line has to have the same height as the line to
+which the tag applies, so we need a dimension \lineht@ to store this
+height in.
+
+%1 \displaywidth@ is max of \totwidth@ and \displaywidth.
+
+%2 Record height of left hand side in \lineht@.
+
+%3 Update \lineht@ to height of right hand side, if it's bigger.
+
+%4 The \kern-\displaywidth@ moves the tag back over to the left (to
+ the left margin of the page, unless \totwidth@ is greater than
+ \displaywidth@ [so that our display is actually overfull], in
+ which case it is moved to the left margin of the display).
+
+
+\expandafter\def\csname align (in ...
+-------------------------------------
+In the case where \align was in a \gather, it reduced to a control
+sequence called
+
+ \align (in \gather)
+
+We simply make this a \vcenter{\align@...} (where \align@ will reduce
+to\align|_| or \align|_||_|).
+
+
+\Invalid@\endalign
+------------------
+Notice that \endalign is quite different from \endaligned, because
+the latter actually ends a group, whereas \endalign is just used as
+the delimiter for the argument of \align. This could cause great
+difficulties if we needed \align ... \endalign within a group that
+has other \\ constructions. Fortunately, the only such case is
+\align ... \endalign within a \gather, and we simply insist that
+braces are used around the \align ... \endalign in this case. But we
+ought to do something more than just leaving \endalign undefined.
+
+
+\newif\ifxat@
+-------------
+\alignat and \xalignat have much in common, so we will write their
+definitions similarly, using \ifxat@ as a flag to do things
+differently for the \xalignat.
+
+
+\alignat first checks to make sure we are in display math mode, and
+then calls \alignat|_| (created by \csname...\endcsname), which uses
+\endalignat as part of its syntax. In the case of \alignat, the test
+for tags on the left or right is made afterwards, so we don't need
+separate names for the two possibilities.
+
+
+\newif\ifmeasuring@, \newbox\savealignat@
+-----------------------------------------
+In `\alignat|_| n' the argument n determines how many &'s are allowed
+per line, namely 2n (2n - 1, plus 1 for the \tag). This in turn
+determines how many &'s have to be added when a \tag appears in a
+line with fewer &'s, and when an error message should be given: if
+\tag appears in a column where \and@ has value k, then we need to add
+2n-k &'s; if we have k > 2n, then the \tag part of the preamble
+should give an error message.
+
+We won't try to set tags on separate lines automatically, but we do
+want to produce a black box if lines are too long, so we still need
+to measure things. Instead of separately calling a \measure@ type of
+argument, we will use a flag \ifmeasuring@ to determine if we are
+measuring or actually typesetting the alignment; the appropriate
+preamble will be made by \attag@, which will depend on \ifmeasuring@
+(and on \ifxat@). When measuring, we will save the result in the box
+\savealignat@.
+
+
+\expandafter\def\csname alignat \endcsname ...
+----------------------------------------------
+
+%1 #1 is the number after \alignat, #2 is everything else.
+%2 First we are just measuring.
+%3 We make the proper preamble with \attag@.
+%4 Then we are actually typesetting.
+%5 We make a new preamble with \attag@.
+%6 Then we typeset all the lines.
+%7 Finally we add a black box if necessary.
+
+
+\endalignat, like \endalign, has no definition of its own.
+
+
+\xalignat, like \alignat, first checks to see that we are in display
+math mode, and then calls \xalignat|_|, since it has \endxalignat as
+part of its syntax.
+
+
+\xalignat|_| is exactly the same as that for \alignat|_|, except that
+we have \xat@true (which will influence \attag@, when building the
+preambles).
+
+
+\attag@ finally builds the preamble. Although the process is similar
+to that used for building the preamble for \alignedat, it is
+complicated by the fact that we have to include \maketag@ and \Tag@
+among the tokens and make sure that they aren't expanded out when we
+do our \xdef's.
+
+%1 Store \maketag@ in \Maketag@ and \Tag@ in \TAG@.
+
+%2 Insure that \maketag@ and \Tag@ won't be expanded.
+
+%3 The preamble will be written in terms of \llap@ and \rlap@, which
+ are simply \llap and \rlap when we are typesetting, but when we
+ are measuring will be a box twice the width of the tag.
+
+%4 \toks@ will be the first part of the \preamble; it acts slightly
+ different for \xalignat|_| and \alignat|_|.
+
+%5 \toks@@ will be the final part of the \preamble; it differs
+ significantly for \xalignat|_| and \alignat|_|.
+
+%6 We use a \loop to add on pieces of the preamble to \toks@.
+
+%7 Then we add on the last part.
+
+%8 Then we do one more \xdef, as with \alignedat.
+
+%9 Finally, we restore the meaning of \maketag@ and \Tag@.
+
+
+\endxalignat also has no definition.
+
+
+\xxalignat is simpler, because we don't have to worry about tags at
+all. First we make \xxalignat call \xxalignat|_|, since it uses
+\endxxalignat as part of its syntax, in display math, but gives an
+error message otherwise.
+
+
+\xxalignat|_| is similar to \alignat|_| and \xalignat|_|, except we
+don't bother about measuring things, since we don't have to worry
+about tags.
+
+
+\xxattag@ is used to make the preamble, rather than \attag@.
+
+
+\endxxalignat also has no definition.
+
+
+\newdimen\gwidth@, \newdimen\gmaxwidth@
+---------------------------------------
+\gather is naturally easier than \align, but we still have the
+problem of putting the \tag on a separate line, so we still have to
+measure things. But we need only the one quantity \gmaxwidth@, the
+maximum width of all the formulas; \gwidth@ is the width of each line
+as it is measured.
+
+
+\gmeasure@ is analogous to \measure@ for \align@.
+
+
+\gather gives an error message if we are not in display math mode,
+and otherwise calls either \gather|_| or \gather|_||_|, since both
+use \endgather as part of their syntax.
+
+
+\gather|_||_| is analogous to \align|_||_|.
+
+
+\gather|_| is analogous to \align|_|, using the \glineht@ instead of
+\lineht@.
+
+
+\newif\ifctagsplit@ ...
+-----------------------
+It seems more elegant if a \split ... \endsplit formula has its tag
+either at the left of the top line or the right of the bottom line,
+but we will allow the tag to be centered, depending on the flag
+\ifctagsplit@. We provided \CenteredTagsOnSplits and
+\TopOrBottomTagsOnSplits to allow the user to set the flag. The
+default is \TopOrBottomTagsOnSplits.
+
+
+\split will be \outsplit@ if it is not in some other alignment, but
+if it is in some other alignment it will be \insplit@, which is the
+interesting thing. We don't need to worry about the
+\csname...\endcsname trick here because \split doesn't actually use
+\endsplit as part of its syntax. The K-method wouldn't work in this
+multi-case situation.
+
+
+\insplit@ just starts setting \box0 as \vbox{\halign{... with the
+proper format.
+
+
+\endpslit then finishes \box0 and calls either \lendsplit@ or
+\rendsplit@.
+
+
+\def\rendsplit@
+---------------
+For tags on the right, we need to get out the last line of the
+\insplit@, which is a \vbox made up of the various lines of the split
+formula, with glue between them. If TG represents various tabskip
+glues (which all happen to be 0pt) and HF represents various glues
+added by the \hfil's in the preambles, this box looks like
+
+ ....
+ ....
+ \hbox{TG\hbox{HF lhs}TG\hbox{rhs HF}TG}
+ <interline glue>
+ \hbox{TG\hbox{HF lhs}TG\hbox{rhs HF}TG}
+
+
+%1 \box9 now has everything in \box0 except the last line, which is
+ now \box8, and the interline glue that preceded the last box,
+ which is removed by \unskip. \box8 is now of the form
+
+ \box8 = \hbox{\TG\hbox{HF lhs}TG\hbox{rhs HF}TG}.
+
+#2 In \box1 we \unhcopy8. \unskip removes the last TG. Then \box2
+ becomes \hbox{rhs HF} (\box 2 is saved by \global). The next
+ \unskip removes the middle TG. Then \box3 (also saved by \global)
+ becomes \hbox{TG{HF lhs}}. Notice that the width of \box3 is the
+ same as the width of the whole left part of the split (the TG is
+ 0, but the HF fills out all lines to the same width, [even though
+ lhs is actually usually empty in a split]).
+
+%3 Finally, \box7 is now the right side of the last line, set to its
+ natural width (the HF glue at the end having been removed by
+ \unskip).
+
+Now we will define \split@ to be the proper repositioning of
+elements.
+
+%4 Suppose our \split is within an \align, and we want tags centered
+ on the \split.
+
+%5 Then we make \split@ be one more line of the form LHS & RHS, where
+ RHS is a \vcenter of the whole split (\box0 ) except moved left by
+ width of \box3, which is the width of the whole left hand side.
+ This means that the symbols that the \split were aligned along
+ will now align with all the other symbols in the \align. We also
+ make LHS an empty box with the same width as the whole left hand
+ side, so that \split will still have the proper width.
+
+%6 Otherwise, we want the tag on the last line, so we have \split@
+ add two lines: one having \box 9 (everything in the \split except
+ the last line and interline glue) on the right, except moved over
+ to the left the right amount, the width of \box3; and another
+ having \box3 on the left and on the right \box7, which is the
+ proper right side (cut down to its natural width). The proper
+ interline glue will then be added back between these two lines.
+
+%7 If we're not in an \align, so don't need to worry about lining up
+ with other things, we do similar, but simpler, things, without
+ worrying about moving things over.
+
+%8 And finally, having defined \split@ correctly, we insert it.
+
+
+\def\lendsplit@
+---------------
+For tags on the left we have to proceed somewhat differently. We
+can't conveniently obtain the first line, but we can begin by making
+a \vtop out of our \vbox:
+
+%1 \box9 is just like \box0, except baseline is that of first line.
+
+%2 Now \box8 is last line.
+
+%3 Now \box3 is as before (but \box2 hasn't been saved, because we
+ don't need to find the natural width of the last right side).
+ \box1 is just a scratch box, so can be used twice like this.
+
+Now we define \split@.
+
+%4 Suppose our \split is within an \align, and we want tags centered
+ on the \split.
+
+%5 Then we make \split@ be one more line of the form LHS & RHS, where
+ RHS is a \vcenter of the whole split, except with a new baseline
+ (\box9 ) and moved left the right amount, and LHS an empty box as
+ before.
+
+%6 Otherwise, we want the tag on the first line, as before.
+
+
+\outsplit@ is just reduced to \insplit@.
+
+
+\newdimen\multlinegap@
+----------------------
+Finally, we come to \multline. We store the gap between the margins
+and the left and right sides of the \multline in a dimension
+\multlinegap@.
+
+
+\newdimen\multlinetaggap@
+-------------------------
+For \multline we use the rule that there must be at least
+\multlinetaggap@ space between the formula and the tag. (This seems
+more reasonable than the usual rule, since the formula doesn't have
+to be centered.)
+
+
+\MultlineGap globally changes \multlinegap@.
+
+
+\multlinegap can only be used in a displayed formula, and then
+affects only this formula.
+
+
+\nomultlinegap is an abbreviation for \multlinegap{0pt}.
+
+
+\multline first checks to see that we are in display math mode, and
+calls \multline@ if we are. There is no point using the
+\csname...\endcsname trick here, because eventually we use the syntax
+\endmultline$$, so if the \endmultline is missing, at the end of the
+paragraph we just get an error message about a missing $ sign.
+
+
+\newif\iftagin@, \def\tagin@
+----------------------------
+\multline@ has to be processed differently depending on whether or
+not the displayed formula it appears in has a \tag. We use a flag
+\iftagin@ to tell us, and test with \tagin@.
+
+
+\multline@ first does the \tagin@ test and then calls either
+\multline@l or \multline@r.
+
+
+\newdimen\mwidth@, \def\rmmeasure@
+----------------------------------
+When tags go on the right, we will need to measure the last line of
+the \multline, and store its width in \mwidth@. This is easily done
+with \rmmeasure@; we set \mwidth@ to the width of each line, so that
+its final value is just the width of the last line.
+
+%1 Don't worry about what \shoveleft and \shoveright really are,
+ since we only care about the result of the last line, which
+ shouldn't have either.
+
+
+\newdimen\mlineht@, ..., \def\lmmeasure@
+----------------------------------------
+When tags go on the left, however, we will need to measure the FIRST
+line of the \multline, again storing its width in \mwidth@ (we will
+also need to store its height, in \mlineht@). This is more
+complicated, and we actually need two new flags, \ifzerocr@ and
+\ifonecr@, to keep things under control.
+
+%1 After the first \cr, which is the one that follows the preamble,
+ we have \zerocr@false and \onecr@true. Then after the first \\ in
+ the \multline, we always have \onecr@false (and also
+ \zerocr@false). So \onecr@true holds only for the first line of
+ the \multline.
+
+
+\newbox\mtagbox@, ..., \newdimen\rtwidth@
+-----------------------------------------
+We will need to store the tag in a box \mtagbox@. And \ltwidth@ and
+\rtwidth@ are dimensions where we will store the widths of this box,
+for use with \shoveleft and \shoveright; however, \ltwidth@ will be
+made 0pt when a tag on the left can't go on the same line as the
+formula (since in this case we want \shoveleft to shove all the way
+to the left), and similarly for \rtwidth@.
+
+
+\multline@l calls \lmultline@@ if there is a \tag, and \lmultline@@@
+otherwise. In the latter case, it first sets \mtagbox@ to \null, and
+makes \ltwidth@ and \rtwidth@ be 0pt.
+
+
+\lmultline@@ sets other values for \mtagbox@, \ltwidth@, and
+\rtwidth@ when there's a \tag, and then simply calls \lmultline@@@.
+
+%1 \mtagbox@ is a box with the tag in it.
+
+%2 \dimen@ is
+
+ (width of first line) + (width of tag) + \multlinetaggap@.
+
+%3 \ltwidth@ is just the width of the tag, unless the tag won't fit
+ on the line (determined by \dimen@>\displaywidth), in which case
+ it is 0pt (because the tag won't really be there!).
+
+
+\lmultline@@@ mainly has to define \shoveright and \shoveleft.
+\shoveright is simple: the \hfilneg cancels the \hfil normally on the
+right, but we add \hskip\multlinegap@, so that the line will come out
+the same distance from the right margin as the last line. \shoveleft
+is more complicated. First of all, we put \hfilneg at the beginning,
+to cancel the \hfil. Then, if \ltwidth@ isn't 0pt (so that the tag
+is actually on the line), we \hskip the width of this tag plus the
+\multlinetaggap@ (the total space from the margin to the beginning of
+the first line); but if \ltwidth@ is 0pt, so that the tag is on a
+separate line, we just \hskip the \multlinegap@. Unfortunately, this
+doesn't quite do it, because the formula that we are applying
+\shoveleft to might begin + A + B + ... for example. Our preamble
+for the \multline involves $\displaystyle{}#$, so that the initial +
+sign will have a medium space between it and the A. But there is
+also a medium space BEFORE the + sign, so the + sign will not really
+line up correctly on the left. To get around this, we set our
+formula with {} before it in \box0 and without the {} before it in
+\box1. When a symbol like + begins the formula, the difference
+between the width of \box0 and the width of \box1 will be two of
+these thick spaces, so we exactly cancel out any extra space with
+\hskip.5\wd1 \hskip-.5\wd0.
+
+%1 First define \shoveright and \shoveleft.
+
+%2 We begin the \multline with a separate line starting with
+ \hfilneg, to cancel the \hfil.
+
+%3 Suppose first that there is a tag.
+
+%4 Moreover, suppose it will fit on the first line.
+
+%5 Then we put in the tag, and skip the proper gap.
+
+%6 But if it won't fit on the first line, we manufacture a box
+ containing the tag on top and an empty box the height of the first
+ line on the bottom.
+
+%7 If there isn't a tag, we just skip the \multlinegap@.
+
+
+\multline@r works just like \multline@l.
+
+
+\rmultline@@ works just like \lmultline@@.
+
+
+\rmultline@@@ works like \lmultline@@@, except that now we don't
+have to worry about the tag yet, which will be taken care of by the
+\endmultline. However, now the definition of \shoveright is a little
+more complicated to take into account whether or not the tag goes on
+the same line as the last line; the definition of \shoveleft is
+simpler, but we still have to do the same trick to take care of
+formulas like + A + ... .
+
+
+\endmultline works slightly differently for tags on the left and tags
+on the right, so we have it call either \lendmultline@ or
+\rendmultline@.
+
+
+\lendmultline@ is trivial.
+
+
+\rendmultline@ has to put in the tag.
+
+%1 Suppose there is a tag.
+
+%2 Suppose, moreover, that it will fit on the last line.
+
+%3 Then we skip the proper gap before the tag, and put in the tag.
+
+%4 But if it won't fit on the last line, we manufacture a box
+ containing an empty box on the first line, and the tag on the
+ bottom line.
+
+%5 If there isn't a tag, we just skip the \multlinegap@, before
+ adding the \hfilneg.
+
+
+\bmod, ..., \mod are easier. \bmod is exactly as in plain, but with
+\fam\z@ instead of \rm. And \pmod is also based on plain, except
+that more space seems to look better in displays. \pod is the same
+as \pmod, but without the word `mod', and \mod is similar, except
+without the parentheses, and slightly different spacing.
+
+
+\newcount\cfraccount@, ..., \def\rcfrac
+-----------------------------------------
+Next come continued fractions. TeX's \over construction
+
+ {...\over\displaystyle ... +
+ {\strut ... \over\displaystyle ... ...}}...}
+
+is admirably suited for a recursive definition, since each new level
+contributes one left brace, with all the right braces occurring at
+the end; we just have to keep track, in a counter \cfraccount@, of
+how many levels we have entered. However, it doesn't look good if TeX
+puts the usual \nulldelimiterspace around each of the subfractions,
+so we will actually have one more level around each subfraction, with
+\nulldelimiterspace subtracted inside it. Thus, each \cfrac will
+contribute two \bgroup's.
+
+We also have to make \\ mean \over\displaystyle inside the \cfrac. In
+case the \cfrac appears in some other construction where \\ has been
+\let=\cr, we use the usual \iffalse{\fi...\iffalse}\fi trick to
+enclose this definition. \lcfrac is just like \cfrac, except that the
+next \\ will put \hfill before the \over (hence at the end of the
+next numerator); and \rcfrac puts in the \hfill before the numerator.
+
+
+\def\gloop@, \def\endcfrac
+--------------------------
+Finally, \endcfrac puts in pairs of }'s, with
+\hskip-\nulldelimiterspace between them. A \loop...\repeat type of
+construction is meant to be used here, in which we decrease
+\cfraccount@ by 1 at each step. But there is a complication, because
+\loop uses \def\body to keep track of things, and after each
+iteration we are two levels up, so that \body is no longer defined
+(it might even be some old definition of \body!). So we have to use
+\gloop@, which is just like \loop, except that it uses \gdef\body.
+
+
+\def\binrel@
+------------
+For \overset and \underset, we want a way to check whether a symbol S
+is either a binary operator or a binary relation, since \overset and
+\underset are supposed to preserve this. The idea is to compare the
+formula $S$ (with \mathsurround=0pt) and the formula ${}S{}$. To
+make the comparison both independent of the present values of
+\thinmuskip, etc., and easy, we set the formulas with
+\thinmuskip=0pt, \medmuskip=1mu, \thickmuskip=-1mu.
+
+The spacing between the \mathord {} and a binary operator is
+\medmuskip, between {} and a binary relation is \thickmuskip and
+between {} and anything else is either 0 or a \thinmuskip. So, S must
+be a binary operator if the formula gets wider, and a binary relation
+if the formula gets narrower. Instead of saving the results of the
+test in control sequences, we just make \box2 have the width of {}S{}
+minus the width of S, and check on the width of \box2, since this
+test will always be done right at the beginning of any construction.
+
+
+\overset and \underset are essentially as in plain, except we make
+the result a binary operator or relation if it started as one; we
+also add the \kern\z@ as in \operatorname, in case only a single
+letter is involved.
+
+
+\oversetbrace and \undersetbrace are simply convenient abbreviations.
+
+
+\def\sideset
+------------
+In a construction like \sideset ^+ \and ^* \to \sum, the final symbol
+will look like {\vphantom{\sum}}^+ {\sum}^* --- with the \vphantom
+used to get the prescript ^+ at the right height. To get the limits
+in the right place, we need a construction like that used for
+multiple integrals: \hskip-<...>\mathop{\hskip<...>{\vphantom } }
+where the correction <...> is the width of {\sum}^* which we set in
+\box2, minus the width of \sum with the prescript, which we set in
+\box1.
+
+
+\rightarrowfill@, ..., \def\leftrightarrowfill@ depend on the math
+style, to modify \overrightarrow and \overleftarrow from plain so
+that they work in all styles, using \mathpalette. The \smash- is
+used because the height of the minus sign happens to be the height of
+the plus sign (thus, larger than you'd like).
+
+
+\overrightarrow, ..., \underleftrightarrow are now defined, using
+\overrightarrow@, ..., \underleftrightarrow@ for use with
+\mathpalette.
+
+
+Now we come to \dots, which is probably the most complicated thing in
+all of AmS-TeX!
+
+We would like \dots to know what to do on the basis of the next
+token, which we can get with a \futurelet. (It turns out that we
+don't happen to encounter any problems if we have \dots & within a
+\matrix, etc. This can be explained only by serendipity.) If that
+next token is a comma, then we will use \dotsc. If it is the token
+\not, then the \not presumably cancels a binary operator, so we will
+use \dotsb@ [\dotsb@ is essentially \dotsb, except that \dotsb will
+look ahead to see if extra space should be left because the next
+symbol might be a right delimiter]. If the next token is +, =, <, >,
+-, * or : then we again want to use \dotsb@.
+
+Otherwise, however, it's not clear what to do with the token. For
+example, we can't simply make a formula containing only that token,
+since it might be something like \matrix that doesn't make any sense
+by itself (we don't have this problem with \underset and \overset,
+since they are actually applied to arguments, which must be
+meaningful formulas).
+
+The only hope at this point is actually to look at the next token in
+detail, using \meaning!!
+
+When we look at \meaning<token> we might get
+
+ \mathchar"... or macro...->...
+
+(Remember, however, that all the characters here will have type 12.)
+
+If we get \mathchar"... the number ... is of the form xnnn, where x
+gives the ``class'', with 2 for a binary operator and 3 for a binary
+relation. So if we set a counter to the number and divide by 4096,
+the value will be 2 and 3 for binary operators and relations,
+respectively.
+
+If we get macro...->... then we don't want to go berserk and actually
+try to figure the macro out, but if the definition begins with \not
+we should use \dotsb (remember that \ne, for example, is a macro that
+expands to \not=). Moreover, we ought to use \dotsb if the definition
+begins with \mathbin or \mathrel.
+
+In addition, if we test to see whether the definition begins with
+\DOTSB we can use \DOTSB as a signal that we are using a binary
+operator (and the user can add this to a definition also). Later we
+will add \DOTSB to certain of plain's definitions, since this will be
+the only reasonable way to see that they represent binary operators
+or relations. For example, \longrightarrow begins with \relbar, and
+\Longrightarrow with \Relbar. We have simply added \DOTSB in front
+of both. \DOTSB has also been added previously to the various big
+operators, so that \dotsb will be used before them.
+
+Similarly, \DOTSI will indicate that \dotsi should be used, for dots
+before an integral sign.
+
+Once \dots has figured out whether to use centered or low dots, it
+will still try to figure out whether some extra space should be left,
+because the next symbol is a right delimiter. Here we will find
+\DOTSX useful, to be put into a macro definition to indicate that it
+represents a right delimiter.
+
+
+\let\DOTSI\relax, ..., \let\DOTSX\relax
+---------------------------------------
+Initially, these are all simply \relax.
+
+
+\newif\ifmath@, {\uccode ...
+----------------------------
+First we make a flag to tell that \meaning begins with \math, where
+\ m a t h are all of type 12. To do this we have to use the \uccode
+trick, temporarily setting the \uccode of various numbers and of !
+(all of which are type 12) to \ m a t and h, so that when we
+\uppercase them we will get type 12 \ m a t and h. We will use
+\math@___\math@ to test ___ and set \ifmath@ true if the first five
+symbols are \ m a t and h, storing what remains in \meaning@. We are
+going to be applying constructions like \math@, which takes at least
+5 arguments, to the unknown ___ and then sometimes yet another
+construction taking at least 5 arguments, so, as will appear later,
+we will always add ten periods (any other symbol would do as well) to
+___ before we begin the whole testing process.
+
+(This construction assumes that ! is of type 12. If some macro
+pacakge changes this [for French punctuation, say], then the ! should
+be replaced by some other symbol that is guaranteed to be of type
+12.)
+
+
+\newif\ifmathch@, {\uccode ...
+------------------------------
+When something begins with `\math', we will further test to see if it
+is followed by ch??" (we don't bother testing the ? characters, since
+no other result of \meaning could be like this). The test is of the
+form \mathch@___\mathch@, setting \ifmathch@ true if it passes, and
+then storing the " and what comes after in a new \meaning@.
+
+
+\newcount\classnum@, \def\getmathch@
+------------------------------------
+Next we define a control sequence to test whether the "____
+combination we've picked up begins with 2 or 3, by computations with
+the hex number `"____' Since we've added periods, we must be careful
+to pick up only the number before the first period. At this point we
+no longer store the result, but directly define \thedots@ [the main
+thing that \dots is trying to produce] to be \dotsb@ if we do have 2
+or 3.
+
+
+\newif\ifmathbin@, {\uccode ...
+-------------------------------
+When we test whether a macro meaning begins with \mathbin or
+\mathchar we will first use the above \math@ test to see if it begins
+with \math. Then we will have to test if it is followed by `bin'.
+But we actually have to test whether it is followed by `bin|_|'
+(since someone might have defined a new control sequence beginning
+\mathbin...). Spaces created by \meaning still have their usual type
+10, so we will use \space@ for this part of the test, picking up the
+token after `bin' with a \futurelet. Compressed format is used here.
+The final result of the test is flagged by \ifmathbin@.
+
+
+\newif\ifmathrel@, {\uccode ...
+-------------------------------
+Similarly, we test for \mathrel.
+
+
+\newif\ifmacro@, {\uccode ..., \def\macro@@
+--------------------------------------------
+To test whether \meaning begins with `macro', we just test for the
+`mac', since no other possible result of \meaning could begin like
+this. The test sets \ifmacro@ and stores the result in (a new)
+\meaning@, which uses \macro@@ to isolate the part after the ->,
+i.e., the actual macro definition.
+
+
+\newif\ifDOTS@, \newcount\DOTSCASE@, {\uccode ...
+-------------------------------------------------
+To test whether a macro definition begins with \DOTSB or \DOTSI or
+\DOTSX we first test for the \DOTS, with \DOTS@...\DOTS@. If it
+doesn't we just set \ifDOTS@ false, otherwise we further test for the
+`B|_|' or `I|_|' or `X|_|', setting \ifDOTS@ true if the test is
+passed, and setting a counter \DOTSCASE@ equal to 0, 1 or 2 in these
+cases.
+
+
+\newif\ifnot@, {\uccode ...
+---------------------------
+This is the test for whether something starts with \not.
+
+
+\newif\ifkeybin@, \def\keybin@
+------------------------------
+We abbreviate the process of checking for all the possible binary
+operators and relations that can be entered from the keyboard.
+
+
+\def\dots
+---------
+Finally, we're ready to define \dots ! which is different in text and
+math.
+
+
+\def\tdots@
+-----------
+In text, we want to ignore spaces before \dots, and we want to leave
+an extra thin space if the next token, which we get with a
+\futurelet, is a , or . or ; or : or ? or ! Otherwise (another letter
+or symbol comes next) we want to leave an ordinary space.
+
+
+\def\mdots@, \def\mdots@@
+-------------------------
+Finally, in math mode we want \mdots@, which uses \futurelet to get
+the next token. Compressed format isn't used here, because things
+are confusing enough already.
+
+The main aim of \mdots@@ is to define \thedots@, which will be used
+at the very end. We begin by defining \thedots@ to be \dotso@ (the
+dots before ordinary symbols), and then modifying it under the stress
+of various tests. The order has been chosen so that the more
+complicated tests come near the end.
+
+Notice that the \xdef\meaning@{\meaning\next..........} is allowed,
+even if \next happens to be outer.
+
+%1 By default, we use \dotso@.
+
+%2 If \boldkey (explained below) happens to come next, then we simply
+ want to swallow up the \boldkey and use \boldkeydots@ instead.
+
+%3 Similarly, if \boldsymbol happens to come next, then we simply want
+ to swallop up the \boldsymbol and use \boldsymboldots@ instead.
+
+%4 Otherwise, if , comes next we use \dotsc.
+
+%5 If \not comes next we use \dotsb@.
+
+%6 If +, =, etc., comes next we use \dotsb@.
+
+%7 Otherwise we want to look at \meaning applied to the next token;
+ we get this by \xdef\meaning@{\meaning\next..........} where the
+ extra periods are added for reasons explained above. We also
+ make another copy, \meaning@@, for later use.
+
+%8 If \meaning@ begins `\math', we further test for ch??"; if this
+ test is passed we use \getmathch@ to define \thedots@.
+
+%9 Otherwise we see if we have a macro. We test on \meaning@@,
+ since the previous test has already changed \meaning@.
+
+%10 Suppose we do have a macro (so that \meaning@ is now the part
+ after ->).
+
+%11 We see if the macro begins with \not. If it does, \thedots@
+ is \dotsb@.
+
+%12 Otherwise, we see if the macro begins with `\DOTSB' or `\DOTSI'
+ or `\DOTSX', and if so, we set \thedots@ to \dotsb@ for \DOTSB
+ and \dotsi for \DOTSI.
+
+%13 Otherwise we still have to see if the macro definition begins
+ with \mathbin or \mathrel. Once again, we see if it starts with
+ \math, storing the remainder in the new value of \meaning@.
+
+%14 If it does we see if it really begins \mathbin and choose \dotsb@
+ if it does (the test doesn't change the value of \meaning@).
+
+%15 Otherwise we also see if it really begins \mathrel, and choose
+ \dotsb@ if it does.
+
+
+Now that we've gotten to \thedots@, which is either \dotsc or \dotsi
+or \dotso@ or \dotsb@ or \boldkeydots@ or \boldsymboldots@, we have
+to define these.
+
+
+\plainldots@, \plaincdots@ are used to store away plain's definitions
+of \ldots and \cdots.
+
+
+\dotsi and \dotsb@ are simple.
+
+
+\newif\ifextra@, ..., \def\rightdelim@
+--------------------------------------
+But \dotso@ is supposed to leave extra space if followed by a right
+delimiter, so it is more complicated.
+
+We use \ifextra@ to say if extra space should be left, after results
+of a test on \next, which a \futurelet will let equal the next token.
+For simplicity, first we simply test if the next token is an obvious
+right delimiter, storing the result in \ifrightdelim@, and then we
+make the real test.
+
+%1 \rightdelim@ is true if
+%2 \next is ) ] \rbrack ...
+%3 or \Biggr, but false otherwise.
+
+
+\extra@ is the real test to set \ifextra@.
+
+%1 \ifextra@ is true if the \rightdelim@ test is passed.
+
+%2 It is also true if a $ sign comes next.
+
+%3 Otherwise we look at \meaning again.
+
+%4 Suppose we have a macro.
+
+%5 Then if it starts with \DOTSX, \ifextra@ is again true.
+
+
+\newif\ifbold@, \dotso@
+-----------------------
+\dotso@, the most common result of \mdots@, has to act specially
+if it was called by \boldkeydots@ or \boldsymboldots@, which
+will be signalled by the flag \ifbold@.
+
+In the standard case, where \ifbold@ is false, we just want to
+use a \futurelet to get the next symbol, use \extra@ to test
+this symbol for a right delimiter, and then use \plainldots@,
+followed by \, if the next symbol is a right delimiter. If this
+were the only case to consider, we could use the definition
+
+ \def\dotso@{%
+ \DN@{\extra@\plainldots@\ifextra@\,\fi}%
+ \FN@\next@}
+
+But when \ifbold@ is true, the next symbol will already have been
+scanned by \boldkeydots@ or \boldsymboldots@, and stored in
+\delayed@. In this case, we don't want to use a \futurelet, but
+simply want to apply \extra@ with \next being \delayed@.
+
+So when \ifbold@ is true we \let\next\delayed@ and then define
+\nextii@ to be this combination, but if \ifbold@ is false we define
+\nextii@ to be the whole combination \DN@{\extra@...}\FN@\next@}, and
+then we call \nextii@.
+
+
+\def\extrap@
+------------
+
+We still haven't defined \dotsc, which will actually be the last kind
+of dots we define, and there's also \dotsb and \dotso (as opposed to
+\dotsb@ and \dotso@) and similarly \ldots and \cdots.
+
+\dotsb, \dotso, \ldots, and \cdots are slightly different from
+\dotso@ and \dotsb@, because they might be used before , or . or :
+especially at the end of a displayed formula that ends with
+punctuation, since that punctuation would have to appear before the
+$$ signs. So we want extra space here also.
+
+We use \extrap@, which takes as argument another (dot producing)
+macro. It is used as an abbreviation for a construction that puts an
+extra thin space before a , or . or ; as well as something that
+passes the \extra@ test.
+
+
+\ldots and \cdots use \extrap@, and of course must have low and
+centered dots, respectively.
+
+
+\dotso is just \ldots, and \dotsb is just \cdots, although other
+styles could change that. Similarly, \dotsm is \dotsb in this style.
+
+
+\dotsc, however, is a little special because we DON'T want extra space
+if it's followed by a comma---someone might have typed \dotsc,
+instead of simply \dots---so we have to explicitly check for only
+a ; or .
+
+
+\cdot should be treated as an ordinary symbol by \dots. We can
+arrange for this by using the fact that \dots doesn't check a macro
+definition for \mathchar!
+
+
+\longrightarrow, ..., \iff need to have \DOTSB added to their plain
+definitions.
+
+
+\dddot, ..., \spvec have nothing special. A lot of adjustment was
+done by eye.
+
+
+\textonlyfont@ is just a control sequence to allow us conveniently to
+redefine \rm, \it, \sl, \bf, \smc, etc.
+
+
+\oldnos will be used instead of \oldstyle, which doesn't fit in this
+scheme; in fact, \cal and \oldstyle and \mit will be made
+\undefined at the end. \oldnos is just a control sequence with an
+argument; as a convenience, it doesn't leave extra spaces around
+commas that might occur in the number.
+
+
+\text in text is basically just an \hbox, but allowed to begin a
+paragraph; in math it will be \text@, which is much more complicated.
+Actually, \text should also reset \mathsurround if this has a non-zero
+value, just in case \text is used within a math formula that appears in
+some construction where \m@th has been used.
+
+
+\def\mathhexbox@, ..., \def\P
+-----------------------------
+Once \text@ is defined, it will be possible to create symbols that
+can be used in either math mode or in text mode without $ signs,
+because \text{$...$} will always change sizes right. With this in
+mind, we redefine \dag, etc., from plain so that they change sizes
+automatically. \mathhexbox@ is the obvious modification of plain's
+\mathhexbox. An extra set of braces is inserted, so that ^\dag, etc.,
+will work.
+
+
+\newif\iffirstchoice@, ..., \def\text@
+---------------------------------
+\text@ will be a \mathchoice; in each case we will simply set an
+\hbox, but we will specify the style that we want for our math
+formulas and also which fonts we want for \rm, etc. This involves a
+few details, but there is also a detail of another sort that needs to
+be attended to.
+
+Conceivably, someone could use \footnotemark (which is actually
+defined in AMSPPT.STY, rather than in AMSTEX.TEX) within \text (so
+that, together with \footnotetext, a footnote could be set on some
+text within a displayed formula). \footnotemark increases the
+counter \footmarkcount@, and since a \mathchoice is set four times,
+\footmarkcount@ would be increased by 4, instead of by 1. To get
+around this, we let the flag \iffirstchoice@ normally be true but set
+it to be false in all but the first part of the \mathchoice for
+\text@, and in AMSPPT.STY we only advance the counter \footmarkcount@
+when \iffirstchoice@ is true.
+
+Aside from this, we will use \everymath to set the style at each
+size, and the control sequence \textdef@@ will be used to select the
+proper text fonts; depending on its argument, T, S or s, it will
+choose the \textfont or \scriptfont or \scriptscriptfont for each
+family of fonts. We also redefine \textfonti and \textfontii to be
+the proper size of families 1 and 2, for any text macros that use
+these. (At present that includes \{ and \} in text, which are fairly
+important, as well as \t and \AmSTeX.)
+
+
+\textdef@@ simply uses \textdef@ for each of the families, \rm, \bf,
+\sl, \it we need. If another family is added that should work
+properly in \text, the appropriate clause should be added here.
+
+
+\def\rmfam{0}, \def\textdef@
+----------------------------
+\textdef@ works under the assumption that \bf has a corresponding
+\bffam, \sl a corresponding \slfam, etc., all with names obtained by
+adding `fam' to the font change name. We therefore have to define
+\rmfam to be 0. If a new font, say \bfit, is introduced,
+\newfam\bfitfam should be used to create a new family with the
+corresponding name.
+
+To get the name of the family, e.g., \bffam, from the name \bf of the
+font, \textdef@ uses
+
+ \csname\expandafter\eat@\string\bf fam\endcsname.
+
+Then it redefines the font name \bf to be the \textfont for \bffam if
+the first argument is T, or the \scriptfont for \bffam if it is S,
+etc. The \relax is needed because \bffam is just a number, after the
+\edef.
+
+
+\scriptfont\itfam ...
+---------------------
+Any family that will be used with \text@ should have some assignment
+for its \scriptfont and \scriptscriptfont; otherwise there will be
+error messages even if only text or display size is being used,
+because a \mathchoice actually sets all four possibilities.
+\sevenit, etc., are not defined in plain. If \sevenit, etc., are
+available, then they can be used here, or in amsppt.sty.
+
+
+\foldedtext, \topfoldedtext, and \botfoldedtext, like \smash and
+\phantom, use one basic definition, with flags \iftopfolded@ and
+\ifbotfolded@.
+
+
+\foldedwidth is syntax that has to be looked for. We don't store the
+\foldedwidth, which is .3\hsize by default, anywhere special, but use
+it as soon as we get it.
+
+
+\def\bold ...
+-------------
+Next come the control sequences for changing fonts in math mode. The
+reason for defining \bold@ in terms of \bold@@, instead of directly,
+is that later on we will sometimes want to change the definition to
+eliminate the extra set of braces, and this is easily done by saying
+\let\bold@=\bold@@. \relax is added after \fam\bffam, etc., because
+these families are just numbers.
+
+
+\Cal@@ has \noaccents@ for reasons that will appear later.
+
+
+
+\mathchardef\Gamma ...
+----------------------
+We make the upper case Greek letters ordinary symbols instead of
+variables, because we don't change them with font change
+instructions.
+
+
+\mathchardef\varGamma ...
+-------------------------
+The variant upper case Greek letters are exactly the same, except "00
+is replaced by "01, since they are on the math italic font, which is
+family 1.
+
+
+
+\newif\ifmsamloaded@ ...
+------------------------
+Originally, \loadmsam, \loadmsbm, and \loadeufm were created because
+the msam, msbm and eufm fonts are not available to everyone, so
+instead of loading them directly, we defined control sequences to
+load them; we also needed to set flags so that AMSPPT.STY will know
+whether to load in the corresponding fonts for the eightpoint size.
+
+Now, \loadmsam, \loadmsbm, and \loadeufm are considered part of
+AmS-TeX, but we keep the same structure, since other font families
+are treated this way.
+
+We will later have a list, \fontlist@, in the form of TB, p. 378,
+that is supposed to list all the fonts used. To make sure that any
+fonts loaded are added to this list, instead of \font we use \font@,
+which is defined later. When we load in fonts for a family we also
+want to use \newfam to create the family name, but \newfam is \outer,
+so we would need an inner version, or the code itself. But there is
+another problem here; we want the allocations we make to use the
+present definition of \alloc@, for proper use of \showallocations. So
+we use \alloc@@ for the present meaning, and then write the code for
+\newfam in terms of \alloc@@.
+
+
+\def\hexnumber@ ...
+-------------------
+We will need to use various family numbers in \mathchar and
+\mathchardef's. But we need the hexadecimal values if any family is
+greater than 9, so we use \hexnumber@ to get it. An \ifcase is most
+efficient here.
+
+In addition to the family number of new families that we will load,
+we will also need to use the family number of the family \bffam, so
+we use \bffam@ to stand for its hexadecimal number. We \edef\bffam@,
+rather than \def'ing it, so that if someone is loading in AMSTEX.TEX,
+instead of using a format file, succeeding definitions will take less
+time.
+
+\loadmsam and \loadmsbm set flags to say they are loaded, declare the
+necessary fonts, create the corresponding new families, assign the
+fonts to these families, and create \msam@ and \msbm@ for the
+hexadecimal numbers of these families.
+
+In addition, once the msam fonts are loaded we will let
+\dashrightarrow, ..., \dasharrow (which use \dabar@), and \ulcorner,
+..., \maltese be defined, because they are defined specially. All
+other symbols can be handled by \newsymbol, explained below.
+
+Similarly, we will redefine plain's \widehat and \widetilde to take
+advantage of wider symbols in the msbm fonts, but these will not be
+used unless the msbm fonts are loaded.
+
+
+\newsymbol
+----------
+We don't want \loadmsam or \loadmsbm to introduce names for all the
+symbols, since this will use up too many control sequence names
+needlessly. Instead we let \newsymbol be used in the form
+
+ \newsymbol\nleqslant 230A
+
+or, more generally,
+
+ \newsymbol\cs 230A
+
+where \cs is the user's choice of a control sequence, and the
+4-character ``ID'' 230A should be listed along with the ``standard''
+name \nleqslant in the list of symbols. The first character of this
+ID will be 1 for symbols on the msam fonts, and 2 for symbols on the
+msbm fonts.
+
+For \newsymbol we first \define the control sequence to be empty, to
+get an error message if it is already defined. Then we let \next@ be
+\relax, but change \next@ to \msamfam@ if #2 is 1 and the msam fonts
+are loaded or to \msbmfam@ if #2 is 2 and the msbm fonts are loaded.
+Then, if \next@ is still \relax we give error messages; otherwise we
+do a \mathchardef, using the values of \next@.
+
+
+\UseAMSsymbols
+--------------
+For people who want to use the AMS's names, \UseAMSSymbols will
+\input the file amssym.tex.
+
+This file begins with \catcode`\@=11 (so that it can use the tests
+\ifmsamloaded@, \ifmsbmloaded@). If these families are loaded, it
+uses \newsymbol with the standard names for all the symbols on the
+fonts. However, it does this within a group where \globaldefs=1 so
+that these names will be globally made, even if \UseAMSsymbols is,
+for some reason, used within a group. We must \undefine
+\rightleftharpoons, \angle, and \hbar before using them with
+\newsymbol, since they are already defined.
+
+At the end, the file makes @ \active again.
+
+If the families aren't loaded we give error messages, and we also
+first add \catcode`\@\active, so that @ will be certain to be active.
+
+
+If the \msbfam is loaded, we can use \Bbb, just like the other font
+change instructions; like \Cal, it has \noaccents@, which will be
+explained later.
+
+
+Though defined here, \loadmsam, \loadmsbm and \loadeufm must actually
+appear later, after \font@ has been defined.
+
+
+\frak has been added for changing to the \eufmfam in math mode.
+Similarly, any other added families of fonts should be treated like
+this, if their characters are basically just specified by typing
+letters.
+
+\goth is just a convenient alternative for \frak.
+
+
+\ifcmmibloaded@ ...
+-------------------
+Next comes the mechanism for loading the two families of bold fonts,
+cmmib and cmbsy. We will have a single control sequence \loadbold
+for loading both, but separate flags for telling when each family is
+loaded (so that users who know what they are doing and who decide to
+load only one family [or only certain sizes of a family] can still
+use subsequent control sequences).
+
+\mathchari@, \mathcharii@ simply give \mathchar's if the first,
+respectively second, family of bold symbols is loaded, otherwise
+error messages.
+
+
+\boldkey
+--------
+\boldkey basically has to test all the various possiblities for
+``keys'' that come after it.
+
+We can test for a letter by using \ifcat\noexpand#1A; in this case we
+just use #1 in \fam\cmmibfam if it is loaded, and give an error
+message otherwise.
+
+Otherwise, we first test individually for ! ( ) + : ; = ? [ ] and
+use the appropriate symbol on the \bf fonts.
+
+After this test, we test individually for , - . / < > * | and use
+the appropriate symbol on the appropriate bold fonts, specifying them
+with \mathchari@ or \mathcharii@, to get error messages if the fonts
+aren't loaded.
+
+Finally, we test for the digits 0, ..., 9, and simply replace them
+with \bold0, ..., \bold9, already defined (\boldkey isn't supposed to
+be used with digits, but if it is we might as well revert to \bold).
+
+
+\def\boldsymbol ...
+-------------------
+\boldsymbol is much more complicated, since we will have to look at
+\meaning.
+
+We begin by defining \next@ to be an error message; it will be
+changed to \relax whenever we reach a case where \boldsymbol can be
+used. (Eventually, alternate error messages may be defined.)
+
+Again, we first test for letters, and use \fam\cmmibfam in this case,
+unless this family isn't loaded, in which case we just give a special
+error message (and let \next@ be \relax, so that the original error
+message isn't given).
+
+Then we do some of the same manipulations with \meaning#1 as in
+\dots. If we had a \mathchar, we will use \boldsymbol@@ on the value
+of \meaning@ (instead of the \getmathch@...\getmathch@ from \dots).
+
+Some of the things we want to use with \boldsymbol are defined as
+delimiters, so if we don't have a \mathchar, we have to use \macro@
+from \dots, together with a new construction \delim@, defined below,
+to see if this is the case, and if so, we will use \delim@@ with
+\meaning@.
+
+Finally, if none of these tests are passed, we will still use a final
+test, \boldsymbol@, for certain exceptional symbols.
+
+
+\mathhexboxii@ is just \mathhexbox@ for the cmbsy family, but an
+error message if this family isn't loaded.
+
+\boldsymbol@, the final check, just examines individual possiblities,
+and defines the result in terms of \mathcharii@ or \mathhexboxii@ or
+\bffam@, in the case of \lbrack and \rbrack (if they are used instead
+of [ and ], which would be used with \boldkey.)
+
+
+\boldsymbol@@#1.#2\boldsymbol@@ is going to be applied
+where #2 are the remaining .'s from \meaning@, and #1 is
+the hexadecimal number after the \mathchar.
+
+%1. We set both \classnum@ and \count@@@ to #1.
+
+%2. We divide \classnum@ by 4096 to get the first hexadecimal
+ digit (first from the left), and set \count@ to this value.
+
+%3. Then we multiply \count@ by 4096, and subtract from the
+ original value, \count@@@, so that \count@@@ now has the
+ value of last three hexadecimal digits. We also set
+ \count@@ to this value.
+
+%4. Then we divide the new \count@@@ by 256 to get the second
+ hexadecimal digit, which we store in \count@.
+
+%5. Then we multiply the second hexadecimal digit, \count@@@,
+ by 256 and subtract from \count@@, which still has the
+ value of the last three hexadecimal digits, so that
+ \count@@ now has the value of the last two hexadecimal
+ digits.
+
+%6. Then we divide \count@@@ by 256 again, so that it has the
+ value of the second hexadecimal digit.
+
+%7. Finally, we multiply \classnum@, the first hexadecimal
+ digit, by 4096 again and add \count@@, the last two
+ hexadecimal digits to it. So if the hexadecimal digit was
+ "abcd, \classnum@ is now "a0cd, and \count@@@ = b.
+
+%8. Now, if \count@@@ = 0, so that our symbol came from family
+ 0 (i.e., the roman fonts, which should mean that our symbol
+ was one of \Gamma, ..., \Omega), we want to use the
+ corresponding symbol in the \bf family, which means that it
+ is \mathchar"axcd, where x is the number for \bffam, so we
+ get this by adding 256 times the hexadecimal number \bffam@
+ to \classnum@, and then using \mathchar\number\classnum@.
+
+%9. On the other hand, if \count@@@ = 1, so that our symbol
+ came from family 1 (i.e., the math italic fonts), then we
+ want to use the corresponding symbol in the cmmib family,
+ so we add 256 times the hexadecimal number \cmmibfam@ to
+ \classnum@ and use \mathchar\number\classnum@, except that
+ we give an error message if these fonts aren't loaded.
+
+%10. Similarly if \count@@@=2 (in which case our symbol came
+ from family 2 (i.e., the math symbol fonts).
+
+
+\newif\ifdelim@ ...
+-------------------
+\delim@#1\delim@ sees if #1 starts with \ d e l; if so, it makes
+\ifdelim@ true and sets \meaning@ to be the rest.
+
+When \delim@@#1"#2#3#4#5#6\delim@@ is used, #2 will be the type of
+delimiter, #3 will be the font family the symbol occurs on, "#4#5
+will be the location of the symbol on the font, and #6 will be
+everything else (i.e., the large variant, if there is one). If #3
+isn't the second family, we stick with the original error message
+that \boldsymbol can't be used with this symbol; otherwise we let
+\next@ be \relax, so that we won't get this error message, and then
+either produce the symbol, with \mathcharii@#2#4#5, or else give an
+error message if the family isn't loaded.
+
+
+\vert, \Vert (and \|) and \backslash have to be redefined so that the
+initial hexadecimal digit 0 is specifically added, in order for the
+definition of \delim@@ to work (plain simply leaves out the 0).
+
+
+\boldkeydots@#1 and \boldsymboldots@#1 are called if \dots is
+followed by \boldkey or \boldysmbol.
+
+In both cases, we first make \ifbold@ true, and then set \next to be
+#1. The value of \next will be used by \mdots@@ to decide whether to
+use \dotso@, etc. If \dotso@ is used, then we need to reset \next to
+#1, for use by \ifextra@, so we first store #1 in \delayed@, and
+include \let\next\delayed@ in the definition of \dotso@. After the
+dots are put in by \mdots@@, we then put in the right symbol with
+\boldkey#1 or \boldysmbol#1, and finally set \ifbold@ to be false
+again.
+
+On subtle point: in \boldkeydots@, the = after \let\next and
+\let\delayed@ are required, because #1 might be = , in which case it
+would disappear, so that \next would be set to \let, or \delayed@ to
+\mdots@@, etc., resulting in no end of mischief.
+
+
+\newif\ifeufbloaded@ ... \newif\ifeurbloaded@ ...
+-------------------------------------------------
+The next five sets of definitions make it easy to load the rest of
+the Euler fonts, one at a time, when needed. The user should take
+care not to try to load too many at once, as TeX's limit of 16
+families cannot be changed.
+
+
+\def\accentclass@, ..., \makeacc@\bar
+-----------------------------------
+We change the definition of \hat, etc., so that constructions like
+\bold{\hat A} will use the bold \hat symbol. But we want \Cal{\hat A}
+and \Bbb{\hat A} to use the usual \hat symbol, since these fonts
+don't have accent characters. That is why we added \noaccents@ to
+the definitions. The strategy is to change \hat from
+\mathaccent"705E to \mathaccent"\accentclass@05E, where \accentclass@ is
+usually 7, but is redefined as 0 when \noaccents@ is in force. To
+save space we use \makeacc@ to produce these definitions.
+
+
+\vec is different, as the accent itself is on only one font
+(\textfont1).
+
+
+\newcount\skewcharcount@, ..., \def\theskewchar@
+------------------------------------------------
+Now come definitions of \Hat, etc., which will get double accents
+correctly positioned. After \dots, these are the most complicated
+things in AmS-TeX.
+
+TeX properly places single accents over letters in math mode by using
+the kern, s, between the letter, L, and the \skewchar for its font
+(TB, p. 443); we have to emulate this procedure. The results of the
+instructions in Rule 12 on p. 443 can be obtained by replacing L by
+{L\hskip 2s}, putting (i.e., centering) the accent over this box, and
+then adding \hskip-2s.
+
+This means, first of all, that we have to find the \skewchar of the
+font. The \skewchar is -1 or '177 for the fonts in plain, but might
+be anything; however, we assume that the \skewchar for all the fonts
+in any particular family are the same. Moreover, we assume that the
+kerns are proportional in different size fonts within a family, so
+that the kern in the \textfont for the family is all we need to know.
+(This seems to give quite adequate results for the Computer Modern
+fonts.)
+
+The control sequence \theskewchar@ globally sets \skewcharcount@ to
+the \skewchar for the family if it is between 0 and 127, and to -1
+otherwise. We use \global because \theskewchar@ will be used within
+an \hbox. If the \skewchar is between 0 and 127, \theskewchar@ will
+also produce the \skewchar character for the font. This character can
+be obtained as \mathchar.... where .... is (the \skewchar for the
+family) + (256 times the family number) + (4096 times the class),
+where we should take the class to be 7 (variable), so that \mathchar
+will select whatever family we are in.
+
+TeX always sets \fam to -1 at the beginning of a formula. This means
+that we should assume that our character is in family 1 (where the
+ordinary letters lie), unless \fam has a different value between 0
+and 15.
+
+%1 First assume that \fam=-1, so that our letter is in family 1, and
+ set \familycount@ to 1, and set \skewcharcount@ to the \skewchar
+ for family 1.
+
+%2 But if \fam has a legal value, between 0 and 15, so that our
+ letter is in this \fam, set \familycount@ to this value, and
+ \skewcharcount@ to the \skewchar for this \fam.
+
+%3 If \skewcharcount isn't between 0 and 127, just set
+ \skewcharcount@ to -1. Otherwise add 256 times \familycount@ to
+ the \skewchar, and then add 28672 (= 7 x 4096), and produce this
+ \mathchar.
+
+
+\newcount\pointcount@, \def\getpoints@
+--------------------------------------
+The construction \getpoints@...\getpoints@ will be applied to things
+like \the\dimen0. If \the\dimen0 is 23.456pt, \pointcount@ will be
+set to 23, the integer number of points in \dimen0. The use of . in
+the syntax for \getpoints@ is OK, since constructions like
+\the\dimen0 always produce the decimal point.
+
+
+\newdimen\accentdimen@, ..., \def\dimentomu@
+--------------------------------------------
+Eventually, we will use \theskewchar@ to store the kern between our
+letter and the \skewchar in a dimension register \accentdimen@. We
+will use the control sequence \dimentomu@ to convert this to mu's and
+store the number of mu's in a counter \accentmu@, so that we can use
+\accentmu@ mu to get a kern that varies appropriately with the style
+of the formula.
+
+Essentially, we want to multiply the number of points by 1.8, since
+there are 18 mu in 10 points. Since we are going to deal in whole
+numbers, we will actually multiply by 1800 and divide by 1000. In
+the definition below, multiplying \accentdimen@ by 100 first lets
+\getpoints return a good value.
+
+
+\def\Makeacc@
+-------------
+Finally, we are ready to produce \Hat, etc., with \mathaccent@, the main
+thing left for us to define. As with ordinary accents, we use a
+control sequence to abbreviate the constructions, and incorporate
+\accentclass@ to take care of the case where letters come from a font
+that doesn't have accent characters.
+
+
+\unbracefonts@ temporarily changes the meanings of \rom, \bold, etc.,
+so that the extra pair of braces isn't included.
+
+
+\def\mathaccent@
+----------------
+
+%1 First we store the current family in \thefam@; as usual, it is set
+ to 1 if it is -1, i.e., if \fam hasn't been changed yet.
+
+%2 We initialize \accentdimen@ to 0pt; it may have been changed by a
+ previous \Hat, etc.
+
+%3 Now we set the formula #2 in the current family (and in
+ \textstyle). \unbracefonts@ isn't really important here, but we
+ put it in for consistency, since it will be needed in a
+ corresponding box later on.
+
+ Although we initialized \accentdimen@ to 0pt, it may have changed,
+ because #2 might already involve a \Hat, etc. In fact, we will
+ later arrange explicitly for this to happen in such a case.
+
+%4 If \accentdimen@ hasn't changed, the accent is simple.
+
+%5 But we will globally make \accentdimen@ different from 0pt, so
+ that a \Hat applied to this new accented character will be treated
+ differently, via the clause after the final \else in this
+ definition. Moreover, we will globally set \accentmu@ to the
+ number that we want to be used for this new accented character:
+
+ %5a \box1 is the formula #2 followed by the \skewchar for the font
+ (or by nothing, if the \skewchar isn't between 0 and 127).
+ Here \unbracefonts@ is needed if #2 is something like \bold X:
+ we don't want the extra braces around the \fam\bffam X,
+ because we want \fam to be \bffam when \theskewchar@ does its
+ thing.
+
+ %5b \box2 is the \skewchar alone (or nothing). It is in the right
+ family, because \skewcharcount@ was most recently globally set
+ in box 1.
+
+ %5c \accentdimen@ is now the kern between #2 and the \skewchar.
+
+ %5d We double it, change to mu's, and add 1 for good measure.
+
+%6 If we're in the case where \accentdimen@ was changed, we use the
+ value of \accentmu@ that was created to properly position the
+ accent. We make the whole result an ordinary symbol, and add an
+ empty group so that things like \Hat{\Hat A}^2 will work OK.
+
+
+\Makeacc@ ...
+-------------
+Now we make all these accents.
+
+
+\Vec is special, as with \vec.
+
+
+\def\newbox@, \def\accentedsymbol
+---------------------------------
+We want \accentedsymbol to create a \newbox to store the symbol.
+Since \newbox is \outer, we need an inner version (we can't simply
+use the code, because we are going to be using it after
+\expandafter).
+
+The \newbox created by \accentedsymbol\Ahathat{\Hat{\Hat A}} will
+just be called \Ahathat@box, which we create with
+\csname...\endcsname.
+
+
+\def\sqrt ...
+-------------
+\radical, \underline and \overline are like ^ and _ : they operate on
+the next <math field> rather than on the next macro argument (TB, p.
+291). So, for example, \underline\noteq becomes \underline\not=
+which underlines only the \not, and \underline\notin gives mysterious
+error messages. To avoid this, we redefine \sqrt, \underline and
+\overline as control sequences with arguments.
+
+
+\Invalid@\leftroot, .., \def\plainroot@
+---------------------------------------
+\root will have both \leftroot and \uproot as possible parts of its
+syntax. The definition is messy because we allow them to occur in
+either order. We also have to worry about skipping over spaces after
+a right brace after \leftroot{...} or \rightroot{...}. The net
+result of all the mess is simply to assign values to the counters
+\uproot@ and \leftroot@.
+
+\root actually begins working with the code on the last line: it
+starts a group (to keep the values of \uproot@ and \leftroot@ local,
+for \root's within \root's), initially sets \uproot@ and \leftroot@
+to 0, and after \uproot@ and \leftroot@ have been properly assigned,
+it calls \plainroot@, which is almost exactly the same as plain's
+\root, except the \mathchoice involving \r@@t has to be written out,
+rather than using \mathpalette, in order to get the final \egroup in
+the right place.
+
+And \r@@t is like plain's \r@@t, except that we add corrections for
+the values of \uproot@ and \leftroot@. For \leftroot@ we simply
+change the \mkern-10mu between the root and the main quantity by
+\mkern-10mu\mkern\leftroot@ (i.e., we leave more room between them,
+since \leftroot@ is the amount to move the root to the left); we have
+to correct for this extra shift with \mkern-\leftroot@ mu at the
+beginning.
+
+\uproot@ is handled a little differently, since mu is a unit for
+horizontal distances, not vertical ones. We set a box of width
+w=\mskip\uproot@ mu, and increase \dimen@, the amount involved in
+raising the root, by 10/6 w. (Then, since we raise by .6\dimen@, the
+extra amount we are raising is w.)
+
+
+\boxed makes a box with rules of width .4\ex@ (so .4pt at 10 points),
+and we want its baseline to be the baseline of the original formula.
+The \vbox on lines 3--5 of the definition surrounds \box0, the
+original formula in \displaystyle, with three points of space and the
+rules on all sides. It is now too high by 3pts + .4\ex@ + depth of
+\box0 (since the construction \vbox{\vskip3\ex@\box\z@\vskip3\ex@}
+produced a box of depth 0). So we lower by that total amount.
+
+
+\let\amspersand@\relax
+----------------------
+Now come commutative diagrams. The diagrams themselves aren't much
+of a problem, and the interesting things are the arrows within them.
+It is pleasant that one can avoid using & in commutative diagrams, by
+having the arrows put the &'s in themselves; the only problem is that
+the same construction used for horizontal arrows in commutative
+diagrams is also supposed to work for individual arrows in math mode.
+The way to do this is to have the macros contain \ampersand@ in the
+right places, where \ampersand@ is usually \relax, but can be changed
+to & within a commutative diagram.
+
+
+\newdimen\minaw@ ...
+--------------------
+We also want the arrow constructions to give different lengths for
+arrows within commutative diagrams and for individual arrows in math
+mode (except that in either case the arrows will get longer, if
+necessary, when they have formulas above and/or below them). We
+store the minimum length for individual arrows in math mode in
+\minaw@, and the minimum length for arrows in a commutative diagram
+in \minCDaw@.
+
+\minaw@ is made 11.11128\ex@ (i.e., 11.11128pt). I can't remember
+where I got this from! Probably the dimension of some symbol.
+\minCDaw is made 2.5pc.
+
+
+\minCDarrowwidth allows user to change the minimum length, provided
+we are in a displayed formula.
+
+
+\CD and \endCD are similar to \matrix and \endmatrix. Of course,
+there are no category code changes, nor any extra space (and so no
+\null), and we make the baselineskip bigger. But we also want to
+\let\ampersand@=&, so that the arrow macros will produce the &'s. As
+with \Let@, we have to hide this within \iffalse{\fi...\iffalse}\fi.
+We also set a flag, \ifCD@, to tell the arrow macros they are in a
+\CD (and hence should have longer length).
+
+
+\endCD just supplies the necessary \cr and }'s.
+
+
+\newdimen\bigaw@
+----------------
+Now we are ready for the arrows themselves. We store the actual
+length that an arrow will be in \bigaw@. Since the arrows are of the
+form @>>>, etc., we use \atdef@ to define them.
+
+
+@>#1>#2>#3>
+-----------
+
+%1 Arrow starts with & in a \CD.
+
+%2 \box0 has formula above the arrow, with suitable spacing around
+ it (\;\; at end to clear arrow head).
+
+%3 \box1 has formula below the arrow, with suitable spacing.
+
+%4 \box2 is just the part below, because we will do things
+ differently if there is no formula below.
+
+%5 If we are in a \CD, \bigaw@ is initially \minCDaw@, otherwise
+ \minaw@.
+
+%6 If formula above or below the arrow is bigger than \bigaw@,
+ change \bigaw@ to the maximum of these widths.
+
+%7 Extra space goes before the arrow in a \CD.
+
+%8 If there is something to go below the arrow, make an arrow of the
+ right length, with \rightarrowfill, make it a \mathop, so we can
+ use \limits to put the formulas above and below (the positioning
+ this provides isn't ideal, so it would probably be better to use
+ a more explicit construction here), and then make the resulting
+ arrow a \mathrel.
+
+%9 If nothing goes below, don't bother with the lower limit (so that
+ unnecessary space below isn't produced).
+
+%10 Extra space goes after the arrow in a \CD.
+
+%11 Arrow ends with & in a \CD.
+
+
+@<#1<#2<#3< is exactly analogous.
+
+
+@)#1)#2)#3), @(#1(#2(#3( are for foreign keyboards that don't have
+< and > available (because they are used for { and }, which are
+instead \AA and \aa).
+
+
+@A#1A#2A, @V#1V#2V
+------------------
+Vertical arrows don't need to bother with \ampersand@, since they are
+only used in \CD's. Notice that the space after \atdef@ is necessary,
+although space after @ in @A... and @V... won't be necessary later!
+
+
+@= is special, and used only in a \CD.
+
+
+@| is also used only in a \CD.
+
+
+\atdef@@\vert
+-------------
+We have to allow @\vert as a synonym, but this needs \atdef@@ instead.
+
+
+\pretend...\haswidth... is just a lot of syntax for a simple
+construction.
+
+
+\pmb is basically as in TB, p. 386, except that in math mode we use
+\mathpalette\pmb@, so that the symbol will change size. In addition,
+we want \pmb to keep binary relations and operators of the same type.
+We already have \binrel@, to start testing if something is of one of
+these two types, and we define \binrel@@ to complete things by making
+a \mathbin or \mathrel of the result.
+
+The final detail involves the amount to move the three copies that we
+are going to superimpose on each other. We want to use mu's rather
+than points or ems. Since 1em=18mu, we have .025em= .45mu, so we use
+-.45mu instead of .025em, and -.9mu instead of .05em. And since
+.0544em =.7794mu, we set a box with this width, and raise by that
+width (we store the width in the dimen register \pmbraise@ to be sure
+that \box4 doesn't happen to get used somewhere in between).
+
+We use \box3 in the definition of \pmb@ because \binrel@, used later,
+involves \box0 and \box1.
+
+
+\documentstyle is similar to LaTeX.
+
+
+\font\dummyft@ ...
+------------------
+For syntax checking, we need the dummy font (TB, p. 401). Since the
+dummy.tfm's available don't seem to have all the \fontdimen's they
+need, we explicitly set them right.
+
+
+\def\fontlist@
+--------------
+We need a list of all the fonts that are used, in the form of TB,
+p. 378, so that we can set them all to \dummyft@. First we list all
+the fonts already used.
+
+
+\font@ is to be used instead of \font, so that when new fonts are
+loaded in they will be added to the list.
+
+
+At this point we can add
+
+ \loadmsam
+ \loadmsbm
+ \loadeufm
+
+
+\dodummy@ sets all fonts to \dummyft@
+
+
+\def\nopages@
+-------------
+We will want to say \newtoks\output (TB, p. 401) within this control
+sequence. Since \newtoks is \outer, we will simply use the code
+instead.
+
+
+\ifsyntax@ is used to record the fact that \syntax was used. This
+might be needed by AMSPPT.STY.
+
+
+\newcount\countxviii@, \def\syntax
+----------------------------------
+To get syntax checking we also have to set \textfont0=\dummyft@, etc.
+We have to do this for all families, and the number of families is
+stored in \count18. The counter \countxviii@ is used to start with
+this value, and decrease in a \loop.
+
+%1 For syntax checking, we set \syntax@true, for use by AMSPPT.STY,
+ set all fonts to \dummyft@, with \dodummy@, set all \textfont's,
+ etc., to \dummyft@, using the \loop construction, and then do
+ everything else.
+
+
+\S@, \G@ and \P@ are used to check if S, G or P (or lowercase
+versions) were typed at the keyboard.
+
+
+\printoptions is a \loop that keeps insisting on an answer until S or
+s or G or g or P or p was typed at the keyboard. S chooses \syntax,
+G chooses \galleys, P just processes things as usual.
+
+%1 This converts the answer to uppercase (TB, p. 331).
+
+
+\def\alloc@
+-----------
+We now change \alloc@, since there are no further allocations in the
+file (or in AMSPPT.STY) that might have to be kept out of the log
+file. The new definition will write things in the log file only if
+\showallocations is used, so that \ifalloc@ is true.
+
+
+\document doesn't really do much in AmS-TeX---it was just put in to
+correspond to LaTeX. But at this point we might as well clear out
+\alloclist@ and \fontlist@, since anything in them will have been
+acted on by now.
+
+
+\enddocument, similarly, is just \bye, though AMSPPT.STY will make it
+considerably more complicated.
+
+
+\plainproclaim, \plainfootnote store plain's \proclaim and \footnote,
+which have different syntax from \proclaim and \footnote in
+AMSPPT.STY.
+
+
+\proclaim and \footnote themselves are made undefined, until a style
+file, like AMSPPT.STY, defines them.
+
+
+\= is also made undefined, since \B has been provided, and goes
+better with \b [to correspond to \D and \d, where \d had to be added
+since \. was redefined].
+
+
+\cal, \mit and \oldstyle are made undefined also, since this method
+of changing fonts is not used in AmS-TeX.
+
+
+The last thing is to make @ active.
+
+
+**********************************************************************
+
+HERE IS A SUMMARY OF ALL PLACES WHERE SPECIFIC VALUES USED IN THIS FILE
+ MIGHT NEED TO BE REPLACED, BECAUSE OF DIFFERENT FONTS, STYLES, ETC.
+
+ \sdrd@, \drsr@, \sldl@, \dlsl@
+ \captionwidth@
+ \ex@
+ spacing for \:
+ \initic@, \negintic@, and possibly \intkern@
+ spacing for \varinjlim, \varprojlim, \varliminf
+ \baselineskip and \lineskip for \smallmatrix
+ possibly \dotsspace@
+ format for \cases
+ \strutbox@
+ \tagform@
+ value of \interdisplaylinepenalty set by \allowdisplaybreaks
+ \multlinegap@
+ \multlinetaggap@ (and perhaps rule for setting tag separately on a
+ \multline)
+ spacing for \bmod, \pmod, \pod, \mod
+ \kern's for \overrightarrow, etc.
+ \dotso, \dotsb, \dotsm, \dotsc
+ spacing in \dddot, etc.
+ \mathsurround within the definition of \text@@ (\text outside of math),
+ in case it is set to a non-zero value in general.
+ \textdef@@
+ \scriptfont\itfam, etc.
+ \minaw@ and \minCDaw@
+ \baselineskip, \lineskip, and \lineskiplimit in \CD
+ the positioning of labels above and below arrows
+ the size of the symbols given by @= and @|
+ activation of \loadmsam, etc.
+
+**********************************************************************
diff --git a/macros/amstex/doc/amstinst.pdf b/macros/amstex/doc/amstinst.pdf
new file mode 100644
index 0000000000..dc333ff998
--- /dev/null
+++ b/macros/amstex/doc/amstinst.pdf
Binary files differ
diff --git a/macros/amstex/doc/amstinst.tex b/macros/amstex/doc/amstinst.tex
new file mode 100644
index 0000000000..ec021e23d4
--- /dev/null
+++ b/macros/amstex/doc/amstinst.tex
@@ -0,0 +1,415 @@
+%%% ====================================================================
+%%% @TeX-file{
+%%% filename = "amstinst.tex",
+%%% version = "2.2",
+%%% date = "2001/08/09",
+%%% time = "18:47:33 EDT",
+%%% checksum = "30594 415 2485 18444",
+%%% filetype = "AMS-TeX: user documentation",
+%%% author = "American Mathematical Society",
+%%% copyright = "Copyright 2001 American Mathematical Society,
+%%% all rights reserved. Copying of this file is
+%%% authorized only if either:
+%%% (1) you make absolutely no changes to your copy,
+%%% including name; OR
+%%% (2) if you do make changes, you first rename it
+%%% to some other name.",
+%%% address = "American Mathematical Society,
+%%% Technical Support,
+%%% P. O. Box 6248,
+%%% Providence, RI 02940,
+%%% USA",
+%%% telephone = "401-455-4080 or (in the USA and Canada)
+%%% 800-321-4AMS (321-4267)",
+%%% FAX = "401-331-3842",
+%%% email = "tech-support@ams.org (Internet)",
+%%% codetable = "ISO/ASCII",
+%%% keywords = "amstex, ams-tex",
+%%% supported = "yes",
+%%% abstract = "This file is part of the AMS-TeX distribution,
+%%% version 2.2. It contains installation instructions.
+%%% The file amsguide.tex inputs this file, but this
+%%% file is also designed so that it can be processed
+%%% separately, using only Plain TeX.",
+%%% docstring = "The checksum field above contains a CRC-16 checksum
+%%% as the first value, followed by the equivalent of
+%%% the standard UNIX wc (word count) utility output of
+%%% lines, words, and characters. This is produced by
+%%% Robert Solovay's checksum utility.",
+%%% }
+%%% ====================================================================
+%
+% This file is input by amsguide.tex, which requires AMS-TeX 2.1 or
+% later. However it can also be typeset separately using Plain \TeX{},
+% means of the mechanism below: we check to see if amsppt.sty has
+% been loaded earlier; if so, we set the catcode of the ~ character
+% to 14 so that the following section of definitions will be ignored
+% (since the definitions would be redundant); otherwise we set the
+% catcode to 9 ("ignore") so that the definitions will be carried out.
+% Several definitions differ from the ones in amsguide.tex because
+% amsppt.sty is absent.
+%
+% Enclosing the definitions section within the initial \if ...
+% \else ... \fi would be problematic because of the outerness of
+% \head and \subhead in the amsppt documentstyle.
+%
+% Leave the definition of \head active; it is slightly different from
+% the one in amsppt.sty, and gives a different result in Appendix C.
+%
+\expandafter\ifx\csname amsppt.sty\endcsname\relax
+ \catcode`\~=9 \else \catcode`\~=14 \let\BYE\relax \fi
+~ \let\BYE\bye
+~ \hsize=30pc \vsize=47pc
+ \def\head#1\endhead{\bigskip{\sc\noindent
+ \leftskip0pt plus.5\hsize \rightskip=\leftskip\parfillskip=0pt
+ \def\\{\break}#1\par}\nobreak\smallskip}
+ \font\sc=cmcsc10
+~ \def\subhead#1\endsubhead{\removelastskip\medskip{\bf\noindent
+~ #1\par}\nobreak\smallskip}
+~ \def\AmSTeX{{\the\textfont2 A\kern-.1667em%
+~ \lower.5ex\hbox{M}\kern-.125emS}-\TeX\spacefactor 1000 }
+~ \long\def\usertype#1{\smallskip
+~ \moveright2pc\vbox{\def\par{\crcr}\halign{%
+~ \setbox0\hbox{\tt##}%
+~ \hbox\ifdim\wd0<10pc to10pc\fi{\unhbox0\hfil}%
+~ \kern1pc \it $\langle$return$\rangle$\hss
+~ \cr#1\crcr}}%
+~ \smallskip}
+~ \def\<#1>{{\it$\langle$#1\/$\rangle$}}
+~ \hfuzz1pc % to suppress reporting of overfull boxes.
+~ \hyphenation{amsppt}
+~ \def\Textures{{\it Textures\/}}
+~ \def\AMS{American Mathematical Society}
+~ \def\filnam#1{{\tt\def\\{\char`\\}\ignorespaces#1\unskip}}
+~ \hyphenchar\tentt=-1 % to prohibit hyphenation in tt text
+~ \newdimen\exindent \exindent=2\parindent
+~ {\obeylines
+~ \gdef^^M{\par\penalty9999}%
+~ \gdef\beginexample#1{\medskip\bgroup %
+~ \def\~{\char`\~}\def\\{\char`\\}\def\{{\char`\{}\def\}{\char`\}}%
+~ \overfullrule0pt\tt\frenchspacing %
+~ \parindent=0pt#1\leftskip=\exindent\obeylines}
+~ }% end \obeylines
+~ \def\endexample{\endgraf\egroup\medskip}
+~ \def\cs#1{\leavevmode
+~ \skip0\lastskip\unskip\penalty0
+~ \ifdim\skip0>0pt \hskip\skip0\fi
+~ {\tt\def\{{\char`\{}\def\}{\char`\}}%
+~ \def\\{\char`\\}\char`\\\ignorespaces#1\unskip}}
+~ \newcount\rostercount
+~ \def\roster{\par\smallskip\begingroup \rostercount=0
+~ \def\par{{\endgraf}}\hangindent3pc
+~ \def\item{\futurelet\next\iitem}%
+~ \def\iitem{\ifx\next"\expandafter\iiitem
+~ \else\advance\rostercount 1 \iiitem"(\the\rostercount)"\fi}%
+~ \def\iiitem"##1"{\par \noindent\hbox to\hangindent{\hss##1\enspace}}%
+~ }
+~ \def\endroster{\par\smallskip\endgroup}
+~ \def\newpage{\vfil\eject}
+\catcode126=\active % restore ~ to normal; using `\~ here wouldn't work!
+\def\TEXMF{{\tt TEXMF}}
+
+\head Appendix B\\ Installation Procedures\endhead
+
+\subhead B.1. Introduction\endsubhead
+
+The \AmSTeX{} software can be used with any implementation of \TeX{}\null.
+Many \TeX{} distributions include \AmSTeX{}, ready to run; check the
+documentation that came with the \TeX{} distribution you are using.
+When a new version of \AmSTeX{} is released, all distributors are
+notified, so if your \TeX{} system is up to date, it is likely that you
+don't need to do anything at all.
+
+Most up-to-date \TeX{} installations are organized according to the
+\TeX{} Directory Structure (TDS)\null. This is a tree structure whose
+root is identified as something like {\tt /usr/local/share/texmf} or
+{\tt c:\char`\\sw\char`\\texmf}. In the following instructions,
+we will use the name \TEXMF{} to identify the root directory of a
+TDS or similar structure.
+
+When installing a new release of \AmSTeX{}, you may want to first
+back up your old version, if you have existing documents that use it.
+Although new releases are intended to be backward compatible, a backup
+provides insurance in case something goes wrong.
+
+
+\subhead B.2. Location of \AmSTeX{} Files in a TDS Tree\endsubhead
+
+Files in the \AmSTeX{} distribution fall into four categories:
+files for use with \TeX{}, source files, documentation, and formats.
+The following list shows all the files in the current distribution,
+along with their recommended locations in a TDS tree.
+
+\medskip
+\begingroup
+\obeylines\obeyspaces\tt%
+TEXMF/
+\ tex/amstex/base/
+\ amstex.tex
+\ amstex.ini
+\ amsppt.sty
+\ amsppt.sti
+\ amsppt1.tex
+\ tex/plain/amsfonts/
+\ amssym.def
+\ amssym.tex
+\ source/amstex/
+\ README
+\ amsppt.doc
+\ amstex.bug
+\ doc/ams/amstex/
+\ amsguide.tex
+\ amsguide.ps
+\ amsppt.faq
+\ amstinst.tex
+\ amstinst.ps
+\ joyerr.tex
+\ joyerr2.tex
+\ \<\TeX-implementation>/formats/
+\ amstex.fmt
+\endgroup
+
+\medskip
+\noindent
+The \AmSTeX{} distribution can be retrieved in bundled form from the
+AMS web site, e.g., as a \filnam{.zip} or \filnam{.tar} file. In this
+form, the files are already arranged according to the TDS structure.
+(The format file is not included in the distribution. It is
+platform-specific, and must be created as part of the installation;
+see below.) To install the collection from a TDS-formatted bundle,
+place the bundled file into a convenient directory and unpack it using
+the \TEXMF{} directory as the ``Extract to'' target. Some examples:
+
+\halign{\quad#\hfil\quad & #\hfil \cr
+ WinZip: & Click on ``Extract'' and then in the ``Extract to'' box, enter\cr
+ & {\tt\char`\\sw\char`\\texmf}\quad (or whatever TEXMF is on your
+ system)\cr
+ gzip: & {\tt gzip -dc amstex.tgz \char`\|\ (cd TEXMF; tar xvf -)}\cr
+ unzip: & {\tt unzip amstex2.zip -d TEXMF}\cr
+}
+
+\noindent
+The bundled file may be deleted after unpacking.
+
+If the files are obtained from CTAN (where they are mirrored from
+the AMS server), they are not in TDS order. Use the above list to
+place the files into the proper location.
+
+Note: If you currently have any of the following files from very old
+releases of \AmSTeX{}, delete them before installing the new release.
+They are either irrelevant or superseded in the new version of \AmSTeX{},
+and it is best to remove them to avoid confusion. If you back up your
+existing \AmSTeX{} files before installing the new version, these files
+should be included.
+
+\settabs4\columns {\tt
+\+\ \ amsfil.chg& amsplain.tex& amsppt.mor& amstex.chg\cr
+\+\ \ cyracc.def& cyrmemo.def& cyrmemo.tex& amsplain.fmt\cr
+}
+
+\medskip
+The TFM files for some of AMSFonts 2.2 (\filnam{msam*}, \filnam{msbm*},
+and \filnam{eufm*}) are needed to run \AmSTeX{} with the AMSPPT
+document style, even if you don't plan to actually print anything using the
+AMSFonts. (These fonts {\it are} needed to process and print the User's
+Guide of which this appendix is a part.) TFM files are available from the
+AMS web site, \filnam{www.ams.org/tex/amsfonts.html}, or by anonymous FTP
+from \filnam{ftp.ams.org}. They should be placed in the directory
+\filnam{TEXMF/fonts/tfm/ams/}.
+
+
+\subhead B.3. What if Your \TeX{} System Isn't in a TDS Tree?\endsubhead
+
+If your \TeX{} system is arranged in some other way, you must consult
+the user documentation for guidance. The hints that follow are just
+that---hints. If your \TeX{} system documentation recommends something
+different, you should follow that procedure.
+
+We recommend placing \AmSTeX{} files into distinct subdirectories or
+folders, to simplify installation of future versions.
+
+First, determine where \TeX{} will look for files to be input. If
+\filnam{amstex.tex} and \filnam{amssym.def} are already present, place
+the files listed in section B.2 under {\tt tex/amstex/base/} and
+{\tt tex/plain/amsfonts/} into those same areas. If neither of these
+files is already present, look for the file \filnam{plain.tex}.
+Create appropriate subdirectories under the area where you find this
+file for the new \AmSTeX{} files.
+
+If there isn't any obvious place to put source or documentation files
+(the ones listed in section B.2 under {\tt source/amstex/} and
+{\tt doc/ams/amstex/}), you can put them in with the input files.
+Consult the documentation for your \TeX{} distribution.
+
+Once all the files are installed, you are ready to create a format
+file.
+
+
+\subhead B.4. Creating a Format File\endsubhead
+
+Every implementation of \TeX{} uses format files to preload the macros,
+fonts, and hyphenation patterns that define basic user environments
+such as \AmSTeX. Although it is not strictly necessary to use a
+format file for \AmSTeX, preloading will save startup time, especially
+on slower systems. Note: Each format file takes up 150K--300K of
+disk space (depending on your \TeX{} implementation).
+
+If your \TeX{} system already includes the format file \filnam{amstex.fmt},
+you may not have to create a new one; recent changes to \filnam{amstex.tex}
+are cosmetic, and will not affect any math formatting features.
+If the AMSPPT preprint style has been included in the format, then a new
+format file is in order. (We recommend using the name \filnam{amsppt.fmt}
+for a format file with AMSPPT preloaded so that there is no question which
+is present; see below.)
+
+Creating a format file (also known as ``initialization'') requires a
+special version of \TeX, a particular switch, or item in a menu.
+Read the documentation for your \TeX{} distribution to learn how to
+create a format file.
+
+Before creating your format file, you will want to consider whether you
+habitually use the AMSPPT document style. If you use other document styles
+rarely or never, then you would benefit from the use of a format file with
+\filnam{amsppt.sty} preloaded. If you are likely to use other document styles
+periodically, then you probably do not want to preload \filnam{amsppt.sty}.
+To make a simple \AmSTeX{} format file, proceed with the next paragraph.
+To make a format file with \filnam{amsppt.sty} preloaded, edit the file
+\filnam{amstex.ini} and remove the percent sign (comment character) at the
+beginning of the line {\tt\char`\%}\cs{documentstyle\{amsppt\}}, just before
+the \cs{dump} command. Save this file with the name \filnam{amsppt.ini}.
+
+If you intend to use Type~1 outline versions of AMSFonts, read Appendix~C
+before proceeding. Users of \Textures{} will have to comment out one more
+\cs{input} statement; read the instructions.
+
+Update the file name database (if one is used) so that \TeX{} will be able
+to find \filnam{amstex.ini} (or \filnam{amsppt.ini}) and the other files.
+This may be done by a command such as {\tt texhash} or via a menu option.
+Consult the documentation for your \TeX{} distribution for instructions
+on how to perform this update.
+
+Now run the ``initialization'' version of \TeX{} on \filnam{amstex.ini}
+(or \filnam{amsppt.ini}). This will create an \AmSTeX{} format file named
+\filnam{amstex.fmt} (or \filnam{amsppt.fmt}). Some implementations of
+\TeX{} will automatically place the format file in the proper directory;
+otherwise you should move this file manually into the \TeX{} formats
+directory. Once again update the file name database to make the format
+file visible to \TeX{}.
+
+
+\subhead B.5. Using \AmSTeX{} 2.0+\endsubhead
+
+With some \TeX{} implementations, a format file can be specified by preceding
+its name with an ampersand:
+
+\usertype{tex \&amstex filename}
+
+Other implementations treat the name of the format file as a command:
+
+\usertype{amstex filename}
+
+Still other implementations allow the installation of this name as a
+menu option. For details of how to use format files with your
+implementation of \TeX{}, see your documentation.
+
+
+\subhead B.5. Getting a printed copy of the User's Guide \endsubhead
+
+The \AmSTeX{} User's Guide can be obtained as a PDF file from the AMS
+web site. It is also included in the distribution as a PostScript file,
+ready to print (\filnam{amsguide.ps}). Or, you can use your newly
+created \AmSTeX{} or AMSPPT format file to typeset the file
+\filnam{amsguide.tex}; even if you print out this guide from another
+source, we recommend using the file \filnam{amsguide.tex} as a test
+to make sure that your newly installed \AmSTeX{} is working properly.
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\newpage
+\csname firstpage\string @true\endcsname
+
+\head Appendix C\\ Before Installing \AmSTeX: Facts About Fonts\endhead
+
+\subhead C.1. Using AMSFonts in PostScript Type~1 Form\endsubhead
+
+The AMSFonts Version~2.2 have been converted to PostScript Type~1 outlines
+in two forms:
+
+The AMS web site ({\tt www.ams.org/tex/type1-fonts.html}) holds the
+canonical distribution. This is a collection containing all the
+typefaces, but only in 5, 7, and 10 point sizes; other sizes must be created
+by scaling. The \AmSTeX{} preprint style provides a way for authors to
+indicate that fonts should be loaded under this alternative scaling
+convention. If you are using this version of AMSFonts, insert the line
+\cs{PSAMSFonts} in the preamble of your file, before the \cs{topmatter}
+line; see section C.3, below, for instructions on making this your local
+default.
+
+Basil Malyshev has created a collection, called BaKoMa, containing the
+Computer Modern fonts as well as all sizes of the AMSFonts used in
+mathematics, but excluding the \filnam{wncy*} cyrillic fonts. The BaKoMa
+fonts can be used with no special action; however, for papers or monographs
+to be published by the AMS, \cs{PSAMSFonts} should be specified.
+
+
+\subhead C.2. Using AMS Symbol Fonts\endsubhead
+
+The preprint style automatically loads the Fraktur font (\filnam{eufm}) and
+both fonts of extra symbols (\filnam{msam} and \filnam{msbm}), as well as
+all the symbol names, as described in the sections {\bf Fonts} and
+{\bf Symbol Names}. If these will not be used, and you want a version of
+\filnam{amsppt.sty} that requires less memory than the default version, you
+can suppress the loading of these resources. If \filnam{amsppt.sty} is to
+be included in your format file, you must make this change before creating
+the format file. See the next section for instructions.
+
+\subhead C.3 Setting Local Default Options\endsubhead
+
+An ``initialization file'', \filnam{amsppt.sti}, contains settings for
+some options that a user may wish to change locally. This file is read
+in automatically by \filnam{amsppt.sty}.
+
+Two lines in \filnam{amsppt.sti} affect the inclusion of AMS symbol fonts:
+\beginexample{}
+\\loadeufm \\loadmsam \\loadmsbm
+\\message\{symbol names\}\\UseAMSsymbols\\message\{,\}
+\endexample
+\noindent
+To use \filnam{amsppt.sty} without AMSFonts, comment out both lines (place
+a {\tt\char`\%} at the beginning of each line); to disable just the symbol
+names, comment out the second line. In either case, remove the {\tt\char`\%}
+sign from the beginning of the line
+\beginexample{}
+\%\\define\\square\{\\vrule width.6em height.5em depth.1em\\relax\}
+\endexample
+\noindent
+This is required for using \cs{qed} to indicate end of proof.
+Extra math symbols can be loaded on demand with \cs{newsymbol} or by
+including \cs{UseAMSsymbols} in the preamble of a particular document.
+
+In order to make the Type~1 versions of the AMSFonts as distributed from
+the AMS web site your local default, activate the line
+\beginexample{}
+\%\\PSAMSFonts
+\endexample
+\noindent
+by removing the {\tt\char`\%} sign from the beginning of the line.
+
+
+\BYE % This is = \relax if this file is input by amsguide.tex
+%% \CharacterTable
+%% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
+%% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
+%% Digits \0\1\2\3\4\5\6\7\8\9
+%% Exclamation \! Double quote \" Hash (number) \#
+%% Dollar \$ Percent \% Ampersand \&
+%% Acute accent \' Left paren \( Right paren \)
+%% Asterisk \* Plus \+ Comma \,
+%% Minus \- Point \. Solidus \/
+%% Colon \: Semicolon \; Less than \<
+%% Equals \= Greater than \> Question mark \?
+%% Commercial at \@ Left bracket \[ Backslash \\
+%% Right bracket \] Circumflex \^ Underscore \_
+%% Grave accent \` Left brace \{ Vertical bar \|
+%% Right brace \} Tilde \~}
diff --git a/macros/amstex/doc/joyerr2.tex b/macros/amstex/doc/joyerr2.tex
new file mode 100644
index 0000000000..8e1881980a
--- /dev/null
+++ b/macros/amstex/doc/joyerr2.tex
@@ -0,0 +1,319 @@
+%% @texfile{
+%% filename = "joyerr2.tex",
+%% version = "1.01",
+%% date = "2001/08/05",
+%% time = "17:03:46 EDT",
+%% checksum = "04000 319 1132 9628",
+%% author = "American Mathematical Society",
+%% filetype = "AMS-TeX: user documentation",
+%% copyright = "Copyright 2000 American Mathematical Society,
+%% all rights reserved. Copying of this file is
+%% authorized only if either:
+%% (1) you make absolutely no changes to your copy
+%% including name; OR
+%% (2) if you do make changes, you first rename it to some
+%% other name.",
+%% address = "American Mathematical Society,
+%% Technical Support,
+%% Electronic Products and Services,
+%% P. O. Box 6248,
+%% Providence, RI 02940,
+%% USA",
+%% telephone = "401-455-4080 or (in the USA and Canada)
+%% 800-321-4AMS (321-4267)",
+%% FAX = "401-331-3842",
+%% email = "tech-support@ams.org (Internet)",
+%% codetable = "ISO/ASCII",
+%% keywords = "amstex, ams-tex, tex",
+%% abstract = "This file contains errata to The Joy of TeX,
+%% second edition, 1990. It must be run with AMSTEX
+%% and AMSPPT 2.0+; it is incompatible with previous
+%% versions. It also requires the file amssym.tex and
+%% the fonts msam10 and msbm10.",
+%% docstring = "The checksum field above contains a CRC-16 checksum
+%% as the first value, followed by the equivalent of
+%% the standard UNIX wc (word count) utility output of
+%% lines, words, and characters. This is produced by
+%% Robert Solovay's checksum utility.",
+%% }
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\input amstex
+\documentstyle{amsppt}
+
+\define\lastupdate{5 August 2001}
+
+\pagewidth{29pc}
+\raggedbottom
+\tenpoint
+
+% \ninepoint required for diversions; sidetrip symbol not available.
+% Substitute 7pt for \scriptfont, usually 6pt; not really needed
+\catcode`\@=11
+\font@\ninerm=cmr10 at 9pt
+\font@\ninei=cmmi10 at 9pt
+\font@\ninesy=cmsy10 at 9pt
+\font@\nineit=cmti10 at 9pt
+\font@\ninesl=cmsl10 at 9pt
+\font@\ninebf=cmbx10 at 9pt
+\font@\ninett=cmtt10 at 9pt
+\def\ninepoint{\normalbaselineskip12pt
+ \def\rm{\fam0\ninerm}%
+ \def\it{\fam\itfam\nineit}%
+ \def\sl{\fam\slfam\ninesl}%
+ \def\bf{\fam\bffam\ninebf}%
+ \def\tt{\ninett}%
+ \def\smc{\tensmc}%
+ \textfont0=\ninerm \scriptfont0=\sevenrm \scriptscriptfont0=\fiverm
+ \textfont1=\ninei \scriptfont1=\seveni \scriptscriptfont1=\fivei
+ \textfont2=\ninesy \scriptfont2=\sevensy \scriptscriptfont2=\fivesy
+ \textfont3=\tenex \scriptfont3=\tenex \scriptscriptfont3=\tenex
+ \textfont\itfam=\nineit
+ \textfont\slfam=\ninesl
+ \textfont\bffam=\ninebf \scriptfont\bffam=\sevenbf
+ \scriptscriptfont\bffam=\fivebf
+ \tt\ttglue=.45em minus .135em
+ \setbox\strutbox=\hbox{\vrule height8pt depth3pt width0pt}%
+ \normalbaselines\rm}
+
+\def\JoT{{\sl The Joy of \TeX}}
+
+% Support verbatim listing of TeX source, as defined in TeXbook, p. 421;
+% lifted from MANMAC.TEX, and modified slightly for narrower columns.
+\catcode`\@=11
+
+\chardef\other=12
+\def\ttverbatim{\begingroup \catcode`\\=\other
+ \catcode`\{=\other \catcode`\}=\other \catcode`\$=\other
+ \catcode`\&=\other \catcode`\#=\other \catcode`\%=\other
+ \catcode`\~=\other \catcode`\_=\other \catcode`\^=\other
+ \catcode`\"=\other
+ \obeyspaces \obeylines \hyphenpenalty=10000 \tt}
+
+\newskip\ttglue
+{\tenpoint\tt \global\ttglue=.5em plus .25em minus .15em}
+% this should be installed in each font
+
+% From David Eppstein's ``Trees'' paper (TUGboat 6#1), preserve initial
+% spaces.
+{\obeyspaces\gdef {\ifvmode\indent\fi\space}}
+
+% Permissible overhang beyond right margin.
+\newdimen\ttrightskip
+\ttrightskip=5pc
+
+% Although | is ordinarily an escape character within verbatim mode,
+% provide a method for letting it instead be the character itself
+% within a display verbatim listing, as needed; this is based on
+% a technique developed by Michael Ferguson. Note that within one
+% \begintt...\endtt block, | can be only one of:
+% the printing | character, or
+% active (the escape character)
+% It cannot perform both functions at the same time.
+\newif\ifttVertChar \ttVertCharfalse
+{\catcode`\|=\active \gdef\VertChar{\def|{\char"7C }}}
+
+% Other non-tt elements that may be embedded within \begintt...\endtt .
+\def\MTH{$}
+\def\sb{_}
+\def\sp{^}
+\def\SP{{\tt\char"20 }} % "visible" space
+\chardef\bs=`\\
+\def\vrt{{\tt\char`\|}}
+
+\catcode`\|=\active
+{\obeylines \gdef\activatettbar{\global\catcode`\|=\active %
+ \gdef|{\ttverbatim \spaceskip\ttglue \xspaceskip\ttglue %
+ \let^^M=\ \let|=\endgroup}}}
+\activatettbar
+
+\catcode`\@=13
+
+\def\ttindent{\noindent\kern3\parindent\hangindent3\parindent}
+
+% This definition is stolen from the file of TeXbook errata.
+\def\bugonpage#1(#2) \par{\bigbreak\tenpoint
+ \hrule width\hsize
+ \line{\lower3.5pt\vbox to13pt{}Page #1\hfil(#2)}\hrule width\hsize
+ \nobreak\medskip}
+
+% Some definitions for setting particular Joy notation.
+\def\CR{$\langle$carriage-return$\rangle$}
+\def\tab{{\smc tab}}
+
+\NoBlackBoxes
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\topmatter
+\title Errata to \JoT, second edition,\linebreak
+ for \AmSTeX{} 2.0\endtitle
+\leftheadtext{Errata to \JoT, second edition, for \AmSTeX{} 2.0}
+\rightheadtext{Errata to \JoT, second edition, for \AmSTeX{} 2.0}
+\endtopmatter
+
+\document
+
+\noindent
+This list of corrections to \JoT, second edition, 1990, includes all known
+corrections to that edition. Corrections for the previous edition, which
+preceded the release of \AmSTeX{} Version 2.0, can be found in the file
+|joterr.tex|.
+
+The printing date of each copy of \JoT\ is identified on the reverse
+of the title page. No corrections have been made in any reprint of
+\JoT, second edition, since the initial printing in 1990.
+
+\smallskip
+(This errata list was last updated \lastupdate.)
+
+
+\bugonpage xviii, line 16 (1997/06/07)
+
+\noindent
+[{\sl change $d0$ at end of line to $d\theta$.}]
+
+\bugonpage xx, line 14 (1997/06/07)
+
+\noindent
+[{\sl change $d0$ at end of line to $d\theta$.}]
+
+\bugonpage 19, lines $-9$ to $-7$ (1997/06/07)
+
+\begingroup
+\hsize27.5pc
+\leftskip1.5pc
+\noindent
+sensation, particularly the material that he has expounded on pages\linebreak
+22--23. Including this material cost an extra \$1000, but it did make
+\P\P\linebreak
+1 and 2 quite popular
+\endgroup
+
+\bugonpage 23, lines 24--26 (1997/06/07)
+
+\begingroup
+\hsize=30.15pc
+\BlackBoxes
+\indent The head of the department, our university's own I. M. Stable,
+ attributes Treemu\-nch's recent aberrant behavior to the much-publicized
+ ``research'' for his paper; notwithstanding, others say that Treemunch's
+ name isn't on the computers' databases,
+\par
+\endgroup
+
+\bugonpage 24, line 17 (1997/06/07)
+
+\noindent\kern1.5pc
+\line{notwithstanding, others say that Treemunch's name isn't on
+ the computers'}
+
+\bugonpage 24, line $-13$ (1997/06/07)
+
+\ttindent
+|the computers'\linebreak databases ...|
+
+\bugonpage 33, line 9 (1997/06/07)
+
+\line{\indent Ties are often preferable to |\.|\ after abbreviations.
+For example, it is best}
+
+\bugonpage 97, lines 7--8 (1997/06/07)
+
+\noindent
+some other kind of tag. Some journals place these tags to the left of
+the formula:
+
+\bugonpage 129, line 13 (1997/06/07)
+
+\noindent\kern-1.5pc
+{\bf ACCENTS IN MATH MODE}
+
+\bugonpage 137, line 12 (1997/06/07)
+
+\noindent\kern-1.5pc
+{\bf ARROWS}
+
+\bugonpage 163, line 16 (1997/06/07)
+
+\noindent\kern-1.5pc
+{\bf GREEK LETTERS}
+
+\bugonpage 163, line 21 (1997/06/07)
+
+\noindent\kern-1.5pc
+{\bf HORIZONTAL BRACES}
+
+\bugonpage 175, line $-13$ (1997/06/07)
+
+\noindent
+|amsppt| style, you still must type |\loadmsam| and |\loadmsbm| but you can
+
+\bugonpage 182, line 20 (1997/06/07)
+
+\noindent\kern-1.5pc
+{\bf RUNNING HEADS}
+
+\bugonpage 183, lines $-3$ to $-2$ (1997/06/07)
+
+\noindent
+the |\bigl| and |\bigr| for the delimiters (see {\bf big and bigg})
+should be accompanied by a |\bigm|{\tt\char`\|} for the $\vert$:
+
+\bugonpage 194, lines $-4$ to $-3$ (1997/06/07)
+
+\begingroup
+\NoBlackBoxes
+\ninepoint
+\leftskip18pt
+\noindent
+\AmSTeX\ also takes care to disregard extraneous spaces in constructions
+like \hbox{|\author|} and |\title|. Although we typed\par
+\endgroup
+
+\bugonpage 201, line $-11$ (1997/06/07)
+
+\noindent
+\line{tuation, the |amsppt| preprint style provides a command |\rom| to
+be applied}
+
+\bugonpage 244, lines $-3$ to $-1$ (1997/06/07)
+
+\noindent
+When you leave out the |&|, \TeX\ simply inserts a blank for the right
+hand part of the second formula, so the whole second formula was treated
+as the left hand part, with the right hand part being blank.
+
+\bugonpage 291, column 2 (1999/01/07)
+
+Add entry\newline
+empty delimiter (|\left.|, |\right.|), 85, 144
+
+\bugonpage 293, column 2, index entry ``formulas'' (1996/11/23)
+
+Add second level entry\newline
+\indent{\it see also\/} tags
+
+\bugonpage 298, column 1 (1997/06/07)
+
+\noindent
+margin gap in |\multline|, 175
+
+\bugonpage 298, column 1, index entry ``math formulas'' (1997/06/07)
+
+Add second level entry\newline
+\indent|\tag|, 97
+
+\bugonpage 293, column 2, index entry ``numbers'' (1996/11/23)
+
+Add second level entry\newline
+\indent{\it see also\/} tags
+
+\bugonpage 300, column 1, index entry ``operators'' (1997/06/07)
+
+\indent space around, 43--44, 164-165, 224
+
+\bugonpage 303, column 1, index entry ``relations'' (1997/06/07)
+
+\indent space around, 43--44, 137, 165
+
+\enddocument