Fix “beamertheme.sty not found” in TeX Live
At a glance
- 1. Check the filename
Look at the exact missing filename and find which command in your source requests it.
- 2. Use Beamer correctly
Load the beamer class, then select a theme with the usetheme command.
- 3. Install missing files
If the class or a specific theme is absent, install or repair the Beamer package in TeX Live.
- 4. Check the active TeX
Verify that your editor and command line use the same TeX Live installation.
The fix depends on the exact filename in the error. A message naming beamertheme.sty often means the document is trying to load a file that is not part of the usual Beamer setup. If the error names beamer.cls or a specific theme file such as beamerthemeMadrid.sty, the Beamer package or that theme may be missing from the TeX Live installation being used.
Use the Beamer class and theme command
For a Beamer presentation, use the beamer document class. Choose a theme with \usetheme{...} rather than trying to load a generic beamertheme package.
Here is a minimal example using Madrid:
\documentclass{beamer}
\usetheme{Madrid}
\begin{document}
\begin{frame}{A test slide}
This is a Beamer presentation.
\end{frame}
\end{document}
The class declaration loads Beamer. The theme command selects a theme; for example, \usetheme{Madrid} makes Beamer look for the corresponding theme file, normally beamerthemeMadrid.sty. If you do not need a particular theme, omit \usetheme and use Beamer’s default appearance.
Search your source and any files it includes for a line such as:
\usepackage{beamertheme}
That line is usually the problem. Replace it with \usetheme{Madrid} or the theme you intend to use. Do not assume that changing the requested filename to beamertheme.sty is the right fix; the theme is selected through Beamer’s interface.
Install or repair Beamer in TeX Live
If the error instead names beamer.cls, or a theme file that your document really uses, install the Beamer package. On Windows, you can use the TeX Live Manager graphical interface and install the package named beamer. You can also open a TeX Live command prompt and run:
tlmgr install beamer
If Beamer files are outdated, update TeX Live through the manager. From a TeX Live command prompt, an update can be run with:
tlmgr update --self --all
If Beamer files are damaged, reinstall the package with:
tlmgr install --reinstall beamer
If you install a package manually, use the TeX Live tools rather than copying a .sty file into an arbitrary folder. Package installation updates TeX Live’s file database so TeX can find the file.
Check which TeX Live installation is being used
Windows computers can have more than one TeX distribution or more than one TeX Live installation. An editor may call a different pdflatex from the one you use in a terminal. That can make a package appear installed in one place but unavailable during compilation.
In the same command prompt used to compile, check the paths with:
where pdflatex
where kpsewhich
Then ask TeX’s filename search tool whether it can find Beamer files:
kpsewhich beamer.cls
kpsewhich beamerthemeMadrid.sty
kpsewhich beamertheme.sty
A path printed for a file means that this TeX installation can find it; no output means it cannot. beamertheme.sty may correctly return no path if your document should not be requesting it. If beamer.cls is missing, install beamer. If the class is found but a particular theme is not, check the theme name and install or repair the package. Also check the executable paths configured in your editor so it uses the same TeX Live installation.
Common mistakes
- Confusing the class with a theme:
\documentclass{beamer}starts a Beamer document;\usetheme{Madrid}selects a theme. - Using the wrong theme name: Theme names are written without the
beamerthemeprefix inside\usetheme. For example, use\usetheme{Madrid}, not\usetheme{beamerthemeMadrid}. - Installing into a different distribution: Installing Beamer in MiKTeX or another TeX Live tree will not make it available to a compiler using a separate TeX Live installation.
- Treating every missing
.styerror alike: The exact filename matters. A missingbeamerthemeMadrid.stypoints to a different issue than a source line requestingbeamertheme.sty.
If a corrected minimal example still fails, compile it from a TeX Live command prompt. That helps distinguish a source problem from an editor configured to use another TeX installation.
References
Spotted an error? Send a correction. Read how we write and check articles in our editorial policy.