敲击桌上的罢工文字
class TableExamples(Scene):
def construct(self):
t0 = Table(
[["This", "is a"],
["simple", "Table in \n Manim."]])
t1 = Table(
[["This", "is a"],
["simple", "Table."]],
row_labels=[Text("R1"), Text("R2")],
col_labels=[Text("C1"), Text("C2")])
t1.add_highlighted_cell((2,2), color=YELLOW)
t2 = Table(
[["This", "is a"],
["simple", "Table."]],
row_labels=[Text("R1"), Text("R2")],
col_labels=[Text("C1"), Text("C2")],
top_left_entry=Star().scale(0.3),
include_outer_lines=True,
arrange_in_grid_config={"cell_alignment": RIGHT})
t2.add(t2.get_cell((2,2), color=RED))
t3 = Table(
[["This", "is a"],
["simple", "Table."]],
row_labels=[Text("R1"), Text("R2")],
col_labels=[Text("C1"), Text("C2")],
top_left_entry=Star().scale(0.3),
include_outer_lines=True,
line_config={"stroke_width": 1, "color": YELLOW})
t3.remove(*t3.get_vertical_lines())
g = Group(
t0,t1,t2,t3
).scale(0.7).arrange_in_grid(buff=1)
self.add(g)
我正在试图打动一些东西。为此,我得到了。因此,为什么,我尝试过:
class TableExamples(Scene):
def construct(self):
t0 = Table(
[['``<span strikethrough="true" strikethrough_color="red">This</span>``', "is a"],
["simple", "Table in \n Manim."]])
t1 = Table(
[["This", "is a"],
["simple", "Table."]],
row_labels=[Text("R1"), Text("R2")],
col_labels=[Text("C1"), Text("C2")])
t1.add_highlighted_cell((2,2), color=YELLOW)
t2 = Table(
[["This", "is a"],
["simple", "Table."]],
row_labels=[Text("R1"), Text("R2")],
col_labels=[Text("C1"), Text("C2")],
top_left_entry=Star().scale(0.3),
include_outer_lines=True,
arrange_in_grid_config={"cell_alignment": RIGHT})
t2.add(t2.get_cell((2,2), color=RED))
t3 = Table(
[["This", "is a"],
["simple", "Table."]],
row_labels=[Text("R1"), Text("R2")],
col_labels=[Text("C1"), Text("C2")],
top_left_entry=Star().scale(0.3),
include_outer_lines=True,
line_config={"stroke_width": 1, "color": YELLOW})
t3.remove(*t3.get_vertical_lines())
g = Group(
t0,t1,t2,t3
).scale(0.7).arrange_in_grid(buff=1)
self.add(g)
但是它行不通。我还尝试使用乳胶标签,但是Manim不将其理解为乳胶,因为(我认为?)将其解释为文本
而不是 tex
。
有什么想法吗?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
看看 /code> ,您想调整
element_to_mobject
keyword参数(因为您正在尝试使用Markuptext
语法中的“正常”text> text 类,这
确实不起作用。
Take a look at the documentation of
Table
, you want to adapt theelement_to_mobject
keyword argument (because you are trying to useMarkupText
syntax in a "normal"Text
class, which does not work.This does though: