Skip to content

armgit / manim

Public Imported from GitHub
0

A community-maintained Python framework for creating mathematical animations.

added copy to tex (#1248)

kolibril13077634e2d7a7
diff --git a/manim/utils/tex.py b/manim/utils/tex.py
index 19120f8ec..8ab08a56a 100644
--- a/manim/utils/tex.py
+++ b/manim/utils/tex.py
@@ -5,7 +5,7 @@ __all__ = [
"TexTemplateFromFile",
]
-
+import copy
import re
@@ -226,6 +226,9 @@ class TexTemplate:
begin, end = self._texcode_for_environment(environment)
return self.body.replace(self.placeholder_text, f"{begin}\n{expression}\n{end}")
+ def copy(self) -> "TexTemplate":
+ return copy.deepcopy(self)
+
class TexTemplateFromFile(TexTemplate):
"""A TexTemplate object created from a template file (default: tex_template.tex)