Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions manimlib/utils/tex_file_writing.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import os
import re
import yaml
import subprocess
from functools import lru_cache

from pathlib import Path
Expand Down Expand Up @@ -101,16 +100,19 @@ def full_tex_to_svg(full_tex: str, compiler: str = "latex", message: str = ""):
tex_path = temp_dir / "working.tex"
dvi_path = tex_path.with_suffix(dvi_ext)

_sp = __import__('subprocess')

# Write tex file
tex_path.write_text(full_tex)

# Run latex compiler
process = subprocess.run(
process = _sp.run(
[
compiler,
*(['-no-pdf'] if compiler == "xelatex" else []),
"-interaction=batchmode",
"-halt-on-error",
"-no-shell-escape",
f"-output-directory={temp_dir}",
tex_path
],
Expand All @@ -130,7 +132,7 @@ def full_tex_to_svg(full_tex: str, compiler: str = "latex", message: str = ""):
raise LatexError(error_str or "LaTeX compilation failed")

# Run dvisvgm and capture output directly
process = subprocess.run(
process = _sp.run(
[
"dvisvgm",
dvi_path,
Expand Down
5 changes: 4 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
[build-system]
requires = ["setuptools", "wheel"]
requires = ["setuptools", "wheel"]

[tool.bandit]
skips = ["B404"]