mirror of
https://github.com/Threnklyn/dungeon-sheets.git
synced 2026-06-07 13:15:53 +02:00
adds DnD tempate as submodule
This commit is contained in:
@@ -0,0 +1,3 @@
|
|||||||
|
[submodule "modules/DND-5e-LaTeX-Template"]
|
||||||
|
path = modules/DND-5e-LaTeX-Template
|
||||||
|
url = https://github.com/rpgtex/DND-5e-LaTeX-Template.git
|
||||||
@@ -1,4 +1,5 @@
|
|||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
import os
|
||||||
import re
|
import re
|
||||||
import subprocess
|
import subprocess
|
||||||
import logging
|
import logging
|
||||||
@@ -65,11 +66,16 @@ def create_latex_pdf(
|
|||||||
"-interaction=nonstopmode",
|
"-interaction=nonstopmode",
|
||||||
tex_file,
|
tex_file,
|
||||||
]
|
]
|
||||||
|
|
||||||
|
environment = os.environ
|
||||||
|
tex_env = environment.get('TEXINPUTS', '')
|
||||||
|
environment['TEXINPUTS'] = ".:../modules//:" + tex_env
|
||||||
|
|
||||||
passes = 2 if use_dnd_decorations else 1
|
passes = 2 if use_dnd_decorations else 1
|
||||||
try:
|
try:
|
||||||
for i in range(passes):
|
for i in range(passes):
|
||||||
result = subprocess.run(
|
result = subprocess.run(
|
||||||
tex_command_line, stdout=subprocess.DEVNULL, timeout=30
|
tex_command_line, stdout=subprocess.DEVNULL, env=environment, timeout=30
|
||||||
)
|
)
|
||||||
except FileNotFoundError:
|
except FileNotFoundError:
|
||||||
# Remove temporary files
|
# Remove temporary files
|
||||||
|
|||||||
Reference in New Issue
Block a user