I have found a code to make typing equations in LaTeX in a simpler and faster way. Instead of typing
\begin{equation}
\end{equation}
I can now type
\be
\ee
It works great and I am happy with it. The code, found in this document (p. 13), is
\makeatletter
\newcommand{\be}{\begingroup
\setlength{\arraycolsep}{2pt}
\eqnarray%
\@ifstar{\nonumber}{}%
}
\newcommand{\ee}{\endeqnarray\endgroup}
\makeatother
My problem is that I use emacs, and it doesn't recognise those math delimiters and hence it doesn't give the face the proper math colour. I have tried to customise this by using the command M-x customize-apropos
to try and find something I could use, but the closest I got were the variables
'font-latex-math-environments'
, which I don't think is what I am after since from what I can see I can only type the name of the command which goes inside the curly brackets in\begin{}
and\end{}
'font-latex-make-built-in-keywords'
, which would require more knowledge from me than I have, and I don't even know whether it would work.
What I would like to know, thus, is how to set up Emacs so that whenever I used the pair \be
and \ee
it would give the face the same colour as I set up for math. I imagine this would require an emacs lisp code, which would be great so I could modify it to include other things if so I wished.
Can anyone help me getting this done?