About \def\b*{\begin{align*}}
The technote
document explains why this kind of shorthand definitions will fail:
6 Why can’t I use abbreviations for
\begin{align} ... \end{align}
?Authors often like to use abbreviations such as
\beq
\eeq
for\begin{equation}
\end{equation}
. For some environments defined by theamsmath
package, such asalign
,gather
,multline
, and others of the same general type, this does not work: An attempt to define\bal
\eal
as shorthand for\begin{align}
\end{align}
will fail with a puzzling error message. This has to do with unfortunately nontrivial technical complications: the given environments must read their contents as a delimited macro argument because they do multipass processing of the contents using algorithms inherited from Spivak’samstex.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-LaTeX project. Work is under way on an auxiliary package calledbreqn
that addresses not only this problem but a number of others; at the time of this writing, however [September 1999] it has only progressed as far as a beta release.Some workarounds:
\def\bal#1\eal{\begin{align}#1\end{align}}
- Define
\newcommand{\env}[2]{\begin{#1}#2\end{#1}}
and then use\env{align}{...}
The restriction of the AMS alignments that they may not be hidden behind command forms is documented on page 28 of the amsmath guide (texdoc amsmath
) Actually the restriction is better described in the technical notes (texdoc technote
) as shown in the other answer.
The names chosen here are particularly dangerous as using \def
you lose the warning that you would have had from the correct LaTeX syntax \newcommand
that you were over-writing the standard accent command \b
.