Permalink
Browse files

Abort PDFLaTeX and print error on failed build.

  • Loading branch information...
1 parent fdbae87 commit 2bd28ab2e7dad79f2e6343c31e782b6a01ee9867 @stefanv stefanv committed Jul 15, 2012
Showing with 9 additions and 1 deletion.
  1. +9 −1 publisher/build_paper.py
View
@@ -83,13 +83,21 @@ def rst2tex(in_path, out_path):
def tex2pdf(out_path):
import shlex, subprocess
- command_line = 'cd '+out_path+' ; pdflatex paper.tex'
+ command_line = 'cd %s ' % out_path + \
+ ' ; pdflatex -halt-on-error paper.tex'
run = subprocess.Popen(command_line, shell=True, stdout=subprocess.PIPE)
out, err = run.communicate()
run = subprocess.Popen(command_line, shell=True, stdout=subprocess.PIPE)
out, err = run.communicate()
+
+ if "Fatal" in out:
+ print "PDFLaTeX error output:"
+ print "=" * 80
+ print out
+ print "=" * 80
+
return out
def page_count(pdflatex_stdout, paper_dir):

0 comments on commit 2bd28ab

Please sign in to comment.