使用python多次编译乳胶

时间:2020-06-03 04:24:15

标签: python latex pdflatex

我正在使用以下代码使用python编译乳胶文档:

    from pdflatex import PDFLaTeX
    with open(f'{reportFile}', 'w') as f:
        f.write(template.render()
    pdfl = PDFLaTeX.from_texfile(reportFile)
    pdfl.add_args({'-output-directory': "/Users/username/Desktop/"})
    pdfl.create_pdf(keep_pdf_file = True, keep_log_file = False)

代码工作正常,但是问题在于,为了使目录包含在乳胶文档中,我需要编译乳胶文件两次。如何使用python两次(或多次)编译乳胶文件?我读过其他有关两次编译乳胶并在python中使用pdflatex的文章,但无法弄清楚。谢谢!

0 个答案:

没有答案