当前位置: 首页 > news >正文

Manim - Extra LaTeX Packages

Extra LaTeX Packages

Some commands require special packages to be loaded into the TeX template. For example, to use the mathscr script, we need to add the mathrsfs package. Since this package isn’t loaded into Manim’s tex template by default, we have to add it manually.

 

from manim import *class AddPackageLatex(Scene):def construct(self):myTemplate = TexTemplate()myTemplate.add_to_preamble(r"\usepackage{mathrsfs}")tex = Tex(r"$\mathscr{H} \rightarrow \mathbb{H}$",tex_template=myTemplate,font_size=144,)self.add(tex)

 

1