0

Why do these newcommands result in error when used?

\newcommand{\bal}{\begin{align*}}
\newcommand{\nal}{\end{align*}}
LaRiFaRi
  • 43,807
Minimus Heximus
  • 715
  • 6
  • 19
  • Welcome to TeX.SX! Could you please provide a complete compilable example, which we can copy and test? Thank you! – LaRiFaRi Nov 03 '14 at 14:20

1 Answers1

2

Here is some code which does exactly what you want. As you can read in the answers of the dupe question, this is not really good advice. There is very little gain in obfuscating your code like this. You just safe very few key-strokes which are not even needed when using a good TeX editor. Btw., like this you would have to define new macros for the other align environment... so why invent the wheel a second time?

% arara: pdflatex

\documentclass{article}
\usepackage{mathtools}
\def\bal#1\nal{\begin{align*}#1\end{align*}}

\begin{document}
 \bal
 a&=c\\
 b&=d
 \nal
\end{document}

enter image description here

LaRiFaRi
  • 43,807