I am trying to convert a latex document to a pdf document are there any commands in python by which I can do this.
Asked
Active
Viewed 2,040 times
1 Answers
0
From here
Try this please.
import os
os.system("pdflatex mylatex.tex")
in addition, you can use os.system("mv mylatex.pdf path/to/directory")
to move the pdf to any specific location
Alternatively, and more "clean" solution is without os.system()
that runs the shell here. You can use subprocess.check_call(['pdflatex', 'mylatex.tex'])
instead. To save the result in a specific location: pass the appropriate command-line argument to pdflatex
or use shutil.move()
.

Yanirmr
- 923
- 8
- 25