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:
parent
3d388cf960
commit
abdb01befe
2 changed files with 11 additions and 2 deletions
|
@ -64,8 +64,11 @@ def generate_pdf(data, tenant: Campaign):
|
||||||
print(latex)
|
print(latex)
|
||||||
(dir / "document.tex").write_text(latex)
|
(dir / "document.tex").write_text(latex)
|
||||||
out = subprocess.run(["latexmk", "-pdf", "-interaction=batchmode", "document.tex"],
|
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())
|
print(out.stdout.decode())
|
||||||
|
if out.returncode != 0:
|
||||||
|
print((dir/"document.log").read_text())
|
||||||
|
raise RuntimeError("LaTeX failed")
|
||||||
pdf_file = dir / "document.pdf"
|
pdf_file = dir / "document.pdf"
|
||||||
webbrowser.open(str(pdf_file))
|
webbrowser.open(str(pdf_file))
|
||||||
with pdf_file.open("rb") as f:
|
with pdf_file.open("rb") as f:
|
||||||
|
@ -73,6 +76,6 @@ def generate_pdf(data, tenant: Campaign):
|
||||||
|
|
||||||
|
|
||||||
def create_document(tenant: Campaign):
|
def create_document(tenant: Campaign):
|
||||||
data = {"days": IngameDay.objects.all()}
|
data = {"days": IngameDay.objects.all().order_by("-day")}
|
||||||
|
|
||||||
generate_pdf(data, tenant)
|
generate_pdf(data, tenant)
|
||||||
|
|
|
@ -33,9 +33,15 @@ bookmarksnumbered=false, %% if true, add the section numbers to the bookmarks
|
||||||
draft=false
|
draft=false
|
||||||
]{hyperref}
|
]{hyperref}
|
||||||
|
|
||||||
|
\title{Title}
|
||||||
|
\author{}
|
||||||
|
|
||||||
|
|
||||||
\begin{document}
|
\begin{document}
|
||||||
|
|
||||||
|
|
||||||
|
\maketitle
|
||||||
|
|
||||||
\chapter{Timeline}
|
\chapter{Timeline}
|
||||||
|
|
||||||
\BLOCK{for day in days}
|
\BLOCK{for day in days}
|
||||||
|
|
Loading…
Reference in a new issue