2

On p.46 of TeXbook it is said \csname\endcsname is the same as empty (aka null) control sequence.

But why they are printed differently by \show? Compare

\endlinechar=-1
\def\
{a}
\def\x{\
}
\show\x

versus

\endlinechar=-1
\def\
{a}
\def\x{\csname\endcsname}
\show\x

What are the rules here and which case deviates from them?

6

The rule you quote means that these two \show are showing the same csname token

\expandafter\show\csname\endcsname

\endlinechar=-1

\show\

\bye

In your case you are not showing the token with empty name but two different definitions of \x in the first case the replacement text of \x is the single csname with empty name, which \show shows as \csname\endcsname but the second definition has replacement text the two tokens \csname and \endcsname these have not been executed so as usual \show shows a space after both the names \csname \endcsname

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.