jlelong / vscode-latex-basics

LaTeX grammars for Visual Studio Code
MIT License
19 stars 10 forks source link

Grammar in environments for math provided by nicematrix package #25

Closed Yarakashi-Kikohshi closed 2 years ago

Yarakashi-Kikohshi commented 2 years ago

Grammar supports NiceTabular[*X]? environment (https://github.com/jlelong/vscode-latex-basics/pull/12), but not NiceMatrix or NiceArray environments. & is not highlighted correctly.

Probably, need to fix it here.

https://github.com/jlelong/vscode-latex-basics/blob/4479589c0f5c21c7f5ef17551e1013ab72e7f718/syntaxes/LaTeX.tmLanguage.json#L811

nicematrix package

nicematrix - CTAN

nicematrix package provides the following environments:

NiceArray environment is similar to array environment, and NiceMatrix environment is similar to matrix environment provided by amsmath.

Demonstrations

nicematrix
Sample TeX file
```latex \documentclass{article} \usepackage{nicematrix} \begin{document} \begin{equation} \begin{NiceMatrix} a & b & c \\ d & e & f \\ g & h & i \end{NiceMatrix} \begin{NiceArray}{ccc} a & b & c \\ d & e & f \\ g & h & i \end{NiceArray} \end{equation} \end{document} ```

Version