Skip to content

Commit

Permalink
Changed modification for tex mobjects that begin with a newline, whic…
Browse files Browse the repository at this point in the history
…h involved eliminating alignment when a TexMobject creates many SingleStringTexMobject to figure out how to divvy itself up
  • Loading branch information
3b1b committed Dec 10, 2019
1 parent f89bb3e commit fc28375
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions manimlib/mobject/svg/tex_mobject.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,8 @@ def modify_special_strings(self, tex):
tex = "\\quad"

# To keep files from starting with a line break
tex = tex.replace("\\\\", "\\quad\\\\")
if tex.startswith("\\\\"):
tex = tex.replace("\\\\", "\\quad\\\\")

# Handle imbalanced \left and \right
num_lefts, num_rights = [
Expand Down Expand Up @@ -174,8 +175,10 @@ def break_up_by_substrings(self):
"""
new_submobjects = []
curr_index = 0
config = dict(self.CONFIG)
config["alignment"] = ""
for tex_string in self.tex_strings:
sub_tex_mob = SingleStringTexMobject(tex_string, **self.CONFIG)
sub_tex_mob = SingleStringTexMobject(tex_string, **config)
num_submobs = len(sub_tex_mob.submobjects)
new_index = curr_index + num_submobs
if num_submobs == 0:
Expand Down

0 comments on commit fc28375

Please sign in to comment.