def construct(self): eq1_text = "4 x + 3 y = 0".split() eq2_text = "5 x - 2 y = 3".split() eq1_mob = TexMobject(*eq1_text) eq2_mob = TexMobject(*eq2_text) color_map = {"x": RED_B, "y": GREEN_C} eq1_mob.set_color_by_tex_to_color_map(color_map) eq2_mob.set_color_by_tex_to_color_map(color_map) for eq1_item, eq2_item in zip(eq1_mob, eq2_mob): eq2_item.align_to(eq1_item, LEFT) eq1 = VGroup(*eq1_mob) eq2 = VGroup(*eq2_mob) eq2.shift(DOWN) eq_group = VGroup(eq1, eq2) braces = Brace(eq_group, LEFT) eq_text = braces.get_text("A pair of equations") self.play(Write(eq_text)) self.play(GrowFromCenter(braces)) self.play(Write(eq1), Write(eq2)) self.wait(2)
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", r"\text{ and acceleration }", r"\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)) self.wait(3)