Skip to content

Instantly share code, notes, and snippets.

@jaddoescad
Created March 10, 2019 17:15
Show Gist options
  • Save jaddoescad/03ca13e8ace6a14c31b1d6363ad22d7a to your computer and use it in GitHub Desktop.
Save jaddoescad/03ca13e8ace6a14c31b1d6363ad22d7a to your computer and use it in GitHub Desktop.
coloringequations
class ColoringEquations(Scene):
#Grouping and coloring parts of equations
def construct(self):
line1=TexMobject(r"\text{The vector } \vec{F}_{net} \text{ is the net }",r"\text{force }",r"\text{on object of mass }")
line1.set_color_by_tex("force", BLUE)
line2=TexMobject("m", "\\text{ and acceleration }", "\\vec{a}", ". ")
line2.set_color_by_tex_to_color_map({
"m": YELLOW,
"{a}": RED
})
sentence=VGroup(line1,line2)
sentence.arrange_submobjects(DOWN, buff=MED_LARGE_BUFF)
self.play(Write(sentence))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment