Browse Source

UCWTeX: Na výrobu pdf si pustíme luatex a naučíme ho hledat soubory

Jiří Kalvoda 8 months ago
parent
commit
c883cefdde
  1. 9
      src/formatitko/formatitko.py

9
src/formatitko/formatitko.py

@ -2,9 +2,11 @@
import argparse import argparse
import sys import sys
import os
import tempfile import tempfile
import subprocess import subprocess
import shutil import shutil
from pathlib import Path
# Import local files # Import local files
from .util import import_md from .util import import_md
@ -112,7 +114,12 @@ def main():
else: else:
filename = args.output_tex filename = args.output_tex
outdir = tempfile.TemporaryDirectory(prefix="formatitko") 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) shutil.move(outdir.name+"/formatitko.pdf", args.output_pdf)
if args.deps is not None: if args.deps is not None:

Loading…
Cancel
Save