TexStudio IEEEtrantools package issue. User .cwl file?

I am using TexStudio 2.9.4 on Windows 7. There is a problem that has been raised here at least once. It is that TexStudio flags unrecognised command to \begin{IEEEeqnarray}{rCl} and then within the environment flags expressions like \mathrm as being used outside the math environment. The fix (on Windows) is to manually edit the file C:\Users\USER\AppData\Roaming\texstudio\IEEEtrantools.cwl adding:

\begin{IEEEeqnarray}{cols}#\math,array
\end{IEEEeqnarray}
\begin{IEEEeqnarray*}{cols}#\math,array
\end{IEEEeqnarray*}


in place of the \IEEEeqnarray entry there.

This works but is there a separate file that I could add (eg myfixes.cwl) which TexStudio would read? Burying the fix in a big autogenerated file is not ideal.

BTW is there any documentation on the format of .cwl files?

Auto-generation is just a fallback in case there is no other information available. It's inferior to customized cwls, because it cannot provide semantic information on the commands. cwls are only auto-generated if they do not exist (either in the internal set of cwls or in the settings directory). Therefore, it is safe to edit any cwl file in the settings directory. In fact, that's the recommended way to do it. Additionally, we encourage to send such improved cwls to us, so we can include them in future releases.

You can also create additional myfixes.cwl. However, you'd have to tell TXS explicitly to use it. IEEEtrantools.cwl will be used because you included the corresponding \usepackage command. Of course, this mechanism does not work for myfixes.cwl. To use definitions in there, you have to enable it globally at Options -> Completion.

See also the FAQ: Why does TeXstudio mark a command as unrecognized?

The cwl format is described in the manual.

• Are .cwl formats standard? If so, is there an editor-independent repository of such files? – cfr Sep 8 '15 at 23:22
• .cwl is no a standard. It was originally introduced by Kile but only with a very basic functionality (websvn.kde.org*checkout*/tags/kile/2.0/src/README.cwl). We've significantly expanded it's capabilities and that's unique to TXS. Additionally, TXS already includes more cwls files than kile (184 vs. 120 based on the latest repositories respectively). – Tim Hoffmann Sep 9 '15 at 19:23
• That's too bad :(. (I use Kile.) – cfr Sep 9 '15 at 21:15
• Tim, thank you for taking the time to answer this. I have found the .cwl documentation at svn.code.sf.net/p/texstudio/code/trunk/utilities/… – peter2108 Sep 10 '15 at 10:20

I was able to solve the problem for IEEEeqnarray environment using the following steps

1. Open the auto-generated IEEEtrantools.cwl in a text editor. Look in "...\config\completion\autogenerated" subfolder of your TexStudio installation.
2. Delete the line with text ""
3. Add the following 5 lines to the IEEEtrantools.cwl file and save

\begin{IEEEeqnarray}#\math

\begin{IEEEeqnarray*}#\math

\end{IEEEeqnarray}#\math

\end{IEEEeqnarray*}#\math

&#m

1. Start TexStudio and now you should not have any annoying highlighing.