I have been using \newcommand and \renewcommand for defining simple commands like the typical
\newcommand{\R}{\mathbb{R}}
But now I wonder if I can renew other types of commands. What I want to do is to create a simple command like
\env
to substitute longer commands like
\begin{my environment}
(And for example \eenv for \end{my environment})
>you should use code sample (highlight code and hit Ctrl+k or the button that looks like { }, alternatively you can add four spaces at the start of each line). Yes you can do this. It's generally not considered a good idea, the environment structure is there for code readability and trouble shooting and these abbreviations are known to break when used foralignhttp://tex.stackexchange.com/questions/100138/what-is-wrong-with-defining-bal-as-beginalign. It'd be much better to get a good editor that can automate this – Au101 Feb 23 '16 at 20:44\end.., but whether it'll work is something altogether different. While using\env...\eenvmay work in general, there are some instances where it won't. Those instances depend on whether TeX is expecting an explicit\end{env}form or not. This is typically the case withverbatim, andlistings, andfilecontents, andalign, and there could be others. – Werner Feb 23 '16 at 21:05tabat the start of the line to a fullfigureenvironment --- which is handier than defining a command. In general, use a command only to define a logical higher level command, not to save typing --- that last is a task for your editor, – Rmano Feb 23 '16 at 22:15