[tex-k] \showthe followed with undefined control sequence misbehaves

Karl Berry karl at freefriends.org
Thu Jul 18 20:02:50 CEST 2024


    The "You can't use `\let' after \the" looks like unexpected behavior
    to me.

It seems natural enough to me. Since \foo is undefined, that token is
effectively skipped. So the \showthe, more or less implemented like
\show\the, is still active, and the next token it sees is the \let.

I suspect other such instances could be constructed, since \the error
messages don't try to figure out if they are coming from a \showthe.
I'll ask the others, but I can't imagine Knuth making any changes in
this regard now.

    On a more minor note, shouldn't it be "`\the'" not "\the" ;-) ?

It does look odd that one control sequence is quoted and the other
isn't, but I think it makes a sort of sense: the quoted `\let' is
referring to the token, more or less as a syntactic entity (which might
not be a control sequence), while the unquoted \the is referring to the
actual primitive \the being executed.  From tex.web:

@ @<Complain that \.{\\the} can't do this; give zero result@>=
begin print_err("You can't use `"); print_cmd_chr(cur_cmd,cur_chr);
@.You can't use x after ...@>
print("' after "); print_esc("the");

Anyway, I'll ask about that too. --thanks, karl.


More information about the tex-k mailing list.