robin/laufey
git clone https://git.robinwobin.dev/robin/laufey
4896178863
master
1" Vim syntax file 2" Language: TeX 3" Maintainer: This runtime file is looking for a new maintainer. 4" Former Maintainer: Charles E. Campbell 5" Last Change: Apr 22, 2022 6" 2024 Feb 19 by Vim Project: announce adoption 7" 2025 Jan 18 by Vim Project: add texEmphStyle to texMatchGroup, #16228 8" 2025 Feb 08 by Vim Project: improve macro option, \providecommand, 9" \newcommand and \newenvironment #16543 10" 2025 Sep 29 by Vim Project: add amsmath support #18433 11" Version: 121 12" Former URL: http://www.drchip.org/astronaut/vim/index.html#SYNTAX_TEX 13" 14" Notes: {{{1 15" 16" 1. If you have a \begin{verbatim} that appears to overrun its boundaries, 17" use %stopzone. 18" 19" 2. Run-on equations ($..$ and $$..$$, particularly) can also be stopped 20" by suitable use of %stopzone. 21" 22" 3. If you have a slow computer, you may wish to modify 23" 24" syn sync maxlines=200 25" syn sync minlines=50 26" 27" to values that are more to your liking. 28" 29" 4. There is no match-syncing for $...$ and $$...$$; hence large 30" equation blocks constructed that way may exhibit syncing problems. 31" (there's no difference between begin/end patterns) 32" 33" 5. If you have the variable "g:tex_no_error" defined then none of the 34" lexical error-checking will be done. 35" 36" ie. let g:tex_no_error=1 37" 38" 6. Please see :help latex-syntax for information on 39" syntax folding :help tex-folding 40" spell checking :help tex-nospell 41" commands and mathzones :help tex-runon 42" new command highlighting :help tex-morecommands 43" error highlighting :help tex-error 44" new math groups :help tex-math 45" new styles :help tex-style 46" using conceal mode :help tex-conceal 47 48" Version Clears: {{{1 49" quit when a syntax file was already loaded 50if exists ( "b:current_syntax" ) 51finish 52endif 53let s: keepcpo = & cpo 54set cpo & vim 55scriptencoding utf-8 56 57" by default, enable all region-based highlighting 58let s: tex_fast = "bcmMprsSvV" 59if exists ( "g:tex_fast" ) 60if type ( g: tex_fast ) != 1 61" g:tex_fast exists and is not a string, so 62" turn off all optional region-based highighting 63let s: tex_fast = "" 64else 65let s: tex_fast = g: tex_fast 66endif 67endif 68 69" let user determine which classes of concealment will be supported 70" a=accents/ligatures d=delimiters m=math symbols g=Greek s=superscripts/subscripts 71if ! exists ( "g:tex_conceal" ) 72let s: tex_conceal = 'abdmgsS' 73else 74let s: tex_conceal = g: tex_conceal 75endif 76if ! exists ( "g:tex_superscripts" ) 77let s: tex_superscripts = '[0-9a-zA-W.,:;+-<>/()=]' 78else 79let s: tex_superscripts = g: tex_superscripts 80endif 81if ! exists ( "g:tex_subscripts" ) 82let s: tex_subscripts = '[0-9aehijklmnoprstuvx,+-/().]' 83else 84let s: tex_subscripts = g: tex_subscripts 85endif 86 87" Determine whether or not to use "*.sty" mode {{{1 88" The user may override the normal determination by setting 89" g:tex_stylish to 1 (for "*.sty" mode) 90" or to 0 else (normal "*.tex" mode) 91" or on a buffer-by-buffer basis with b:tex_stylish 92let s: extfname = expand ( "%:e" ) 93if exists ( "g:tex_stylish" ) 94let b: tex_stylish = g: tex_stylish 95elseif ! exists ( "b:tex_stylish" ) 96if s: extfname == "sty" || s: extfname == "cls" || s: extfname == "clo" || s: extfname == "dtx" || s: extfname == "ltx" 97let b: tex_stylish = 1 98else 99let b: tex_stylish = 0 100endif 101endif 102 103" handle folding {{{1 104if ! exists ( "g:tex_fold_enabled" ) 105let s: tex_fold_enabled = 0 106elseif g: tex_fold_enabled && ! has ( "folding" ) 107let s: tex_fold_enabled = 0 108echomsg "Ignoring g:tex_fold_enabled=" . g: tex_fold_enabled . "; need to re-compile vim for +fold support" 109else 110let s: tex_fold_enabled = 1 111endif 112if s: tex_fold_enabled && & fdm == "manual" 113setl fdm = syntax 114endif 115if s: tex_fold_enabled && has ( "folding" ) 116com ! -nargs = * TexFold <args> fold 117else 118com ! -nargs = * TexFold <args> 119endif 120 121" (La)TeX keywords: uses the characters 0-9,a-z,A-Z,192-255 only... {{{1 122" but _ is the only one that causes problems. 123" One may override this iskeyword setting by providing 124" g:tex_isk 125if exists ( "g:tex_isk" ) 126if b: tex_stylish && g: tex_isk !~ '@' 127let b: tex_isk = '@,' . g: tex_isk 128else 129let b: tex_isk = g: tex_isk 130endif 131elseif b: tex_stylish 132let b: tex_isk = "@,48-57,a-z,A-Z,192-255" 133else 134let b: tex_isk = "48-57,a-z,A-Z,192-255" 135endif 136if ( v: version == 704 && has ( "patch-7.4.1142" )) || v: version > 704 137exe "syn iskeyword " . b: tex_isk 138else 139exe "setl isk=" . b: tex_isk 140endif 141if exists ( "g:tex_no_error" ) && g: tex_no_error 142let s: tex_no_error = 1 143else 144let s: tex_no_error = 0 145endif 146if exists ( "g:tex_comment_nospell" ) && g: tex_comment_nospell 147let s: tex_comment_nospell = 1 148else 149let s: tex_comment_nospell = 0 150endif 151if exists ( "g:tex_nospell" ) && g: tex_nospell 152let s: tex_nospell = 1 153else 154let s: tex_nospell = 0 155endif 156if exists ( "g:tex_matchcheck" ) 157let s: tex_matchcheck = g: tex_matchcheck 158else 159let s: tex_matchcheck = '[({[]' 160endif 161if exists ( "g:tex_excludematcher" ) 162let s: tex_excludematcher = g: tex_excludematcher 163else 164let s: tex_excludematcher = 0 165endif 166 167" Clusters: {{{1 168" -------- 169syn cluster texCmdGroup contains = texCmdBody , texComment , texDefParm , texDelimiter , texDocType , texInput , texLength , texLigature , texMathDelim , texMathOper , texNewCmd , texNewEnv , texRefZone , texSection , texBeginEnd , texBeginEndName , texSpecialChar , texStatement , texString , texTypeSize , texTypeStyle , @texMathZones 170if ! s: tex_no_error 171syn cluster texCmdGroup add = texMathError 172endif 173syn cluster texEnvGroup contains = texDefParm , texMatcher , texMathDelim , texSpecialChar , texStatement 174syn cluster texFoldGroup contains = texAccent , texBadMath , texComment , texDefCmd , texDelimiter , texDocType , texInput , texInputFile , texLength , texLigature , texMatcher , texMathZoneV , texMathZoneW , texMathZoneX , texMathZoneY , texMathZoneZ , texNewCmd , texNewEnv , texOnlyMath , texOption , texParen , texRefZone , texSection , texBeginEnd , texSectionZone , texSpaceCode , texSpecialChar , texStatement , texString , texTypeSize , texTypeStyle , texZone , @texMathZones , texTitle , texAbstract , texBoldStyle , texItalStyle , texEmphStyle , texNoSpell 175syn cluster texBoldGroup contains = texAccent , texBadMath , texComment , texDefCmd , texDelimiter , texDocType , texInput , texInputFile , texLength , texLigature , texMathZoneV , texMathZoneW , texMathZoneX , texMathZoneY , texMathZoneZ , texNewCmd , texNewEnv , texOnlyMath , texOption , texParen , texRefZone , texSection , texBeginEnd , texSectionZone , texSpaceCode , texSpecialChar , texStatement , texString , texTypeSize , texTypeStyle , texZone , @texMathZones , texTitle , texAbstract , texBoldStyle , texBoldItalStyle , texNoSpell 176syn cluster texItalGroup contains = texAccent , texBadMath , texComment , texDefCmd , texDelimiter , texDocType , texInput , texInputFile , texLength , texLigature , texMathZoneV , texMathZoneW , texMathZoneX , texMathZoneY , texMathZoneZ , texNewCmd , texNewEnv , texOnlyMath , texOption , texParen , texRefZone , texSection , texBeginEnd , texSectionZone , texSpaceCode , texSpecialChar , texStatement , texString , texTypeSize , texTypeStyle , texZone , @texMathZones , texTitle , texAbstract , texItalStyle , texEmphStyle , texItalBoldStyle , texNoSpell 177if ! s: tex_excludematcher 178syn cluster texBoldGroup add = texMatcher 179syn cluster texItalGroup add = texMatcher 180endif 181if ! s: tex_nospell 182if ! s: tex_no_error 183syn cluster texMatchGroup contains = texAccent , texBadMath , texComment , texDefCmd , texDelimiter , texDocType , texError , texInput , texLength , texLigature , texMatcher , texNewCmd , texNewEnv , texOnlyMath , texParen , texRefZone , texSection , texSpecialChar , texStatement , texString , texTypeSize , texTypeStyle , texBoldStyle , texBoldItalStyle , texItalStyle , texItalBoldStyle , texEmphStyle , texZone , texInputFile , texOption , @Spell 184syn cluster texMatchNMGroup contains = texAccent , texBadMath , texComment , texDefCmd , texDelimiter , texDocType , texError , texInput , texLength , texLigature , texMatcherNM , texNewCmd , texNewEnv , texOnlyMath , texParen , texRefZone , texSection , texSpecialChar , texStatement , texString , texTypeSize , texTypeStyle , texBoldStyle , texBoldItalStyle , texItalStyle , texItalBoldStyle , texZone , texInputFile , texOption , @Spell 185syn cluster texStyleGroup contains = texAccent , texBadMath , texComment , texDefCmd , texDelimiter , texDocType , texError , texInput , texLength , texLigature , texNewCmd , texNewEnv , texOnlyMath , texParen , texRefZone , texSection , texSpecialChar , texStatement , texString , texTypeSize , texTypeStyle , texBoldStyle , texBoldItalStyle , texItalStyle , texItalBoldStyle , texZone , texInputFile , texOption , texStyleStatement , texStyleMatcher , @Spell 186else 187syn cluster texMatchGroup contains = texAccent , texBadMath , texComment , texDefCmd , texDelimiter , texDocType , texInput , texLength , texLigature , texMatcher , texNewCmd , texNewEnv , texOnlyMath , texParen , texRefZone , texSection , texSpecialChar , texStatement , texString , texTypeSize , texTypeStyle , texBoldStyle , texBoldItalStyle , texItalStyle , texItalBoldStyle , texEmphStyle , texZone , texInputFile , texOption , @Spell 188syn cluster texMatchNMGroup contains = texAccent , texBadMath , texComment , texDefCmd , texDelimiter , texDocType , texInput , texLength , texLigature , texMatcherNM , texNewCmd , texNewEnv , texOnlyMath , texParen , texRefZone , texSection , texSpecialChar , texStatement , texString , texTypeSize , texTypeStyle , texBoldStyle , texBoldItalStyle , texItalStyle , texItalBoldStyle , texZone , texInputFile , texOption , @Spell 189syn cluster texStyleGroup contains = texAccent , texBadMath , texComment , texDefCmd , texDelimiter , texDocType , texInput , texLength , texLigature , texNewCmd , texNewEnv , texOnlyMath , texParen , texRefZone , texSection , texSpecialChar , texStatement , texString , texTypeSize , texTypeStyle , texBoldStyle , texBoldItalStyle , texItalStyle , texItalBoldStyle , texZone , texInputFile , texOption , texStyleStatement , texStyleMatcher , @Spell 190endif 191else 192if ! s: tex_no_error 193syn cluster texMatchGroup contains = texAccent , texBadMath , texComment , texDefCmd , texDelimiter , texDocType , texError , texInput , texLength , texLigature , texMatcher , texNewCmd , texNewEnv , texOnlyMath , texParen , texRefZone , texSection , texSpecialChar , texStatement , texString , texTypeSize , texTypeStyle , texZone , texInputFile , texOption 194syn cluster texMatchNMGroup contains = texAccent , texBadMath , texComment , texDefCmd , texDelimiter , texDocType , texError , texInput , texLength , texLigature , texMatcherNM , texNewCmd , texNewEnv , texOnlyMath , texParen , texRefZone , texSection , texSpecialChar , texStatement , texString , texTypeSize , texTypeStyle , texZone , texInputFile , texOption 195syn cluster texStyleGroup contains = texAccent , texBadMath , texComment , texDefCmd , texDelimiter , texDocType , texError , texInput , texLength , texLigature , texNewCmd , texNewEnv , texOnlyMath , texParen , texRefZone , texSection , texSpecialChar , texStatement , texString , texTypeSize , texTypeStyle , texZone , texInputFile , texOption , texStyleStatement , texStyleMatcher 196else 197syn cluster texMatchGroup contains = texAccent , texBadMath , texComment , texDefCmd , texDelimiter , texDocType , texInput , texLength , texLigature , texMatcher , texNewCmd , texNewEnv , texOnlyMath , texParen , texRefZone , texSection , texSpecialChar , texStatement , texString , texTypeSize , texTypeStyle , texZone , texInputFile , texOption 198syn cluster texMatchNMGroup contains = texAccent , texBadMath , texComment , texDefCmd , texDelimiter , texDocType , texInput , texLength , texLigature , texMatcherNM , texNewCmd , texNewEnv , texOnlyMath , texParen , texRefZone , texSection , texSpecialChar , texStatement , texString , texTypeSize , texTypeStyle , texZone , texInputFile , texOption 199syn cluster texStyleGroup contains = texAccent , texBadMath , texComment , texDefCmd , texDelimiter , texDocType , texInput , texLength , texLigature , texNewCmd , texNewEnv , texOnlyMath , texParen , texRefZone , texSection , texSpecialChar , texStatement , texString , texTypeSize , texTypeStyle , texZone , texInputFile , texOption , texStyleStatement , texStyleMatcher 200endif 201endif 202syn cluster texPreambleMatchGroup contains = texAccent , texBadMath , texComment , texDefCmd , texDelimiter , texDocType , texInput , texLength , texLigature , texMatcherNM , texNewCmd , texNewEnv , texOnlyMath , texParen , texRefZone , texSection , texSpecialChar , texStatement , texString , texTitle , texTypeSize , texTypeStyle , texZone , texInputFile , texOption , texMathZoneZ 203syn cluster texRefGroup contains = texMatcher , texComment , texDelimiter 204if ! exists ( "g:tex_no_math" ) 205syn cluster texPreambleMatchGroup contains = texAccent , texBadMath , texComment , texDefCmd , texDelimiter , texDocType , texInput , texLength , texLigature , texMatcherNM , texNewCmd , texNewEnv , texOnlyMath , texParen , texRefZone , texSection , texSpecialChar , texStatement , texString , texTitle , texTypeSize , texTypeStyle , texZone , texInputFile , texOption , texMathZoneZ 206syn cluster texMathZones contains = texMathZoneV , texMathZoneW , texMathZoneX , texMathZoneY , texMathZoneZ 207syn cluster texMatchGroup add = @texMathZones 208syn cluster texMathDelimGroup contains = texMathDelimBad , texMathDelimKey , texMathDelimSet1 , texMathDelimSet2 209syn cluster texMathMatchGroup contains = @texMathZones , texComment , texDefCmd , texDelimiter , texDocType , texInput , texLength , texLigature , texMathDelim , texMathMatcher , texMathOper , texNewCmd , texNewEnv , texRefZone , texSection , texSpecialChar , texStatement , texString , texTypeSize , texTypeStyle , texZone 210syn cluster texMathZoneGroup contains = texBadPar , texComment , texDelimiter , texLength , texMathDelim , texMathMatcher , texMathOper , texMathSymbol , texMathText , texRefZone , texSpecialChar , texStatement , texTypeSize , texTypeStyle 211if ! s: tex_no_error 212syn cluster texMathMatchGroup add = texMathError 213syn cluster texMathZoneGroup add = texMathError 214endif 215syn cluster texMathZoneGroup add = @NoSpell 216" following used in the \part \chapter \section \subsection \subsubsection 217" \paragraph \subparagraph \author \title highlighting 218syn cluster texDocGroup contains = texPartZone , @texPartGroup 219syn cluster texPartGroup contains = texChapterZone , texSectionZone , texParaZone 220syn cluster texChapterGroup contains = texSectionZone , texParaZone 221syn cluster texSectionGroup contains = texSubSectionZone , texParaZone 222syn cluster texSubSectionGroup contains = texSubSubSectionZone , texParaZone 223syn cluster texSubSubSectionGroup contains = texParaZone 224syn cluster texParaGroup contains = texSubParaZone 225if has ( "conceal" ) && & enc == 'utf-8' 226syn cluster texMathZoneGroup add = texGreek , texSuperscript , texSubscript , texMathSymbol 227syn cluster texMathMatchGroup add = texGreek , texSuperscript , texSubscript , texMathSymbol 228endif 229endif 230 231" Try to flag {}, [], and () mismatches: {{{1 232if s: tex_fast =~# 'm' 233if ! s: tex_no_error 234if s: tex_matchcheck =~ '{' 235syn region texMatcher matchgroup = texDelimiter start = "{ "skip = "\\\\\|\\ [ {} ] "end = "} "transparent contains = @texMatchGroup , texError 236syn region texMatcherNM matchgroup = texDelimiter start = "{ "skip = "\\\\\|\\ [ {} ] "end = "} "transparent contains = @texMatchNMGroup , texError 237endif 238if s: tex_matchcheck =~ '\[' 239syn region texMatcher matchgroup = texDelimiter start = "\[ "end = "] "transparent contains = @texMatchGroup , texError , @NoSpell 240syn region texMatcherNM matchgroup = texDelimiter start = "\[ "end = "] "transparent contains = @texMatchNMGroup , texError , @NoSpell 241endif 242else 243if s: tex_matchcheck =~ '{' 244syn region texMatcher matchgroup = texDelimiter start = "{ "skip = "\\\\\|\\ [ {} ] "end = "} "transparent contains = @texMatchGroup 245syn region texMatcherNM matchgroup = texDelimiter start = "{ "skip = "\\\\\|\\ [ {} ] "end = "} "transparent contains = @texMatchNMGroup 246endif 247if s: tex_matchcheck =~ '\[' 248syn region texMatcher matchgroup = texDelimiter start = "\[ "end = "] "transparent contains = @texMatchGroup 249syn region texMatcherNM matchgroup = texDelimiter start = "\[ "end = "] "transparent contains = @texMatchNMGroup 250endif 251endif 252if s: tex_matchcheck =~ '(' 253if ! s: tex_nospell 254syn region texParen start = "( "end = ") "transparent contains = @texMatchGroup , @Spell 255else 256syn region texParen start = "( "end = ") "transparent contains = @texMatchGroup 257endif 258endif 259endif 260if ! s: tex_no_error 261if s: tex_matchcheck =~ '(' 262syn match texError "[ }\] ] " 263else 264syn match texError "[ }\]) ] " 265endif 266endif 267if s: tex_fast =~# 'M' 268if ! exists ( "g:tex_no_math" ) 269if ! s: tex_no_error 270syn match texMathError "} "contained 271endif 272syn region texMathMatcher matchgroup = texDelimiter start = "{ "skip = "\%(\\\\\) * \\} "end = "} "end = "%stopzone\> "contained contains = @texMathMatchGroup 273endif 274endif 275 276" TeX/LaTeX keywords: {{{1 277" Instead of trying to be All Knowing, I just match \..alphameric.. 278" Note that *.tex files may not have "@" in their \commands 279if exists ( "g:tex_tex" ) || b: tex_stylish 280syn match texStatement "\\ [ a-zA-Z@ ] \+ " 281else 282syn match texStatement "\\\a\+ " 283if ! s: tex_no_error 284syn match texError "\\\a * @ [ a-zA-Z@ ] * " 285endif 286endif 287 288" TeX/LaTeX delimiters: {{{1 289syn match texDelimiter "& " 290syn match texDelimiter "\\\\ " 291 292" Tex/Latex Options: {{{1 293syn match texOption "[ ^\\ ] \zs# [ 1-9 ] \|^# [ 1-9 ] " 294 295" texAccent (tnx to Karim Belabas) avoids annoying highlighting for accents: {{{1 296if b: tex_stylish 297syn match texAccent "\\ [ bcdvuH ][ ^a-zA-Z@ ] "me= e-1 298syn match texLigature "\\\( [ ijolL ] \|ae\|oe\|ss\|AA\|AE\|OE\) [ ^a-zA-Z@ ] "me= e-1 299else 300syn match texAccent "\\ [ bcdvuH ] \A "me= e-1 301syn match texLigature "\\\( [ ijolL ] \|ae\|oe\|ss\|AA\|AE\|OE\)\A "me= e-1 302endif 303syn match texAccent "\\ [ bcdvuH ] $ " 304syn match texAccent +\\ [ =^.\~"`' ] + 305syn match texAccent +\\ [ '=t'.c^ud"vb~Hr ] {\a} + 306syn match texLigature "\\\( [ ijolL ] \|ae\|oe\|ss\|AA\|AE\|OE\)$ " 307 308 309" \begin{}/\end{} section markers: {{{1 310syn match texBeginEnd "\\begin\>\|\\end\> "nextgroup = texBeginEndName 311if s: tex_fast =~# 'm' 312syn region texBeginEndName matchgroup = texDelimiter start = "{ "end = "} "contained nextgroup = texBeginEndModifier contains = texComment 313syn region texBeginEndModifier matchgroup = texDelimiter start = "\[ "end = "] "contained contains = texComment , @texMathZones , @NoSpell 314endif 315 316" \documentclass, \documentstyle, \usepackage: {{{1 317syn match texDocType "\\documentclass\>\|\\documentstyle\>\|\\usepackage\> "nextgroup = texBeginEndName , texDocTypeArgs 318if s: tex_fast =~# 'm' 319syn region texDocTypeArgs matchgroup = texDelimiter start = "\[ "end = "] "contained nextgroup = texBeginEndName contains = texComment , @NoSpell 320endif 321 322" Preamble syntax-based folding support: {{{1 323if s: tex_fold_enabled && has ( "folding" ) 324syn region texPreamble transparent fold start = '\zs\\documentclass\> 'end = '\ze\\begin{document} 'contains = texStyle , @texPreambleMatchGroup 325endif 326 327" TeX input: {{{1 328syn match texInput "\\input\s\+ [ a-zA-Z/.0-9_^ ] \+ "hs= s+7contains = texStatement 329syn match texInputFile "\\include\(graphics\|list\)\=\(\[.\{-}\]\)\=\s * {.\{-}} "contains = texStatement , texInputCurlies , texInputFileOpt 330syn match texInputFile "\\\(epsfig\|input\|usepackage\)\s * \(\[. * \]\)\={.\{-}} "contains = texStatement , texInputCurlies , texInputFileOpt 331syn match texInputCurlies "[ {} ] "contained 332if s: tex_fast =~# 'm' 333syn region texInputFileOpt matchgroup = texDelimiter start = "\[ "end = "\] "contained contains = texComment 334endif 335 336" Type Styles (LaTeX 2.09): {{{1 337syn match texTypeStyle "\\rm\> " 338syn match texTypeStyle "\\em\> " 339syn match texTypeStyle "\\bf\> " 340syn match texTypeStyle "\\it\> " 341syn match texTypeStyle "\\sl\> " 342syn match texTypeStyle "\\sf\> " 343syn match texTypeStyle "\\sc\> " 344syn match texTypeStyle "\\tt\> " 345 346" Type Styles: attributes, commands, families, etc (LaTeX2E): {{{1 347if s: tex_conceal !~# 'b' 348syn match texTypeStyle "\\textbf\> " 349syn match texTypeStyle "\\textit\> " 350syn match texTypeStyle "\\emph\> " 351endif 352syn match texTypeStyle "\\textmd\> " 353syn match texTypeStyle "\\textrm\> " 354 355syn match texTypeStyle "\\mathbf\> " 356syn match texTypeStyle "\\mathcal\> " 357syn match texTypeStyle "\\mathit\> " 358syn match texTypeStyle "\\mathnormal\> " 359syn match texTypeStyle "\\mathrm\> " 360syn match texTypeStyle "\\mathsf\> " 361syn match texTypeStyle "\\mathtt\> " 362 363syn match texTypeStyle "\\rmfamily\> " 364syn match texTypeStyle "\\sffamily\> " 365syn match texTypeStyle "\\ttfamily\> " 366 367syn match texTypeStyle "\\itshape\> " 368syn match texTypeStyle "\\scshape\> " 369syn match texTypeStyle "\\slshape\> " 370syn match texTypeStyle "\\upshape\> " 371 372syn match texTypeStyle "\\bfseries\> " 373syn match texTypeStyle "\\mdseries\> " 374 375" Some type sizes: {{{1 376syn match texTypeSize "\\tiny\> " 377syn match texTypeSize "\\scriptsize\> " 378syn match texTypeSize "\\footnotesize\> " 379syn match texTypeSize "\\small\> " 380syn match texTypeSize "\\normalsize\> " 381syn match texTypeSize "\\large\> " 382syn match texTypeSize "\\Large\> " 383syn match texTypeSize "\\LARGE\> " 384syn match texTypeSize "\\huge\> " 385syn match texTypeSize "\\Huge\> " 386 387" Spacecodes (TeX'isms): {{{1 388" \mathcode`\^^@="2201 \delcode`\(="028300 \sfcode`\)=0 \uccode`X=`X \lccode`x=`x 389syn match texSpaceCode "\\\(math\|cat\|del\|lc\|sf\|uc\)code` "me= e-1nextgroup = texSpaceCodeChar 390syn match texSpaceCodeChar "`\\\=.\(\^.\)\==\(\d\|\"\x\{1,6}\|`.\) "contained 391 392" Sections, subsections, etc: {{{1 393if s: tex_fast =~# 'p' 394if ! s: tex_nospell 395TexFold syn region texDocZone matchgroup=texSection start='\\begin\s*{\s*document\s*}' end='\\end\s*{\s*document\s*}' contains=@texFoldGroup,@texDocGroup,@Spell 396TexFold syn region texPartZone matchgroup=texSection start='\\part\>' end='\ze\s*\\\%(part\>\|end\s*{\s*document\s*}\)' contains=@texFoldGroup,@texPartGroup,@Spell 397TexFold syn region texChapterZone matchgroup=texSection start='\\chapter\>' end='\ze\s*\\\%(chapter\>\|part\>\|end\s*{\s*document\s*}\)' contains=@texFoldGroup,@texChapterGroup,@Spell 398TexFold syn region texSectionZone matchgroup=texSection start='\\section\>' end='\ze\s*\\\%(section\>\|chapter\>\|part\>\|end\s*{\s*document\s*}\)' contains=@texFoldGroup,@texSectionGroup,@Spell 399TexFold syn region texSubSectionZone matchgroup=texSection start='\\subsection\>' end='\ze\s*\\\%(\%(sub\)\=section\>\|chapter\>\|part\>\|end\s*{\s*document\s*}\)' contains=@texFoldGroup,@texSubSectionGroup,@Spell 400TexFold syn region texSubSubSectionZone matchgroup=texSection start='\\subsubsection\>' end='\ze\s*\\\%(\%(sub\)\{,2}section\>\|chapter\>\|part\>\|end\s*{\s*document\s*}\)' contains=@texFoldGroup,@texSubSubSectionGroup,@Spell 401TexFold syn region texParaZone matchgroup=texSection start='\\paragraph\>' end='\ze\s*\\\%(paragraph\>\|\%(sub\)*section\>\|chapter\>\|part\>\|end\s*{\s*document\s*}\)' contains=@texFoldGroup,@texParaGroup,@Spell 402TexFold syn region texSubParaZone matchgroup=texSection start='\\subparagraph\>' end='\ze\s*\\\%(\%(sub\)\=paragraph\>\|\%(sub\)*section\>\|chapter\>\|part\>\|end\s*{\s*document\s*}\)' contains=@texFoldGroup,@Spell 403TexFold syn region texTitle matchgroup=texSection start='\\\%(author\|title\)\>\s*{' end='}' contains=@texFoldGroup,@Spell 404TexFold syn region texAbstract matchgroup=texSection start='\\begin\s*{\s*abstract\s*}' end='\\end\s*{\s*abstract\s*}' contains=@texFoldGroup,@Spell 405else 406TexFold syn region texDocZone matchgroup=texSection start='\\begin\s*{\s*document\s*}' end='\\end\s*{\s*document\s*}' contains=@texFoldGroup,@texDocGroup 407TexFold syn region texPartZone matchgroup=texSection start='\\part\>' end='\ze\s*\\\%(part\>\|end\s*{\s*document\s*}\)' contains=@texFoldGroup,@texPartGroup 408TexFold syn region texChapterZone matchgroup=texSection start='\\chapter\>' end='\ze\s*\\\%(chapter\>\|part\>\|end\s*{\s*document\s*}\)' contains=@texFoldGroup,@texChapterGroup 409TexFold syn region texSectionZone matchgroup=texSection start='\\section\>' end='\ze\s*\\\%(section\>\|chapter\>\|part\>\|end\s*{\s*document\s*}\)' contains=@texFoldGroup,@texSectionGroup 410TexFold syn region texSubSectionZone matchgroup=texSection start='\\subsection\>' end='\ze\s*\\\%(\%(sub\)\=section\>\|chapter\>\|part\>\|end\s*{\s*document\s*}\)' contains=@texFoldGroup,@texSubSectionGroup 411TexFold syn region texSubSubSectionZone matchgroup=texSection start='\\subsubsection\>' end='\ze\s*\\\%(\%(sub\)\{,2}section\>\|chapter\>\|part\>\|end\s*{\s*document\s*}\)' contains=@texFoldGroup,@texSubSubSectionGroup 412TexFold syn region texParaZone matchgroup=texSection start='\\paragraph\>' end='\ze\s*\\\%(paragraph\>\|\%(sub\)*section\>\|chapter\>\|part\>\|end\s*{\s*document\s*}\)' contains=@texFoldGroup,@texParaGroup 413TexFold syn region texSubParaZone matchgroup=texSection start='\\subparagraph\>' end='\ze\s*\\\%(\%(sub\)\=paragraph\>\|\%(sub\)*section\>\|chapter\>\|part\>\|end\s*{\s*document\s*}\)' contains=@texFoldGroup 414TexFold syn region texTitle matchgroup=texSection start='\\\%(author\|title\)\>\s*{' end='}' contains=@texFoldGroup 415TexFold syn region texAbstract matchgroup=texSection start='\\begin\s*{\s*abstract\s*}' end='\\end\s*{\s*abstract\s*}' contains=@texFoldGroup 416endif 417endif 418 419" particular support for bold and italic {{{1 420if s: tex_fast =~# 'b' 421if s: tex_conceal =~# 'b' 422if ! exists ( "g:tex_nospell" ) || ! g: tex_nospell 423syn region texBoldStyle matchgroup = texTypeStyle start = "\\textbf\s * { "matchgroup = texTypeStyle end = "} "concealends contains = @texBoldGroup , @Spell 424syn region texBoldItalStyle matchgroup = texTypeStyle start = "\\textit\s * { "matchgroup = texTypeStyle end = "} "concealends contains = @texItalGroup , @Spell 425syn region texItalStyle matchgroup = texTypeStyle start = "\\textit\s * { "matchgroup = texTypeStyle end = "} "concealends contains = @texItalGroup , @Spell 426syn region texItalBoldStyle matchgroup = texTypeStyle start = "\\textbf\s * { "matchgroup = texTypeStyle end = "} "concealends contains = @texBoldGroup , @Spell 427syn region texEmphStyle matchgroup = texTypeStyle start = "\\emph\s * { "matchgroup = texTypeStyle end = "} "concealends contains = @texItalGroup , @Spell 428syn region texEmphStyle matchgroup = texTypeStyle start = "\\texts [ cfl ] \s * { "matchgroup = texTypeStyle end = "} "concealends contains = @texBoldGroup , @Spell 429syn region texEmphStyle matchgroup = texTypeStyle start = "\\textup\s * { "matchgroup = texTypeStyle end = "} "concealends contains = @texBoldGroup , @Spell 430syn region texEmphStyle matchgroup = texTypeStyle start = "\\texttt\s * { "matchgroup = texTypeStyle end = "} "concealends contains = @texBoldGroup , @Spell 431else 432syn region texBoldStyle matchgroup = texTypeStyle start = "\\textbf\s * { "matchgroup = texTypeStyle end = "} "concealends contains = @texBoldGroup 433syn region texBoldItalStyle matchgroup = texTypeStyle start = "\\textit\s * { "matchgroup = texTypeStyle end = "} "concealends contains = @texItalGroup 434syn region texItalStyle matchgroup = texTypeStyle start = "\\textit\s * { "matchgroup = texTypeStyle end = "} "concealends contains = @texItalGroup 435syn region texItalBoldStyle matchgroup = texTypeStyle start = "\\textbf\s * { "matchgroup = texTypeStyle end = "} "concealends contains = @texBoldGroup 436syn region texEmphStyle matchgroup = texTypeStyle start = "\\emph\s * { "matchgroup = texTypeStyle end = "} "concealends contains = @texItalGroup 437syn region texEmphStyle matchgroup = texTypeStyle start = "\\texts [ cfl ] \s * { "matchgroup = texTypeStyle end = "} "concealends contains = @texEmphGroup 438syn region texEmphStyle matchgroup = texTypeStyle start = "\\textup\s * { "matchgroup = texTypeStyle end = "} "concealends contains = @texEmphGroup 439syn region texEmphStyle matchgroup = texTypeStyle start = "\\texttt\s * { "matchgroup = texTypeStyle end = "} "concealends contains = @texEmphGroup 440endif 441endif 442endif 443 444" Bad Math (mismatched): {{{1 445if ! exists ( "g:tex_no_math" ) && ! s: tex_no_error 446syn match texBadMath "\\end\s * {\s * \(array\| [ bBpvV ] matrix\|split\|smallmatrix\)\s * } " 447syn match texBadMath "\\end\s * {\s * \(align\|alignat\|displaymath\|eqnarray\|equation\|flalign\|gather\|math\|multline\)\*\=\s * } " 448syn match texBadMath "\\ [ \]) ] " 449syn match texBadPar contained "\%(\\par\>\|^\s * \n.\) " 450endif 451 452" Math Zones: {{{1 453if ! exists ( "g:tex_no_math" ) 454" TexNewMathZone: function creates a mathzone with the given suffix and mathzone name. {{{2 455" Starred forms are created if starform is true. Starred 456" forms have syntax group and synchronization groups with a 457" "S" appended. Handles: cluster, syntax, sync, and highlighting. 458fun ! TexNewMathZone ( sfx , mathzone , starform ) 459let grpname = "texMathZone" . a: sfx 460let syncname = "texSyncMathZone" . a: sfx 461if s: tex_fold_enabled 462let foldcmd = " fold" 463else 464let foldcmd = "" 465endif 466exe "syn cluster texMathZones add=" . grpname 467if s: tex_fast =~# 'M' 468exe 'syn region ' . grpname . ' start=' . "'" . '\\begin\s*{\s*' . a: mathzone . '\s*}' . "'" . ' end=' . "'" . '\\end\s*{\s*' . a: mathzone . '\s*}' . "'" . ' keepend contains=@texMathZoneGroup' . foldcmd 469exe 'syn sync match ' . syncname . ' grouphere ' . grpname . ' "\\begin\s*{\s*' . a: mathzone . '\*\s*}"' 470exe 'syn sync match ' . syncname . ' grouphere ' . grpname . ' "\\begin\s*{\s*' . a: mathzone . '\*\s*}"' 471endif 472exe 'hi def link ' . grpname . ' texMath' 473if a: starform 474let grpname = "texMathZone" . a: sfx . 'S' 475let syncname = "texSyncMathZone" . a: sfx . 'S' 476exe "syn cluster texMathZones add=" . grpname 477if s: tex_fast =~# 'M' 478exe 'syn region ' . grpname . ' start=' . "'" . '\\begin\s*{\s*' . a: mathzone . '\*\s*}' . "'" . ' end=' . "'" . '\\end\s*{\s*' . a: mathzone . '\*\s*}' . "'" . ' keepend contains=@texMathZoneGroup' . foldcmd 479exe 'syn sync match ' . syncname . ' grouphere ' . grpname . ' "\\begin\s*{\s*' . a: mathzone . '\*\s*}"' 480exe 'syn sync match ' . syncname . ' grouphere ' . grpname . ' "\\begin\s*{\s*' . a: mathzone . '\*\s*}"' 481endif 482exe 'hi def link ' . grpname . ' texMath' 483endif 484endfun 485 486" Standard Math Zones: {{{2 487call TexNewMathZone ( "A" , "displaymath" , 1 ) 488call TexNewMathZone ( "B" , "eqnarray" , 1 ) 489call TexNewMathZone ( "C" , "equation" , 1 ) 490call TexNewMathZone ( "D" , "math" , 1 ) 491call TexNewMathZone ( "E" , "align" , 1 ) 492call TexNewMathZone ( "F" , "alignat" , 1 ) 493call TexNewMathZone ( "G" , "flalign" , 1 ) 494call TexNewMathZone ( "H" , "gather" , 1 ) 495call TexNewMathZone ( "I" , "multline" , 1 ) 496 497" Inline Math Zones: {{{2 498if s: tex_fast =~# 'M' 499if has ( "conceal" ) && & enc == 'utf-8' && s: tex_conceal =~# 'd' 500syn region texMathZoneV matchgroup = texDelimiter start = "\\( "matchgroup = texDelimiter end = "\\)\|%stopzone\> "keepend concealends contains = @texMathZoneGroup 501syn region texMathZoneW matchgroup = texDelimiter start = "\\\[ "matchgroup = texDelimiter end = "\\]\|%stopzone\> "keepend concealends contains = @texMathZoneGroup 502syn region texMathZoneX matchgroup = texDelimiter start = "\$ "skip = "\\\\\|\\\$ "matchgroup = texDelimiter end = "\$ "end = "%stopzone\> "concealends contains = @texMathZoneGroup 503syn region texMathZoneY matchgroup = texDelimiter start = "\$\$ "matchgroup = texDelimiter end = "\$\$ "end = "%stopzone\> "keepend concealends contains = @texMathZoneGroup 504else 505syn region texMathZoneV matchgroup = texDelimiter start = "\\( "matchgroup = texDelimiter end = "\\)\|%stopzone\> "keepend contains = @texMathZoneGroup 506syn region texMathZoneW matchgroup = texDelimiter start = "\\\[ "matchgroup = texDelimiter end = "\\]\|%stopzone\> "keepend contains = @texMathZoneGroup 507syn region texMathZoneX matchgroup = texDelimiter start = "\$ "skip = "\%(\\\\\) * \\\$ "matchgroup = texDelimiter end = "\$ "end = "%stopzone\> "contains = @texMathZoneGroup 508syn region texMathZoneY matchgroup = texDelimiter start = "\$\$ "matchgroup = texDelimiter end = "\$\$ "end = "%stopzone\> "keepend contains = @texMathZoneGroup 509endif 510syn region texMathZoneZ matchgroup = texStatement start = "\\ensuremath\s * { "matchgroup = texStatement end = "} "end = "%stopzone\> "contains = @texMathZoneGroup 511endif 512 513syn match texMathOper "[ _^= ] "contained 514 515" Text Inside Math Zones: {{{2 516if s: tex_fast =~# 'M' 517if ! exists ( "g:tex_nospell" ) || ! g: tex_nospell 518syn region texMathText matchgroup = texStatement start = '\\\(\(inter\)\=text\|mbox\)\s * { 'end = '} 'contains = @texFoldGroup , @Spell 519else 520syn region texMathText matchgroup = texStatement start = '\\\(\(inter\)\=text\|mbox\)\s * { 'end = '} 'contains = @texFoldGroup 521endif 522endif 523 524" \left..something.. and \right..something.. support: {{{2 525syn match texMathDelimBad contained "\S " 526if has ( "conceal" ) && & enc == 'utf-8' && s: tex_conceal =~# 'm' 527syn match texMathDelim contained "\\left\[ " 528syn match texMathDelim contained "\\left\\{ "skipwhite nextgroup = texMathDelimSet1 , texMathDelimSet2 , texMathDelimBad contains = texMathSymbol cchar = { 529syn match texMathDelim contained "\\right\\} "skipwhite nextgroup = texMathDelimSet1 , texMathDelimSet2 , texMathDelimBad contains = texMathSymbol cchar = } 530let s: texMathDelimList = [ 531 \[ '<' , '<' ] , 532 \[ '>' , '>' ] , 533 \[ '(' , '(' ] , 534 \[ ')' , ')' ] , 535 \[ '\[' , '[' ] , 536 \[ ']' , ']' ] , 537 \[ '\\{' , '{' ] , 538 \[ '\\}' , '}' ] , 539 \[ '|' , '|' ] , 540 \[ '\\|' , '‖' ] , 541 \[ '\\backslash' , '\' ] , 542 \[ '\\downarrow' , '↓' ] , 543 \[ '\\Downarrow' , '⇓' ] , 544 \[ '\\lbrace' , '[' ] , 545 \[ '\\lceil' , '⌈' ] , 546 \[ '\\lfloor' , '⌊' ] , 547 \[ '\\lgroup' , '⌊' ] , 548 \[ '\\lmoustache' , '⎛' ] , 549 \[ '\\rbrace' , ']' ] , 550 \[ '\\rceil' , '⌉' ] , 551 \[ '\\rfloor' , '⌋' ] , 552 \[ '\\rgroup' , '⌋' ] , 553 \[ '\\rmoustache' , '⎞' ] , 554 \[ '\\uparrow' , '↑' ] , 555 \[ '\\Uparrow' , '↑' ] , 556 \[ '\\updownarrow' , '↕' ] , 557 \[ '\\Updownarrow' , '⇕' ]] 558if & ambw == "double" || exists ( "g:tex_usedblwidth" ) 559let s: texMathDelimList = s: texMathDelimList + [ 560 \[ '\\langle' , '〈' ] , 561 \[ '\\rangle' , '〉' ]] 562else 563let s: texMathDelimList = s: texMathDelimList + [ 564 \[ '\\langle' , '<' ] , 565 \[ '\\rangle' , '>' ]] 566endif 567syn match texMathDelim '\\ [ bB ] igg\= [ lr ] 'contained nextgroup = texMathDelimBad 568for texmath in s: texMathDelimList 569exe "syn match texMathDelim '\\\\[bB]igg\\=[lr]\\=" . texmath [ 0 ] . "' contained conceal cchar=" . texmath [ 1 ] 570endfor 571 572else 573syn match texMathDelim contained "\\\(left\|right\)\> "skipwhite nextgroup = texMathDelimSet1 , texMathDelimSet2 , texMathDelimBad 574syn match texMathDelim contained "\\ [ bB ] igg\= [ lr ] \=\> "skipwhite nextgroup = texMathDelimSet1 , texMathDelimSet2 , texMathDelimBad 575syn match texMathDelimSet2 contained "\\ "nextgroup = texMathDelimKey , texMathDelimBad 576syn match texMathDelimSet1 contained "[ <>()[\]|/. ] \|\\ [ {}| ] " 577syn keyword texMathDelimKey contained backslash lceil lVert rgroup uparrow 578syn keyword texMathDelimKey contained downarrow lfloor rangle rmoustache Uparrow 579syn keyword texMathDelimKey contained Downarrow lgroup rbrace rvert updownarrow 580syn keyword texMathDelimKey contained langle lmoustache rceil rVert Updownarrow 581syn keyword texMathDelimKey contained lbrace lvert rfloor 582endif 583syn match texMathDelim contained "\\\(left\|right\)arrow\>\|\<\( [ aA ] rrow\|brace\)\=vert\> " 584syn match texMathDelim contained "\\lefteqn\> " 585endif 586 587" Special TeX characters ( \$ \& \% \# \{ \} \_ \S \P ) : {{{1 588syn match texSpecialChar "\\ [ $&%#{}_ ] " 589if b: tex_stylish 590syn match texSpecialChar "\\ [ SP@ ][ ^a-zA-Z@ ] "me= e-1 591else 592syn match texSpecialChar "\\ [ SP@ ] \A "me= e-1 593endif 594syn match texSpecialChar "\\\\ " 595if ! exists ( "g:tex_no_math" ) 596syn match texOnlyMath "[ _^ ] " 597endif 598syn match texSpecialChar "\^\^ [ 0-9a-f ] \{2}\|\^\^\S " 599if s: tex_conceal !~# 'S' 600syn match texSpecialChar '\\glq\> 'contained conceal cchar = ‚ 601syn match texSpecialChar '\\grq\> 'contained conceal cchar = ‘ 602syn match texSpecialChar '\\glqq\> 'contained conceal cchar = „ 603syn match texSpecialChar '\\grqq\> 'contained conceal cchar = “ 604syn match texSpecialChar '\\hyp\> 'contained conceal cchar = - 605endif 606 607" Comments: {{{1 608" Normal TeX LaTeX : %.... 609" Documented TeX Format: ^^A... -and- leading %s (only) 610if ! s: tex_comment_nospell 611syn cluster texCommentGroup contains = texTodo , @Spell 612else 613syn cluster texCommentGroup contains = texTodo , @NoSpell 614endif 615syn case ignore 616syn keyword texTodo contained combak fixme todo xxx 617syn case match 618if s: extfname == "dtx" 619syn match texComment "\^\^A. * $ "contains = @texCommentGroup 620syn match texComment "^%\+ "contains = @texCommentGroup 621else 622if s: tex_fold_enabled 623" allows syntax-folding of 2 or more contiguous comment lines 624" single-line comments are not folded 625syn match texComment "%. * $ "contains = @texCommentGroup 626if s: tex_fast =~# 'c' 627TexFold syn region texComment start="^\zs\s*%.*\_s*%" skip="^\s*%" end='^\ze\s*[^%]' contains=@texCommentGroup 628TexFold syn region texNoSpell contained matchgroup=texComment start="%\s*nospell\s*{" end="%\s*nospell\s*}" contains=@texFoldGroup,@NoSpell 629endif 630else 631syn match texComment "%. * $ "contains = @texCommentGroup 632if s: tex_fast =~# 'c' 633syn region texNoSpell contained matchgroup = texComment start = "%\s * nospell\s * { "end = "%\s * nospell\s * } "contains = @texFoldGroup , @NoSpell 634endif 635endif 636endif 637 638" %begin-include ... %end-include acts like a texDocZone for \include'd files. Permits spell checking, for example, in such files. 639if ! s: tex_nospell 640TexFold syn region texDocZone matchgroup=texSection start='^\s*%begin-include\>' end='^\s*%end-include\>' contains=@texFoldGroup,@texDocGroup,@Spell 641else 642TexFold syn region texDocZone matchgroup=texSection start='^\s*%begin-include\>' end='^\s*%end-include\>' contains=@texFoldGroup,@texDocGroup 643endif 644 645" Separate lines used for verb` and verb# so that the end conditions {{{1 646" will appropriately terminate. 647" If g:tex_verbspell exists, then verbatim texZones will permit spellchecking there. 648if s: tex_fast =~# 'v' 649if exists ( "g:tex_verbspell" ) && g: tex_verbspell 650syn region texZone start = "\\begin{ [ vV ] erbatim} "end = "\\end{ [ vV ] erbatim}\|%stopzone\> "contains = @Spell 651" listings package: 652if b: tex_stylish 653syn region texZone start = "\\verb\*\=\z( [ ^\ta-zA-Z@ ] \) "end = "\z1\|%stopzone\> "contains = @Spell 654else 655syn region texZone start = "\\verb\*\=\z( [ ^\ta-zA-Z ] \) "end = "\z1\|%stopzone\> "contains = @Spell 656endif 657else 658syn region texZone start = "\\begin{ [ vV ] erbatim} "end = "\\end{ [ vV ] erbatim}\|%stopzone\> " 659if b: tex_stylish 660syn region texZone start = "\\verb\*\=\z( [ ^\ta-zA-Z@ ] \) "end = "\z1\|%stopzone\> " 661else 662syn region texZone start = "\\verb\*\=\z( [ ^\ta-zA-Z ] \) "end = "\z1\|%stopzone\> " 663endif 664endif 665endif 666 667" Tex Reference Zones: {{{1 668if s: tex_fast =~# 'r' 669syn region texZone matchgroup = texStatement start = "@samp{ "end = "}\|%stopzone\> "contains = @texRefGroup 670syn region texRefZone matchgroup = texStatement start = "\\nocite{ "end = "}\|%stopzone\> "contains = @texRefGroup 671syn region texRefZone matchgroup = texStatement start = "\\bibliography{ "end = "}\|%stopzone\> "contains = @texRefGroup 672syn region texRefZone matchgroup = texStatement start = "\\label{ "end = "}\|%stopzone\> "contains = @texRefGroup 673syn region texRefZone matchgroup = texStatement start = "\\\(page\|eq\)ref{ "end = "}\|%stopzone\> "contains = @texRefGroup 674syn region texRefZone matchgroup = texStatement start = "\\v\=ref{ "end = "}\|%stopzone\> "contains = @texRefGroup 675syn region texRefOption contained matchgroup = texDelimiter start = '\[ 'end = '] 'contains = @texRefGroup , texRefZone nextgroup = texRefOption , texCite 676syn region texCite contained matchgroup = texDelimiter start = '{ 'end = '} 'contains = @texRefGroup , texRefZone , texCite 677endif 678syn match texRefZone '\\cite\%( [ tp ] \*\=\)\=\> 'nextgroup = texRefOption , texCite 679 680" Handle (re)newcommand, providecommand, (re)newenvironment : {{{1 681" EXAMPLE: 682" 683" The followings are valid (ignoring error due to redefinition): 684" 685" \newcommand{\foo}{body} 686" \newcommand{\foo}[1]{#1} 687" \newcommand{\foo}[1][def]{#1} 688" 689" The followings are ill-formed: 690" 691" \newcommand{\foo}{#1} ! Illegal parameter number in definition of \foo. 692" \newcommand{\foo}[x]{…} ! Missing number, treated as zero. 693" \newcommand{\foo}[10]{…} ! You already have nine parameters. 694syn match texNewCmd "\\\%(\%(re\)\=new\|provide\)command\>\*\? "nextgroup = texCmdName skipwhite skipnl 695if s: tex_fast =~# 'V' 696syn region texCmdName contained matchgroup = texDelimiter start = "{ "rs= s+1end = "} "nextgroup = texCmdArgs , texCmdBody skipwhite skipnl 697syn region texCmdArgs contained matchgroup = texDelimiter start = "\[ "rs= s+1end = "] "nextgroup = texCmdDefaultPar , texCmdBody skipwhite skipnl 698syn region texCmdDefaultPar contained matchgroup = texDelimiter start = "\[ "rs= s+1end = "] "nextgroup = texCmdBody skipwhite skipnl 699syn region texCmdBody contained matchgroup = texDelimiter start = "{ "rs= s+1skip = "\\\\\|\\ [ {} ] "matchgroup = texDelimiter end = "} "contains = @texCmdGroup 700endif 701" EXAMPLE: 702" 703" The followings are valid (ignoring error due to redefinition): 704" 705" \newenvironment{baz}{beg}{end} 706" \newenvironment{baz}[1]{beg #1}{end} 707" \newenvironment{baz}[1][default]{beg #1}{end} 708" 709" The followings are invalid: 710" 711" \newenvironment{baz}{#1}{…} ! Illegal parameter number in definition of \baz. 712" \newenvironment{baz}[x]{…}{…} ! Missing number, treated as zero. 713" \newenvironment{baz}[10]{…}{…} ! You already have nine parameters. 714" \newenvironment{baz}[1]{…}{#1} ! Illegal parameter number in definition of \endbaz. 715syn match texNewEnv "\\\%(re\)\=newenvironment\>\*\? "nextgroup = texEnvName skipwhite skipnl 716if s: tex_fast =~# 'V' 717syn region texEnvName contained matchgroup = texDelimiter start = "{ "rs= s+1end = "} "nextgroup = texEnvArgs , texEnvBgn skipwhite skipnl 718syn region texEnvArgs contained matchgroup = texDelimiter start = "\[ "rs= s+1end = "] "nextgroup = texEnvDefaultPar , texEnvBgn skipwhite skipnl 719syn region texEnvDefaultPar contained matchgroup = texDelimiter start = "\[ "rs= s+1end = "] "nextgroup = texEnvBgn skipwhite skipnl 720syn region texEnvBgn contained matchgroup = texDelimiter start = "{ "rs= s+1end = "} "nextgroup = texEnvEnd skipwhite skipnl contains = @texEnvGroup 721syn region texEnvEnd contained matchgroup = texDelimiter start = "{ "rs= s+1end = "} "skipwhite skipnl contains = @texEnvGroup 722endif 723 724" Definitions/Commands: {{{1 725syn match texDefCmd "\\def\> "nextgroup = texDefName skipwhite skipnl 726if b: tex_stylish 727syn match texDefName contained "\\ [ a-zA-Z@ ] \+ "nextgroup = texDefParms , texCmdBody skipwhite skipnl 728syn match texDefName contained "\\ [ ^a-zA-Z@ ] "nextgroup = texDefParms , texCmdBody skipwhite skipnl 729else 730syn match texDefName contained "\\\a\+ "nextgroup = texDefParms , texCmdBody skipwhite skipnl 731syn match texDefName contained "\\\A "nextgroup = texDefParms , texCmdBody skipwhite skipnl 732endif 733syn match texDefParms contained "# [ ^{ ] * "contains = texDefParm nextgroup = texCmdBody skipwhite skipnl 734syn match texDefParm contained "# [ 1-9 ] " 735 736" TeX Lengths: {{{1 737syn match texLength "\<\d\+\( [ ., ] \d\+\)\=\s * \(true\)\=\s * \(bp\|cc\|cm\|dd\|em\|ex\|in\|mm\|pc\|pt\|sp\)\> " 738 739" TeX String Delimiters: {{{1 740syn match texString "\(``\|''\|,,\) " 741 742" makeatletter -- makeatother sections 743if ! s: tex_no_error 744if s: tex_fast =~# 'S' 745syn region texStyle matchgroup = texStatement start = '\\makeatletter 'end = '\\makeatother 'contains = @texStyleGroup contained 746endif 747syn match texStyleStatement "\\ [ a-zA-Z@ ] \+ "contained 748if s: tex_fast =~# 'S' 749syn region texStyleMatcher matchgroup = texDelimiter start = "{ "skip = "\\\\\|\\ [ {} ] "end = "} "contains = @texStyleGroup , texError contained 750syn region texStyleMatcher matchgroup = texDelimiter start = "\[ "end = "] "contains = @texStyleGroup , texError contained 751endif 752endif 753 754" Conceal mode support (supports set cole=2) {{{1 755if has ( "conceal" ) && & enc == 'utf-8' 756 757" Math Symbols {{{2 758" (many of these symbols were contributed by Björn Winckler) 759if s: tex_conceal =~# 'm' 760let s: texMathList = [ 761 \[ '|' , '‖' ], 762 \[ 'aleph' , 'ℵ' ], 763 \[ 'amalg' , '∐' ], 764 \[ 'angle' , '∠' ], 765 \[ 'approx' , '≈' ], 766 \[ 'ast' , '∗' ], 767 \[ 'asymp' , '≍' ], 768 \[ 'backslash' , '∖' ], 769 \[ 'bigcap' , '∩' ], 770 \[ 'bigcirc' , '○' ], 771 \[ 'bigcup' , '∪' ], 772 \[ 'bigodot' , '⊙' ], 773 \[ 'bigoplus' , '⊕' ], 774 \[ 'bigotimes' , '⊗' ], 775 \[ 'bigsqcup' , '⊔' ], 776 \[ 'bigtriangledown' , '∇' ], 777 \[ 'bigtriangleup' , '∆' ], 778 \[ 'bigvee' , '⋁' ], 779 \[ 'bigwedge' , '⋀' ], 780 \[ 'bot' , '⊥' ], 781 \[ 'bowtie' , '⋈' ], 782 \[ 'bullet' , '•' ], 783 \[ 'cap' , '∩' ], 784 \[ 'cdot' , '·' ], 785 \[ 'cdots' , '⋯' ], 786 \[ 'circ' , '∘' ], 787 \[ 'clubsuit' , '♣' ], 788 \[ 'cong' , '≅' ], 789 \[ 'coprod' , '∐' ], 790 \[ 'copyright' , '©' ], 791 \[ 'cup' , '∪' ], 792 \[ 'dagger' , '†' ], 793 \[ 'dashv' , '⊣' ], 794 \[ 'ddagger' , '‡' ], 795 \[ 'ddots' , '⋱' ], 796 \[ 'diamond' , '⋄' ], 797 \[ 'diamondsuit' , '♢' ], 798 \[ 'div' , '÷' ], 799 \[ 'doteq' , '≐' ], 800 \[ 'dots' , '…' ], 801 \[ 'downarrow' , '↓' ], 802 \[ 'Downarrow' , '⇓' ], 803 \[ 'ell' , 'ℓ' ], 804 \[ 'emptyset' , '∅' ], 805 \[ 'equiv' , '≡' ], 806 \[ 'exists' , '∃' ], 807 \[ 'flat' , '♭' ], 808 \[ 'forall' , '∀' ], 809 \[ 'frown' , '⁔' ], 810 \[ 'ge' , '≥' ], 811 \[ 'geq' , '≥' ], 812 \[ 'gets' , '←' ], 813 \[ 'gg' , '⟫' ], 814 \[ 'hbar' , 'ℏ' ], 815 \[ 'heartsuit' , '♡' ], 816 \[ 'hookleftarrow' , '↩' ], 817 \[ 'hookrightarrow' , '↪' ], 818 \[ 'iff' , '⇔' ], 819 \[ 'Im' , 'ℑ' ], 820 \[ 'imath' , 'ɩ' ], 821 \[ 'in' , '∈' ], 822 \[ 'infty' , '∞' ], 823 \[ 'int' , '∫' ], 824 \[ 'jmath' , '𝚥' ], 825 \[ 'land' , '∧' ], 826 \[ 'lceil' , '⌈' ], 827 \[ 'ldots' , '…' ], 828 \[ 'le' , '≤' ], 829 \[ 'left|' , '|' ], 830 \[ 'left\\|' , '‖' ], 831 \[ 'left(' , '(' ], 832 \[ 'left\[' , '[' ], 833 \[ 'left\\{' , '{' ], 834 \[ 'leftarrow' , '←' ], 835 \[ 'Leftarrow' , '⇐' ], 836 \[ 'leftharpoondown' , '↽' ], 837 \[ 'leftharpoonup' , '↼' ], 838 \[ 'leftrightarrow' , '↔' ], 839 \[ 'Leftrightarrow' , '⇔' ], 840 \[ 'leq' , '≤' ], 841 \[ 'leq' , '≤' ], 842 \[ 'lfloor' , '⌊' ], 843 \[ 'll' , '≪' ], 844 \[ 'lmoustache' , '╭' ], 845 \[ 'lor' , '∨' ], 846 \[ 'mapsto' , '↦' ], 847 \[ 'mid' , '∣' ], 848 \[ 'models' , '╞' ], 849 \[ 'mp' , '∓' ], 850 \[ 'nabla' , '∇' ], 851 \[ 'natural' , '♮' ], 852 \[ 'ne' , '≠' ], 853 \[ 'nearrow' , '↗' ], 854 \[ 'neg' , '¬' ], 855 \[ 'neq' , '≠' ], 856 \[ 'ni' , '∋' ], 857 \[ 'notin' , '∉' ], 858 \[ 'nwarrow' , '↖' ], 859 \[ 'odot' , '⊙' ], 860 \[ 'oint' , '∮' ], 861 \[ 'ominus' , '⊖' ], 862 \[ 'oplus' , '⊕' ], 863 \[ 'oslash' , '⊘' ], 864 \[ 'otimes' , '⊗' ], 865 \[ 'owns' , '∋' ], 866 \[ 'P' , '¶' ], 867 \[ 'parallel' , '║' ], 868 \[ 'partial' , '∂' ], 869 \[ 'perp' , '⊥' ], 870 \[ 'pm' , '±' ], 871 \[ 'prec' , '≺' ], 872 \[ 'preceq' , '⪯' ], 873 \[ 'prime' , '′' ], 874 \[ 'prod' , '∏' ], 875 \[ 'propto' , '∝' ], 876 \[ 'rceil' , '⌉' ], 877 \[ 'Re' , 'ℜ' ], 878 \[ 'quad' , ' ' ], 879 \[ 'qquad' , ' ' ], 880 \[ 'rfloor' , '⌋' ], 881 \[ 'right|' , '|' ], 882 \[ 'right\\|' , '‖' ], 883 \[ 'right)' , ')' ], 884 \[ 'right]' , ']' ], 885 \[ 'right\\}' , '}' ], 886 \[ 'rightarrow' , '→' ], 887 \[ 'Rightarrow' , '⇒' ], 888 \[ 'rightleftharpoons' , '⇌' ], 889 \[ 'rmoustache' , '╮' ], 890 \[ 'S' , '§' ], 891 \[ 'searrow' , '↘' ], 892 \[ 'setminus' , '∖' ], 893 \[ 'sharp' , '♯' ], 894 \[ 'sim' , '∼' ], 895 \[ 'simeq' , '⋍' ], 896 \[ 'smile' , '‿' ], 897 \[ 'spadesuit' , '♠' ], 898 \[ 'sqcap' , '⊓' ], 899 \[ 'sqcup' , '⊔' ], 900 \[ 'sqsubset' , '⊏' ], 901 \[ 'sqsubseteq' , '⊑' ], 902 \[ 'sqsupset' , '⊐' ], 903 \[ 'sqsupseteq' , '⊒' ], 904 \[ 'star' , '✫' ], 905 \[ 'subset' , '⊂' ], 906 \[ 'subseteq' , '⊆' ], 907 \[ 'succ' , '≻' ], 908 \[ 'succeq' , '⪰' ], 909 \[ 'sum' , '∑' ], 910 \[ 'supset' , '⊃' ], 911 \[ 'supseteq' , '⊇' ], 912 \[ 'surd' , '√' ], 913 \[ 'swarrow' , '↙' ], 914 \[ 'times' , '×' ], 915 \[ 'to' , '→' ], 916 \[ 'top' , '⊤' ], 917 \[ 'triangle' , '∆' ], 918 \[ 'triangleleft' , '⊲' ], 919 \[ 'triangleright' , '⊳' ], 920 \[ 'uparrow' , '↑' ], 921 \[ 'Uparrow' , '⇑' ], 922 \[ 'updownarrow' , '↕' ], 923 \[ 'Updownarrow' , '⇕' ], 924 \[ 'vdash' , '⊢' ], 925 \[ 'vdots' , '⋮' ], 926 \[ 'vee' , '∨' ], 927 \[ 'wedge' , '∧' ], 928 \[ 'wp' , '℘' ], 929 \[ 'wr' , '≀' ]] 930if & ambw == "double" || exists ( "g:tex_usedblwidth" ) 931let s: texMathList = s: texMathList + [ 932 \[ 'right\\rangle' , '〉' ], 933 \[ 'left\\langle' , '〈' ]] 934else 935let s: texMathList = s: texMathList + [ 936 \[ 'right\\rangle' , '>' ], 937 \[ 'left\\langle' , '<' ]] 938endif 939for texmath in s: texMathList 940if texmath [ 0 ] =~# '\w$' 941exe "syn match texMathSymbol '\\\\" . texmath [ 0 ] . "\\>' contained conceal cchar=" . texmath [ 1 ] 942else 943exe "syn match texMathSymbol '\\\\" . texmath [ 0 ] . "' contained conceal cchar=" . texmath [ 1 ] 944endif 945endfor 946 947if & ambw == "double" 948syn match texMathSymbol '\\gg\> 'contained conceal cchar = ≫ 949syn match texMathSymbol '\\ll\> 'contained conceal cchar = ≪ 950else 951syn match texMathSymbol '\\gg\> 'contained conceal cchar = ⟫ 952syn match texMathSymbol '\\ll\> 'contained conceal cchar = ⟪ 953endif 954 955syn match texMathSymbol '\\hat{a} 'contained conceal cchar = â 956syn match texMathSymbol '\\hat{A} 'contained conceal cchar =  957syn match texMathSymbol '\\hat{c} 'contained conceal cchar = ĉ 958syn match texMathSymbol '\\hat{C} 'contained conceal cchar = Ĉ 959syn match texMathSymbol '\\hat{e} 'contained conceal cchar = ê 960syn match texMathSymbol '\\hat{E} 'contained conceal cchar = Ê 961syn match texMathSymbol '\\hat{g} 'contained conceal cchar = ĝ 962syn match texMathSymbol '\\hat{G} 'contained conceal cchar = Ĝ 963syn match texMathSymbol '\\hat{i} 'contained conceal cchar = î 964syn match texMathSymbol '\\hat{I} 'contained conceal cchar = Î 965syn match texMathSymbol '\\hat{o} 'contained conceal cchar = ô 966syn match texMathSymbol '\\hat{O} 'contained conceal cchar = Ô 967syn match texMathSymbol '\\hat{s} 'contained conceal cchar = ŝ 968syn match texMathSymbol '\\hat{S} 'contained conceal cchar = Ŝ 969syn match texMathSymbol '\\hat{u} 'contained conceal cchar = û 970syn match texMathSymbol '\\hat{U} 'contained conceal cchar = Û 971syn match texMathSymbol '\\hat{w} 'contained conceal cchar = ŵ 972syn match texMathSymbol '\\hat{W} 'contained conceal cchar = Ŵ 973syn match texMathSymbol '\\hat{y} 'contained conceal cchar = ŷ 974syn match texMathSymbol '\\hat{Y} 'contained conceal cchar = Ŷ 975" syn match texMathSymbol '\\bar{a}' contained conceal cchar=a̅ 976 977syn match texMathSymbol '\\dot{B} 'contained conceal cchar = Ḃ 978syn match texMathSymbol '\\dot{b} 'contained conceal cchar = ḃ 979syn match texMathSymbol '\\dot{D} 'contained conceal cchar = Ḋ 980syn match texMathSymbol '\\dot{d} 'contained conceal cchar = ḋ 981syn match texMathSymbol '\\dot{F} 'contained conceal cchar = Ḟ 982syn match texMathSymbol '\\dot{f} 'contained conceal cchar = ḟ 983syn match texMathSymbol '\\dot{H} 'contained conceal cchar = Ḣ 984syn match texMathSymbol '\\dot{h} 'contained conceal cchar = ḣ 985syn match texMathSymbol '\\dot{M} 'contained conceal cchar = Ṁ 986syn match texMathSymbol '\\dot{m} 'contained conceal cchar = ṁ 987syn match texMathSymbol '\\dot{N} 'contained conceal cchar = Ṅ 988syn match texMathSymbol '\\dot{n} 'contained conceal cchar = ṅ 989syn match texMathSymbol '\\dot{P} 'contained conceal cchar = Ṗ 990syn match texMathSymbol '\\dot{p} 'contained conceal cchar = ṗ 991syn match texMathSymbol '\\dot{R} 'contained conceal cchar = Ṙ 992syn match texMathSymbol '\\dot{r} 'contained conceal cchar = ṙ 993syn match texMathSymbol '\\dot{S} 'contained conceal cchar = Ṡ 994syn match texMathSymbol '\\dot{s} 'contained conceal cchar = ṡ 995syn match texMathSymbol '\\dot{T} 'contained conceal cchar = Ṫ 996syn match texMathSymbol '\\dot{t} 'contained conceal cchar = ṫ 997syn match texMathSymbol '\\dot{W} 'contained conceal cchar = Ẇ 998syn match texMathSymbol '\\dot{w} 'contained conceal cchar = ẇ 999syn match texMathSymbol '\\dot{X} 'contained conceal cchar = Ẋ 1000syn match texMathSymbol '\\dot{x} 'contained conceal cchar = ẋ 1001syn match texMathSymbol '\\dot{Y} 'contained conceal cchar = Ẏ 1002syn match texMathSymbol '\\dot{y} 'contained conceal cchar = ẏ 1003syn match texMathSymbol '\\dot{Z} 'contained conceal cchar = Ż 1004syn match texMathSymbol '\\dot{z} 'contained conceal cchar = ż 1005 1006syn match texMathSymbol '\\dot{C} 'contained conceal cchar = Ċ 1007syn match texMathSymbol '\\dot{c} 'contained conceal cchar = ċ 1008syn match texMathSymbol '\\dot{E} 'contained conceal cchar = Ė 1009syn match texMathSymbol '\\dot{e} 'contained conceal cchar = ė 1010syn match texMathSymbol '\\dot{G} 'contained conceal cchar = Ġ 1011syn match texMathSymbol '\\dot{g} 'contained conceal cchar = ġ 1012syn match texMathSymbol '\\dot{I} 'contained conceal cchar = İ 1013 1014syn match texMathSymbol '\\dot{A} 'contained conceal cchar = Ȧ 1015syn match texMathSymbol '\\dot{a} 'contained conceal cchar = ȧ 1016syn match texMathSymbol '\\dot{O} 'contained conceal cchar = Ȯ 1017syn match texMathSymbol '\\dot{o} 'contained conceal cchar = ȯ 1018endif 1019 1020" Greek {{{2 1021if s: tex_conceal =~# 'g' 1022fun ! s: Greek ( group , pat , cchar ) 1023exe 'syn match ' . a: group . " '" . a: pat . "' contained conceal cchar=" . a: cchar 1024endfun 1025call s: Greek ( 'texGreek' , '\\alpha\>' , 'α' ) 1026call s: Greek ( 'texGreek' , '\\beta\>' , 'β' ) 1027call s: Greek ( 'texGreek' , '\\gamma\>' , 'γ' ) 1028call s: Greek ( 'texGreek' , '\\delta\>' , 'δ' ) 1029call s: Greek ( 'texGreek' , '\\epsilon\>' , 'ϵ' ) 1030call s: Greek ( 'texGreek' , '\\varepsilon\>' , 'ε' ) 1031call s: Greek ( 'texGreek' , '\\zeta\>' , 'ζ' ) 1032call s: Greek ( 'texGreek' , '\\eta\>' , 'η' ) 1033call s: Greek ( 'texGreek' , '\\theta\>' , 'θ' ) 1034call s: Greek ( 'texGreek' , '\\vartheta\>' , 'ϑ' ) 1035call s: Greek ( 'texGreek' , '\\iota\>' , 'ι' ) 1036call s: Greek ( 'texGreek' , '\\kappa\>' , 'κ' ) 1037call s: Greek ( 'texGreek' , '\\lambda\>' , 'λ' ) 1038call s: Greek ( 'texGreek' , '\\mu\>' , 'μ' ) 1039call s: Greek ( 'texGreek' , '\\nu\>' , 'ν' ) 1040call s: Greek ( 'texGreek' , '\\xi\>' , 'ξ' ) 1041call s: Greek ( 'texGreek' , '\\pi\>' , 'π' ) 1042call s: Greek ( 'texGreek' , '\\varpi\>' , 'ϖ' ) 1043call s: Greek ( 'texGreek' , '\\rho\>' , 'ρ' ) 1044call s: Greek ( 'texGreek' , '\\varrho\>' , 'ϱ' ) 1045call s: Greek ( 'texGreek' , '\\sigma\>' , 'σ' ) 1046call s: Greek ( 'texGreek' , '\\varsigma\>' , 'ς' ) 1047call s: Greek ( 'texGreek' , '\\tau\>' , 'τ' ) 1048call s: Greek ( 'texGreek' , '\\upsilon\>' , 'υ' ) 1049call s: Greek ( 'texGreek' , '\\phi\>' , 'ϕ' ) 1050call s: Greek ( 'texGreek' , '\\varphi\>' , 'φ' ) 1051call s: Greek ( 'texGreek' , '\\chi\>' , 'χ' ) 1052call s: Greek ( 'texGreek' , '\\psi\>' , 'ψ' ) 1053call s: Greek ( 'texGreek' , '\\omega\>' , 'ω' ) 1054call s: Greek ( 'texGreek' , '\\Gamma\>' , 'Γ' ) 1055call s: Greek ( 'texGreek' , '\\Delta\>' , 'Δ' ) 1056call s: Greek ( 'texGreek' , '\\Theta\>' , 'Θ' ) 1057call s: Greek ( 'texGreek' , '\\Lambda\>' , 'Λ' ) 1058call s: Greek ( 'texGreek' , '\\Xi\>' , 'Ξ' ) 1059call s: Greek ( 'texGreek' , '\\Pi\>' , 'Π' ) 1060call s: Greek ( 'texGreek' , '\\Sigma\>' , 'Σ' ) 1061call s: Greek ( 'texGreek' , '\\Upsilon\>' , 'Υ' ) 1062call s: Greek ( 'texGreek' , '\\Phi\>' , 'Φ' ) 1063call s: Greek ( 'texGreek' , '\\Chi\>' , 'Χ' ) 1064call s: Greek ( 'texGreek' , '\\Psi\>' , 'Ψ' ) 1065call s: Greek ( 'texGreek' , '\\Omega\>' , 'Ω' ) 1066delfun s:Greek 1067endif 1068 1069" Superscripts/Subscripts {{{2 1070if s: tex_conceal =~# 's' 1071if s: tex_fast =~# 's' 1072syn region texSuperscript matchgroup = texDelimiter start = '\^{ 'skip = "\\\\\|\\ [ {} ] "end = '} 'contained concealends contains = texSpecialChar , texSuperscripts , texStatement , texSubscript , texSuperscript , texMathMatcher 1073syn region texSubscript matchgroup = texDelimiter start = '_{ 'skip = "\\\\\|\\ [ {} ] "end = '} 'contained concealends contains = texSpecialChar , texSubscripts , texStatement , texSubscript , texSuperscript , texMathMatcher 1074endif 1075" s:SuperSub: 1076fun ! s: SuperSub ( group , leader , pat , cchar ) 1077if a: pat =~# '^\\' || ( a: leader == '\^' && a: pat =~# s: tex_superscripts ) || ( a: leader == '_' && a: pat =~# s: tex_subscripts ) 1078" call Decho("SuperSub: group<".a:group."> leader<".a:leader."> pat<".a:pat."> cchar<".a:cchar.">") 1079exe 'syn match ' . a: group . " '" . a: leader . a: pat . "' contained conceal cchar=" . a: cchar 1080exe 'syn match ' . a: group . "s '" . a: pat . "' contained conceal cchar=" . a: cchar . ' nextgroup=' . a: group . 's' 1081endif 1082endfun 1083call s: SuperSub ( 'texSuperscript' , '\^' , '0' , '⁰' ) 1084call s: SuperSub ( 'texSuperscript' , '\^' , '1' , '¹' ) 1085call s: SuperSub ( 'texSuperscript' , '\^' , '2' , '²' ) 1086call s: SuperSub ( 'texSuperscript' , '\^' , '3' , '³' ) 1087call s: SuperSub ( 'texSuperscript' , '\^' , '4' , '⁴' ) 1088call s: SuperSub ( 'texSuperscript' , '\^' , '5' , '⁵' ) 1089call s: SuperSub ( 'texSuperscript' , '\^' , '6' , '⁶' ) 1090call s: SuperSub ( 'texSuperscript' , '\^' , '7' , '⁷' ) 1091call s: SuperSub ( 'texSuperscript' , '\^' , '8' , '⁸' ) 1092call s: SuperSub ( 'texSuperscript' , '\^' , '9' , '⁹' ) 1093call s: SuperSub ( 'texSuperscript' , '\^' , 'a' , 'ᵃ' ) 1094call s: SuperSub ( 'texSuperscript' , '\^' , 'b' , 'ᵇ' ) 1095call s: SuperSub ( 'texSuperscript' , '\^' , 'c' , 'ᶜ' ) 1096call s: SuperSub ( 'texSuperscript' , '\^' , 'd' , 'ᵈ' ) 1097call s: SuperSub ( 'texSuperscript' , '\^' , 'e' , 'ᵉ' ) 1098call s: SuperSub ( 'texSuperscript' , '\^' , 'f' , 'ᶠ' ) 1099call s: SuperSub ( 'texSuperscript' , '\^' , 'g' , 'ᵍ' ) 1100call s: SuperSub ( 'texSuperscript' , '\^' , 'h' , 'ʰ' ) 1101call s: SuperSub ( 'texSuperscript' , '\^' , 'i' , 'ⁱ' ) 1102call s: SuperSub ( 'texSuperscript' , '\^' , 'j' , 'ʲ' ) 1103call s: SuperSub ( 'texSuperscript' , '\^' , 'k' , 'ᵏ' ) 1104call s: SuperSub ( 'texSuperscript' , '\^' , 'l' , 'ˡ' ) 1105call s: SuperSub ( 'texSuperscript' , '\^' , 'm' , 'ᵐ' ) 1106call s: SuperSub ( 'texSuperscript' , '\^' , 'n' , 'ⁿ' ) 1107call s: SuperSub ( 'texSuperscript' , '\^' , 'o' , 'ᵒ' ) 1108call s: SuperSub ( 'texSuperscript' , '\^' , 'p' , 'ᵖ' ) 1109call s: SuperSub ( 'texSuperscript' , '\^' , 'r' , 'ʳ' ) 1110call s: SuperSub ( 'texSuperscript' , '\^' , 's' , 'ˢ' ) 1111call s: SuperSub ( 'texSuperscript' , '\^' , 't' , 'ᵗ' ) 1112call s: SuperSub ( 'texSuperscript' , '\^' , 'u' , 'ᵘ' ) 1113call s: SuperSub ( 'texSuperscript' , '\^' , 'v' , 'ᵛ' ) 1114call s: SuperSub ( 'texSuperscript' , '\^' , 'w' , 'ʷ' ) 1115call s: SuperSub ( 'texSuperscript' , '\^' , 'x' , 'ˣ' ) 1116call s: SuperSub ( 'texSuperscript' , '\^' , 'y' , 'ʸ' ) 1117call s: SuperSub ( 'texSuperscript' , '\^' , 'z' , 'ᶻ' ) 1118call s: SuperSub ( 'texSuperscript' , '\^' , 'A' , 'ᴬ' ) 1119call s: SuperSub ( 'texSuperscript' , '\^' , 'B' , 'ᴮ' ) 1120call s: SuperSub ( 'texSuperscript' , '\^' , 'D' , 'ᴰ' ) 1121call s: SuperSub ( 'texSuperscript' , '\^' , 'E' , 'ᴱ' ) 1122call s: SuperSub ( 'texSuperscript' , '\^' , 'G' , 'ᴳ' ) 1123call s: SuperSub ( 'texSuperscript' , '\^' , 'H' , 'ᴴ' ) 1124call s: SuperSub ( 'texSuperscript' , '\^' , 'I' , 'ᴵ' ) 1125call s: SuperSub ( 'texSuperscript' , '\^' , 'J' , 'ᴶ' ) 1126call s: SuperSub ( 'texSuperscript' , '\^' , 'K' , 'ᴷ' ) 1127call s: SuperSub ( 'texSuperscript' , '\^' , 'L' , 'ᴸ' ) 1128call s: SuperSub ( 'texSuperscript' , '\^' , 'M' , 'ᴹ' ) 1129call s: SuperSub ( 'texSuperscript' , '\^' , 'N' , 'ᴺ' ) 1130call s: SuperSub ( 'texSuperscript' , '\^' , 'O' , 'ᴼ' ) 1131call s: SuperSub ( 'texSuperscript' , '\^' , 'P' , 'ᴾ' ) 1132call s: SuperSub ( 'texSuperscript' , '\^' , 'R' , 'ᴿ' ) 1133call s: SuperSub ( 'texSuperscript' , '\^' , 'T' , 'ᵀ' ) 1134call s: SuperSub ( 'texSuperscript' , '\^' , 'U' , 'ᵁ' ) 1135call s: SuperSub ( 'texSuperscript' , '\^' , 'V' , 'ⱽ' ) 1136call s: SuperSub ( 'texSuperscript' , '\^' , 'W' , 'ᵂ' ) 1137call s: SuperSub ( 'texSuperscript' , '\^' , ',' , '︐' ) 1138call s: SuperSub ( 'texSuperscript' , '\^' , ':' , '︓' ) 1139call s: SuperSub ( 'texSuperscript' , '\^' , ';' , '︔' ) 1140call s: SuperSub ( 'texSuperscript' , '\^' , '+' , '⁺' ) 1141call s: SuperSub ( 'texSuperscript' , '\^' , '-' , '⁻' ) 1142call s: SuperSub ( 'texSuperscript' , '\^' , '<' , '˂' ) 1143call s: SuperSub ( 'texSuperscript' , '\^' , '>' , '˃' ) 1144call s: SuperSub ( 'texSuperscript' , '\^' , '/' , 'ˊ' ) 1145call s: SuperSub ( 'texSuperscript' , '\^' , '(' , '⁽' ) 1146call s: SuperSub ( 'texSuperscript' , '\^' , ')' , '⁾' ) 1147call s: SuperSub ( 'texSuperscript' , '\^' , '\.' , '˙' ) 1148call s: SuperSub ( 'texSuperscript' , '\^' , '=' , '˭' ) 1149call s: SuperSub ( 'texSubscript' , '_' , '0' , '₀' ) 1150call s: SuperSub ( 'texSubscript' , '_' , '1' , '₁' ) 1151call s: SuperSub ( 'texSubscript' , '_' , '2' , '₂' ) 1152call s: SuperSub ( 'texSubscript' , '_' , '3' , '₃' ) 1153call s: SuperSub ( 'texSubscript' , '_' , '4' , '₄' ) 1154call s: SuperSub ( 'texSubscript' , '_' , '5' , '₅' ) 1155call s: SuperSub ( 'texSubscript' , '_' , '6' , '₆' ) 1156call s: SuperSub ( 'texSubscript' , '_' , '7' , '₇' ) 1157call s: SuperSub ( 'texSubscript' , '_' , '8' , '₈' ) 1158call s: SuperSub ( 'texSubscript' , '_' , '9' , '₉' ) 1159call s: SuperSub ( 'texSubscript' , '_' , 'a' , 'ₐ' ) 1160call s: SuperSub ( 'texSubscript' , '_' , 'e' , 'ₑ' ) 1161call s: SuperSub ( 'texSubscript' , '_' , 'h' , 'ₕ' ) 1162call s: SuperSub ( 'texSubscript' , '_' , 'i' , 'ᵢ' ) 1163call s: SuperSub ( 'texSubscript' , '_' , 'j' , 'ⱼ' ) 1164call s: SuperSub ( 'texSubscript' , '_' , 'k' , 'ₖ' ) 1165call s: SuperSub ( 'texSubscript' , '_' , 'l' , 'ₗ' ) 1166call s: SuperSub ( 'texSubscript' , '_' , 'm' , 'ₘ' ) 1167call s: SuperSub ( 'texSubscript' , '_' , 'n' , 'ₙ' ) 1168call s: SuperSub ( 'texSubscript' , '_' , 'o' , 'ₒ' ) 1169call s: SuperSub ( 'texSubscript' , '_' , 'p' , 'ₚ' ) 1170call s: SuperSub ( 'texSubscript' , '_' , 'r' , 'ᵣ' ) 1171call s: SuperSub ( 'texSubscript' , '_' , 's' , 'ₛ' ) 1172call s: SuperSub ( 'texSubscript' , '_' , 't' , 'ₜ' ) 1173call s: SuperSub ( 'texSubscript' , '_' , 'u' , 'ᵤ' ) 1174call s: SuperSub ( 'texSubscript' , '_' , 'v' , 'ᵥ' ) 1175call s: SuperSub ( 'texSubscript' , '_' , 'x' , 'ₓ' ) 1176call s: SuperSub ( 'texSubscript' , '_' , ',' , '︐' ) 1177call s: SuperSub ( 'texSubscript' , '_' , '+' , '₊' ) 1178call s: SuperSub ( 'texSubscript' , '_' , '-' , '₋' ) 1179call s: SuperSub ( 'texSubscript' , '_' , '/' , 'ˏ' ) 1180call s: SuperSub ( 'texSubscript' , '_' , '(' , '₍' ) 1181call s: SuperSub ( 'texSubscript' , '_' , ')' , '₎' ) 1182call s: SuperSub ( 'texSubscript' , '_' , '\.' , '‸' ) 1183call s: SuperSub ( 'texSubscript' , '_' , 'r' , 'ᵣ' ) 1184call s: SuperSub ( 'texSubscript' , '_' , 'v' , 'ᵥ' ) 1185call s: SuperSub ( 'texSubscript' , '_' , 'x' , 'ₓ' ) 1186call s: SuperSub ( 'texSubscript' , '_' , '\\beta\>' , 'ᵦ' ) 1187call s: SuperSub ( 'texSubscript' , '_' , '\\delta\>' , 'ᵨ' ) 1188call s: SuperSub ( 'texSubscript' , '_' , '\\phi\>' , 'ᵩ' ) 1189call s: SuperSub ( 'texSubscript' , '_' , '\\gamma\>' , 'ᵧ' ) 1190call s: SuperSub ( 'texSubscript' , '_' , '\\chi\>' , 'ᵪ' ) 1191 1192delfun s:SuperSub 1193endif 1194 1195" Accented characters and Ligatures: {{{2 1196if s: tex_conceal =~# 'a' 1197if b: tex_stylish 1198syn match texAccent "\\ [ bcdvuH ][ ^a-zA-Z@ ] "me= e-1 1199syn match texLigature "\\\( [ ijolL ] \|ae\|oe\|ss\|AA\|AE\|OE\) [ ^a-zA-Z@ ] "me= e-1 1200syn match texLigature '-- ' 1201syn match texLigature '--- ' 1202else 1203fun ! s: Accents ( chr ,...) 1204let i = 1 1205for accent in [ "`" , "\\'" , "^" , '"' , '\~' , '\.' , '=' , "c" , "H" , "k" , "r" , "u" , "v" ] 1206if i > a: 0 1207break 1208endif 1209if strlen ( a: {i}) ==0 || a:{i} == ' ' || a:{i} == '?' 1210let i = i + 1 1211continue 1212endif 1213if accent =~# '\a' 1214exe "syn match texAccent '" . '\\' . accent . '\(\s*{' . a: chr . '}\|\s\+' . a: chr . '\)' . "' conceal cchar=" . a: { i } 1215else 1216exe "syn match texAccent '" . '\\' . accent . '\s*\({' . a: chr . '}\|' . a: chr . '\)' . "' conceal cchar=" . a: { i } 1217endif 1218let i = i + 1 1219endfor 1220endfun 1221" \` \' \^ \" \~ \. \= \c \H \k \r \u \v 1222call s: Accents ( 'a' , 'à' , 'á' , 'â' , 'ä' , 'ã' , 'ȧ' , 'ā' , ' ' , ' ' , 'ą' , 'å' , 'ă' , 'ǎ' ) 1223call s: Accents ( 'A' , 'À' , 'Á' , 'Â' , 'Ä' , 'Ã' , 'Ȧ' , 'Ā' , ' ' , ' ' , 'Ą' , 'Å' , 'Ă' , 'Ǎ' ) 1224call s: Accents ( 'c' , ' ' , 'ć' , 'ĉ' , ' ' , ' ' , 'ċ' , ' ' , 'ç' , ' ' , ' ' , ' ' , ' ' , 'č' ) 1225call s: Accents ( 'C' , ' ' , 'Ć' , 'Ĉ' , ' ' , ' ' , 'Ċ' , ' ' , 'Ç' , ' ' , ' ' , ' ' , ' ' , 'Č' ) 1226call s: Accents ( 'd' , ' ' , ' ' , ' ' , ' ' , ' ' , ' ' , ' ' , ' ' , ' ' , ' ' , ' ' , ' ' , 'ď' ) 1227call s: Accents ( 'D' , ' ' , ' ' , ' ' , ' ' , ' ' , ' ' , ' ' , ' ' , ' ' , ' ' , ' ' , ' ' , 'Ď' ) 1228call s: Accents ( 'e' , 'è' , 'é' , 'ê' , 'ë' , 'ẽ' , 'ė' , 'ē' , 'ȩ' , ' ' , 'ę' , ' ' , 'ĕ' , 'ě' ) 1229call s: Accents ( 'E' , 'È' , 'É' , 'Ê' , 'Ë' , 'Ẽ' , 'Ė' , 'Ē' , 'Ȩ' , ' ' , 'Ę' , ' ' , 'Ĕ' , 'Ě' ) 1230call s: Accents ( 'g' , ' ' , 'ǵ' , 'ĝ' , ' ' , ' ' , 'ġ' , ' ' , 'ģ' , ' ' , ' ' , ' ' , 'ğ' , 'ǧ' ) 1231call s: Accents ( 'G' , ' ' , 'Ǵ' , 'Ĝ' , ' ' , ' ' , 'Ġ' , ' ' , 'Ģ' , ' ' , ' ' , ' ' , 'Ğ' , 'Ǧ' ) 1232call s: Accents ( 'h' , ' ' , ' ' , 'ĥ' , ' ' , ' ' , ' ' , ' ' , ' ' , ' ' , ' ' , ' ' , ' ' , 'ȟ' ) 1233call s: Accents ( 'H' , ' ' , ' ' , ' ' , ' ' , ' ' , ' ' , ' ' , ' ' , ' ' , ' ' , ' ' , ' ' , 'Ȟ' ) 1234call s: Accents ( 'i' , 'ì' , 'í' , 'î' , 'ï' , 'ĩ' , 'į' , 'ī' , ' ' , ' ' , 'į' , ' ' , 'ĭ' , 'ǐ' ) 1235call s: Accents ( 'I' , 'Ì' , 'Í' , 'Î' , 'Ï' , 'Ĩ' , 'İ' , 'Ī' , ' ' , ' ' , 'Į' , ' ' , 'Ĭ' , 'Ǐ' ) 1236call s: Accents ( 'J' , ' ' , ' ' , ' ' , ' ' , ' ' , ' ' , ' ' , ' ' , ' ' , ' ' , ' ' , ' ' , 'ǰ' ) 1237call s: Accents ( 'k' , ' ' , ' ' , ' ' , ' ' , ' ' , ' ' , ' ' , 'ķ' , ' ' , ' ' , ' ' , ' ' , 'ǩ' ) 1238call s: Accents ( 'K' , ' ' , ' ' , ' ' , ' ' , ' ' , ' ' , ' ' , 'Ķ' , ' ' , ' ' , ' ' , ' ' , 'Ǩ' ) 1239call s: Accents ( 'l' , ' ' , 'ĺ' , 'ľ' , ' ' , ' ' , ' ' , ' ' , 'ļ' , ' ' , ' ' , ' ' , ' ' , 'ľ' ) 1240call s: Accents ( 'L' , ' ' , 'Ĺ' , 'Ľ' , ' ' , ' ' , ' ' , ' ' , 'Ļ' , ' ' , ' ' , ' ' , ' ' , 'Ľ' ) 1241call s: Accents ( 'n' , ' ' , 'ń' , ' ' , ' ' , 'ñ' , ' ' , ' ' , 'ņ' , ' ' , ' ' , ' ' , ' ' , 'ň' ) 1242call s: Accents ( 'N' , ' ' , 'Ń' , ' ' , ' ' , 'Ñ' , ' ' , ' ' , 'Ņ' , ' ' , ' ' , ' ' , ' ' , 'Ň' ) 1243call s: Accents ( 'o' , 'ò' , 'ó' , 'ô' , 'ö' , 'õ' , 'ȯ' , 'ō' , ' ' , 'ő' , 'ǫ' , ' ' , 'ŏ' , 'ǒ' ) 1244call s: Accents ( 'O' , 'Ò' , 'Ó' , 'Ô' , 'Ö' , 'Õ' , 'Ȯ' , 'Ō' , ' ' , 'Ő' , 'Ǫ' , ' ' , 'Ŏ' , 'Ǒ' ) 1245call s: Accents ( 'r' , ' ' , 'ŕ' , ' ' , ' ' , ' ' , ' ' , ' ' , 'ŗ' , ' ' , ' ' , ' ' , ' ' , 'ř' ) 1246call s: Accents ( 'R' , ' ' , 'Ŕ' , ' ' , ' ' , ' ' , ' ' , ' ' , 'Ŗ' , ' ' , ' ' , ' ' , ' ' , 'Ř' ) 1247call s: Accents ( 's' , ' ' , 'ś' , 'ŝ' , ' ' , ' ' , ' ' , ' ' , 'ş' , ' ' , 'ȿ' , ' ' , ' ' , 'š' ) 1248call s: Accents ( 'S' , ' ' , 'Ś' , 'Ŝ' , ' ' , ' ' , ' ' , ' ' , 'Ş' , ' ' , ' ' , ' ' , ' ' , 'Š' ) 1249call s: Accents ( 't' , ' ' , ' ' , ' ' , ' ' , ' ' , ' ' , ' ' , 'ţ' , ' ' , ' ' , ' ' , ' ' , 'ť' ) 1250call s: Accents ( 'T' , ' ' , ' ' , ' ' , ' ' , ' ' , ' ' , ' ' , 'Ţ' , ' ' , ' ' , ' ' , ' ' , 'Ť' ) 1251call s: Accents ( 'u' , 'ù' , 'ú' , 'û' , 'ü' , 'ũ' , ' ' , 'ū' , ' ' , 'ű' , 'ų' , 'ů' , 'ŭ' , 'ǔ' ) 1252call s: Accents ( 'U' , 'Ù' , 'Ú' , 'Û' , 'Ü' , 'Ũ' , ' ' , 'Ū' , ' ' , 'Ű' , 'Ų' , 'Ů' , 'Ŭ' , 'Ǔ' ) 1253call s: Accents ( 'w' , ' ' , ' ' , 'ŵ' , ' ' , ' ' , ' ' , ' ' , ' ' , ' ' , ' ' , ' ' , ' ' , ' ' ) 1254call s: Accents ( 'W' , ' ' , ' ' , 'Ŵ' , ' ' , ' ' , ' ' , ' ' , ' ' , ' ' , ' ' , ' ' , ' ' , ' ' ) 1255call s: Accents ( 'y' , 'ỳ' , 'ý' , 'ŷ' , 'ÿ' , 'ỹ' , ' ' , ' ' , ' ' , ' ' , ' ' , ' ' , ' ' , ' ' ) 1256call s: Accents ( 'Y' , 'Ỳ' , 'Ý' , 'Ŷ' , 'Ÿ' , 'Ỹ' , ' ' , ' ' , ' ' , ' ' , ' ' , ' ' , ' ' , ' ' ) 1257call s: Accents ( 'z' , ' ' , 'ź' , ' ' , ' ' , ' ' , 'ż' , ' ' , ' ' , ' ' , ' ' , ' ' , ' ' , 'ž' ) 1258call s: Accents ( 'Z' , ' ' , 'Ź' , ' ' , ' ' , ' ' , 'Ż' , ' ' , ' ' , ' ' , ' ' , ' ' , ' ' , 'Ž' ) 1259call s: Accents ( '\\i' , 'ì' , 'í' , 'î' , 'ï' , 'ĩ' , 'į' , ' ' , ' ' , ' ' , ' ' , ' ' , 'ĭ' , ' ' ) 1260" \` \' \^ \" \~ \. \= \c \H \k \r \u \v 1261delfun s:Accents 1262syn match texAccent '\\aa\> 'conceal cchar = å 1263syn match texAccent '\\AA\> 'conceal cchar = Å 1264syn match texAccent '\\o\> 'conceal cchar = ø 1265syn match texAccent '\\O\> 'conceal cchar = Ø 1266syn match texLigature '\\AE\> 'conceal cchar = Æ 1267syn match texLigature '\\ae\> 'conceal cchar = æ 1268syn match texLigature '\\oe\> 'conceal cchar = œ 1269syn match texLigature '\\OE\> 'conceal cchar = Œ 1270syn match texLigature '\\ss\> 'conceal cchar = ß 1271syn match texLigature '-- 'conceal cchar = – 1272syn match texLigature '--- 'conceal cchar = — 1273endif 1274endif 1275endif 1276 1277" --------------------------------------------------------------------- 1278" LaTeX synchronization: {{{1 1279syn sync maxlines= 200 1280syn sync minlines= 50 1281 1282syn syncmatch texSyncStop groupthereNONE "%stopzone\> " 1283 1284" Synchronization: {{{1 1285" The $..$ and $$..$$ make for impossible sync patterns 1286" (one can't tell if a "$$" starts or stops a math zone by itself) 1287" The following grouptheres coupled with minlines above 1288" help improve the odds of good syncing. 1289if ! exists ( "g:tex_no_math" ) 1290syn syncmatch texSyncMathZoneA groupthereNONE "\\end{abstract} " 1291syn syncmatch texSyncMathZoneA groupthereNONE "\\end{center} " 1292syn syncmatch texSyncMathZoneA groupthereNONE "\\end{description} " 1293syn syncmatch texSyncMathZoneA groupthereNONE "\\end{enumerate} " 1294syn syncmatch texSyncMathZoneA groupthereNONE "\\end{itemize} " 1295syn syncmatch texSyncMathZoneA groupthereNONE "\\end{table} " 1296syn syncmatch texSyncMathZoneA groupthereNONE "\\end{tabular} " 1297syn syncmatch texSyncMathZoneA groupthereNONE "\\\(sub\) * section\> " 1298endif 1299 1300" --------------------------------------------------------------------- 1301" Highlighting: {{{1 1302 1303" Define the default highlighting. {{{1 1304if ! exists ( "skip_tex_syntax_inits" ) 1305 1306" TeX highlighting groups which should share similar highlighting 1307if ! exists ( "g:tex_no_error" ) 1308if ! exists ( "g:tex_no_math" ) 1309hi def link texBadMath texError 1310hi def link texBadPar texBadMath 1311hi def link texMathDelimBad texError 1312hi def link texMathError texError 1313if ! b: tex_stylish 1314hi def link texOnlyMath texError 1315endif 1316endif 1317hi def link texError Error 1318endif 1319 1320hi texBoldStyle gui = bold cterm = bold 1321hi texItalStyle gui = italic cterm = italic 1322hi texBoldItalStyle gui = bold , italiccterm = bold , italic 1323hi texItalBoldStyle gui = bold , italiccterm = bold , italic 1324hi def link texEmphStyle texItalStyle 1325hi def link texCite texRefZone 1326hi def link texDefCmd texDef 1327hi def link texDefName texDef 1328hi def link texDocType texCmdName 1329hi def link texDocTypeArgs texCmdArgs 1330hi def link texInputFileOpt texCmdArgs 1331hi def link texInputCurlies texDelimiter 1332hi def link texLigature texSpecialChar 1333if ! exists ( "g:tex_no_math" ) 1334hi def link texMathDelimSet1 texMathDelim 1335hi def link texMathDelimSet2 texMathDelim 1336hi def link texMathDelimKey texMathDelim 1337hi def link texMathMatcher texMath 1338hi def link texAccent texStatement 1339hi def link texGreek texStatement 1340hi def link texSuperscript texStatement 1341hi def link texSubscript texStatement 1342hi def link texSuperscripts texSuperscript 1343hi def link texSubscripts texSubscript 1344hi def link texMathSymbol texStatement 1345hi def link texMathZoneV texMath 1346hi def link texMathZoneW texMath 1347hi def link texMathZoneX texMath 1348hi def link texMathZoneY texMath 1349hi def link texMathZoneV texMath 1350hi def link texMathZoneZ texMath 1351endif 1352hi def link texBeginEnd texCmdName 1353hi def link texBeginEndName texSection 1354hi def link texSpaceCode texStatement 1355hi def link texStyleStatement texStatement 1356hi def link texTypeSize texType 1357hi def link texTypeStyle texType 1358 1359" Basic TeX highlighting groups 1360hi def link texCmdArgs Number 1361hi def link texCmdName Statement 1362hi def link texComment Comment 1363hi def link texDef Statement 1364hi def link texDefParm Special 1365hi def link texDelimiter Delimiter 1366hi def link texEnvArgs Number 1367hi def link texInput Special 1368hi def link texInputFile Special 1369hi def link texLength Number 1370hi def link texMath Special 1371hi def link texMathDelim Statement 1372hi def link texMathOper Operator 1373hi def link texNewCmd Statement 1374hi def link texNewEnv Statement 1375hi def link texOption Number 1376hi def link texRefZone Special 1377hi def link texSection PreCondit 1378hi def link texSpaceCodeChar Special 1379hi def link texSpecialChar SpecialChar 1380hi def link texStatement Statement 1381hi def link texString String 1382hi def link texTodo Todo 1383hi def link texType Type 1384hi def link texZone PreCondit 1385 1386endif 1387 1388" Cleanup: {{{1 1389delc TexFold 1390unlet s: extfname 1391let b: current_syntax = "tex" 1392let & cpo = s: keepcpo 1393unlet s: keepcpo 1394" vim: ts=8 fdm=marker