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.
\end…), but what I hope is solved in LaTeX3 is the hability to have\quote{…}and\begin{quote} … \end{quote}by default without further tricks, with a different namespace. – Manuel Sep 05 '14 at 15:38\@qend& co.) that certainly indicate that yes, LaTeX does prevent the creation of those macros. By the way, the “plainer” TeX\def\end…doesn't complain in LaTeX either :) – Manuel Sep 05 '14 at 15:45\def\end...way already. I should have looked intolatex.ltxof course ;-) I will add your comment as further information. – Sep 05 '14 at 15:47\def\end…doesn't cause complaints in LaTeX is because LaTeX doesn't 'see' it—since it, by design, doesn't interfere with TeX primitives, preferring instead to build new mechanisms like\newcommandatop them. (I think that this is universally true, but let me toss in a 'usually' there to make sure.) – LSpice Sep 06 '14 at 07:14