Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions manim/mobject/text/tex_mobject.py
Original file line number Diff line number Diff line change
Expand Up @@ -338,12 +338,16 @@ def _prepare_tex_strings(self, tex_strings: Iterable[str]) -> list[str]:
tex_strings_validated = [
string if isinstance(string, str) else str(string) for string in tex_strings
]
# Remove Python line breaks when strings are spread over multiple lines
tex_strings_validated_one = [
tex.replace("\n", " ") for tex in tex_strings_validated
]
# Locate double curly bracers and split on them.
tex_strings_validated_two = []
for tex_string in tex_strings_validated:
for tex_string in tex_strings_validated_one:
split = self._split_double_braces(tex_string)
tex_strings_validated_two.extend(split)
if len(tex_strings_validated_two) > len(tex_strings_validated):
if len(tex_strings_validated_two) > len(tex_strings_validated_one):
self.brace_notation_split_occurred = True
return [string for string in tex_strings_validated_two if len(string) > 0]

Expand Down
Loading