LaTeX error: File `….sty' not found
\usepackage{name} makes TeX look for name.sty. This error means no such file exists anywhere TeX searches: the TeX distribution, or the folder of your document.
! LaTeX Error: File `nonexistentpkgxyz.sty' not found.
Try it: this example has the error
Press Fix it in the error box, and it compiles to a PDF. What pdfTeX printed for it:
! LaTeX Error: File `nonexistentpkgxyz.sty' not found.
Type X to quit or <RETURN> to proceed,
or enter new name. (Default extension: sty)
Enter file name:
! Emergency stop.
<read *>
l.3 \begin
Ready. Press Compile (or Ctrl/Cmd + Enter).
Common causes
- The package name is misspelled (
graphixforgraphicx,amsmathsforamsmath). - The package is not installed in your local TeX distribution (common with a minimal MiKTeX or BasicTeX install).
- A custom style file from a journal or a colleague (
mystyle.sty) is not in the same folder as the .tex file. - The package is very new or not on CTAN, so no distribution ships it.
How to fix it
- Check the spelling against the package documentation on CTAN.
- On a local install, add it with your package manager (
tlmgr install nameon TeX Live, the MiKTeX console on Windows). - For a custom .sty, put it next to your document. In TeXpad, the Overleaf import keeps custom .sty and .cls files automatically.
- If you do not need it, remove the line. TeXpad offers that as a one-click fix.