Automatically start the necessary pdflatex runs if .tex has changed (MacOS X)?

latexmk can run in automatic-update mode using the -pvc option:

# latexmk -pdf -pvc file.tex

It is a Perl script, so it should run under any OS as long a Perl compiler is installed. I'm not sure, but I think TeXLive ships with one, at least under Windows I think.


Claus Gerhardt's FlashMode does this, but for TeXShop.


During searching in the internet, I also found atchange which seems to also be able to automatically detect changes in any specified text document and then run predefined shell scripts.

Taken from the homepage 1:

When the atchange program is running, it watches one or more files. When any of those files changes, the atchange program will wake up and do any actions you want. Tasks such as modifying and compiling a program, modifying a data file and using it, or editing a text and typesetting it can be automated with a single typed command such as: atchange myprogram "compile myprogram" By setting up atchange once before starting a repetitive task, one can avoid hundreds of mouse movements.

(I did not test it yet)