Technical notes on AMS-L^{A}TEX version 1.2

American Mathematical Society Michael Downes

December 1994

1 Introduction

These notes are miscellaneous remarks on some technical questions that arose during the work on version 1.2 of AMS-L^{A}TEX. We expect to add more sections as further questions arise.

2 Why can’t I use abbreviations for the equation environment?

Many users have discovered to their dismay that when switching from ordinary L^{A}TEX to the amsmath package, they are no longer able to use abbreviations

such as \beq \eeq for \begin{equation} \end{equation}. This has to do

with unfortunately nontrivial technical complications: the environments such as align must read their contents as a delimited macro argument because they do multipass processing of the contents using algorithms inherited from Spivak’s amstex.tex. The obvious solution—substitution of different algorithms that do box shuffling instead of token shuffling for the multipass calculations—would require rewriting these display environments from the ground up; while that is a worthy goal, it was beyond the original scope of the AMS-L^{A}TEX project. Some progress has in fact been made on such a solution [time of writing: January 1995], but not yet to the point of being ready for release.

3 The upref package

The reason for splitting out the upref package instead of automatically incorporating it in the amsart and amsbook classes is this: It involves low-level surgery on an important L^{A}TEX command. This means that if ever this command changes in the future (as it did between versions 2.09 and 2e of L^{A}TEX) we have a maintenance problem. And the benefit that upref provides is something that most users don’t care much about. It can be used for in-house AMS production but it need not be inflicted on all users. Instead we leave the choice to the individual user.

4 The amsintx package

The amsintx package is still in the experimental stage. The variety of notation for integrals and sums is so great it’s difficult to pick one’s way through all the complications.

5 Deprecated and disallowed commands

Certain commands were moved out of amstex into amsxtra because they seemed to be little-used relics: \accentedsymbol, ‘sup accents’ (\sptilde, \sphat, etc.). The primitive commands \over, \atop, \above were disallowed by the amsmath package when it superseded amstex (see below).

6 Hyphenation in the documentation

Hyphenation was allowed for certain long command names in amsldoc.tex; this presented technical difficulties because L^{A}TEX normally deactivates hyphenation for tt fonts. The method chosen to reinstate hyphenation was to turn off the encoding-specific function \OT1+cmtt that disables the \hyphenchar for tt fonts; see the definition of \allowtthyphens in amsdtx.dtx. Then a list of all tt words in the document was gathered (from the .idx file, produced by the \cn, \fn, \pkg, etc. commands) and \showhyphens was applied to this list. The result was another list in the resulting TEX log, containing those words in a form suitable for the argument of \hyphenation. That list was then edited by hand to overrule undesirable hyphenations; words with acceptable hyphenations were dropped from the list, as they don’t need to be repeated there.

7 Why did \matrix, \pmatrix, and \cases stop working when I added the amsmath package?

If you used the plain.tex versions of \matrix, \pmatrix, or \cases in a document and then later converted the document to use the amsmath package (or one of the AMS documentclasses, which automatically call the amsmath package internally), the instances of those commands will produce error messages. The problem is that when L^{A}TEX was originally created, it adopted most of its mathematics features straight from plain.tex. But in the case of \matrix, \pmatrix, \cases this was a mistake—the plain.tex syntax for them is decidedly non-L^{A}TEX in style, for example the fact that they use \cr instead of \\ to mark line breaks, and they don’t use \begin and \end. In basic L^{A}TEX this mistake will be perpetuated at least until L^{A}TEX3 appears, in order to avoid breaking existing documents. But no existing documents that were written with the amsmath package have that syntactic problem, as amsmath provides proper L^{A}TEX-syntax versions of \matrix and the others. The possibility of optionally allowing the plain.tex variants to make document conversion easier seems ill-advised since those variants are so blatantly wrong in a L^{A}TEX context.

8 Why did \over, \atop, \above [… withdelims] stop working when I added the amsmath package?

The six generalized fraction commands \over, \overwithdelims, \atop,

\atopwithdelims, \above, \abovewithdelims are expressly forbidden by the

amsmath package; use of the recommended forms \frac (and variants) is now required, instead of merely recommended. (I tend to construe L^{A}TEX’s provision of \frac, and the lack of any mention in the L^{A}TEX book of the primitive fraction commands, as an implicit injunction against their use, although I don’t think Lamport actually spent a lot of time pondering the issue, and the basic L^{A}TEX version of \frac provides access only to \over, not to \atop, \above, or the

withdelims variants.)

Not only is the unusual syntax of the TEX primitives rather out of place in L^{A}TEX, but furthermore that syntax seems to be responsible for one of the most significant flaws in TEX’s mathematical typesetting capabilities: the fact that the current mathstyle at any given point in a math formula cannot be determined until the end of the formula, because of the possibility that a following generalized fraction command will change the mathstyle of the preceding material. To cite two of the worst side effects: \mathchoice must actually typeset all four of its arguments, instead of being able to immediately select only one; and, were it possible to always know the current math style at a given point, math font selection would be greatly simplified and the upper limit of 16 different math font \fams would never be a problem as \text,script[script]font assignments for any \fam could take immediate effect and therefore could be changed arbitrarily often within a single formula. More concretely, math font selection difficulties are responsible for many of the more convoluted passages in the source code of L^{A}TEX’s NFSS (that does font loading on demand) and of the amsmath package, and by extension it has historically been responsible for significant delays in making new features available to end users and for making those features more prone to bugs.

There are additional bad consequences following from the syntax of those generalized fraction commands that only become evident when you do some writing of nontrivial macros for math use. For example, as things currently stand you cannot measure the size of any object in math without going through \mathchoice and leaving and reentering math mode via \hbox{$ (which then introduces complications regarding \everymath and \mathsurround). And it seems that uncertainty about the current mathstyle is the only barrier to allowing the use of mu units with \vrule, to make vertical struts in constructing compound symbols or notation. And so on and so forth.