Skip to content

armgit / manim

Public Imported from GitHub
0

A community-maintained Python framework for creating mathematical animations.

move basic template to tex_templates.py

Aron Fischer10c5c28773f8
diff --git a/manim/utils/tex.py b/manim/utils/tex.py
index efe5f0dbe..033bf1e6e 100644
--- a/manim/utils/tex.py
+++ b/manim/utils/tex.py
@@ -3,7 +3,6 @@
__all__ = [
"TexTemplate",
"TexTemplateFromFile",
- "BasicTexTemplate",
]
@@ -166,19 +165,6 @@ class TexTemplate:
)
-class BasicTexTemplate(TexTemplate):
- """A simple Tex Template with only basic AMS packages"""
-
- def __init__(self, *args, **kwargs):
- basic_headers = r"""
-\usepackage[english]{babel}
-\usepackage{amsmath}
-\usepackage{amssymb}
-"""
- preamble = kwargs.pop("preamble", basic_headers)
- super().__init__(*args, preamble=preamble, **kwargs)
-
-
class TexTemplateFromFile(TexTemplate):
"""A TexTemplate object created from a template file (default: tex_template.tex)"""
diff --git a/manim/utils/tex_templates.py b/manim/utils/tex_templates.py
index 5f78f0fe4..cca663a28 100644
--- a/manim/utils/tex_templates.py
+++ b/manim/utils/tex_templates.py
@@ -7,9 +7,23 @@ __all__ = [
from .tex import *
+
# This file makes TexTemplateLibrary and TexFontTemplates available for use in manim Tex and MathTex objects.
+class BasicTexTemplate(TexTemplate):
+ """A simple Tex Template with only basic AMS packages"""
+
+ def __init__(self, *args, **kwargs):
+ basic_headers = r"""
+\usepackage[english]{babel}
+\usepackage{amsmath}
+\usepackage{amssymb}
+"""
+ preamble = kwargs.pop("preamble", basic_headers)
+ super().__init__(*args, preamble=preamble, **kwargs)
+
+
# TexTemplateLibrary
#
class TexTemplateLibrary(object):