manim TextMobject 无法使用异常“Latex error converting to dvi

manim TextMobject not work with exception "Latex error converting to dvi

我的电脑是Windows 10 64位,安装python 3.7.3 32位,MikTex 2.9 32位,2019年6月左右git的manim master(一两个几周前)和其他依赖项,我终于可以 运行 SquareToCircle 成功了。

然而,当我将 makeText class 添加到 example_scenes.py 和 运行 时,如下所示:

class makeText(Scene):
    def construct(self):
        first_line = TextMobject("Manim is fun")
        second_line = TextMobject("and useful")

        second_line.next_to(first_line, DOWN)

        self.wait(1)
        self.play(Write(first_line), Write(second_line))

在 windows 命令行中发出以下命令 window:

c:\software\manim>python -m manim example_scenes.py makeText -pl

异常弹出:

Media will be written to ./media\. You can change this behavior with the --media_dir flag.



Traceback (most recent call last):
  File "C:\software\manim\manimlib\extract_scene.py", line 150, in main
    scene = SceneClass(**scene_kwargs)
  File "C:\software\manim\manimlib\scene\scene.py", line 52, in __init__
    self.construct()
  File "example_scenes.py", line 90, in construct
    first_line = TextMobject("Manim is fun")
  File "C:\software\manim\manimlib\mobject\svg\tex_mobject.py", line 144, in __init__
    self, self.arg_separator.join(tex_strings), **kwargs
  File "C:\software\manim\manimlib\mobject\svg\tex_mobject.py", line 44, in __init__
    self.template_tex_file_body
  File "C:\software\manim\manimlib\utils\tex_file_writing.py", line 19, in tex_to_svg_file
    dvi_file = tex_to_dvi(tex_file)
  File "C:\software\manim\manimlib\utils\tex_file_writing.py", line 67, in tex_to_dvi
    "See log output above or the log file: %s" % log_file)
Exception: Latex error converting to dvi. See log output above or the log file: ./media\Texb85ca5665e2f414.log

实际上我找不到 6b85ca5665e2f414.log 但 6b85ca5665e2f414.tex 和 6b85ca5665e2f414.pdf.

谁能帮帮我,谢谢!

===============================================

更新(2019 年 6 月 28 日): 做了一些调试,发现下面的代码导致了异常(tex_file_writing.py 的第 61 行):

exit_code = os.system(" ".join(commands))

exit_code为1,命令以"latex...."

开头

例如制作形状有用吗?还是仅当您尝试制作 TextMobjects 时才会发生这种情况?

我遵循了 this,它起作用了,不知道为什么修复没有合并到主控中。

如果您使用 运行 Latex 命令,那么它会显示命令失败的地方。在我的例子中,这是由于缺少 Tex 字体。我正在使用 ubuntu 和 运行ning 这个命令解决了这个问题 sudo apt 安装 texlive-latex-base texlive-full texlive-fonts-extra