[Tex/LaTex] IEEEtrantools not found by TeXstudio but IEEEtrantools.cwl is in AppData (and file compiles ok using MikTeX)

miktexpackagestexstudio

Newbie here. I'm running MikTeX 2.9 on Win8.1 and I'm trying to setup TeXstudio to implement some of the suggestions in "The not so short intro…" by Oetiker et al.

Since IEEEtrantools aren't in MikTeX I followed some instructions I found somewhere and installed the files to "C:\Local TeX Files." I managed to get the MikTeX package pointed in the right direction (and registered and updated) so this code works just like Oetiker said it would (when run in TeXstudio):

\begin{IEEEeqnarray}{rCl}
    a & = & b + c
    \\
    & = & d + e + f + g + h
    + i + j + k \nonumber\\
    && +\: l + m + n + o
    \\
    & = & p + q + r + s
\end{IEEEeqnarray}

The problem is that in TeXstudio, the command:

\usepackage[retainorgcmds]{IEEEtrantools}

has the package name underlined and a pop-up says it's not found. Given that, I guess it's no surprise that the \begin{IEEEeqnarray} and "&"s are highlighted in pink.

It is a little surprising that
C:\Users…\AppData\Roaming\texstudio\IEEEtrantools.cwl is there. It's possible that got there when I checked the box in config\completion for the tools but I kind of doubt it. It stays there when I uncheck the box. There are some other files in there that look promising like "miktexPackageNames.dat." That file has "IEEEtran" since I tried that first but the tools didn't get in there.

Another clue would seem to be that "IEEEtrantools.cwl" is listed in "options/configure/completion" but checking the box makes no difference.

Maybe I can just add the tools name to the dat file? -> Nope. That file gets regenerated when studio is closed.

So it seems that TeXstudio is not scanning the "Local TeX Files" folder even though it is registered in MikTeX. I also tried copying the *sty file to the folder my *.tex file is in.

I've seen some related questions but nothing quite the same.

Best Answer

the package name underlined and a pop-up says it's not found

With a MikTeX installation, TXS checks the presence of a package by analyzing the result of mpm --list. I assume that this does not cover packages in a local tex folder. You may disable package checking at Options -> Editor -> Inline Checking -> Packages.

There are some other files in there that look promising like "miktexPackageNames.dat."

This file maps the MikTeX package names to the .sty and .cls file names. It's used as cache for a fast lookup. It's automatically updated in a background process, therefore, manual modifications do not persist.

It is a little surprising that C:\Users...\AppData\Roaming\texstudio\IEEEtrantools.cwl is there.

TXS tries to detect the commands defined in a style file. These are stored in a .cwl file. See the TeXstudio FAQ and the link therein for more details. Depending on the complexity of the sty files, it is not possible to extract all valid commands. You may add missing commands to the cwl file. To see the changes, restart TXS afterwards.

Related Question