1
0
Fork 0
mirror of https://github.com/Findus23/RPGnotes.git synced 2024-09-19 15:43:45 +02:00

minor tex fixes

This commit is contained in:
Lukas Winkler 2023-05-28 16:27:45 +02:00
parent 3d388cf960
commit abdb01befe
Signed by: lukas
GPG key ID: 54DE4D798D244853
2 changed files with 11 additions and 2 deletions

View file

@ -64,8 +64,11 @@ def generate_pdf(data, tenant: Campaign):
print(latex)
(dir / "document.tex").write_text(latex)
out = subprocess.run(["latexmk", "-pdf", "-interaction=batchmode", "document.tex"],
cwd=dir, check=True, capture_output=True)
cwd=dir, check=False, capture_output=True)
print(out.stdout.decode())
if out.returncode != 0:
print((dir/"document.log").read_text())
raise RuntimeError("LaTeX failed")
pdf_file = dir / "document.pdf"
webbrowser.open(str(pdf_file))
with pdf_file.open("rb") as f:
@ -73,6 +76,6 @@ def generate_pdf(data, tenant: Campaign):
def create_document(tenant: Campaign):
data = {"days": IngameDay.objects.all()}
data = {"days": IngameDay.objects.all().order_by("-day")}
generate_pdf(data, tenant)

View file

@ -33,9 +33,15 @@ bookmarksnumbered=false, %% if true, add the section numbers to the bookmarks
draft=false
]{hyperref}
\title{Title}
\author{}
\begin{document}
\maketitle
\chapter{Timeline}
\BLOCK{for day in days}