[Tex/LaTex] TeXstudio: How to add custom highlighting for custom environment

environmentstexstudio

Until there is a cwl file for the paralist package, I would like to just include the compactenum environment into the custom highlighting list in the TeXstudio Options. I tried adding compactenum in the custom environment column, but to no avail.

Even after a restart of TeXstudio, \begin{compactenum} and \end{compactenum} were still highlighted in red

Is there something I'm missing? How do you add a custom environment to TeXstudio? The custom command \possessivecite that you can see in the first screenshot is working fine…

Best Answer

Actually, it's not you who is missing something, but the Custom Highlighting. It's an unfinished feature. See the FAQ for what it can(not) do.

If it's just about telling the syntax checker, you should use a custom cwl file. Note, that TXS autogenerates a cwl file by inspecting the package. But this mechanism is not perfect due to the complexity of LaTeX. Therefore it may not find all specified commands. You are welcome to take this cwl as a starting point, add the missing commands and provide it to us, so we can include it in TXS.

For instance, to tell the syntax checker and completer that there is the compactenum environment, just add the following line to your custom cwl file:

\begin{compactenum}#\env
Related Question