Tag Info

New answers tagged


The \scantokens command is not “dangerous” by itself, but it can have surprising effects. How does it work? Its argument is scanned like for a \write operation, but all symbolic tokens are considered unexpandable, based on the current category codes; the result is placed in a “pseudofile” that is read in exactly as if \input was used. This has various ...


TeX's scanner (eyes) convert characters in a file to tokens. That only happens once, macro replacement text and all expansion processing processes tokens (which are [character-code,catcode] pairs. the catcode table affects the conversion of characters to character tokens. So your definition locally makes the catcode of _ 13 so if a _ character is encounted ...

Top 50 recent answers are included