[OS X TeX] Recovering from typing errors

Nicola Cabibbo nicola.cabibbo at roma1.infn.it
Sun Feb 19 07:47:07 EST 2006

Thanks, Maarten,

On Feb 19, 2006, at 2:00 AM, Maarten Sneep wrote:

> On 18 Feb 2006, at 16:57, Nicola Cabibbo wrote:
>> Would it be possible to avoid the second run by making a backup of
>> the .aux
>> file and restoring it in case of an aborted typesetting? I realize
>> that in
>> certain cases a second run is required, e.g if new labels have been
>> introduced,
>> but in many cases it should not.
> An interesting thought.
>> Where should such a modification be introduced?
>> in texshop itself, or in an ad-hoc script?
> I think you can get away with an ad-hoc script, but you'll have to
> detect the error in the script, and restore the aux files from there.
> You should also be aware that some errors are caused by an old aux
> file (introducing or removing some packages - natbib, hyperref,
> longtable, ... I don't recall which one in particular). Having such a
> restore mechanism in place then would cause a loop you really do not
> want.
>> Is this possible? Is it difficult?
> Not easy, at least not if you rely on \include, because you get an
> aux file for each .tex file.

I do use includes. I made the following experiment: I included an error
(unmatched "{" in an equation) in one of the includes (A.tex), and a  
new label
in a previous include (B.tex). Result: when the error is detected and
displayed in the console, B.aux has been written correctly, A.aux and
the "root.aux" are both empty (Zero bytes). I cannot see what is wrong
(but maybe someone does) with substituting with a previously saved

This could be done before invoking pdftex, so it is not really necessary
to detect the error in the script, which could do the following

1)  Let Projectdir be the dictionary of the tex file to be processed
2)  For each X.aux file in 	Projectdir do:
	If (X.aux is empty) and (X.aux.back exists)
		move (rename) X.aux.back to X.aux
	Else copy X.aux to X.aux.back
3)  invoke pdftex

in this way I would not touch the aux files from a successful run,
or aux files from other projects, while if the run is not successful
in a rerun after some corrections  I would essentially restore the
aux files to that before the faulty run.

Would this work? I might give it a try in a few days if I find time.

	Nicola Cabibbo

------------------------- Info --------------------------
Mac-TeX Website: http://www.esm.psu.edu/mac-tex/
          & FAQ: http://latex.yauh.de/faq/
TeX FAQ: http://www.tex.ac.uk/faq
List Archive: http://tug.org/pipermail/macostex-archives/

More information about the MacOSX-TeX mailing list