manim.animation.transform_matching_parts.TransformMatchingTex

class TransformMatchingTex(mobject, target_mobject, transform_mismatches=False, fade_transform_mismatches=False, key_map=None, **kwargs)[source]

Bases: manim.animation.transform_matching_parts.TransformMatchingAbstractBase

A transformation trying to transform rendered LaTeX strings.

Two submobjects match if their tex_string matches.

Examples

Example: MatchingEquationParts

from manim import *

class MatchingEquationParts(Scene):
    def construct(self):
        eq1 = MathTex("{{a^2}} + {{b^2}} = {{c^2}}")
        eq2 = MathTex("{{a^2}} = {{c^2}} - {{b^2}}")
        self.add(eq1)
        self.wait(0.5)
        self.play(TransformMatchingTex(eq1, eq2))
        self.wait(0.5)

Methods

get_mobject_key

get_mobject_parts

Parameters
  • mobject (Mobject) –

  • target_mobject (Mobject) –

  • transform_mismatches (bool) –

  • fade_transform_mismatches (bool) –

  • key_map (Optional[dict]) –