CTAN Comprehensive TeX Archive Network

Directory macros/latex/contrib/unravel


unravel: Watching digest tokens

The unravel package provides tools to explore code, performing expansion and assignments step by step.

is a strange beast. Its eyes read files, making characters into tokens. Its mouth then chews tokens, expanding them if possible, namely, expanding user-defined macros, or conditionals, etc. When meeting a so called 'unexpandable' token, 's stomach comes into play, performing assignments, or moving boxes around, eventually typesetting the result thanks to its great line- and page-breaking algorithms.

All of this is interleaved, and difficult to follow. Of course, one can always use \tracingall, but the result is... messy. This package is an attempt to replicate how digests tokens, and to make the process easier to follow. Namely, \unravel{\some\tokens} will let you go through expansions and assignments performed by upon seeing of \some\tokens, step by step.

Some parts of are not covered. In particular, category codes are fixed for the whole argument of \unravel when it is read.

The package is extracted by running pdflatex unravel.ins. For the documentation, run pdflatex unravel.dtx twice.

This is work in progress, all suggestions/comments/bug reports are welcome! See https://github.com/blefloch/latex-unravel/

Download the contents of this package in one zip archive (906.8k).

unravel – Watching digest tokens

The aim of this package is to help debug complicated macros. This is done by letting the user step through the execution of some code, going through the details of nested expansions, performing assignments, as well as some simple typesetting commands. To use this package, one should normally run in a terminal.

The unravel package requires up-to-date versions of the l3kernel, l3packages and l3experimental bundles.

Version0.3c 2024-01-05
LicensesThe Project Public License 1.3c
Copyright2013, 2015, 2018–2019, 2021, 2024 Bruno Le Floch
MaintainerBruno Le Floch
Contained inTeX Live as unravel
MiKTeX as unravel
TopicsMacro support
Experimental 3
Debug supp
Guest Book Sitemap Contact Contact Author