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

macros

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

\newcommand{\supersophisticatedmacroname}{Hello}

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

\endsupersophisticatedmacroname

but this fails:

! LaTeX Error: Command \endsupersophisticatedmacroname already
defined.
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

\documentclass{book}

\newcommand{\supersophisticatedmacroname}{Hello}%

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

\begin{document}%
Hello World

\supersophisticatedmacroname

\end{document}


Plain TeX does not complain:

\def\supersophisticatedmacroname{Hello}%
\def\endsupersophisticatedmacroname{World}%

\supersophisticatedmacroname

\bye


Edit

As Manuel states in his comment,

\def\endsupersophisticatedmacroname{...}


will even work in LaTeX.

Edit

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.

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

\begin{small}....\end{small}


even though \endsmall is not normally defined.

If you were allowed to go

\newcommand\endsmall{zzzz}


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