parse: @ is a letter inside a control word - #8
Merged
Conversation
TeX reads a control word as a run of category-11 letters, and LaTeX makes @ a letter in package and class code (\makeatletter). So \the@inst and \@ifundefined are ONE control sequence each. This tokeniser read control words as ASCII letters only, so \the@inst came apart into \the and @inst — and the error said "unknown command \the", which no caller's macro table has. \the@inst, which the document defines, is one it would have found. That matters because the error string is the caller's only handle: go-tex/engine takes the name out of it and looks it up. 68 formulas over 6 of the 200 papers in its arXiv corpus are lost this way, all of them a class's own \the@inst. A caller writes every control sequence with a trailing space — that is what this package's own source strings do — so a name never bleeds into what follows: "\@ x" stays \@ then x. \@ alone, and every control SYMBOL, is unchanged. It also makes \z@ one word, which readArgText had been reassembling by hand for \genfrac's thickness; that special case goes.
This was referenced Aug 31, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
TeX reads a control word as a run of category-11 letters, and LaTeX makes
@a letter in package and class code (\makeatletter). So\the@instand\@ifundefinedare one control sequence each.This tokeniser read control words as ASCII letters only, so
\the@instcame apart into\theand@inst— and the error saidunknown command \the, which no caller's macro table has.\the@inst, which the document itself defines, is one it would have found.That matters because the error string is the caller's only handle: go-tex/engine takes the name out of it and looks it up on its retry path. 68 formulas over 6 of the 200 papers in its arXiv corpus are lost this way, all of them a class's own
\the@inst.A caller writes every control sequence with a trailing space — that is what this package's own source strings do — so a name never bleeds into what follows:
\@ xstays\@thenx.\@alone, and every control symbol, is unchanged.It also makes
\z@one word, whichreadArgTexthad been reassembling by hand for\genfrac's thickness (#7); that special case goes.Test
atletter_test.go:\the@inst,\@ifundefined,\@@affmarkmust each tokenise as one control sequence,\@ xmust not swallow the x,\alphaand\{must be untouched — and the renderer must report an unknown command by its whole name, since that string is what the caller resolves.