The e-TeX primitive `\detokenize`, which removes special meaning from TeX code.

learn more… | top users | synonyms

12
votes
2answers
801 views

Removing a backslash from a character sequence

For indexing I wanted to write a macro \macroname that removes leading backslashes from macro names but leaves the names of environments untouched. That is \macroname{\relax} --> relax ...
21
votes
2answers
2k views

What are the exact semantics of \detokenize?

How does \detokenize work? The e-TeX Short Reference Manual states: When followed by a <general text>, expands to yield a sequence of character tokens of \catcode 10 (space) or 12 ...
5
votes
1answer
126 views

Strange behaviour with \detokenize and underscore

I just learned about \detokenize, so this question is likely a naive one. Nonetheless, based on what I thought that I understood about \detokenize, I would have expected \detokenize{_} to render as ...
4
votes
1answer
201 views

The command \string does not print curly braces of its argument

While printing the List of Symbols, I would like, in a draft, to print the definition commands as well. For instance, consider the following commands: \providecommand{\perm}{\ensuremath{\pi}} ...
3
votes
2answers
602 views

How listing and verbatim do to escape special character?

I use one macro to display text using texttt style. For the moment this macro is very basic. For example, if I want to use the character _, its catcode must be changed. Is there a clever way to ...