Fix: Manim "standalone.cls not found" | QuantumSketch

Manim's 'standalone.cls not found' means your LaTeX install is missing the standalone package. Install it via tlmgr or MiKTeX and re-render.

By Shihab
2 min read

Manim's "standalone.cls not found" error means your LaTeX distribution is missing the standalone package, which Manim uses to typeset each equation as a cropped image. Install the package and re-render.

The fix

TeX Live (Linux/macOS):

tlmgr install standalone preview

Debian/Ubuntu (broad fix):

sudo apt install texlive-latex-extra

MiKTeX (Windows): open the MiKTeX Console โ†’ Packages โ†’ install standalone, or enable "install missing packages on the fly."

Then test:

from manim import *
class T(Scene):
    def construct(self):
        self.play(Write(MathTex(r"\int_0^1 x^2\,dx")))

Why it happens

Manim wraps each MathTex/Tex in a tiny LaTeX document using the standalone class so the output is cropped to the equation with a transparent background. A minimal TeX install omits standalone, so latex aborts with File 'standalone.cls' not found.

Related package errors

The same tlmgr install <name> pattern fixes other "not found" class/style errors:

| Missing file | Install | |---|---| | standalone.cls | tlmgr install standalone | | preview.sty | tlmgr install preview | | tipa.sty | tlmgr install tipa | | dvisvgm missing | tlmgr install dvisvgm |

If LaTeX isn't found at all (not just a package), see LaTeX not found. For a full diagnostic, run manim checkhealth.

Avoid LaTeX package hunting

A full TeX install is the reliable cure, but it's large. If you just want the animation, QuantumSketch ships a complete LaTeX environment in the cloud โ€” standalone and friends are always present. See Manim Without Code.


Written by Shihab Shahriar Antor ยท Shahriar Labs

FAQ

Q.What is standalone.cls and why does Manim use it?

standalone.cls is a LaTeX document class that typesets a single equation or snippet cropped to its own bounding box, with no page margins. Manim uses it (along with the preview package) to render each MathTex or Tex object as a tight, transparent image it can place anywhere in the scene. If your TeX distribution doesn't include the standalone package, the latex run fails with 'File standalone.cls not found,' which Manim surfaces as a compilation error. Installing the standalone package fixes it.

Q.How do I install missing LaTeX packages for Manim?

On TeX Live, use the package manager tlmgr: run tlmgr install standalone preview (and any other missing package the error names). On MiKTeX, missing packages usually install automatically on first use if you enabled 'install packages on the fly'; otherwise open the MiKTeX Console and install standalone manually. On Debian/Ubuntu, the broad fix is apt install texlive-latex-extra, which bundles standalone and many other commonly needed classes. After installing, re-run your scene.

Tags:#manim#latex#troubleshooting
S

Shihab Shahriar

AI Engineer & Founder of Shahriar Labs. Exploring the intersection of design, cognition, and machine learning.