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 []
|
||||
|
||||
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):
|
||||
if not span_0[0] < span_1[0] < span_0[1] < span_1[1]:
|
||||
continue
|
||||
|
|
|
@ -266,11 +266,12 @@ class MTex(LabelledString):
|
|||
result = self.get_replaced_substr(self.full_span, span_repl_dict)
|
||||
|
||||
if self.tex_environment:
|
||||
result = "\n".join([
|
||||
f"\\begin{{{self.tex_environment}}}",
|
||||
result,
|
||||
f"\\end{{{self.tex_environment}}}"
|
||||
])
|
||||
if isinstance(self.tex_environment, str):
|
||||
prefix = f"\\begin{{{self.tex_environment}}}"
|
||||
suffix = f"\\end{{{self.tex_environment}}}"
|
||||
else:
|
||||
prefix, suffix = self.tex_environment
|
||||
result = "\n".join([prefix, result, suffix])
|
||||
if self.alignment:
|
||||
result = "\n".join([self.alignment, result])
|
||||
if use_plain_file:
|
||||
|
|
Loading…
Add table
Reference in a new issue