[Tex/LaTex] Pure python compiler

compilingdistributionspython

I am writing a Python 2.7 program on Windows that generates LaTeX output.

I would like to make it able to generate PDF output from the LaTeX, but I have only limited leeway to install additional software (I can't install regular *TeX distributions but I can install Python packages with pip).

I would like to know:

  • Is there a LaTeX compiler in the form of a Python package?
  • If there is, where can I find it and how can I use it to compile a Python string into a PDF file?

The generated LaTeX output is meant to be used with the regular latex or pdflatex.

Best Answer

Ok, try this:

  1. let Python create a latex document
  2. compile it via the DOS-Cmd shell into a pdf (check Latex doc how to do it)
  3. Python can also call shell commands, so just put the previous command into code