Skip to content

armgit / manim

Public Imported from GitHub
0

A community-maintained Python framework for creating mathematical animations.

Fixed bug for multipled braces being imbalanced

Grant Sanderson692a2dfd1ff1
diff --git a/mobject/svg/tex_mobject.py b/mobject/svg/tex_mobject.py
index c7bcc78b9..fbaf89227 100644
--- a/mobject/svg/tex_mobject.py
+++ b/mobject/svg/tex_mobject.py
@@ -102,10 +102,12 @@ class SingleStringTexMobject(SVGMobject):
tex.count(char)
for char in "{}"
]
- if num_rights > num_lefts:
+ while num_rights > num_lefts:
tex = "{" + tex
- elif num_lefts > num_rights:
+ num_lefts += 1
+ while num_lefts > num_rights:
tex = tex + "}"
+ num_rights += 1
return tex
def get_tex_string(self):