0

When I use \def to redefine \end{split}, there is an error.

\documentclass{article}
\usepackage{amsmath}

\begin{document}
\def\be{\begin{equation}}
\def\ee{\end{equation}}
\def\bs{\begin{split}}
\def\es{\end{split}}

\be
    \bs
        a\\
        b
    \es
\ee

\end{document}

The error is:

Runaway argument?

a\ b \es \ee

! Paragraph ended before \split was complete.

However, if I don't use \def\es{\end{split}} and just modify the code to be

\documentclass{article}
\usepackage{amsmath}

\begin{document}
\def\be{\begin{equation}}
\def\ee{\end{equation}}
\def\bs{\begin{split}}
\def\es{\end{split}}

\be
    \bs
        a\\
        b
    \end{split}
\ee

\end{document}

it's OK. What's the problem? Thank you!

0

1 Answer 1

3

Welcome to TeX-SE! The issue is the same as here: LaTeX wants to see an explicit \end{split}. So you could use

\documentclass{article}
\usepackage{amsmath}

\begin{document}
\def\be{\begin{equation}}
\def\ee{\end{equation}}
\def\bs#1\es{\begin{split}#1\end{split}}


\be
    \bs
        a\\
        b
    \es
\ee

\end{document}

So far for the LaTeXnical aspects of your question.

However, I would like to convince you not to use these abbreviations. At the very moment you collaborate with others, this will be extremely cumbersome; everyone comes with their own abbreviations. And in this millennium there is also no need for that, every editor has shortcuts.

1
  • 6
    +1 for the last three lines!
    – user156344
    Commented Feb 24, 2019 at 3:35

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .