gillescastel / latex-snippets

Vim + LaTeX snippets setup
MIT License
1.05k stars 200 forks source link

math content does not recognize align #10

Closed xinist closed 3 years ago

xinist commented 4 years ago

Hi,

This repo is extremely useful for me. Everything works fine in most math environments, but not for the align (and align*) environment. I did some google and found that "AmsA" seems to represent align. But it is already in the file...

Thank you!

Best

Konfekt commented 3 years ago

This should be fine with the latest version 2.1 of vimtex and #14

Konfekt commented 3 years ago

If you want to keep using the built-in TeX syntax highlighting, then you need to addamsmath.vim from Charles E. Campbell at http://www.drchip.org/astronaut/vim/vbafiles/amsmath.vba.gz to the after/syntax/ folder. This file adds highlighting for the align environments by

  call TexNewMathZone("E","align",1)
  call TexNewMathZone("F","alignat",1)
  call TexNewMathZone("G","equation",1)
  call TexNewMathZone("H","flalign",1)
  call TexNewMathZone("I","gather",1)
  call TexNewMathZone("J","multline",1)
  call TexNewMathZone("K","xalignat",1)
  call TexNewMathZone("L","xxalignat",0)
gillescastel commented 3 years ago

This should be fixed now. Update vimtex and use the following code:

https://github.com/gillescastel/latex-snippets/blob/baa1b42ed9558b4a7ba220c50c5046957719f898/tex.snippets#L1-L12