Comprehensive TeX Archive Network
Cover Upload Browse Search

Direc­tory tex-archive/macros/latex/contrib/unravel

unravel --- Watching TeX digest tokens
Released under the LaTeX Project Public License v1.3c or later

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

TeX 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, TeX'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 TeX digests tokens,
and to make the process easier to follow. Namely,
\unravel{\some\tokens} will let you go through expansions and
assignments performed by TeX upon seeing of ``\some\tokens'',
step by step.

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

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

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


Name Size Date Notes
README 1546 2013-07-29 02:42
unravel.dtx 245001 2013-07-29 02:42
unravel.ins 393 2013-07-29 02:42
unravel.pdf 674252 2013-07-29 02:42

Down­load the con­tents of this pack­age in one zip archive (694.9k).

un­ravel – Watch­ing TeX di­gest to­kens

The pack­age em­u­lates large parts of TeX’s be­haviour when it chews on to­kens, ex­pand­ing and per­form­ing type­set­ting com­mands. Us­ing un­ravel will let you go one step at a time through some com­pli­cated LaTeX code that you are try­ing to de­bug. It un­der­stands a whole breadth of TeX’s fea­tures, from deeply nested ex­pan­sion to box as­sign­ments, to char­ac­ters, and the proper in­ser­tion of \ev­ery­par.

The un­ravel pack­age re­quires up-to-date l3k­er­nel and l3­ex­per­i­men­tal bun­dles, as well as the new pack­age gtl.

Pack­age De­tailsun­ravel
Li­censeThe LaTeX Project Public Li­cense
Copy­right2013 Bruno Le Floch
Main­tainerBruno Le Floch
Con­tained inTeXlive as un­ravel
MikTeX as un­ravel
Topics sup­port for de­vel­op­ment of (La)TeX macros
Guest Book Sitemap Contact