JelteF / PyLaTeX

A Python library for creating LaTeX files
https://jeltef.github.io/PyLaTeX/
MIT License
2.24k stars 286 forks source link

Could not generate pdf file when use doc.generate_pdf()? #313

Closed TianZhengjie-lxc closed 3 years ago

TianZhengjie-lxc commented 3 years ago

Traceback (most recent call last): File "D:/Python_code/gen_latex/test.py", line 72, in doc.generate_pdf(filepath="test_doc\test1", clean_tex=False, compiler="pdflatex") File "D:\anaconda3\lib\site-packages\pylatex\document.py", line 298, in generate_pdf raise(CompilerError( pylatex.errors.CompilerError: No LaTex compiler was found Either specify a LaTex compiler or make sure you have latexmk or pdfLaTex installed.

Process finished with exit code 1

JelteF commented 3 years ago

You should install latexmk, like the error says...............................

TianZhengjie-lxc commented 3 years ago

i have installed latexmk by: pip install latexmk.py (in pycharm) but how to choose compiler_args,it is compiler_args=['--pdf']? some doc from https://mg.readthedocs.io/latexmk.html may help? subprocess.CalledProcessError: Command '['latexmk', '--pdf', '--interaction=nonstopmode', 'F:\xx.tex']' returned non-zero exit status 2.

TianZhengjie-lxc commented 3 years ago

why it has error?