CTAN Comprehensive TeX Archive Network

CTAN update: tokstools

Date: April 18, 2026 9:54:02 PM CEST
Christian Tellechea submitted an update to the tokstools package. Version: 0.2 License: lppl1.3c Summary description: Tools for manipulating tokens Announcement text:
tokstools v0.2
* \pegreplace macro has new features and a new syntax * \printtoks macro can now send token information to the log file * code improvements
The package’s Catalogue entry can be viewed at https://ctan.org/pkg/tokstools The package’s files themselves can be inspected at https://mirrors.ctan.org/macros/generic/tokstools/
Thanks for the upload. For the CTAN Team Vincent Goulet
CTAN is run entirely by volunteers and supported by TeX user groups. Please join a user group or donate to one, see https://ctan.org/lugs

tokstools – Tools for manipulating tokens

This package is still in the experimental stage. Therefore, its behavior is not guaranteed to match the description in the manual, and bugs of varying severity may occur.

Additionally, some features, as well as their syntax, may be subject to change.

It requires any modern engine that supports etex primitives and can therefore be used with either or .

The tokstools package provides tools for manipulating tokens and implements “PEG”-style grammars in . Predefined elementary patterns can be combined to form grammars that search for matches within tokens.

Two categories of macros are provided:

  • those operating on individual tokens (\toksdo, \tokscount, and \printtoks);
  • those operating on tokens that have matched a grammar (\ifpegmatch, \pegcount, and \pegreplace)

Packagetokstools
Version0.2
Copyright2026 Christian Tellechea
MaintainerChristian Tellechea

Announcements

more

Guest Book Sitemap Contact Contact Author