Skip to content

armgit / manim

Public Imported from GitHub
0

A community-maintained Python framework for creating mathematical animations.

Bug fix

Grant Sanderson731748df4c53
diff --git a/mobject/svg/tex_mobject.py b/mobject/svg/tex_mobject.py
index e1849d382..e376e897f 100644
--- a/mobject/svg/tex_mobject.py
+++ b/mobject/svg/tex_mobject.py
@@ -81,7 +81,10 @@ class SingleStringTexMobject(SVGMobject):
# Handle imbalanced \left and \right
num_lefts, num_rights = [
- len([s for s in tex.split(substr)[1:] if s[0] in "(){}[]|.\\"])
+ len([
+ s for s in tex.split(substr)[1:]
+ if s and s[0] in "(){}[]|.\\"
+ ])
for substr in ("\\left", "\\right")
]
if num_lefts != num_rights: