mirror of
https://github.com/3b1b/manim.git
synced 2025-08-05 16:49:03 +00:00
Support passing in complete environment tags
This commit is contained in:
parent
bff9f74b04
commit
0c1e5b337b
2 changed files with 8 additions and 5 deletions
|
@ -373,6 +373,8 @@ class LabelledString(_StringSVG, ABC):
|
||||||
return []
|
return []
|
||||||
|
|
||||||
def check_overlapping(self) -> None:
|
def check_overlapping(self) -> None:
|
||||||
|
if len(self.label_span_list) >= 16777216:
|
||||||
|
raise ValueError("Cannot label that many substrings")
|
||||||
for span_0, span_1 in it.product(self.label_span_list, repeat=2):
|
for span_0, span_1 in it.product(self.label_span_list, repeat=2):
|
||||||
if not span_0[0] < span_1[0] < span_0[1] < span_1[1]:
|
if not span_0[0] < span_1[0] < span_0[1] < span_1[1]:
|
||||||
continue
|
continue
|
||||||
|
|
|
@ -266,11 +266,12 @@ class MTex(LabelledString):
|
||||||
result = self.get_replaced_substr(self.full_span, span_repl_dict)
|
result = self.get_replaced_substr(self.full_span, span_repl_dict)
|
||||||
|
|
||||||
if self.tex_environment:
|
if self.tex_environment:
|
||||||
result = "\n".join([
|
if isinstance(self.tex_environment, str):
|
||||||
f"\\begin{{{self.tex_environment}}}",
|
prefix = f"\\begin{{{self.tex_environment}}}"
|
||||||
result,
|
suffix = f"\\end{{{self.tex_environment}}}"
|
||||||
f"\\end{{{self.tex_environment}}}"
|
else:
|
||||||
])
|
prefix, suffix = self.tex_environment
|
||||||
|
result = "\n".join([prefix, result, suffix])
|
||||||
if self.alignment:
|
if self.alignment:
|
||||||
result = "\n".join([self.alignment, result])
|
result = "\n".join([self.alignment, result])
|
||||||
if use_plain_file:
|
if use_plain_file:
|
||||||
|
|
Loading…
Add table
Reference in a new issue