I read a lot of stuff about \relax for 2 days but can't handle the following problem.
Why \romanNumber has no problem but \romanNumberX does not work? \relax
must stop \romannumeral and not \csname. Please correct my vision about TeX.
\documentclass{article}
\newcommand{\romanNumber}[1]{\romannumeral #1}
\newcommand{\romanNumberX}[1]{\romannumeral #1\relax}
\begin{document}
\expandafter\def\csname name\romanNumber{2}\endcsname{Must do!\\}
\nameii%OK, no problem here
%The following line generate error "missing \endcsname"
\expandafter\def\csname nameX\romanNumberX{2}\endcsname{Also must do!\\}%
\nameXii%Does not work, :(
\end{document}
Thanks a lot!
\csnameand\endcsnameshould expand into characters. – campa Aug 18 '16 at 11:22