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!

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.

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.