Search code examples
manim

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


My computer is Windows 10 64bit, and I install python 3.7.3 32bit, and MikTex 2.9 32bit, manim master from git at around june 2019 (one or two weeks ago) and other dependencies, finally I can run SquareToCircle successfully.

However when I add a makeText class to example_scenes.py and run as below:

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))

Issue below command in windows command line window:

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

Exception pops:

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 I cannot find 6b85ca5665e2f414.log but a 6b85ca5665e2f414.tex and a 6b85ca5665e2f414.pdf.

Anyone can help me please, thanks!

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

update (June 28, 2019): Did some debug and found below code caused the exception (line 61 of tex_file_writing.py):

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

the exit_code is 1, and the commands begin with "latex...."


Solution

  • I followed this, and it works, not sure why the fix was not merged into the master.