Merge pull request #103 from matsavage/latex_environment

adds DnD tempate as submodule
This commit is contained in:
Mark Wolfman
2021-08-05 14:11:55 -05:00
committed by GitHub
4 changed files with 62 additions and 38 deletions
+8 -1
View File
@@ -1,4 +1,5 @@
from pathlib import Path
import os
import re
import subprocess
import logging
@@ -65,11 +66,17 @@ def create_latex_pdf(
"-interaction=nonstopmode",
tex_file,
]
environment = os.environ
tex_env = environment.get('TEXINPUTS', '')
module_directory = str(Path(__file__).parent)
environment['TEXINPUTS'] = f".:{module_directory}/modules//:" + tex_env
passes = 2 if use_dnd_decorations else 1
try:
for i in range(passes):
result = subprocess.run(
tex_command_line, stdout=subprocess.DEVNULL, timeout=30
tex_command_line, stdout=subprocess.DEVNULL, env=environment, timeout=30
)
except FileNotFoundError:
# Remove temporary files