简体   繁体   中英

Why does Manim meet problems with latex

I am trying to run very basic Latex but I meet error. Does somebody know how to fix it?

code:

from manimlib import *
class TexTransformExample(Scene):
    def construct(self):
        munis=Tex(r'\munis')
        self.add(munis)

and here is the error

'latex' is not recognized as an internal or external command, operable program or batch file. ERROR:root:

LaTeX Error! Not a worry, it happens to the best of us.

Traceback (most recent call last): File "C:\\Users\\Alek\\AppData\\Local\\Programs\\Python\\Python39\\lib\\runpy.py", line 197, in _run_module_as_main return run_code(code, main_globals, None, File "C:\\Users\\Alek\\AppData\\Local\\Programs\\Python\\Python39\\lib\\runpy.py", line 87, in run_code exec(code, run_globals) File "C:\\Users\\Alek\\AppData\\Local\\Programs\\Python\\Python39\\Scripts\\manimgl.exe_ main .py", line 7, in File "C:\\Users\\Alek\\AppData\\Local\\Programs\\Python\\Python39\\lib\\site-packages\\manimlib_ main .py", line 17, in main scene.run() File "C:\\Users\\Alek\\AppData\\Local\\Programs\\Python\\Python39\\lib\\site-packages\\manimlib\\scene\\scene.py", line 75, in run self.construct() File "1.py", line 4, in construct munis=Tex("{{x}}") File "C:\\Users\\Alek\\AppData\\Local\\Programs\\Python\\Python39\\lib\\site-packages\\manimlib\\mobject\\svg\\tex_mobject.py", line 163, in init super(). init (full_string, **kwargs) File "C:\\Users\\Alek\\AppData\\Local\\Programs\\Python\\Python39\\lib\\site-packages\\manimlib\\mobject\\svg\\tex_mobjec t.py", line 42, in init filename = tex_to_svg_file(full_tex) File "C:\\Users\\Alek\\AppData\\Local\\Programs\\Python\\Python39\\lib\\site-packages\\manimlib\\utils\\tex_file_writing.py", line 52, in tex_to_svg_file tex_to_svg(tex_file_content, svg_file) File "C:\\Users\\Alek\\AppData\\Local\\Programs\\Python\\Python39\\lib\\site-packages\\manimlib\\utils\\tex_file_writing.py", line 60, in tex_to_svg svg_file = dvi_to_svg(tex_to_dvi(tex_file)) File "C:\\Users\\Alek\\AppData\\Local\\Programs\\Python\\Python39\\lib\\site-packages\\manimlib\\utils\\tex_file_writing.py", line 94, in tex_to_dvi with open(log_file, "r") as file: FileNotFoundError: [Errno 2] No such file or directory: 'C:\\Users\\Alek\\AppData\\Local\\Temp\\Tex\\7623af840f03027e.log'

Try installing the Windows MikTex distribution:

https://miktex.org/download

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM