From 961c9cf4f3e0157ecb889952b31ff1a7f447b8de Mon Sep 17 00:00:00 2001 From: Aathish Sivasubrahmanian Date: Mon, 27 Jul 2020 13:05:07 +0530 Subject: [PATCH] Rename CustomTeX example scenes to be more specific. Rewrite comments about proper way to render scenes as Docstrings for each scene. --- example_scenes/customtex.py | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/example_scenes/customtex.py b/example_scenes/customtex.py index 4a6ca9fa7d..10fb3b4e89 100644 --- a/example_scenes/customtex.py +++ b/example_scenes/customtex.py @@ -1,23 +1,23 @@ from manim import * -# Test cases: -# 1. manim customtex.py ExampleFileScene -pl -# --> should fail, because \vv is not defined -# -# 2. manim customtex.py ExampleFileScene --tex_template custom_template.tex -pl -# --> should succeed as custom template includes package esvect (which defines \vv) -# -# 3. manim customtex.py ExampleClassScene -pl -# --> should succeed as the package esvect is included in template object - -class ExampleFileScene(Scene): +class TexTemplateFromCLI(Scene): + """This scene uses a custom TexTemplate file. + The path of the TexTemplate _must_ be passed with the command line + argument `--tex_template `. + For this scene, you can use the custom_template.tex file next to it. + This scene will fail to render if a tex_template.tex that doesn't + import esvect is passed, and will throw a LaTeX error in that case. + """ def construct(self): text = TexMobject(r"\vv{vb}") #text=TextMobject(r"$\vv{vb}$") self.play(Write(text)) -class ExampleClassScene(Scene): +class InCodeTexTemplate(Scene): + """This example scene demonstrates how to modify the tex template + for a particular scene from the code for the scene itself. + """ def construct(self): tpl = TexTemplate() tpl.append_package(["esvect", ["f"]])