python - 如何在 Manim 中操作乳胶列表中的每个项目
问题描述
我正在尝试在 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
解决方案
我在 GitHub 存储库上打开了一个问题,并使用BulletedList
类找到了一个更有希望的解决方案。我认为如果使用索尼的解决方案$\\bullet$
,所有项目都将居中(或需要手动重新定位),我们希望项目向左对齐。
推荐阅读
- python - 计算聚合模式
- swagger - swagger 3.0 定义模式以防止重复
- java - 是否可以在 Android 的运行时卸载库并加载不同版本的库?
- javascript - ReactJs 上下文 - 元素类型无效
- go - Go 例程和 Defer
- visual-studio-2013 - OldConvergedLogin_PCore.js 上的 VS 2013 登录错误
- sql - 使用优先规则将多行合并为一
- javascript - jQuery datepicker 仅在第一次执行时运行
- typescript - 如何在 Typescript 3.0 中将元组“映射”到另一个元组类型
- java - 无法在成本适配器中的 onCreate 下访问数组