clean the auxiliary files after latex run

This commit is contained in:
Sina Atalay 2024-02-11 23:08:45 +01:00
parent ff05e07463
commit b5d227cc6b
1 changed files with 9 additions and 0 deletions

View File

@ -543,6 +543,15 @@ def latex_to_pdf(latex_file_path: pathlib.Path) -> pathlib.Path:
"If you can't solve the problem, please open an issue on GitHub.",
)
# clean the auxiliary files:
subprocess.run(
command + ["-c"],
cwd=latex_file_path.parent,
stdout=subprocess.DEVNULL, # don't capture the output
stderr=subprocess.DEVNULL, # don't capture the error
stdin=subprocess.DEVNULL, # don't allow TinyTeX to ask for user input
)
# check if the PDF file is generated:
pdf_file_path = latex_file_path.with_suffix(".pdf")
if not pdf_file_path.is_file():