| 1 |
# tokmap |
| 2 |
|
| 3 |
tokmap: iterate over a token list expandably, without dropping spaces or braced groups. |
| 4 |
|
| 5 |
Usage: `\tokmap <command> { <tokens> }` applies command over the token list tokens. |
| 6 |
Space tokens, left and right braces are replaced with the marker tokens `\tokmap@space`, |
| 7 |
`\tokmap@bgroup`, and `\tokmap@egroup` respectively (who are `\ifx`-equal to themselves |
| 8 |
exclusively). For convenience, command may contain multiple tokens. |
| 9 |
It is assumed that `{` and `}` are the only characters with category codes 1 |
| 10 |
(beginning of group) and 2 (end of group) respectively. |
| 11 |
Expandable. |
| 12 |
|
| 13 |
This package may be used in LaTeX by `\usepackage{tokmap}`, or |
| 14 |
in plain TeX and other formats by `\input{tokmap}`. |
| 15 |
|
| 16 |
See the [visualtoks](https://ctan.org/pkg/visualtoks) package for an example application. |
| 17 |
|
| 18 |
Copyright (C) 2025 plante |
| 19 |
Version 1.0 |
| 20 |
|
| 21 |
This package is released under the LaTeX Project Public License (LPPL) 1.3c. |