[Tex/LaTex] Renew command for \begin{equation}

environmentsequationsmacros

Since I am lazy, and I don't want to write

\begin{equation}
\end{equation}

all the time, I thought I could have renewed the command into

\renewcommand\beq{\begin{equation}}
\renewcommand\enq{\end{equation}}

but I failed.

Why? Does someone know how to do it properly?

Best Answer

While the code you showed works without problems, provided you use \newcommand rather than \renewcommand, I can't recommend doing so.

\documentclass{article}
\usepackage{amsmath}

\newcommand\beq{\begin{equation}}
\newcommand\enq{\end{equation}}

\begin{document}

\beq
a=b
\enq

\end{document}

enter image description here

Why do I recommend the fully spelled out version? There are several reasons, but here are the main ones.

  1. \begin{equation}...\end{equation} can easily become \begin{equation*}...\end{equation*} for the unnumbered version (and conversely

  2. You can look for environment nesting without distinguishing special cases

  3. The code with explicit \begin and \end tag is more prominent when skimming through the typescript

  4. Such shorthands cannot be used for align and the other amsmath display environments.

Littering a typescript with obscure markup is a bad thing. Really. Laziness can be implemented through the shortcuts provided by your text editor: every text editor provides them or, at least, a way to define new ones.

Personally, I don't even use shortcuts: typing \begin{equation} is as easy as remembering a shortcut.