TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Possible Duplicate:
Tools for automating document compilation

I am fairly new to latex and would like to automate my workflow (creating pdfs from a beamer/listings/tkiz source).

What I want is a script to automatically recompile the source and reload the resulting pdf in acrobat whenever my code changes. Of course this is easy to do however I have one issue:

How can a script determine whether or not a second pass of pdflatex is neccessary?

Unfortunately this cannot be deduced from pdflatex' exit code (which is 0 even when another pass is needed), but maybe there is some other way to detect that in an automated way.

Many thanks!

share|improve this question

marked as duplicate by lockstep, Marco Daniel, egreg, Stephan Lehmke, Ian Thompson Jun 11 '12 at 10:47

This question was marked as an exact duplicate of an existing question.

Have a look at latexmk – egreg Jun 8 '12 at 15:56
I can only second egreg's advise: latexmk is probably the way to go. You also might want to change your PDF viewer, as there are viewers, which automatically reload the PDF file, if the file changed. – Patrick Häcker Jun 8 '12 at 16:13
If you are a vim user, the latex-suite is a set of tools that support compilation of documents within vim. – Miguel de Val-Borro Jun 8 '12 at 16:35

Have you thought about using Rubber on Linux Terminal http://latexbr.blogspot.com.br/2011/11/compilando-com-rubber.html.

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.