[Tex/LaTex] Use package listing error: Listing.sty not found

listingsmiktextexmakerwindows

I want to use the listings package, but every time I compile my document in Texmaker I get the following error:

!LaTeX Error: File `listings.sty' not found.

Before this happens Texmaker displays me a window asking me to install listings, but even though I click install, the problem persists.

Best Answer

LaTeX Error: File `listings.sty' not found.

This error message means the source file needs the package listings but the system doesn't have it. MikTeX was designed to be a TeX distribution that can install missing packages automatically, but this feature doesn't work well.

Fortunately, you can install packages manually in three steps:

  1. Press <Win> + R to open Startup window.
  2. Type mpm to start MikTeX Package Manager.
  3. Find the package you want to install, and instal it.
Related Question