You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Parse punctuation after LaTeX control words (\sin', \mu=, \Delta=) #182
The spaced/braced forms (\Delta =, \Delta{}=) parse successfully
These failures have one tokenizer cause: LaTeXCommandDictionary.SplitCommand absorbs ' and = into the preceding control word. TeX control words end at the first non-letter, so the punctuation must be parsed as the next token. A standalone prime already parses (x'), which confirms that \sin' should be tokenized as \sin followed by '.
Two original examples are not remaining bugs:
A brace used as a \left/\right delimiter must be escaped in LaTeX. \left\{ \frac{-b}{2a} \right\} parses; \left{...\right} is invalid input.
$35.99 \%$ now parses. (Callers passing math content directly can omit the surrounding $ delimiters.)
Acceptance criteria
\sin' parses equivalently to a sine operator followed by a postfix prime.
\mu=, \Delta=, and other control words followed immediately by non-letter punctuation parse the same as their spaced equivalents.
Explicitly supported starred-command behavior is preserved or handled after normal TeX control-word tokenization.
Parser and round-trip regression tests cover apostrophe, equals, and the corrected escaped-brace form.
This is related to how commands are parsed. It is hard to know whether ' and = are part of the command name or are their own symbols after commands. More digging around LaTeX documentation is needed.
SplitCommand method (line 87) in /Structures/Dictionary.cs also don't handle * at the end. Parser explicitly (intentionally increases splitIndex for *, = and ', i.e. includes these characters in the token passed to TryLookup()) appends these signs to the command name, so it reads for ex. also \Delta= as a non-existent command. \Delta{}= and \Delta = circumvent the flaw fo me.
Triage update: this remains a real, actionable tokenizer bug, but not for all four original examples. Current master reproduces \sin', \mu=, and \Delta=; it accepts $35.99 \%$ and the valid escaped-brace form \left\{...\right\}.
I updated the title/body with the current reproduction and acceptance criteria so the issue can be implemented without re-investigating the obsolete examples.
Activity
Happypig375 commentedon Nov 16, 2020
This is related to how commands are parsed. It is hard to know whether ' and = are part of the command name or are their own symbols after commands. More digging around LaTeX documentation is needed.
haribo841 commentedon Jul 12, 2026
SplitCommand method (line 87) in /Structures/Dictionary.cs also don't handle * at the end. Parser explicitly (intentionally increases splitIndex for *, = and ', i.e. includes these characters in the token passed to TryLookup()) appends these signs to the command name, so it reads for ex. also \Delta= as a non-existent command. \Delta{}= and \Delta = circumvent the flaw fo me.
[-]Invalid command \sin'[/-][+]Parse punctuation after LaTeX control words (\sin', \mu=, \Delta=)[/+]Happypig375 commentedon Aug 30, 2026
Triage update: this remains a real, actionable tokenizer bug, but not for all four original examples. Current
masterreproduces\sin',\mu=, and\Delta=; it accepts$35.99 \%$and the valid escaped-brace form\left\{...\right\}.The expected token boundary is defined by TeX: a control word is a backslash plus letters and ends before the first non-letter. See the LaTeX2e control-sequence reference and the
\left/\rightdelimiter reference.I updated the title/body with the current reproduction and acceptance criteria so the issue can be implemented without re-investigating the obsolete examples.