Update app.py
Browse files
app.py
CHANGED
|
@@ -533,7 +533,6 @@ class GeneratedMathScene(Scene):
|
|
| 533 |
wrap_width = {wrap_width}
|
| 534 |
|
| 535 |
def make_inline_segments(content, color, font, text_size, equation_size):
|
| 536 |
-
|
| 537 |
if not content:
|
| 538 |
return VGroup()
|
| 539 |
|
|
@@ -546,9 +545,9 @@ class GeneratedMathScene(Scene):
|
|
| 546 |
if not segment:
|
| 547 |
continue
|
| 548 |
|
| 549 |
-
# Check if it's a LaTeX equation (starts with
|
| 550 |
if segment.startswith("%"):
|
| 551 |
-
# Remove
|
| 552 |
latex_content = segment[1:]
|
| 553 |
mob = MathTex(latex_content, color=color, font_size=equation_size)
|
| 554 |
else:
|
|
@@ -561,7 +560,7 @@ class GeneratedMathScene(Scene):
|
|
| 561 |
return VGroup()
|
| 562 |
|
| 563 |
# Arrange horizontally with minimal spacing
|
| 564 |
-
inline_group = VGroup(*mobjects).arrange(RIGHT, buff=0.
|
| 565 |
return inline_group
|
| 566 |
|
| 567 |
def make_wrapped_paragraph(content, color, font, font_size, line_spacing=0.2):
|
|
@@ -637,7 +636,7 @@ class GeneratedMathScene(Scene):
|
|
| 637 |
mid = len(parts) // 2
|
| 638 |
line1 = " ".join(parts[:mid])
|
| 639 |
line2 = " ".join(parts[mid:])
|
| 640 |
-
wrapped_eq = f"{{line1}}
|
| 641 |
obj = MathTex(wrapped_eq, color=default_color, font_size=equation_size)
|
| 642 |
else:
|
| 643 |
obj = MathTex(eq_content, color=default_color, font_size=equation_size)
|
|
|
|
| 533 |
wrap_width = {wrap_width}
|
| 534 |
|
| 535 |
def make_inline_segments(content, color, font, text_size, equation_size):
|
|
|
|
| 536 |
if not content:
|
| 537 |
return VGroup()
|
| 538 |
|
|
|
|
| 545 |
if not segment:
|
| 546 |
continue
|
| 547 |
|
| 548 |
+
# Check if it's a LaTeX equation (starts with %)
|
| 549 |
if segment.startswith("%"):
|
| 550 |
+
# Remove % from start
|
| 551 |
latex_content = segment[1:]
|
| 552 |
mob = MathTex(latex_content, color=color, font_size=equation_size)
|
| 553 |
else:
|
|
|
|
| 560 |
return VGroup()
|
| 561 |
|
| 562 |
# Arrange horizontally with minimal spacing
|
| 563 |
+
inline_group = VGroup(*mobjects).arrange(RIGHT, buff=0.05)
|
| 564 |
return inline_group
|
| 565 |
|
| 566 |
def make_wrapped_paragraph(content, color, font, font_size, line_spacing=0.2):
|
|
|
|
| 636 |
mid = len(parts) // 2
|
| 637 |
line1 = " ".join(parts[:mid])
|
| 638 |
line2 = " ".join(parts[mid:])
|
| 639 |
+
wrapped_eq = f"{{{{line1}}}} \\\\\\\\ {{{{line2}}}}"
|
| 640 |
obj = MathTex(wrapped_eq, color=default_color, font_size=equation_size)
|
| 641 |
else:
|
| 642 |
obj = MathTex(eq_content, color=default_color, font_size=equation_size)
|