manim
Verifiedby manim-community · Updated Apr 16, 2026
Comprehensive guide for Manim Community - Python framework for creating mathematical animations and educational videos with programmatic control
See It In Action
I'll start by exploring the codebase and understanding the project structure, then create the Manim animation.
Now let me read the key reference files to nail the Manim API usage.
Now I'll create the Manim script and render both the video and a preview still.
Now let me render the video (medium quality) and the still frame in parallel.
Manim isn't installed. Let me install it.
Manim is installed. Now let me render the video and the still frame.
LaTeX tooling (dvisvgm) is missing. I'll rewrite the script to use Text and MathTex-free approaches so it renders without a TeX distribution.
Good, dvisvgm is installed now. Let me render both the video and the still frame.
The standalone dvisvgm can't find the TeX config. Let me check if texlive ships its own version.
The dvisvgm/texlive integration is broken. The fastest fix is to rewrite the script using Text objects instead of MathTex to avoid LaTeX entirely.
The axis numbers use LaTeX internally. Let me fix the dvisvgm configuration issue -- it needs to find texlive's kpathsea config.
The dvisvgm issue persists. Let me take the clean approach: disable LaTeX entirely and use only Text objects for everything including axis labels.
Video rendered successfully. Now let me render the preview still.
Both outputs are ready. Let me verify the files and show the preview.
Both files are ready:
| Output | Path | Size |
|---|---|---|
| Video (720p 30fps) | media/videos/gradient_descent/720p30/GradientDescent.mp4 | 1.2 MB |
| Preview still (PNG) | media/images/gradient_descent/GradientDescent_ManimCE_v0.20.1.png | 69 KB |
The animation walks through:
- Title card -- "Gradient Descent"
- Parabola
f(x) = x²plotted on labeled axes - Update rule displayed:
x_new = x_old - α · f'(x)with derivativef'(x) = 2xand learning rateα = 0.3 - 7 descent steps starting at
x = 3.50-- each step shows a red tangent line at the current point, the slope value, and the x-value update before the dot slides down the curve - Minimum highlight with a green flash at
x = 0 - Closing summary text
External Tools
| Tool | Type |
|---|---|
| python3 | binary |
Permissions
| Scope | Description |
|---|---|
| filesystem:read | |
| filesystem:write | |
| process:spawn |
SKILL.md
Manim Community - Mathematical Animation Engine
Comprehensive skill set for creating mathematical animations using Manim Community, a Python framework for creating explanatory math videos programmatically, popularized by 3Blue1Brown.
When to use
Use this skill whenever you are dealing with Manim code to obtain domain-specific knowledge about:
- Creating mathematical animations and visualizations
- Building educational video content programmatically
- Working with geometric shapes and transformations
- Animating LaTeX equations and mathematical formulas
- Creating graphs, charts, and coordinate systems
- Implementing scene-based animation sequences
- Rendering high-quality mathematical diagrams
- Building explanatory visual content for teaching
Core Concepts
Manim allows you to create animations using:
- Scenes: Canvas for your animations where you orchestrate mobjects
- Mobjects: Mathematical objects that can be displayed (shapes, text, equations)
- Animations: Transformations applied to mobjects (Write, Create, Transform, FadeIn)
- Transforms: Morphing between different states of mobjects
- LaTeX Integration: Native support for rendering mathematical notation
- Python Simplicity: Use Python to programmatically specify animation behavior
Key Features
- Precise mathematical object positioning and transformations
- Native LaTeX rendering for equations and formulas
- Extensive shape library (circles, rectangles, arrows, polygons)
- Coordinate systems and function graphing
- Boolean operations on geometric shapes
- Camera controls and scene management
- High-quality video rendering
- IPython/Jupyter notebook integration
- VS Code extension with live preview
How to use
Read individual rule files for detailed explanations and code examples:
Core Concepts
- references/scenes.md - Creating scenes and organizing animations
- references/mobjects.md - Understanding mathematical objects and shapes
- references/animations.md - Core animation types and techniques
- references/latex.md - Rendering LaTeX equations and formulas
For additional topics including transforms, timing, shapes, coordinate systems, 3D animations, camera movement, and advanced features, refer to the comprehensive Manim Community documentation.
Quick Start Example
from manim import *
class SquareToCircle(Scene):
def construct(self):
# Create a square
square = Square()
square.set_fill(BLUE, opacity=0.5)
# Create a circle
circle = Circle()
circle.set_fill(RED, opacity=0.5)
# Animate square creation
self.play(Create(square))
self.wait(1)
# Transform square into circle
self.play(Transform(square, circle))
self.wait(1)
# Fade out
self.play(FadeOut(square))
Render with: manim -pql script.py SquareToCircle
Best Practices
- Inherit from Scene - All animations should be in a class inheriting from Scene
- Use construct() method - Place all animation code inside the construct() method
- Think in layers - Add mobjects to the scene before animating them
- Use self.play() - Animate mobjects using self.play(Animation(...))
- Test with low quality - Use
-qlflag for faster preview renders - Leverage LaTeX - Use Tex() and MathTex() for mathematical notation
- Group related objects - Use VGroup to manage multiple mobjects together
- Preview frequently - Use
-pflag to automatically open rendered videos
Command Line Usage
# Preview at low quality (fast)
manim -pql script.py SceneName
# Render at high quality
manim -pqh script.py SceneName
# Save last frame as image
manim -s script.py SceneName
# Render multiple scenes
manim script.py Scene1 Scene2
Resources
- Documentation: https://docs.manim.community/
- Repository: https://github.com/ManimCommunity/manim
- Examples Gallery: https://docs.manim.community/en/stable/examples.html
- Discord Community: https://www.manim.community/discord/
- 3Blue1Brown Channel: https://www.youtube.com/c/3blue1brown
- License: MIT
FAQ
What does manim do?
Comprehensive guide for Manim Community - Python framework for creating mathematical animations and educational videos with programmatic control
When should I use manim?
Use it when you need a repeatable workflow that produces source code, image output, downloadable file.
What does manim output?
In the evaluated run it produced source code, image output, downloadable file.
How do I install or invoke manim?
npx skills add https://github.com/davila7/claude-code-templates --skill manim
Which agents does manim support?
Claude Code
What tools, channels, or permissions does manim need?
It uses python3; channels commonly include code, image, file, text; permissions include filesystem:read, filesystem:write, process:spawn.
Is manim safe to install?
Static analysis marked this skill as medium risk; review side effects and permissions before enabling it.
How is manim different from an MCP or plugin?
A skill packages instructions and workflow conventions; tools, MCP servers, and plugins are dependencies the skill may call during execution.
Does manim outperform not using a skill?
About manim
When to use manim
When you need to write or edit Manim scenes for mathematical animations. When you want to render explanatory visuals or educational videos from Python code. When working with LaTeX-based equations, graphs, or geometric animation sequences in Manim.
When manim is not the right choice
When you only need general-purpose video editing rather than programmatic animation generation. When the environment cannot run Python-based rendering workflows.
What it produces
Produces source code, image output and downloadable file.
Install
npx skills add https://github.com/davila7/claude-code-templates --skill manimInvoke: Ask Claude Code to use manim for the task.
