[texhax] Single-stepping through TeX

Doug McKenna doug at mathemaesthetics.com
Sat Nov 19 01:43:56 CET 2011


Joseph -

>On 18/11/2011 19:47, Doug McKenna wrote:
>> Is there any way to single-step through a very simple TeX execution 
>> (after inputing the plain format), in order to watch with a debugger how 
>> it operates?  Preferably using the XCode environment that in turn depends 
>> on gdb.
>> 
>> I've got TeXLive 2010 installed, with the 2011 disk available.
>> 
>> Although there's a directory in the distribution tree for web2c, I can't 
>> find any executables or sources or directions that make it easy (no doubt 
>> for some value of "easy") to convert TeX's source code into final 
>> runnable C code for the command line program "tex".
>> 
>> Searching the web hasn't helped much either, except to make clear that 
>> the endeavor looks completely frought and complex.
>> 
>> Thanks.
>> 
>> Doug McKenna
>
>Like many people with a background in functional programming, you are
>misunderstanding how TeX fundamentally works!

No, I understand fairly completely how TeX works.  I just have trouble 
writing an unambiguous question. :)  (Must be my non-functional 
programming background. :)

>TeX is a macro expansion language ....
>[snip]

I understand.  What I wanted to do is peek at, with a debugger, the 
execution of the "tex" interpreter itself (it's a program) as it 
interprets the TeX language found in a test input file.

I thought this might be an easy task, but I don't think it is.  
Regardless, I figured out my problem, so for now, it's moot.

>The way to trace what TeX is doing is to use \tracingall, or if you use
>LaTeX to load the trace package and use \traceon ... \traceoff. (The
>later hides some noisy-but-boring LaTeX internals.) This will show you
>in the log what is TeX is doing.

Thanks.

>(I've kept the Mac list on the CC, but this is really a general TeX
>issue, so suggest further replies go to TeXhax only.)

Done, although I used the Mac list because I'm running on that platform.

Thanks for the time you took to answer, even if it a tad was off-base.  
Sorry for the confusion.

Tally ho,


Doug McKenna



More information about the texhax mailing list