txt11 = TexMobject(r"-7", color=BLACK)
txt12 = TexMobject(r"\frac{1}{7}", color=BLACK).next_to(txt11, RIGHT)
我想给 txt12 的分母上色,尝试将 txt12 拆分为:
txt12 = TexMobject(r"\frac{1}", r"{7}", color=BLACK).next_to(txt11, RIGHT)
txt12.set_color_by_tex("{7}", BLUE)
但不起作用,然后我创建一个新的 txt13 与 txt12 重叠但一个空分子:
txt13 = TexMobject(r"\frac{}{7}", color=BLUE).move_to(txt12.get_center())
也不行。
有没有可行的方法来为部分等式着色,如分数?谢谢!