Communitygithub.com

manim-math

Use Manim to teach the solution of a math problem or the proof of a theorem in analysis, linear algebra, or discrete mathematics. Visualize the motivation and structure of each key step, then display the corresponding algebra, estimates, or logical deductions step by step. Use when the user requests a mathematical animation or invokes $manim-math.

What is manim-math?

manim-math is a Claude Code agent skill that use Manim to teach the solution of a math problem or the proof of a theorem in analysis, linear algebra, or discrete mathematics. Visualize the motivation and structure of each key step, then display the corresponding algebra, estimates, or logical deductions step by step. Use when the user requests a mathematical animation or invokes $manim-math.

Works with~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/ethanzihao/manim-math/tree/HEAD/.agents/skills/manim-math

Ask in your favorite AI

Open a new chat with this agent skill pre-loaded.

Documentation

Manim Math

Produce a local Manim animation, the runnable Python scene, and a complete written solution or proof. Use English for on-screen explanations and the written proof unless the user requests another language. Preserve the problem's notation and variables.

Plan the proof and the animation

  1. Resolve the problem first. Verify hypotheses, domains, quantifiers, equality cases, and any boundary cases that affect the argument. If there is a gap in the proposed reasoning, correct it before storyboarding.
  2. For each key decision, identify the obstacle visible at that point, the hypothesis or structure that suggests a move, the move itself, and the deduction it enables. Make the obstacle and the move visible in the scene. Examples include shrinking an interval to control its contribution, projecting onto a subspace to separate orthogonal components, and highlighting the state that makes an algorithmic step legal. Present mathematical motivation the learner can reconstruct.
  3. Synchronize picture and proof. Reuse symbols and consistent highlights across them. Show the relevant algebra, estimates, implications, quantifier choices, or invariant updates in order. Give each substantive deduction a readable beat and display the rule or hypothesis it relies on. Use compact steps for routine arithmetic. If geometry illustrates a higher-dimensional or general claim, label the picture as an example and display the general argument. For abstract steps, an annotated expression, state table, or dependency diagram can serve as the visual.
  4. Make transformed terms traceable. Use segmented MathTex and TransformMatchingTex for matching fragments. For splitting, combining, or repeated terms, use deliberate highlights or explicit transformations when automatic matching would suggest the wrong correspondence. Keep a summary of the main proof steps readable at the end. Put the complete derivation, including details that would crowd the frame, in the written proof.

Render and verify

  • From the repository root, activate the manim-math Conda environment from environment.yml, as documented in the README. Preview with python scripts/render.py <scene.py> <SceneName> --quality l --silent. Use Text for labels and MathTex for formulas.
  • Inspect frames that carry the proof, including at least one intermediate step and the last frame. Check correspondence, notation, labels, clipping and reading time. Fix any issues before rendering the final MP4. Keep intermediate files in the task's scratch directory.
  • For the final render, run python scripts/render.py <scene.py> <SceneName> --output <final.mp4> --open. The script adds a quiet original instrumental track by default, without narration. Follow explicit audio preferences. Verify the audio and picture in the finished MP4.

Deliver and open the video

Deliver the MP4, runnable scene, and written proof. Pass --open on the final render to launch the platform default player once the MP4 is ready. Include the rerender command. If opening or rendering fails, report the specific issue and deliver the verified parts.

Related Skills