0

我正在尝试在 Manim 中操作乳胶列表中的每个项目(例如更改颜色,设置运动动画),但它不会让我这样做。我可以将乳胶配方分成几部分,但为什么我不能对乳胶列表做同样的事情?

这是我的代码:

class TitleAndListOfContent(Scene):
    def construct(self):
        list_of_content = TextMobject(
            '\\begin {itemize}',
            '\\item a',
            '\\item b',
            '\\item c',
            '\\end {itemize}',
        )
        self.play(Write(list_of_content))
        self.wait()

和回溯:

Traceback (most recent call last):
  File ".../manim/manimlib/extract_scene.py", line 155, in main
    scene = SceneClass(**scene_kwargs)
  File ".../manim/manimlib/scene/scene.py", line 75, in __init__
    self.construct()
  File "my_scene.py", line 33, in construct
    '\\end {itemize}',
  File ".../manim/manimlib/mobject/svg/tex_mobject.py", line 148, in __init__
    self, self.arg_separator.join(tex_strings), **kwargs
  File ".../manim/manimlib/mobject/svg/tex_mobject.py", line 44, in __init__
    self.template_tex_file_body
  File ".../manim/manimlib/utils/tex_file_writing.py", line 21, in tex_to_svg_file
    dvi_file = tex_to_dvi(tex_file)
  File ".../manim/manimlib/utils/tex_file_writing.py", line 72, in tex_to_dvi
    "See log output above or the log file: %s" % log_file)
Exception: Xelatex error converting to xdv. See log output above or the log file: media/Tex/a64dc4dc7f5621bd.log

作为参考,我想要达到的视觉效果是这样的: https ://youtu.be/BOMNd-bRQ4A?t=31

4

2 回答 2

1

我在 GitHub 存储库上打开了一个问题,并使用BulletedList类找到了一个更有希望的解决方案。我认为如果使用索尼的解决方案$\\bullet$,所有项目都将居中(或需要手动重新定位),我们希望项目向左对齐。

于 2020-08-06T03:01:03.660 回答
0

我是 manim 的新手,尝试时无法正常工作(所以我不知道为什么)。但是,您可以使用一种解决方法。

在数学模式下,您可以使用$\\bullet$在前面创建点的命令。因此,调整您的程序:

        list_of_content = TextMobject(
        '$\\bullet$ a \\\\',
        '$\\bullet$ b \\\\',
        '$\\bullet$ c \\\\'
        )

记住换行符,所以所有内容都不在同一行。

于 2020-08-06T01:00:57.367 回答