-
Hi everyone, I’m working on a didactic scene in Manim to explain the Hockey Stick Identity. Now I want to visually transition to the general formula and help the audience understand the role of each part. What I want to achieve: My problem:
But this renders incorrectly or does not behave like a proper My questions: Any tips, suggestions or code examples would be highly appreciated. Thanks in advance! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
You cannot split an equation like this, because the individual parts must remain valid LaTeX code, which for example The recommended way to do this is to identify the individual indices of your glyphs: class binomscene(Scene):
def construct(self):
binom1 = MathTex(r"\binom{2}{2}", font_size=32)
self.add(binom1)
self.add(index_labels(binom1[0]).set_color(RED)) class binomscene(Scene):
def construct(self):
binom1 = MathTex(r"\binom{2}{2}", font_size=32)
self.add(binom1)
# uncomment following line for index labels
#self.add(index_labels(binom1[0]).set_color(RED))
self.play(
binom1[0][1].animate.set_color(PURE_BLUE),
binom1[0][2].animate.set_color(PURE_RED),
)
self.wait() binomscene.mp4 |
Beta Was this translation helpful? Give feedback.
You cannot split an equation like this, because the individual parts must remain valid LaTeX code, which for example
\binom
on its own is not.The recommended way to do this is to identify the individual indices of your glyphs: