Add a debugging method

This commit is contained in:
Michael W 2021-12-07 12:55:52 +08:00 committed by GitHub
parent 88d863c1d7
commit 744916507c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -335,6 +335,7 @@ class MTex(VMobject):
return self
def assign_submob_tex_strings(self):
# Not sure whether this is the best practice...
tex_string = self.tex_string
label_dict = {
tex_span.label: (span_tuple, tex_span.containing_labels)
@ -461,6 +462,13 @@ class MTex(VMobject):
for span_tuple in self.tex_spans_dict.keys()
])
def print_tex_strings_of_submobjects(self):
# For debugging
# Working with `index_labels()`
print(f"Submobjects of \"{self.get_tex()}\":")
for i, submob in enumerate(self.submobjects):
print(f"{i}: \"{submob.get_tex()}\"")
class MTexText(MTex):
CONFIG = {