Jump to content

TeX/string

From Wikibooks, open books for an open world
< TeX

Synopsis

[edit | edit source]

\string

Description

[edit | edit source]

\string accepts a single token (a command sequence, a letter, or another character (including special characters like {, $, }), and converts it into a string of characters. The escape character is controlled by the register \escapechar and is "\" in standard TeX. If it equals -1, \string outputs nothing as the escape character.

All characters except space (code=32) are output with category 12 (other character), even if they're letters or special characters. As an exception, space gets the category 10 (space character), but still-concatenated spaces are not merged to one space.