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

learn more… | top users | synonyms

13
votes
1answer
172 views

What could go wrong if I don't use \detokenize when creating macro names using macro arguments?

I was in correspondence with the author of a LaTeX package in which I volunteered code similar to the following (I have anonymised it so that it is not obvious what package): \makeatletter ...
5
votes
1answer
140 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 ...
6
votes
2answers
322 views

Use detokenize with command line input that has underscores

I'm calling a script where I give a command line input to LaTeX: pdflatex "\def\myvar{given_test} \input{figures.tex}" And then in the script, I try to use this "given_test" input and print it: ...
4
votes
1answer
208 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}} ...
7
votes
1answer
292 views

Can I use \begingroup \endgroup as delimiter of \detokenize, instead of {}?

I would like to use other delimiters than {} for the argument of \detokenize. E.g. something like \detokenize\begingroup a lot of stuff \com \mycom \endgroup but it does not work. Am I really ...
12
votes
2answers
864 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 ...
3
votes
2answers
654 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 ...
22
votes
2answers
3k 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 ...