X-Git-Url: https://git.mdrn.pl/librarian.git/blobdiff_plain/07f1b10113588774b5cc75df100e8487a54b45d2..c6d792e73002970964923c0105b1f0c366d744fc:/librarian/pdf.py diff --git a/librarian/pdf.py b/librarian/pdf.py index 246fd0c..c8af03b 100644 --- a/librarian/pdf.py +++ b/librarian/pdf.py @@ -310,12 +310,14 @@ def transform(wldoc, verbose=False, save_tex=None, morefloats=None, cwd = None os.chdir(temp) - if verbose: - p = call(['xelatex', tex_path]) - else: - p = call(['xelatex', '-interaction=batchmode', tex_path], stdout=PIPE, stderr=PIPE) - if p: - raise ParseError("Error parsing .tex file") + # some things work better when compiled twice + for run in xrange(2): + if verbose: + p = call(['xelatex', tex_path]) + else: + p = call(['xelatex', '-interaction=batchmode', tex_path], stdout=PIPE, stderr=PIPE) + if p: + raise ParseError("Error parsing .tex file") if cwd is not None: os.chdir(cwd)