JelteF / PyLaTeX

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

Add ability to pass extra kwargs to subprocess #355

Open mgao6767 opened 2 years ago

mgao6767 commented 2 years ago

This patch allows users to pass extra kwargs to subprocess.check_output in Document.generate_pdf.

It can be useful when, e.g., we want to hide the popup console window in certain circumstances.

self.doc.generate_pdf(
            pathlib.Path(output_path).joinpath(filename),
            compiler_args=["--shell-escape", "-f"],
            check_output_kwargs={"creationflags": subprocess.CREATE_NO_WINDOW},
        )