You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is both a issue report and my-attempt-to-fix-the-issue report:
When I try to use the maths environment, say
{{$
a^b
}}$
it is highlighted as if I am using maths in a non-maths environment, that is, the ^ is red.
However, if I put
{{$
$a^b
}}$
the red error-highlighting is gone and the content after $ in the second line is treated as maths in latex, but after conversion to html there would be an extra $ at the beginning of the equation.
I am trying to solve this problem by delving into the syntax files of both vimwiki and latex (tex.vim)
These lines 608-613 in syntax/vimwiki.vim caught my attention:
I am not quite familiar with vimscript, but some googling tells me this line links VimwikiMath group to Number group.
But how is the Number group related to the syntax highlight in tex.vim?
Inspecting tex.vim, I notice the following lines
syn region texMathZoneV matchgroup=Delimiter start="\\(" matchgroup=Delimiter end="\\)\|%stopzone\>" keepend concealends contains=@texMathZoneGroup
syn region texMathZoneW matchgroup=Delimiter start="\\\[" matchgroup=Delimiter end="\\]\|%stopzone\>" keepend concealends contains=@texMathZoneGroup
So I added
syn region texMathZoneU matchgroup=Delimiter start="{{\$" matchgroup=Delimiter end="}}\$\|%stopzone\>" keepend concealends contains=@texMathZoneGroup
I also changed
syn cluster texMathZones contains=texMathZoneV,texMathZoneW,texMathZoneX,texMathZoneY,texMathZoneZ
to
syn cluster texMathZones contains=texMathZoneU,texMathZoneV,texMathZoneW,texMathZoneX,texMathZoneY,texMathZoneZ
and added
HiLink texMathZoneU texMath
Now the highlight of
{{$
a^b
}}$
works as expected in .tex files, but the problem in .wiki files persists...
Can anyone give an explanation, or simply fix the issue?
Thanks in advance.
The text was updated successfully, but these errors were encountered:
This is both a issue report and my-attempt-to-fix-the-issue report:
When I try to use the maths environment, say
it is highlighted as if I am using maths in a non-maths environment, that is, the
^
is red.However, if I put
the red error-highlighting is gone and the content after
$
in the second line is treated as maths in latex, but after conversion to html there would be an extra$
at the beginning of the equation.I am trying to solve this problem by delving into the syntax files of both vimwiki and latex (
tex.vim
)These lines 608-613 in
syntax/vimwiki.vim
caught my attention:as well as line 509
I am not quite familiar with vimscript, but some googling tells me this line links
VimwikiMath
group toNumber
group.But how is the
Number
group related to the syntax highlight intex.vim
?Inspecting
tex.vim
, I notice the following linesSo I added
I also changed
syn cluster texMathZones contains=texMathZoneV,texMathZoneW,texMathZoneX,texMathZoneY,texMathZoneZ
to
and added
Now the highlight of
works as expected in
.tex
files, but the problem in.wiki
files persists...Can anyone give an explanation, or simply fix the issue?
Thanks in advance.
The text was updated successfully, but these errors were encountered: