UCWTeX: Na výrobu pdf si pustíme luatex a naučíme ho hledat soubory
This commit is contained in:
parent
4bd05b098b
commit
2fd0efe3a7
1 changed files with 8 additions and 1 deletions
|
@ -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…
Reference in a new issue