A community-maintained Python framework for creating mathematical animations.
simplified example scene
Aron Fischerc323385649ee
diff --git a/example_scenes/custom_template.tex b/example_scenes/custom_template.texindex cf730f975..feb78b76e 100644--- a/example_scenes/custom_template.tex+++ b/example_scenes/custom_template.tex@@ -4,21 +4,6 @@\usepackage{amsmath}\usepackage{amssymb}\usepackage[f]{esvect}-\usepackage{dsfont}-\usepackage{setspace}-\usepackage{tipa}-\usepackage{relsize}-\usepackage{textcomp}-\usepackage{mathrsfs}-\usepackage{calligra}-\usepackage{wasysym}-\usepackage{ragged2e}-\usepackage{physics}-\usepackage{xcolor}-\usepackage{microtype}-\DisableLigatures{encoding = *, family = * }-%\usepackage[UTF8]{ctex}-\linespread{1}\begin{document}diff --git a/example_scenes/customtex.py b/example_scenes/customtex.pyindex 4a7824d6a..6d119ba58 100644--- a/example_scenes/customtex.py+++ b/example_scenes/customtex.py@@ -12,8 +12,8 @@ class TexTemplateFromCLI(Scene):def construct(self):text = MathTex(r"\vv{vb}")- # text=Tex(r"$\vv{vb}$")self.play(Write(text))+ self.wait(1)class InCodeTexTemplate(Scene):@@ -23,22 +23,19 @@ class InCodeTexTemplate(Scene):def construct(self):# Create a new template- template = TexTemplate()+ myTemplate = TexTemplate()# Add packages to the template- template.add_to_preamble(r"\usepackage{esvect}")+ myTemplate.add_to_preamble(r"\usepackage{esvect}")# Set the compiler and output format (default: latex and .dvi)# possible tex compilers: "latex", "pdflatex", "xelatex", "lualatex", "luatex"# possible output formats: ".dvi", ".pdf", and ".xdv"- template.tex_compiler = "pdflatex"- template.output_format = ".pdf"+ myTemplate.tex_compiler = "pdflatex"+ myTemplate.output_format = ".pdf"- # To use this as the default template for all Tex:- # config["tex_template"] = template- # To use this template only for specific Tex() objects+ # To use this template in a Tex() or MathTex object# use the keyword argument tex_template-- text = MathTex(r"f:A\rightarrow B", tex_template=template)- text.shift(DOWN)+ text = MathTex(r"\vv{vb}", tex_template=myTemplate)self.play(Write(text))+ self.wait(1)