manim TextMobject不适用于异常“ Latex错误转换为dvi

时间:2019-06-23 14:53:47

标签: manim

我的计算机是Windows 10 64位操作系统,我安装了python 3.7.3 32bit和MikTex 2.9 32bit,2019年6月左右(一两周前)来自git的manim master和其他依赖项,最后我可以成功运行SquareToCircle。

但是,当我将一个makeText类添加到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命令行窗口中发出以下命令:

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\Tex\6b85ca5665e2f414.log

Actuall我找不到6b85ca5665e2f414.log,但找不到6b85ca5665e2f414.tex和6b85ca5665e2f414.pdf。

任何人都可以帮助我,谢谢!

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

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

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

exit_code为1,并且命令以“ latex ....”开头。

3 个答案:

答案 0 :(得分:0)

例如可以制作形状吗?还是只在尝试制作TextMobjects时才会发生这种情况?

答案 1 :(得分:0)

我遵循了this,并且可以正常工作,不确定为什么未将修订合并到主版本中。

答案 2 :(得分:0)

如果运行Latex命令,它将显示命令失败的地方。就我而言,这是由于缺少Tex字体。我正在使用ubuntu并运行此命令解决了该问题 sudo apt安装texlive-latex-base texlive-full texlive-fonts-extra