Comprehensive TeX Archive Network

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


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

The unravel LaTeX pack­age pro­vides tools to ex­plore TeX code, per­form­ing ex­pan­sion and as­sign­ments step by step.

TeX is a strange beast. Its eyes read files, mak­ing char­ac­ters into to­kens. Its mouth then chews to­kens, ex­pand­ing them if pos­si­ble, namely, ex­pand­ing user-de­fined macros, or con­di­tion­als, etc. When meet­ing a so called 'un­ex­pand­able' to­ken, TeX's stom­ach comes into play, per­form­ing as­sign­ments, or mov­ing boxes around, even­tu­ally type­set­ting the re­sult thanks to its great line- and page-break­ing al­go­rithms.

All of this is in­ter­leaved, and dif­fi­cult to fol­low. Of course, one can al­ways use \tracingall, but the re­sult is... messy. This pack­age is an at­tempt to repli­cate how TeX di­gests to­kens, and to make the pro­cess eas­ier to fol­low. Namely, \unravel{\some\tokens} will let you go through ex­pan­sions and as­sign­ments per­formed by TeX upon see­ing of \some\tokens, step by step.

Some parts of TeX are not cov­ered. In par­tic­u­lar, cat­e­gory codes are fixed for the whole ar­gu­ment of \unravel when it is read.

This pack­age re­quires up-to-date ver­sions of the l3kernel, l3packages and l3experimental bun­dles.

The pack­age is ex­tracted by run­ning pdflatex unravel.ins. For the doc­u­men­ta­tion, run pdflatex unravel.dtx twice.

This is work in progress, all sug­ges­tions/com­ments/bug re­ports are wel­come! See https://github.com/ble­floch/la­tex-un­ravel/


Name Size Date Notes
README.md 1611 2015-09-30 02:29
un­ravel.dtx 279702 2015-09-30 02:28
un­ravel.ins 393 2015-09-30 02:28
un­ravel.pdf 709793 2015-09-30 02:28

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

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

The aim of this LaTeX pack­age is to help de­bug com­pli­cated macros. This is done by let­ting the user step through the ex­e­cu­tion of some TeX code, go­ing through the de­tails of nested ex­pan­sions, per­form­ing as­sign­ments, as well as some sim­ple type­set­ting com­mands. To use this pack­age, one should nor­mally run TeX in a ter­mi­nal.

The un­ravel pack­age re­quires up-to-date ver­sions of the l3k­er­nel, l3­pack­ages and l3­ex­per­i­men­tal bun­dles.

Pack­age De­tailsun­ravel
Li­censeThe LaTeX Project Public Li­cense 1.3
Main­tainerBruno Le Floch
Con­tained inTeX Live as un­ravel
MiKTeX as un­ravel
Topics sup­port for de­vel­op­ment of (La)TeX macros
Guest Book Sitemap Contact Contact Author