0

I use the following commands for equations that extend over several lines, but only have a single label:

\begin{align} \begin{split} \label{mylabel}
...
\end{split} \end{align}

This works fine, but is a lot of typing to have to do over and over. I try to define a command:

\newcommand{\bas}[1] {\begin{align}\begin{split}\label{#1}}
\newcommand{\ea}{\end{split}\end{align}}

but it does not work. Here is the complete input:


\documentclass{article}
\usepackage{amsmath}

\newcommand{\bas}{\begin{align}\begin{split}}
\newcommand{\eas}{\end{split}\end{align}}

\begin{document}
I try

\begin{align}\begin{split}
...
\end{split}\end{align}

and it works, but 

\bas
...
\eas

does not work
\end{document}

-----------

Here is the output:

Runaway argument?
\begin {split}... \eas
! Paragraph ended before \align was complete.
<to be read again>
                   \par

l.19

Does anyone know why, of can suggest an alternative.

David Carlisle
  • 757,742
  • This is a documented restriction of the amsmath environments, you can not do that. Even for "normal" environments where such commands do seem to work it is usually better not to hide the environment syntax as it just confuses syntax checkers etc environments are a core feature of the latex syntax, it is best not to hide them. – David Carlisle Jul 16 '18 at 07:55
  • Without a link to where they have been asked before, or the answers, I am not sure how I can find them. Anyway, thanks for the information you give. (I normally rely on myself for syntax checking). – Richard Hartley Jul 17 '18 at 09:56

0 Answers0