[OS X TeX] TeX auto-scripts (was: Nobody knows)

Joachim Kock kock at math.uqam.ca
Wed Mar 24 12:58:56 EST 2004



Hello all,

Concerning auto-rerun scripts, let me take the opportunity to explain the
approach taken by tetexComm (package for fancy interaction between AlphaX
and tetex).  The ideas might be of interest to other tex interface 
developers.  It is something intermediate between a completely automatic
script and the completely manual approach (and it specialises to these
two extremes, depending on some settings):

There is a notion of 'nextAction' which is a variable set behind the 
scenes after each run by parsing log files.  Hence if there is an error,
nextAction will be 'error-browsing' (which is an easy way of navigating
among errors --- also a very interesting concept, in the author's opinion
anyway ); if 'labels may have changed', nextAction is to re-typeset; if
there is a missing bib, nextAction is to run bibtex (and then latex twice,
by the above criteria); if there are no errors, nextAction is to view the
resulting dvi or pdf.

Now there is an option for automatically taking next action --- the result
of this setting is like running some of the auto scripts posted to the list.
But there is also a more interesting option, in which <space> is bound to 
taking next action, and a discrete message is displayed to announce what 
the nextAction would be.  In this way, all you have to do to is to sit and 
tap the space bar, and the appropriate action is taken each time.  
You don't have to think.  The advantage of this approach is that you are
*allowed* to think, if you want: at any point you can choose not to take
the nextAction, and instead do something else.  For example you might wish
to view the result independent of any missing refs (which you know will be
corrected in the next run anyway), or you might wish not to view, even if
the document compiled correctly, if you just remembered one more thing to
put into the source.

(This also provides a smart paraphrase of altpdflatex, where you avoid the
dvips and gs steps if latex exits nonzero.  Instead the script is broken
into two steps, with a 'way out' after the first part, or automatically
running the second part (in which case it is just the same behaviour as
running altpdflatex).)

I have found this approach less intrusive than blindly automating
everything --- which can sometimes be annoying.  There are also some
intermediate settings, like having view-when-no-errors as only automatic
action.

The package can be downloaded from 
http://www.cirget.uqam.ca/~kock/alpha-tcl/tetexComm.tcl.gz

Cheers,
Joachim.
-----------------------------------------------------
Please see <http://www.esm.psu.edu/mac-tex/> for list
guidelines, information, and LaTeX/TeX resources.





More information about the MacOSX-TeX mailing list