Skip to content

self.play(Write(MathTex)) with string split and \\sqrt #2241

@HACHEDOSO

Description

@HACHEDOSO

Description of bug / unexpected behavior

Hi guys. I had a problem. I had a problem with the animation Write. When I split strings on MathTex and one of these contains \\sqrt or \\sqrt{ (I know if there is one of these strings, that represents two indexes), the mobject is written as you can see in the next video.

How to reproduce the issue

Code and video for reproducing the problem
Video.mp4
from manim import *

class Video(Scene):
    def construct(self):
        limit = MathTex("\\lim_{", "x", "\\to", "-\\infty}", "{", "\\sqrt{", "x", "^2", "+", "1}", "\\over", "x}").scale(2)
        limit[1].set_color(ORANGE)
        limit[6].set_color(ORANGE)
        limit[11].set_color(ORANGE)
        forsolve = Text("Para resolver este límite", font="Orbitron", weight=BOLD, color=BLACK).to_edge(UP)
        rec1 = SurroundingRectangle(forsolve, color=ORANGE, stroke_color=WHITE, fill_opacity=1.0, buff=0.3)
        self.play(Write(limit), DrawBorderThenFill(rec1), run_time=2)
        self.play(FadeIn(forsolve, shift=UP))

Additional media files

However, when I do the same thing with self.add, it's working fine.

Thumbnail_ManimCE_v0 11 0

from manim import *

class Thumbnail(Scene):
    def construct(self):
        title = Text("Calcula el siguiente límite",
        font="Orbitron",
        weight=BOLD,
        color=BLACK).to_edge(UP)
        rec = SurroundingRectangle(title,
        color=ORANGE,
        stroke_color=WHITE,
        fill_opacity=1.0,
        buff=0.3)
        limit = MathTex("\\lim_{", "x", "\\to", "-\\infty}", "{", "\\sqrt{", "x", "^2", "+", "1}", "\\over", "x}").scale(2)
        limit[1].set_color(ORANGE)
        limit[6].set_color(ORANGE)
        limit[11].set_color(ORANGE)
        svg = SVGMobject("deafness.svg").to_corner(DR)
        text = Tex("Video inclusivo", color=ORANGE).scale(1.5).to_edge(DOWN)
        self.add(rec, title, limit, svg, text)

Metadata

Metadata

Assignees

No one assigned

    Labels

    issue:bugSomething isn't working... For use in issues

    Type

    No type

    Projects

    Status

    🆕 New

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions