As suggested here , latexmk is a convenient way to constantly compile your document every time you change the source. But often, when you work on a document, you will get errors, and then latex will panic and wait for user input before continuing. This can be very annoying, especially recently when I hacked something to compile latex directly from an etherpad document, which is saved continuously as you type.
Is there a parameter for latex or latexmk so that it just interrupts with an error message if it cannot compile? Or, if necessary, how do I configure some kind of Expect script to automatically dismiss LaTeX complaints?
(I thought pdflatex -halt-on-error option -halt-on-error do the trick, but apparently not.)
Bonus question: Skim on Mac OSX is a good PDF viewer that automatically recovers when a PDF changes (unlike Preview), except that whenever a latex error occurs, you confirm that you want to restore automatically. Texniscope does not have this problem, but I had to abandon Texniscope for other reasons . Is there a way to make Skim always autorefresh, or is there another viewer who gets this right?
ADDED: a latexmk mini tutorial based on the answer to this question:
Get latexmk here: http://www.phys.psu.edu/~collins/software/latexmk-jcc/
Add the following to your ~/.latexmkrc file:
$pdflatex = 'pdflatex -interaction=nonstopmode';
(for OS X with Skim)
$pdf_previewer = "open -a /Applications/Skim.app";
When editing the source file foo.tex run the following in the terminal:
latexmk -pvc -pdf foo.tex
Use Skim or another live viewer to view foo.pdf. For Skim, just browse the βSyncβ tab in the Skims settings and configure it for your editor.
Voila! Pressing save foo.tex now calls foo.pdf to update without touching a thing.
automation prompt latex expect
dreeves Apr 10 '09 at 20:20 2009-04-10 20:20
source share