From dae24891fab10f993ef0b42c63737e53b9ce47ae Mon Sep 17 00:00:00 2001 From: Michael W <50232075+YishiMichael@users.noreply.github.com> Date: Sun, 28 Nov 2021 13:03:33 +0800 Subject: [PATCH] Add `get_all_isolated_substrings` method --- manimlib/mobject/svg/mtex_mobject.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/manimlib/mobject/svg/mtex_mobject.py b/manimlib/mobject/svg/mtex_mobject.py index 8f900d88..7e03fdd5 100644 --- a/manimlib/mobject/svg/mtex_mobject.py +++ b/manimlib/mobject/svg/mtex_mobject.py @@ -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()),