[tug-summer-of-code] Simplifying TeX's \tracingall output
J.Fine
J.Fine at open.ac.uk
Wed Feb 18 17:50:15 CET 2009
Wads: RE: [tug-summer-of-code] Wanted: A LaTeX3 mentored project
Hello Will
You wrote:
> I'm interested in hearing your ideas.
Python is an example of a 2to3 transition that seems to be going fairly
well (although it's early days yet). They've made an automated code
translation tool for the process:
http://docs.python.org/library/2to3.html
> We're too early to talk about helping transitions, I think. A script
> to transform some LaTeX programming code to expl3 syntax might be fun
> but you well know how limited it would be. And would miss the point of
> a lot of the ideas in expl3.
There are perhaps four aspects to the transition:
1. Changing style files.
2. Changing source documents.
3. Knowing if the output dvi (say) is as before.
4. Understanding and if need be fixing the difference found in 4.
Of course, such tools would be useful when refactoring large amounts of
code. One can cmp the dvi to know that the output is the same, but that
doesn't really help us when it is different.
Here's one thing I have in mind. A tool that makes it easier to browse
the output of \tracingall. This has two main aspects, macros and boxes.
Boxes are easier, but perhaps less useful.
Running:
$ latex '\tracingall \input small2e.tex '
produces a log file that is 876069 bytes.
It has an enormous amount of redundancy.
===
$ wc -l small2e.log
36920 small2e.log
$ sort small2e.log | uniq | wc -l
4877
===
Part of the macro project is reduce that redundancy. For example:
===
\@ifundefined #1->\expandafter \ifx \csname #1\endcsname \relax
\expandafter \@
firstoftwo \else \expandafter \@secondoftwo \fi
#1<-c at page
{\expandafter}
{\csname}
{\ifx}
{false}
{\expandafter}
{\fi}
===
might be replaced by:
===
\@ifundefined 'c at page' => {false}
===
And, of course, \@ifundefined will be a hyperlink to its definition.
Hope this is enough to give the flavour of what might be done.
Working title: Simplifying TeX's \tracingall output.
Comments welcome.
--
Jonathan
---------------------------------
The Open University is incorporated by Royal Charter (RC 000391), an exempt charity in England & Wales and a charity registered in Scotland (SC 038302).
More information about the summer-of-code
mailing list