Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!usc!sdd.hp.com!spool.mu.edu!snorkelwacker.mit.edu!bloom-beacon!eru!hagbard!sunic!mcsun!ukc!tcdcs!dce.ie!em From: em@dce.ie (Eamonn McManus) Newsgroups: comp.text.tex Subject: Re: TeX preprocessor? Message-ID: Date: 3 Apr 91 17:01:42 GMT References: <1991Mar30.215707.649@basho.uucp> Organization: Datacode Communications Ltd, Dublin, Ireland Lines: 20 john@basho.uucp (John Lacey) writes: >Is there any way to write a TeX file that will process another TeX file >and reduce it to primitives and then write it out? I'm thinking of >something extremely analogous to the C preprocessor. > >If that isn't possible, how hard would altering the structure of TeX to >conform more closely to that of cc, with separate passed being separate >executables. Or perhaps switches controlling those passes could be added. Since the expansion of macros can depend intimately on the results of TeX's typesetting (for instance, they may be invoked from \output when a page is finished, or they may test to see whether the width of a box is greater than some value), it is not possible to do this without effectively doing everything that TeX would do anyway. Given the interesting possibilities introduced by conditional expansion and recursion, I think it would be very hard to do even if typesetting-dependent macros were ignored. , Eamonn