Automatic LaTeX file recompilation
Here are two tools, for automatic recompilation of LaTeX files after modification and save from your favourite editor.
The first version, is the one I'm using since I wrote it in 1996. It is written in C and recently has been adapted to run on MacOsX too.
You can access it from the old mk_tex homepage
In 2005, I rewrote completely the utility in PERL, getting a much more syntetic program, with better features, running on Linux/Unix and MacOsX.
Its features include:
- complete PERL source available under GPL2 (Open Source)
- portable across Linux/Unix and MacOsX,
- handles automatically included files (via \input{}) and figures (\includegraphics{})
- takes care of rerunning bibtex in case of undefined citations
- takes care of generating pdf or ps when terminated
- refreshes automatically the xdvi preview as soon as the dvi is regenerated
Just install this file in a directory on your path and give it the execution rights (e.g. mv mktex $HOME/bin; chmod ug+x $HOME/bin/mktex
)
The program is to be run in a terminal window. The command line parmeters can be viewed with a mktex -h
.
If only the parameter specifying the main file to be compile is given (e.g. mktex -m paper
, you can omit the .tex
suffix), it observes the main file, all the included files and all the figures included. As soon as one of these is modified, the main file is recompiled.
If no xdvi
viewer is open, a new one is opened. Once the main file has been recompiled, the viewer window is automatically refreshed.
By specifying the -e
parameter, an editor window is also opened.
The viewer and the editor windows opend from within the mktex program are closed when the program is terminated.
The program is an infinite loop. To terminate it, just type a ^C in the terminal window. If a -f
(or -p
) option has been specified, at that point the dvi is transformed into PDF (Postscript) just before terminating the program, and a list of the compire generated warning, if any, are output before returning the prompt in the terminal window.
Here are some snapshots of the program running on my Powerbook:
Immedieately before launching mktex
Immediately after mktex has been started
Immediately after the main file has been saved from the editor window
Just after typing a ^C
DOWNLOAD the file from here