SingleStringMathTex¶
Qualified name: manim.mobject.text.tex\_mobject.SingleStringMathTex
- class SingleStringMathTex(tex_string, stroke_width=0, should_center=True, height=None, organize_left_to_right=False, tex_environment='align*', tex_template=None, font_size=48, color=None, **kwargs)[source]¶
Bases:
SVGMobjectElementary building block for rendering text with LaTeX.
Tests
Check that creating a
SingleStringMathTexobject works:>>> SingleStringMathTex('Test') SingleStringMathTex('Test')
Methods
get_tex_stringInitializes the colors.
Attributes
alwaysCall a method on a mobject every frame.
animateUsed to animate the application of any method of
self.animation_overridescolordepthThe depth of the mobject.
fill_colorIf there are multiple colors (for gradient) this returns the first one
The font size of the tex mobject.
hash_seedA unique hash representing the result of the generated mobject points.
heightThe height of the mobject.
n_points_per_curvesheen_factorstroke_colorwidthThe width of the mobject.
- Parameters:
tex_string (str)
stroke_width (float)
should_center (bool)
height (float | None)
organize_left_to_right (bool)
tex_environment (str | None)
tex_template (TexTemplate | None)
font_size (float)
color (ParsableManimColor | None)
kwargs (Any)
- _original__init__(tex_string, stroke_width=0, should_center=True, height=None, organize_left_to_right=False, tex_environment='align*', tex_template=None, font_size=48, color=None, **kwargs)¶
Initialize self. See help(type(self)) for accurate signature.
- Parameters:
tex_string (str)
stroke_width (float)
should_center (bool)
height (float | None)
organize_left_to_right (bool)
tex_environment (str | None)
tex_template (TexTemplate | None)
font_size (float)
color (TypeAliasForwardRef('~manim.utils.color.core.ParsableManimColor') | None)
kwargs (Any)
- _remove_stray_braces(tex)[source]¶
Makes
MathTexresilient to unmatched braces.This is important when the braces in the TeX code are spread over multiple arguments as in, e.g.,
MathTex(r"e^{i", r"\tau} = 1").- Parameters:
tex (str)
- Return type:
str
- property font_size: float¶
The font size of the tex mobject.