From c883cefdde093f9e6ffa7e11509c73b5254a0245 Mon Sep 17 00:00:00 2001 From: Jiri Kalvoda Date: Mon, 18 Mar 2024 21:14:12 +0100 Subject: [PATCH] =?UTF-8?q?UCWTeX:=20Na=20v=C3=BDrobu=20pdf=20si=20pust?= =?UTF-8?q?=C3=ADme=20luatex=20a=20nau=C4=8D=C3=ADme=20ho=20hledat=20soubo?= =?UTF-8?q?ry?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/formatitko/formatitko.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/formatitko/formatitko.py b/src/formatitko/formatitko.py index 3e764ba..c48c3d8 100755 --- a/src/formatitko/formatitko.py +++ b/src/formatitko/formatitko.py @@ -2,9 +2,11 @@ import argparse import sys +import os import tempfile import subprocess import shutil +from pathlib import Path # Import local files from .util import import_md @@ -112,7 +114,12 @@ def main(): else: filename = args.output_tex outdir = tempfile.TemporaryDirectory(prefix="formatitko") - subprocess.run(["pdfcsplain", "-halt-on-error", "-output-directory="+outdir.name, "-jobname=formatitko", filename], check=True) + + env = os.environ.copy() + d = Path("/".join(__file__.split("/")[:-1])) + env["TEXINPUTS"]=".:"+str(d/"tex")+":"+env.get("TEXINPUTS", "") + + subprocess.run(["luatex", "-halt-on-error", "-output-directory="+outdir.name, "-jobname=formatitko", filename], check=True, env=env) shutil.move(outdir.name+"/formatitko.pdf", args.output_pdf) if args.deps is not None: