Skip to content

armgit / manim

Public Imported from GitHub
0

A community-maintained Python framework for creating mathematical animations.

fix the problem that --tex_template flag didn't handle. (#969)

yalikes8f4506da4346
diff --git a/manim/_config/utils.py b/manim/_config/utils.py
index 54e556214..9acc033bb 100644
--- a/manim/_config/utils.py
+++ b/manim/_config/utils.py
@@ -699,6 +699,10 @@ class ManimConfig(MutableMapping):
if hasattr(args, "media_dir") and args.media_dir:
self.media_dir = args.media_dir
+ # Handle --tex_template
+ if args.tex_template:
+ self.tex_template = TexTemplateFromFile(tex_filename=args.tex_template)
+
return self
def digest_file(self, filename: str) -> "ManimConfig":
diff --git a/manim/utils/tex.py b/manim/utils/tex.py
index 6804e1040..19120f8ec 100644
--- a/manim/utils/tex.py
+++ b/manim/utils/tex.py
@@ -265,7 +265,7 @@ class TexTemplateFromFile(TexTemplate):
"""
def __init__(self, **kwargs):
- self.template_file = kwargs.pop("filename", "tex_template.tex")
+ self.template_file = kwargs.pop("tex_filename", "tex_template.tex")
super().__init__(**kwargs)
def _rebuild(self):