TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

This question is very similar to a previous post: Where do I place my own .sty files, to make them available to all my .tex files?

I am using MiKTeX 2.9 and TeXnicCenter to compose and execute my LaTeX file(s) on Windows 7. I am using a template from Elsevier to submit a journal article, but I am getting the LaTeX Error that File 'numcompress.sty' not found. This file is currently located in the same directory as the other elsarticle files: C:\Program Files (x86)\MikTex 2.9\tex\latex\elsarticle. I have actually followed the directions posted to the above question exactly: http://tex.stackexchange.com/a/20121/ but still have had no change in outcome.

share|improve this question
If numcompress.sty is in this directory, and you clicked refresh FNDB, it should works. Did you try to compile your file without TeXnic center? – corentin Jul 20 '12 at 20:52

Are you using MikTeX as User or as administrator? To be safe change to adminstrator, check wheather your file numcompress.sty is really in the directory C:\Program Files (x86)\MikTex 2.9\tex\latex\elsarticle. Now start MiKTeX 2.9 over Windows start -> all programms. Choose Maintenance (Admin), then Settings (admin) (Admin is important!). Now choose General and click Refresh FNDB. Afterwards you can change to user again and run MiKTeX. Refresh FNDB means refresh your database for the used filenames.

share|improve this answer

As others answer already said: You should update the FNDB in admin mode if you put files in the main miktex tree. But it is not recommended to use this tree for local additions. Your additions can get lost when miktex updates packages. Use either one of the other trees (UserConfig or CommonConfig) or (better) use a new local tree: Create (e.g.) C:\mylocaltree\tex\latex\elsarticle, copy your file in this folder and then add C:\mylocaltree as a new root in miktex settings.

share|improve this answer

With MikTeX installed you have access to Texworks at the All Programs/MikTeX/ menu. Try loading and compiling from that IDE. If it will not compile from TeXworks then the *.sty has not been properly registered.

If this fails then use My Computer and actually verify that the files are exactly where you think they are. (The Windows defaults for file saving can easily trip you up.)

share|improve this answer

First, launch the Windows cmd line as administator and search for an .sty file that you know is present and works using the findtexmf utility, e.g.

findtexmf colortbl.sty

Ensure that your .sty file is in a similar location.

Now, update the filename database using the initexmf utility:

initexmf --admin -u
initexmf --admin --dump

The first one refreshes the filename database and the second performs other updates. You may not need both but it won't hurt.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.