Please take this question for a moot point:

I'd like to know about edge cases where different tokens which TeX might encounter during expansion without delivering error-messages have the same meaning and the same \string-representation.

By "have the same meaning" I mean that

\ifx⟨token 1⟩⟨token 2⟩\expandafter\firstoftwo\else\expandafter\secondoftwo\fi
yields \firstoftwo.

By "same \string-representation" I mean that \string⟨token 1⟩ yields the same set of tokens as \string⟨token 2⟩.

Edge cases I came up with so far:

  • frozen-\relax and \relax-primitive.
  • the nameless control-sequence (producible via \csname\endcsname or via an escape-character (backslash) at the end of a line of .tex-input while \endlinechar has a negative value) and the control-sequence whose name is csname⟨escapechar⟩endcsname (producible via \csname csname\string\endcsname\endcsname) while those control-sequences have the same meaning.
  • active-character-token let equal to a non-active pendant.
  • one-letter-control-sequence let equal to an explicit character token where the character-code corresponds to the character which forms the name of the control-sequence while \escapechar has a negative value.

Are there more edge cases?

E.g., what about things like \inaccessible or tokens that TeX might insert while processing an alignment? You can define \inaccessible. Can you let it equal to TeX's \inaccessible?

  • by "same meaning" do you mean "same string produced by \meaning" ? Dec 28, 2021 at 20:21
  • @DavidCarlisle By "same meaning" I mean that \ifx-comparison of the tokens yields the "true"-branch. I edited the question. Dec 28, 2021 at 21:35

1 Answer 1


Another such case are frozen font control sequences obtained by applying \the to a font command and the original font command itself. They fulfill all your criteria:

% Let's assume that we loaded a font at some point:
\font\cmr cmr10
% Then we can get a second token for accessing the font using \the
% Compare their \string representations:
  They have the same \texttt{\string\string} representation.
  They have different \texttt{\string\string} representation.

  They have the same meaning.
  They have different meaning.

% Now in case some people question that they are actually different, let's change the meaning of one of them and compare again.
  They are identical.
  They are different tokens.

enter image description here

  • Typo in \ifx\helpI\helpII? The true text is the same as the false text.
    – egreg
    Dec 28, 2021 at 22:41
  • @egreg You're of course right. Thanks! Dec 29, 2021 at 12:50

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .