Note: This is a temporary test environment in which you can play around with Manim without the need of installing it locally. Keep in mind that this is a temporary environment, though: your changes will not be saved and cannot be shared with others. To save your work, you will need to download the notebook file (“File > Download as > Notebook (.ipynb)”). Enjoy!
Useful resources: Documentation, Discord, Reddit
from manim import *
config.media_width = "35%"
config.media_embed = True
config.verbosity = "WARNING"
%manim --help
Manim Community v0.18.1
Usage: manim [OPTIONS] COMMAND [ARGS]...
Animation engine for explanatory math videos.
Options:
--version Show version and exit.
--show-splash / --hide-splash Print splash message with version information.
--help Show this message and exit.
Commands:
cfg Manages Manim configuration files.
checkhealth This subcommand checks whether Manim is installed correctly...
init Create a new project or insert a new scene.
plugins Manages Manim plugins.
render Render SCENE(S) from the input FILE.
See 'manim <command>' to read about a specific subcommand.
Note: the subcommand 'manim render' is called if no other subcommand is
specified. Run 'manim render --help' if you would like to know what the '-ql' or
'-p' flags do, for example.
Made with <3 by Manim Community developers.
%%manim -qm -v WARNING SquareToCircle
class SquareToCircle(Scene):
def construct(self):
circle = Circle()
square = Square()
square.flip(RIGHT)
square.rotate(-3 * TAU / 8)
circle.set_fill(PINK, opacity=0.5)
self.play(Create(square))
self.play(Transform(square, circle))
self.play(FadeOut(square))
Manim Community v0.18.1
%%manim -qm -v WARNING WarpSquare
class WarpSquare(Scene):
def construct(self):
square = Square()
self.play(
ApplyPointwiseFunction(
lambda point: complex_to_R3(np.exp(R3_to_complex(point))), square
)
)
self.wait()
Manim Community v0.18.1
%%manim -qm -v WARNING WriteStuff
class WriteStuff(Scene):
def construct(self):
example_text = Tex("This is some text", tex_to_color_map={"text": YELLOW})
example_tex = MathTex(
"\\sum_{k=1}^\\infty {1 \\over k^2} = {\\pi^2 \\over 6}",
)
group = VGroup(example_text, example_tex)
group.arrange(DOWN)
group.set(width=config["frame_width"] - 2 * LARGE_BUFF)
self.play(Write(example_text))
self.play(Write(example_tex))
self.wait()
Manim Community v0.18.1
[12/19/24 00:23:12] ERROR LaTeX compilation error: LaTeX Error: File `standalone.cls' tex_file_writing.py:314 not found.
# 2024-12-19 00:23:12,214 ERROR manim tex_file_writing.py:314 -- LaTeX compilation error: LaTeX Error: File `standalone.cls' not found.
# 2024-12-19 00:23:12,219 ERROR manim tex_file_writing.py:348 -- Context of error:
-> \documentclass[preview]{standalone}
\usepackage[english]{babel}
\usepackage{amsmath}
\usepackage{amssymb}
# 2024-12-19 00:23:12,225 ERROR manim tex_file_writing.py:314 -- LaTeX compilation error: Emergency stop.
# 2024-12-19 00:23:12,228 ERROR manim tex_file_writing.py:348 -- Context of error:
-> \documentclass[preview]{standalone}
\usepackage[english]{babel}
\usepackage{amsmath}
\usepackage{amssymb}
ERROR Context of error: tex_file_writing.py:348 -> \documentclass[preview]{standalone} \usepackage[english]{babel} \usepackage{amsmath} \usepackage{amssymb}
ERROR LaTeX compilation error: Emergency stop. tex_file_writing.py:314
ERROR Context of error: tex_file_writing.py:348 -> \documentclass[preview]{standalone} \usepackage[english]{babel} \usepackage{amsmath} \usepackage{amssymb}
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
Cell In[5], line 1
----> 1 get_ipython().run_cell_magic('manim', '-qm -v WARNING WriteStuff', '\nclass WriteStuff(Scene):\n def construct(self):\n example_text = Tex("This is some text", tex_to_color_map={"text": YELLOW})\n example_tex = MathTex(\n "\\\\sum_{k=1}^\\\\infty {1 \\\\over k^2} = {\\\\pi^2 \\\\over 6}",\n )\n group = VGroup(example_text, example_tex)\n group.arrange(DOWN)\n group.set(width=config["frame_width"] - 2 * LARGE_BUFF)\n\n self.play(Write(example_text))\n self.play(Write(example_tex))\n self.wait()\n')
File /media/pc/data/lxw/envs/anaconda3a/envs/ai/lib/python3.12/site-packages/IPython/core/interactiveshell.py:2541, in InteractiveShell.run_cell_magic(self, magic_name, line, cell)
2539 with self.builtin_trap:
2540 args = (magic_arg_s, cell)
-> 2541 result = fn(*args, **kwargs)
2543 # The code below prevents the output from being displayed
2544 # when using magics with decorator @output_can_be_silenced
2545 # when the last Python token in the expression is a ';'.
2546 if getattr(fn, magic.MAGIC_OUTPUT_CAN_BE_SILENCED, False):
File /media/pc/data/lxw/envs/anaconda3a/envs/ai/lib/python3.12/site-packages/manim/utils/ipython_magic.py:143, in ManimMagic.manim(self, line, cell, local_ns)
141 SceneClass = local_ns[config["scene_names"][0]]
142 scene = SceneClass(renderer=renderer)
--> 143 scene.render()
144 finally:
145 # Shader cache becomes invalid as the context is destroyed
146 shader_program_cache.clear()
File /media/pc/data/lxw/envs/anaconda3a/envs/ai/lib/python3.12/site-packages/manim/scene/scene.py:229, in Scene.render(self, preview)
227 self.setup()
228 try:
--> 229 self.construct()
230 except EndSceneEarlyException:
231 pass
File <string>:4, in construct(self)
File /media/pc/data/lxw/envs/anaconda3a/envs/ai/lib/python3.12/site-packages/manim/mobject/text/tex_mobject.py:443, in Tex.__init__(self, arg_separator, tex_environment, *tex_strings, **kwargs)
440 def __init__(
441 self, *tex_strings, arg_separator="", tex_environment="center", **kwargs
442 ):
--> 443 super().__init__(
444 *tex_strings,
445 arg_separator=arg_separator,
446 tex_environment=tex_environment,
447 **kwargs,
448 )
File /media/pc/data/lxw/envs/anaconda3a/envs/ai/lib/python3.12/site-packages/manim/mobject/text/tex_mobject.py:293, in MathTex.__init__(self, arg_separator, substrings_to_isolate, tex_to_color_map, tex_environment, *tex_strings, **kwargs)
280 if self.brace_notation_split_occurred:
281 logger.error(
282 dedent(
283 """\
(...)
291 ),
292 )
--> 293 raise compilation_error
294 self.set_color_by_tex_to_color_map(self.tex_to_color_map)
296 if self.organize_left_to_right:
File /media/pc/data/lxw/envs/anaconda3a/envs/ai/lib/python3.12/site-packages/manim/mobject/text/tex_mobject.py:272, in MathTex.__init__(self, arg_separator, substrings_to_isolate, tex_to_color_map, tex_environment, *tex_strings, **kwargs)
270 self.tex_strings = self._break_up_tex_strings(tex_strings)
271 try:
--> 272 super().__init__(
273 self.arg_separator.join(self.tex_strings),
274 tex_environment=self.tex_environment,
275 tex_template=self.tex_template,
276 **kwargs,
277 )
278 self._break_up_by_substrings()
279 except ValueError as compilation_error:
File /media/pc/data/lxw/envs/anaconda3a/envs/ai/lib/python3.12/site-packages/manim/mobject/text/tex_mobject.py:81, in SingleStringMathTex.__init__(self, tex_string, stroke_width, should_center, height, organize_left_to_right, tex_environment, tex_template, font_size, **kwargs)
79 assert isinstance(tex_string, str)
80 self.tex_string = tex_string
---> 81 file_name = tex_to_svg_file(
82 self._get_modified_expression(tex_string),
83 environment=self.tex_environment,
84 tex_template=self.tex_template,
85 )
86 super().__init__(
87 file_name=file_name,
88 should_center=should_center,
(...)
95 **kwargs,
96 )
97 self.init_colors()
File /media/pc/data/lxw/envs/anaconda3a/envs/ai/lib/python3.12/site-packages/manim/utils/tex_file_writing.py:63, in tex_to_svg_file(expression, environment, tex_template)
60 if svg_file.exists():
61 return svg_file
---> 63 dvi_file = compile_tex(
64 tex_file,
65 tex_template.tex_compiler,
66 tex_template.output_format,
67 )
68 svg_file = convert_to_svg(dvi_file, tex_template.output_format)
69 if not config["no_latex_cleanup"]:
File /media/pc/data/lxw/envs/anaconda3a/envs/ai/lib/python3.12/site-packages/manim/utils/tex_file_writing.py:213, in compile_tex(tex_file, tex_compiler, output_format)
211 log_file = tex_file.with_suffix(".log")
212 print_all_tex_errors(log_file, tex_compiler, tex_file)
--> 213 raise ValueError(
214 f"{tex_compiler} error converting to"
215 f" {output_format[1:]}. See log output above or"
216 f" the log file: {log_file}",
217 )
218 return result
ValueError: latex error converting to dvi. See log output above or the log file: media/Tex/da7f99663012a762.log
%%manim -qm -v WARNING UpdatersExample
class UpdatersExample(Scene):
def construct(self):
decimal = DecimalNumber(
0,
show_ellipsis=True,
num_decimal_places=3,
include_sign=True,
)
square = Square().to_edge(UP)
decimal.add_updater(lambda d: d.next_to(square, RIGHT))
decimal.add_updater(lambda d: d.set_value(square.get_center()[1]))
self.add(square, decimal)
self.play(
square.animate.to_edge(DOWN),
rate_func=there_and_back,
run_time=5,
)
self.wait()
Manim Community v0.18.1
[12/19/24 00:23:28] ERROR LaTeX compilation error: LaTeX Error: File `standalone.cls' tex_file_writing.py:314 not found.
# 2024-12-19 00:23:28,032 ERROR manim tex_file_writing.py:314 -- LaTeX compilation error: LaTeX Error: File `standalone.cls' not found.
# 2024-12-19 00:23:28,036 ERROR manim tex_file_writing.py:348 -- Context of error:
-> \documentclass[preview]{standalone}
\usepackage[english]{babel}
\usepackage{amsmath}
\usepackage{amssymb}
# 2024-12-19 00:23:28,041 ERROR manim tex_file_writing.py:314 -- LaTeX compilation error: Emergency stop.
# 2024-12-19 00:23:28,045 ERROR manim tex_file_writing.py:348 -- Context of error:
-> \documentclass[preview]{standalone}
\usepackage[english]{babel}
\usepackage{amsmath}
\usepackage{amssymb}
ERROR Context of error: tex_file_writing.py:348 -> \documentclass[preview]{standalone} \usepackage[english]{babel} \usepackage{amsmath} \usepackage{amssymb}
ERROR LaTeX compilation error: Emergency stop. tex_file_writing.py:314
ERROR Context of error: tex_file_writing.py:348 -> \documentclass[preview]{standalone} \usepackage[english]{babel} \usepackage{amsmath} \usepackage{amssymb}
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
Cell In[6], line 1
----> 1 get_ipython().run_cell_magic('manim', '-qm -v WARNING UpdatersExample', '\nclass UpdatersExample(Scene):\n def construct(self):\n decimal = DecimalNumber(\n 0,\n show_ellipsis=True,\n num_decimal_places=3,\n include_sign=True,\n )\n square = Square().to_edge(UP)\n\n decimal.add_updater(lambda d: d.next_to(square, RIGHT))\n decimal.add_updater(lambda d: d.set_value(square.get_center()[1]))\n self.add(square, decimal)\n self.play(\n square.animate.to_edge(DOWN),\n rate_func=there_and_back,\n run_time=5,\n )\n self.wait()\n')
File /media/pc/data/lxw/envs/anaconda3a/envs/ai/lib/python3.12/site-packages/IPython/core/interactiveshell.py:2541, in InteractiveShell.run_cell_magic(self, magic_name, line, cell)
2539 with self.builtin_trap:
2540 args = (magic_arg_s, cell)
-> 2541 result = fn(*args, **kwargs)
2543 # The code below prevents the output from being displayed
2544 # when using magics with decorator @output_can_be_silenced
2545 # when the last Python token in the expression is a ';'.
2546 if getattr(fn, magic.MAGIC_OUTPUT_CAN_BE_SILENCED, False):
File /media/pc/data/lxw/envs/anaconda3a/envs/ai/lib/python3.12/site-packages/manim/utils/ipython_magic.py:143, in ManimMagic.manim(self, line, cell, local_ns)
141 SceneClass = local_ns[config["scene_names"][0]]
142 scene = SceneClass(renderer=renderer)
--> 143 scene.render()
144 finally:
145 # Shader cache becomes invalid as the context is destroyed
146 shader_program_cache.clear()
File /media/pc/data/lxw/envs/anaconda3a/envs/ai/lib/python3.12/site-packages/manim/scene/scene.py:229, in Scene.render(self, preview)
227 self.setup()
228 try:
--> 229 self.construct()
230 except EndSceneEarlyException:
231 pass
File <string>:4, in construct(self)
File /media/pc/data/lxw/envs/anaconda3a/envs/ai/lib/python3.12/site-packages/manim/mobject/text/numbers.py:135, in DecimalNumber.__init__(self, number, num_decimal_places, mob_class, include_sign, group_with_commas, digit_buff_per_font_unit, show_ellipsis, unit, unit_buff_per_font_unit, include_background_rectangle, edge_to_fix, font_size, stroke_width, fill_opacity, **kwargs)
117 self.initial_config = kwargs.copy()
118 self.initial_config.update(
119 {
120 "num_decimal_places": num_decimal_places,
(...)
132 },
133 )
--> 135 self._set_submobjects_from_number(number)
136 self.init_colors()
File /media/pc/data/lxw/envs/anaconda3a/envs/ai/lib/python3.12/site-packages/manim/mobject/text/numbers.py:160, in DecimalNumber._set_submobjects_from_number(self, number)
157 self.submobjects = []
159 num_string = self._get_num_string(number)
--> 160 self.add(*(map(self._string_to_mob, num_string)))
162 # Add non-numerical bits
163 if self.show_ellipsis:
File /media/pc/data/lxw/envs/anaconda3a/envs/ai/lib/python3.12/site-packages/manim/mobject/text/numbers.py:225, in DecimalNumber._string_to_mob(self, string, mob_class, **kwargs)
222 mob_class = self.mob_class
224 if string not in string_to_mob_map:
--> 225 string_to_mob_map[string] = mob_class(string, **kwargs)
226 mob = string_to_mob_map[string].copy()
227 mob.font_size = self._font_size
File /media/pc/data/lxw/envs/anaconda3a/envs/ai/lib/python3.12/site-packages/manim/mobject/text/tex_mobject.py:293, in MathTex.__init__(self, arg_separator, substrings_to_isolate, tex_to_color_map, tex_environment, *tex_strings, **kwargs)
280 if self.brace_notation_split_occurred:
281 logger.error(
282 dedent(
283 """\
(...)
291 ),
292 )
--> 293 raise compilation_error
294 self.set_color_by_tex_to_color_map(self.tex_to_color_map)
296 if self.organize_left_to_right:
File /media/pc/data/lxw/envs/anaconda3a/envs/ai/lib/python3.12/site-packages/manim/mobject/text/tex_mobject.py:272, in MathTex.__init__(self, arg_separator, substrings_to_isolate, tex_to_color_map, tex_environment, *tex_strings, **kwargs)
270 self.tex_strings = self._break_up_tex_strings(tex_strings)
271 try:
--> 272 super().__init__(
273 self.arg_separator.join(self.tex_strings),
274 tex_environment=self.tex_environment,
275 tex_template=self.tex_template,
276 **kwargs,
277 )
278 self._break_up_by_substrings()
279 except ValueError as compilation_error:
File /media/pc/data/lxw/envs/anaconda3a/envs/ai/lib/python3.12/site-packages/manim/mobject/text/tex_mobject.py:81, in SingleStringMathTex.__init__(self, tex_string, stroke_width, should_center, height, organize_left_to_right, tex_environment, tex_template, font_size, **kwargs)
79 assert isinstance(tex_string, str)
80 self.tex_string = tex_string
---> 81 file_name = tex_to_svg_file(
82 self._get_modified_expression(tex_string),
83 environment=self.tex_environment,
84 tex_template=self.tex_template,
85 )
86 super().__init__(
87 file_name=file_name,
88 should_center=should_center,
(...)
95 **kwargs,
96 )
97 self.init_colors()
File /media/pc/data/lxw/envs/anaconda3a/envs/ai/lib/python3.12/site-packages/manim/utils/tex_file_writing.py:63, in tex_to_svg_file(expression, environment, tex_template)
60 if svg_file.exists():
61 return svg_file
---> 63 dvi_file = compile_tex(
64 tex_file,
65 tex_template.tex_compiler,
66 tex_template.output_format,
67 )
68 svg_file = convert_to_svg(dvi_file, tex_template.output_format)
69 if not config["no_latex_cleanup"]:
File /media/pc/data/lxw/envs/anaconda3a/envs/ai/lib/python3.12/site-packages/manim/utils/tex_file_writing.py:213, in compile_tex(tex_file, tex_compiler, output_format)
211 log_file = tex_file.with_suffix(".log")
212 print_all_tex_errors(log_file, tex_compiler, tex_file)
--> 213 raise ValueError(
214 f"{tex_compiler} error converting to"
215 f" {output_format[1:]}. See log output above or"
216 f" the log file: {log_file}",
217 )
218 return result
ValueError: latex error converting to dvi. See log output above or the log file: media/Tex/9f38976a758de16a.log
%%manim -qm -v WARNING OpeningManim
class OpeningManim(Scene):
def construct(self):
title = Tex(r"This is some \LaTeX")
basel = MathTex(r"\sum_{n=1}^\infty \frac{1}{n^2} = \frac{\pi^2}{6}")
VGroup(title, basel).arrange(DOWN)
self.play(
Write(title),
FadeIn(basel, shift = UP),
)
self.wait()
transform_title = Tex("That was a transform")
transform_title.to_corner(UP + LEFT)
self.play(
Transform(title, transform_title),
LaggedStart(*[FadeOut(obj, shift=DOWN) for obj in basel]),
)
self.wait()
grid = NumberPlane(x_range=(- 10, 10, 1), y_range=(- 6.0, 6.0, 1))
grid_title = Tex("This is a grid")
grid_title.scale(1.5)
grid_title.move_to(transform_title)
self.add(grid, grid_title) # Make sure title is on top of grid
self.play(
FadeOut(title),
FadeIn(grid_title, shift=DOWN),
Create(grid, run_time=3, lag_ratio=0.1),
)
self.wait()
grid_transform_title = Tex(
r"That was a non-linear function \\ applied to the grid"
)
grid_transform_title.move_to(grid_title, UL)
grid.prepare_for_nonlinear_transform()
self.play(
grid.animate.apply_function(
lambda p: p
+ np.array(
[
np.sin(p[1]),
np.sin(p[0]),
0,
]
)
),
run_time=3,
)
self.wait()
self.play(Transform(grid_title, grid_transform_title))
self.wait()
Manim Community v0.18.1
[12/19/24 00:23:32] ERROR LaTeX compilation error: LaTeX Error: File `standalone.cls' tex_file_writing.py:314 not found.
# 2024-12-19 00:23:32,026 ERROR manim tex_file_writing.py:314 -- LaTeX compilation error: LaTeX Error: File `standalone.cls' not found.
# 2024-12-19 00:23:32,030 ERROR manim tex_file_writing.py:348 -- Context of error:
-> \documentclass[preview]{standalone}
\usepackage[english]{babel}
\usepackage{amsmath}
\usepackage{amssymb}
# 2024-12-19 00:23:32,034 ERROR manim tex_file_writing.py:314 -- LaTeX compilation error: Emergency stop.
# 2024-12-19 00:23:32,038 ERROR manim tex_file_writing.py:348 -- Context of error:
-> \documentclass[preview]{standalone}
\usepackage[english]{babel}
\usepackage{amsmath}
\usepackage{amssymb}
ERROR Context of error: tex_file_writing.py:348 -> \documentclass[preview]{standalone} \usepackage[english]{babel} \usepackage{amsmath} \usepackage{amssymb}
ERROR LaTeX compilation error: Emergency stop. tex_file_writing.py:314
ERROR Context of error: tex_file_writing.py:348 -> \documentclass[preview]{standalone} \usepackage[english]{babel} \usepackage{amsmath} \usepackage{amssymb}
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
Cell In[7], line 1
----> 1 get_ipython().run_cell_magic('manim', '-qm -v WARNING OpeningManim', '\nclass OpeningManim(Scene):\n def construct(self):\n title = Tex(r"This is some \\LaTeX")\n basel = MathTex(r"\\sum_{n=1}^\\infty \\frac{1}{n^2} = \\frac{\\pi^2}{6}")\n VGroup(title, basel).arrange(DOWN)\n self.play(\n Write(title),\n FadeIn(basel, shift = UP),\n )\n self.wait()\n\n transform_title = Tex("That was a transform")\n transform_title.to_corner(UP + LEFT)\n self.play(\n Transform(title, transform_title),\n LaggedStart(*[FadeOut(obj, shift=DOWN) for obj in basel]),\n )\n self.wait()\n\n grid = NumberPlane(x_range=(- 10, 10, 1), y_range=(- 6.0, 6.0, 1))\n grid_title = Tex("This is a grid")\n grid_title.scale(1.5)\n grid_title.move_to(transform_title)\n\n self.add(grid, grid_title) # Make sure title is on top of grid\n self.play(\n FadeOut(title),\n FadeIn(grid_title, shift=DOWN),\n Create(grid, run_time=3, lag_ratio=0.1),\n )\n self.wait()\n\n grid_transform_title = Tex(\n r"That was a non-linear function \\\\ applied to the grid"\n )\n grid_transform_title.move_to(grid_title, UL)\n grid.prepare_for_nonlinear_transform()\n self.play(\n grid.animate.apply_function(\n lambda p: p\n + np.array(\n [\n np.sin(p[1]),\n np.sin(p[0]),\n 0,\n ]\n )\n ),\n run_time=3,\n )\n self.wait()\n self.play(Transform(grid_title, grid_transform_title))\n self.wait()\n')
File /media/pc/data/lxw/envs/anaconda3a/envs/ai/lib/python3.12/site-packages/IPython/core/interactiveshell.py:2541, in InteractiveShell.run_cell_magic(self, magic_name, line, cell)
2539 with self.builtin_trap:
2540 args = (magic_arg_s, cell)
-> 2541 result = fn(*args, **kwargs)
2543 # The code below prevents the output from being displayed
2544 # when using magics with decorator @output_can_be_silenced
2545 # when the last Python token in the expression is a ';'.
2546 if getattr(fn, magic.MAGIC_OUTPUT_CAN_BE_SILENCED, False):
File /media/pc/data/lxw/envs/anaconda3a/envs/ai/lib/python3.12/site-packages/manim/utils/ipython_magic.py:143, in ManimMagic.manim(self, line, cell, local_ns)
141 SceneClass = local_ns[config["scene_names"][0]]
142 scene = SceneClass(renderer=renderer)
--> 143 scene.render()
144 finally:
145 # Shader cache becomes invalid as the context is destroyed
146 shader_program_cache.clear()
File /media/pc/data/lxw/envs/anaconda3a/envs/ai/lib/python3.12/site-packages/manim/scene/scene.py:229, in Scene.render(self, preview)
227 self.setup()
228 try:
--> 229 self.construct()
230 except EndSceneEarlyException:
231 pass
File <string>:4, in construct(self)
File /media/pc/data/lxw/envs/anaconda3a/envs/ai/lib/python3.12/site-packages/manim/mobject/text/tex_mobject.py:443, in Tex.__init__(self, arg_separator, tex_environment, *tex_strings, **kwargs)
440 def __init__(
441 self, *tex_strings, arg_separator="", tex_environment="center", **kwargs
442 ):
--> 443 super().__init__(
444 *tex_strings,
445 arg_separator=arg_separator,
446 tex_environment=tex_environment,
447 **kwargs,
448 )
File /media/pc/data/lxw/envs/anaconda3a/envs/ai/lib/python3.12/site-packages/manim/mobject/text/tex_mobject.py:293, in MathTex.__init__(self, arg_separator, substrings_to_isolate, tex_to_color_map, tex_environment, *tex_strings, **kwargs)
280 if self.brace_notation_split_occurred:
281 logger.error(
282 dedent(
283 """\
(...)
291 ),
292 )
--> 293 raise compilation_error
294 self.set_color_by_tex_to_color_map(self.tex_to_color_map)
296 if self.organize_left_to_right:
File /media/pc/data/lxw/envs/anaconda3a/envs/ai/lib/python3.12/site-packages/manim/mobject/text/tex_mobject.py:272, in MathTex.__init__(self, arg_separator, substrings_to_isolate, tex_to_color_map, tex_environment, *tex_strings, **kwargs)
270 self.tex_strings = self._break_up_tex_strings(tex_strings)
271 try:
--> 272 super().__init__(
273 self.arg_separator.join(self.tex_strings),
274 tex_environment=self.tex_environment,
275 tex_template=self.tex_template,
276 **kwargs,
277 )
278 self._break_up_by_substrings()
279 except ValueError as compilation_error:
File /media/pc/data/lxw/envs/anaconda3a/envs/ai/lib/python3.12/site-packages/manim/mobject/text/tex_mobject.py:81, in SingleStringMathTex.__init__(self, tex_string, stroke_width, should_center, height, organize_left_to_right, tex_environment, tex_template, font_size, **kwargs)
79 assert isinstance(tex_string, str)
80 self.tex_string = tex_string
---> 81 file_name = tex_to_svg_file(
82 self._get_modified_expression(tex_string),
83 environment=self.tex_environment,
84 tex_template=self.tex_template,
85 )
86 super().__init__(
87 file_name=file_name,
88 should_center=should_center,
(...)
95 **kwargs,
96 )
97 self.init_colors()
File /media/pc/data/lxw/envs/anaconda3a/envs/ai/lib/python3.12/site-packages/manim/utils/tex_file_writing.py:63, in tex_to_svg_file(expression, environment, tex_template)
60 if svg_file.exists():
61 return svg_file
---> 63 dvi_file = compile_tex(
64 tex_file,
65 tex_template.tex_compiler,
66 tex_template.output_format,
67 )
68 svg_file = convert_to_svg(dvi_file, tex_template.output_format)
69 if not config["no_latex_cleanup"]:
File /media/pc/data/lxw/envs/anaconda3a/envs/ai/lib/python3.12/site-packages/manim/utils/tex_file_writing.py:213, in compile_tex(tex_file, tex_compiler, output_format)
211 log_file = tex_file.with_suffix(".log")
212 print_all_tex_errors(log_file, tex_compiler, tex_file)
--> 213 raise ValueError(
214 f"{tex_compiler} error converting to"
215 f" {output_format[1:]}. See log output above or"
216 f" the log file: {log_file}",
217 )
218 return result
ValueError: latex error converting to dvi. See log output above or the log file: media/Tex/95419684cd0167a8.log
See many more examples at https://docs.manim.community/en/latest/examples.html!