Continuously build latex files in the background
This small script continuously builds a latex file in the background. Importantly, it only overwrites the target pdf file upon a successful and complete build. This allows you to watch the PDf in a PDF viewer without the PDF viewer corrupting or crashing because of an incomplete PDF. See http://stackoverflow.com/questions/1240037/recommended-build-system-for-latex/1394702#1394702 for motivation and usage instruction.