I'm making a .cwl file for the package nicematrix, and am unsure how TeXstudio checks keyvals for completion. Here is a sample .cwl file and an image of the editor in TeXstudio that display the issue:

# nicematrix package





It works fine for the NiceMatrix environment since it recognizes the key hlines listed in the .cwl and does not recognize the unlisted key hvlines. However, for the NiceTabular environment, neither the listed nor unlisted key is recognized, and for the NiceArray environment, it does not mark the unlisted key as invalid.

Clearly this has something to do with the fact that NiceTabular and NiceArray have the optional [position] and mandatory {cols} while NiceMatrix has neither, but I've not been able to find a fix from the user manual or examples. How does one account for the [position] and {cols} arguments while still having TeXstudio properly check for completion in the [keyvals]?

  • 1
    For information, in {NiceArray} and {NiceTabular}, you can put all the available keys both before and after the preamble. That means that you should write rather \begin{NiceTabular}[keyvals]{cols}[keyvals]#\tabular (I say that but I have no competence in TeXStudio and its cwl files). Commented Jun 10, 2021 at 20:24

1 Answer 1


TeXstudio's parsing of cwls is somewhat limited, so the current nicematrix cwl just checks for keyval completion using the syntax where the keys come before the preamble.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .