[Tex/LaTex] Are \end…. macro names reserved in LaTeX2e


Perhaps this question has been asked before, but I could not track the correct question down.

I stumbled accidentally over this feature:

Say, I want to make a


definition and then something like an end-of-environment command


but this fails:

! LaTeX Error: Command \endsupersophisticatedmacroname already
               Or name \end... illegal, see p.192 of the manual.

I could understand the error message, if I would say \newcommand{\endtable} etc, as those names are defined of course, marking the end of environments. But I am pretty sure, that there is no such command (think of the macro name ;-)) in any sensible class.

Does LaTeX prevent definition of commands beginning with \end...?
Why? Just to make the conceptual implementation of environments easier?

Here is a non-MWE



\newcommand{\endsupersophisticatedmacroname}{World}% fails
\newcommand{\endandnowforsomethingcompletelydifferent}{World}% fails too.

Hello World



Plain TeX does not complain:





As Manuel states in his comment,


will even work in LaTeX.


There are four (!!) good answers to my question — I have thought about accepting one and I know, this means, I must 'disappoint' three other, equally highly qualified users here.

Best Answer

As others have noted, you may not define any commands starting with \end. The reason is that you may use any latex2e command as an environment (some don't like that design, but that's the way it was designed) so you can go


even though \endsmall is not normally defined.

If you were allowed to go


just if \endsmall is not defined, then you would have been allowed to redefine the small environment with no warning.