Add get_all_isolated_substrings method

This commit is contained in:
Michael W 2021-11-28 13:03:33 +08:00 committed by GitHub
parent a4f9de1ca1
commit dae24891fa
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -288,6 +288,13 @@ class MTex(VMobject):
self.set_submobjects(new_submobjects)
return self
def get_all_isolated_substrings(self):
tex_string = self.tex_string
return remove_list_redundancies([
tex_string[span_tuple[0] : span_tuple[1]]
for span_tuple in self.tex_spans_dict.keys()
])
def get_parts_by_tex(self, tex):
all_span_tuples = sorted(
list(self.tex_spans_dict.keys()),