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 (other) corresponding to a decomposition of the tokens of the<balanced text>
of the unexpanded<general text>
; c.f.\showtokens
. The effect is rather as if\scantokens
applied to the<general text>
within a régime in which only\catcodes
10 and 12 existed. Note that in order to preserve the boundaries between control words and any following letter, a space is yielded after each control word including the last.
What does that mean in plain English? I want to understand this snippet of code:
\def\task#1{\@task#1::\@nil}
\def\@task#1:#2:#3\@nil{%
\if\relax\detokenize{#2}\relax
...
I think that \task
is defined as a macro taking one argument which calls \@task
. I don't know what \@nil
means -- it is probably used to end the macro call. I also don't know what \relax
and \detokenize
do, but detokenize takes the second part of the argument for the task macro
(the parts are separated with semicolons).