manim.mobject.svg.tex_mobject.MathTex

class MathTex(*tex_strings, arg_separator=' ', substrings_to_isolate=None, tex_to_color_map=None, tex_environment='align*', **kwargs)[source]

Bases: manim.mobject.svg.tex_mobject.SingleStringMathTex

A string compiled with LaTeX in math mode.

Examples

../_images/Formula-1.png
Formula
class Formula(Scene):
    def construct(self):
        t = MathTex(r"\int_a^b f'(x) dx = f(b)- f(a)")
        self.add(t)

Tests

Check that creating a MathTex works:

>>> MathTex('a^2 + b^2 = c^2')
MathTex('a^2 + b^2 = c^2')

Methods

break_up_by_substrings

Reorganize existing submobjects one layer deeper based on the structure of tex_strings (as a list of tex_strings)

break_up_tex_strings

get_part_by_tex

get_parts_by_tex

index_of_part

index_of_part_by_tex

set_color_by_tex

set_color_by_tex_to_color_map

sort_alphabetically

Attributes

animate

Used to animate the application of a method.

break_up_by_substrings()[source]

Reorganize existing submobjects one layer deeper based on the structure of tex_strings (as a list of tex_strings)