Given:
\documentclass{minimal}
\newcommand{\emrule}[1]{\rule[4pt]{#1em}{0.2pt}}
\newcommand{\endash}{\emrule{.5}}
\begin{document}
2000\endash2013
\end{document}
I get:
! LaTeX Error: Command \endash already defined.
Or name \end... illegal, see p.192 of the manual.
See the LaTeX manual or LaTeX Companion for explanation.
Type H <return> for immediate help.
...
l.3 \newcommand{\endash}{\emrule{.5}}
?
So my first question is what manual---see p.192 of the manual.
?
Through experimentation I believe that what is going on here is a name clash. The processor sees \end
and hits the brake with an attendent error message. For instance \EMdash
and \enrule
both work without error. Since I lack sufficient macro-foo, could someone with greater knowledge than I please clarify? BTW if I comment out the definition of \endash
it fails with a message about \endash
not defined:
! Undefined control sequence.
l.5 2000\endash
2013
?
Which leads me back to my contention that this is a name clash with just \end
.
\HSEndash
,\HSEmdash
,\HSMyMacro
, etc.\EMdash
or for that matterENdash
both work. I'm not looking for a fix, just an explanation, thanks though.