[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

One-pass document processing

From: Ludovic Courtès
Subject: One-pass document processing
Date: Mon, 7 Feb 2005 14:50:33 +0100
User-agent: Mutt/1.5.6+20040907i


Currently, Lout users must run `lout' several times in order to get a
"camera-ready" PostScript file, i.e. a document where everything is in
place and there are no unresolved references.  While I first found this
approach flexible, because it gives the user more control on document
processing, I now consider it quite inconvenient for several reasons.

First, because Lout knows better than the user whether a document is
"ready".  When running Lout by hand, one has to carefully look for
"unresolved reference" messages and the likes and must keep running it
till they don't come up anymore.  I used to use a tiny script that did
this for me.  Since `lout' returns zero when there are, for instance,
unresolved references (which is a good behavior since unresolved
references, most of the time, are not actual errors), that script could
not rely on Lout's return value.  Instead, it piped Lout's error
messages through `wc -l' and kept running it until no error message was

This approach turned out to be inconvenient because the
Lout-running-script has no idea of the meaning of the error messages
produced by Lout.  Some errors are fatal, some are not, some are just
warning messages that will always be there.

Furthermore, each time Lout is ran, it spends a significant amount of
time doing I/O:  loading font metrics, character maps, font databases,
package definitions, the whole user's document, the user's temporary
state files (the `.li' and `.lout.ld' files).  Before exiting, Lout
must re-create these state files, along with the PostScript output.

Therefore, I believe that it should be possible for Lout to process
a whole document at once.  This could be made an option in order to
retain compatibility and also because it may not be desirable sometimes
(e.g. if there are unresolved references that really can't be resolved,
although there could be some sort of a watchdog to prevent Lout from
looping forever).

I gave it a try, without any success so far.  Basically, my idea was to
have z10.c::CrossExpand notify the "main processing loop" of pending
unresolved references, in which case Lout would go on "processing".
However, I am not knowledgeable enough about what "processing" exactly
means here.  A look at z06.c::Parse gives a rough idea of what gets
done, but still, I don't understand what needs to be done to get this
working.  Also, there may be other things (like galley transfer)
involved besides cross-references.

Comments?  Hints?  :-)


reply via email to

[Prev in Thread] Current Thread [Next in Thread]