mirror of
https://github.com/3b1b/manim.git
synced 2025-09-19 04:41:56 +00:00
Account for edge case where \{ is used in Tex
This commit is contained in:
parent
2488b9e866
commit
8e9b4d8563
1 changed files with 5 additions and 1 deletions
|
@ -132,7 +132,11 @@ class SingleStringTex(VMobject):
|
|||
Makes Tex resiliant to unmatched braces
|
||||
"""
|
||||
num_unclosed_brackets = 0
|
||||
for char in tex:
|
||||
for i in range(len(tex)):
|
||||
if i > 0 and tex[i - 1] == "\\":
|
||||
# So as to not count '\{' type expressions
|
||||
continue
|
||||
char = tex[i]
|
||||
if char == "{":
|
||||
num_unclosed_brackets += 1
|
||||
elif char == "}":
|
||||
|
|
Loading…
Add table
Reference in a new issue