Skip to main content
`Ctrl`+`K`

# pyladoc.latex.compile

pyladoc.latex.compile(latex_code, output_file='', encoding='utf-8', engine='pdflatex')

  Compiles LaTeX code to a PDF file.

  Parameters:

    - latex_code (`str`) – The LaTeX code to compile.

    - output_file (`str`) – The output file path.

    - encoding (`str`) – The encoding of the LaTeX code.

    - engine (`Literal`[`'pdflatex'`, `'lualatex'`, `'xelatex'`, `'tectonic'`]) – LaTeX engine (pdflatex, lualatex, xelatex or tectonic)

  Returns:

    - A boolean indicating whether the compilation was successful.

    - A list of errors.

    - A list of warnings.

  Return type:

    A tuple with three elements