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
\documentclass{article}
\usepackage{nonexistentpackage} % Not installed
\begin{document}
Hello
\end{document}\documentclass{article}
% Install via: tlmgr install booktabs
\usepackage{booktabs}
\begin{document}
Hello
\end{document}Related errors
File Not Found
! LaTeX Error: File 'XXX' not found.
Unknown Graphics Extension
! LaTeX Error: Unknown graphics extension: .XXX.
Unicode Character Not Supported (pdfLaTeX)
! Package inputenc Error: Unicode char U+XXXX not set up for use with LaTeX.
Cannot Determine Size of Graphic (No BoundingBox)
! LaTeX Error: Cannot determine size of graphic (no BoundingBox).
Test the fix live
Paste your LaTeX into the playground and compile instantly.

