FormaTeX
FatalFiles & Resources

Package .sty File Not Found

! LaTeX Error: File 'XXX.sty' not found.

What this error means

LaTeX cannot find the style file for a package you tried to load with \usepackage{}. The package is either not installed in your TeX distribution, has a different name, or is a custom package not in the current directory.

FormaTeX smart compile

FormaTeX smart compile automatically installs missing CTAN packages from the full TeX Live distribution before compiling your document.

Common causes

  • The package is not installed in your TeX distribution
  • Typo in the package name
  • A custom .sty file not in the same directory as the .tex file
  • Using a newer package not available in an older TeX installation

How to fix it

Install the missing package: run tlmgr install packagename (TeX Live) or use MiKTeX's package manager. Check the exact package name on CTAN. For custom packages, place the .sty file in the same directory as your .tex file.

Code examples

Causes the error
\documentclass{article}
\usepackage{nonexistentpackage}  % Not installed
\begin{document}
Hello
\end{document}
Fixed
\documentclass{article}
% Install via: tlmgr install booktabs
\usepackage{booktabs}
\begin{document}
Hello
\end{document}

Related errors

Test the fix live

Paste your LaTeX into the playground and compile instantly.

One quick thing

We track anonymous usage — page views, feature usage, compilation events — to understand what works and what doesn't. No ads, no personal data, no third-party sharing.

Cookie policy