"""Rebuild manuscript with pdflatex; bibliography is already rendered and editable.""" import shutil,subprocess from pathlib import Path root=Path(__file__).resolve().parent exe=shutil.which('pdflatex') if not exe:raise SystemExit('Install a TeX distribution providing pdflatex and the packages used in main.tex.') for i in range(3):subprocess.run([exe,'-interaction=nonstopmode','-halt-on-error','main.tex'],cwd=root/'manuscript',check=True) shutil.copy2(root/'manuscript/main.pdf',root/'Infinite_Players_Final_Research.pdf') print('Built',root/'Infinite_Players_Final_Research.pdf')