[Tex/LaTex] TexStudio says package not found

texstudio

I use TexStudio 2.8 with MikTex.
I have all packages installed on my computer and some of them actually work.
The problem is that if I hover the mouse over

\usepackage{fontspec}

I get a Package: fontspec (not found)

I wouldn't care that much for that, since I know it works, but the problem is that other packages, like currfile do not work, or at least their commands do not popup in autocomplete and I suspect these 2 problems are related.

So, how does TexStudio takes the decision to display Not found, even though it obviously finds the package since it gives no error when compiled and it does what it is supposed to do?

Best Answer

Generally, I'd recommend to update to the most recent version (currently 2.9.4).

If the problem still exists, here's some more info:

TeXstudio queries MikTeX about the installed packages (mpm.exe --list). This information is used for the highlighting of missing packages. Compilation is a completely different issue. TXS just calls the latex compiler, and it's its responsibility to find the package. Usually this should be the same, but it may be different if you have multiple TeX distributions installed (maybe older versions of MikTeX or e.g. additionally TeXlive) or if you added the package files manually.

In the end, it just matters if the compiler finds the packages. TXS tries to warn you if it thinks that the package is missing (in special cases it may be wrong). This is just for your convenience so that you can recognize possible errors before compiling. You can disable the checks in the options.

The completer is again a different issue. See

FAQ: Why does a command not show up in the completion?

FAQ: Why does TeXstudio mark a command as unrecognized?