[Tex/LaTex] Automatically start the necessary pdflatex runs if .tex has changed (MacOS X)

automationlatexmkmactools

I read about Latex Daemon, which seems to automatically start a new latex run, when the source document (.tex) has changed.

Can somebody recommend me a similar solution for MacOS X (as Latex daemon seems to be for Windows only)?


snip:
I've removed the 2nd part of my question about speeding things up and created a new question: How to speed up pdflatex for a very large document on MacOS X?


I use TexMakerX as editor and Skimas viewer.
Skim can autoupdate the PDF file, as soon as it has changed, so that should be no problem.
My current LaTeX project has several source files, combined with \include, so the solution should be able to "observe" the changes of at least one of those files.

edit:

I'll accept latexmk as the answer for automatically running pdflatex several times to update bibliography and references
and I'll ask the question of speeding up processing in a new question.

For those who want to set up latexmkon MacOS X, this page from Damien Pollet could be helpful.

Problems I had with latexmk:

  • with the -pvc-option it seems to slow down my MacBook, as switching to another application got quite slow, especially when its windows were located in another Space
  • so I turned that off and just now use latexmk via short key F1 to automatically compile "everything", while I use a single pdflatex-run with F2 to add small changes in the text.

While searching with google I also found the atchange program http://www.ccrnp.ncifcrf.gov/~toms/atchange.html which seems to do similar things, I did not test it yet.

Best Answer

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.

Related Question