Skip to content
Merged
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
12 changes: 6 additions & 6 deletions manim/utils/tex_file_writing.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,8 @@ def tex_compilation_command(
"-interaction=batchmode",
f'-output-format="{output_format[1:]}"',
"-halt-on-error",
f'-output-directory="{tex_dir}"',
f'"{tex_file}"',
f'-output-directory="{tex_dir.as_posix()}"',
f'"{tex_file.as_posix()}"',
">",
os.devnull,
]
Expand All @@ -146,8 +146,8 @@ def tex_compilation_command(
outflag,
"-interaction=batchmode",
"-halt-on-error",
f'-output-directory="{tex_dir}"',
f'"{tex_file}"',
f'-output-directory="{tex_dir.as_posix()}"',
f'"{tex_file.as_posix()}"',
">",
os.devnull,
]
Expand Down Expand Up @@ -229,10 +229,10 @@ def convert_to_svg(dvi_file: Path, extension: str, page: int = 1):
"dvisvgm",
"--pdf" if extension == ".pdf" else "",
"-p " + str(page),
f'"{dvi_file}"',
f'"{dvi_file.as_posix()}"',
"-n",
"-v 0",
"-o " + f'"{result}"',
"-o " + f'"{result.as_posix()}"',
">",
os.devnull,
]
Expand Down
13 changes: 13 additions & 0 deletions tests/module/mobject/text/test_texmobject.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,19 @@ def test_tex():
assert Path(config.media_dir, "Tex", "f2e45e6e82d750e6.svg").exists()


def test_tex_temp_directory(tmpdir, monkeypatch):
# Adds a test for #3060
# It's not possible to reproduce the issue normally, because we use
# tempconfig to change media directory to temporary directory by default
# we partially, revert that change here.
monkeypatch.chdir(tmpdir)
Path(tmpdir, "media").mkdir()
with tempconfig({"media_dir": "media"}):
Tex("The horse does not eat cucumber salad.")
assert Path("media", "Tex").exists()
assert Path("media", "Tex", "f2e45e6e82d750e6.svg").exists()


def test_percent_char_rendering():
Tex(r"\%")
assert Path(config.media_dir, "Tex", "3f48edf8ebaf82c8.tex").exists()
Expand Down