tex.vim
Upload User: lindaa
Upload Date: 2015-08-29
Package Size: 48772k
Code Size: 20k
Development Platform:

Delphi

  1. " Vim syntax file
  2. " Language: TeX
  3. " Maintainer: Dr. Charles E. Campbell, Jr. <NdrOchipS@PcampbellAfamily.Mbiz>
  4. " Last Change: Jun 01, 2004
  5. " Version: 24
  6. " URL: http://www.erols.com/astronaut/vim/index.html#vimlinks_syntax
  7. "
  8. " Notes: {{{1
  9. "
  10. " 1. If you have a begin{verbatim} that appears to overrun its boundaries,
  11. "    use %stopzone.
  12. "
  13. " 2. Run-on equations ($..$ and $$..$$, particularly) can also be stopped
  14. "    by suitable use of %stopzone.
  15. "
  16. " 3. If you have a slow computer, you may wish to modify
  17. "
  18. " syn sync maxlines=200
  19. " syn sync minlines=50
  20. "
  21. "    to values that are more to your liking.
  22. "
  23. " 4. There is no match-syncing for $...$ and $$...$$; hence large
  24. "    equation blocks constructed that way may exhibit syncing problems.
  25. "    (there's no difference between begin/end patterns)
  26. "
  27. " 5. If you have the variable "g:tex_no_error" defined then none of the
  28. "    lexical error-checking will be done.
  29. "
  30. "    ie. let g:tex_no_error=1
  31. " Version Clears: {{{1
  32. " For version 5.x: Clear all syntax items
  33. " For version 6.x: Quit when a syntax file was already loaded
  34. if version < 600
  35.   syntax clear
  36. elseif exists("b:current_syntax")
  37.   finish
  38. endif
  39. " Define the default highlighting. {{{1
  40. " For version 5.7 and earlier: only when not done already
  41. " For version 5.8 and later: only when an item doesn't have highlighting yet
  42. if version >= 508 || !exists("did_tex_syntax_inits")
  43.  let did_tex_syntax_inits = 1
  44.  if version < 508
  45.   command -nargs=+ HiLink hi link <args>
  46.  else
  47.   command -nargs=+ HiLink hi def link <args>
  48.  endif
  49. endif
  50. if exists("g:tex_tex") && !exists("g:tex_no_error")
  51.  let g:tex_no_error= 1
  52. endif
  53. " Determine whether or not to use "*.sty" mode
  54. " The user may override the normal determination by setting
  55. "   g:tex_stylish to 1      (for    "*.sty" mode)
  56. "    or to           0 else (normal "*.tex" mode)
  57. " or on a buffer-by-buffer basis with b:tex_stylish
  58. let b:extfname=expand("%:e")
  59. if exists("g:tex_stylish")
  60.  let b:tex_stylish= g:tex_stylish
  61. elseif !exists("b:tex_stylish")
  62.  if b:extfname == "sty" || b:extfname == "cls" || b:extfname == "clo" || b:extfname == "dtx" || b:extfname == "ltx"
  63.   let b:tex_stylish= 1
  64.  else
  65.   let b:tex_stylish= 0
  66.  endif
  67. endif
  68. " (La)TeX keywords: only use the letters a-zA-Z {{{1
  69. " but _ is the only one that causes problems.
  70. if version < 600
  71.   set isk-=_
  72.   if b:tex_stylish
  73.     set isk+=@
  74.   endif
  75. else
  76.   setlocal isk-=_
  77.   if b:tex_stylish
  78.     setlocal isk+=@
  79.   endif
  80. endif
  81. " Clusters: {{{1
  82. " --------
  83. syn cluster texCmdGroup contains=texCmdBody,texComment,texDefParm,texDelimiter,texDocType,texInput,texLength,texLigature,texMathDelim,texMathOper,texNewCmd,texNewEnv,texRefZone,texSection,texSectionMarker,texSectionName,texSpecialChar,texStatement,texString,texTypeSize,texTypeStyle
  84. if !exists("g:tex_no_error")
  85.  syn cluster texCmdGroup add=texMathError
  86. endif
  87. syn cluster texEnvGroup contains=texMatcher,texMathDelim,texSpecialChar,texStatement
  88. syn 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
  89. if !exists("tex_no_math")
  90.  syn cluster texMathZones contains=texMathZoneV,texMathZoneW,texMathZoneX,texMathZoneY,texMathZoneZ
  91.  syn cluster texMatchGroup add=@texMathZones
  92.  syn cluster texMathDelimGroup contains=texMathDelimBad,texMathDelimKey,texMathDelimSet1,texMathDelimSet2
  93.  syn cluster texMathMatchGroup contains=@texMathZones,texComment,texDefCmd,texDelimiter,texDocType,texInput,texLength,texLigature,texMathDelim,texMathMatcher,texMathOper,texNewCmd,texNewEnv,texRefZone,texSection,texSpecialChar,texStatement,texString,texTypeSize,texTypeStyle,texZone
  94.  syn cluster texMathZoneGroup contains=texComment,texDelimiter,texLength,texMathDelim,texMathMatcher,texMathOper,texRefZone,texSpecialChar,texStatement,texTypeSize,texTypeStyle
  95.  if !exists("g:tex_no_error")
  96.   syn cluster texMathMatchGroup add=texMathError
  97.   syn cluster texMathZoneGroup add=texMathError
  98.  endif
  99. endif
  100. " Try to flag {} and () mismatches: {{{1
  101. if !exists("g:tex_no_error")
  102.  syn region texMatcher matchgroup=Delimiter start="{" skip="\\|\[{}]" end="}" contains=@texMatchGroup,texError
  103.  syn region texMatcher matchgroup=Delimiter start="[" end="]" contains=@texMatchGroup,texError
  104. else
  105.  syn region texMatcher matchgroup=Delimiter start="{" skip="\\|\[{}]" end="}" contains=@texMatchGroup
  106.  syn region texMatcher matchgroup=Delimiter start="[" end="]" contains=@texMatchGroup
  107. endif
  108. syn region texParen start="(" end=")" contains=@texMatchGroup
  109. if !exists("g:tex_no_error")
  110.  syn match  texError "[}])]"
  111. endif
  112. if !exists("tex_no_math")
  113.  if !exists("g:tex_no_error")
  114.   syn match  texMathError "}" contained
  115.  endif
  116.  syn region texMathMatcher matchgroup=Delimiter start="{"  skip="\\|\}"  end="}" end="%stopzone>" contained contains=@texMathMatchGroup
  117. endif
  118. " TeX/LaTeX keywords: {{{1
  119. " Instead of trying to be All Knowing, I just match ..alphameric..
  120. " Note that *.tex files may not have "@" in their commands
  121. if exists("g:tex_tex") || b:tex_stylish
  122.   syn match texStatement "\[a-zA-Z@]+"
  123. else
  124.   syn match texStatement "\a+"
  125.   if !exists("g:tex_no_error")
  126.    syn match texError "\a*@[a-zA-Z@]*"
  127.   endif
  128. endif
  129. " TeX/LaTeX delimiters: {{{1
  130. syn match texDelimiter "&"
  131. syn match texDelimiter "\\"
  132. " Tex/Latex Options: {{{1
  133. syn match texOption "[^\]zs#d+|^#d+"
  134. " texAccent (tnx to Karim Belabas) avoids annoying highlighting for accents: {{{1
  135. if b:tex_stylish
  136.   syn match texAccent "\[bcdvuH][^a-zA-Z@]"me=e-1
  137.   syn match texLigature "\([ijolL]|ae|oe|ss|AA|AE|OE)[^a-zA-Z@]"me=e-1
  138. else
  139.   syn match texAccent "\[bcdvuH]A"me=e-1
  140.   syn match texLigature "\([ijolL]|ae|oe|ss|AA|AE|OE)A"me=e-1
  141. endif
  142. syn match texAccent "\[bcdvuH]$"
  143. syn match texAccent +\[=^.~"`']+
  144. syn match texAccent +\['=t'.c^ud"vb~Hr]{a}+
  145. syn match texLigature "\([ijolL]|ae|oe|ss|AA|AE|OE)$"
  146. " begin{}/end{} section markers: {{{1
  147. syn match  texSectionMarker "\begin>|\end>" nextgroup=texSectionName
  148. syn region texSectionName matchgroup=Delimiter start="{" end="}"  contained nextgroup=texSectionModifier
  149. syn region texSectionModifier matchgroup=Delimiter start="[" end="]" contained
  150. " documentclass, documentstyle, usepackage: {{{1
  151. syn match  texDocType "\documentclass>|\documentstyle>|\usepackage>" nextgroup=texSectionName,texDocTypeArgs
  152. syn region texDocTypeArgs matchgroup=Delimiter start="[" end="]" contained nextgroup=texSectionName
  153. " TeX input: {{{1
  154. syn match texInput "\inputs+[a-zA-Z/.0-9_^]+"hs=s+7 contains=texStatement
  155. syn match texInputFile "\include(graphics|list)=([.{-}])=s*{.{-}}" contains=texStatement,texInputCurlies
  156. syn match texInputFile "\(epsfig|input|usepackage)s*([.*])={.{-}}" contains=texStatement,texInputCurlies,texInputFileOpt
  157. syn match texInputCurlies "[{}]" contained
  158. syn region texInputFileOpt matchgroup=Delimiter start="[" end="]" contained
  159. " Type Styles (LaTeX 2.09): {{{1
  160. syn match texTypeStyle "\rm>"
  161. syn match texTypeStyle "\em>"
  162. syn match texTypeStyle "\bf>"
  163. syn match texTypeStyle "\it>"
  164. syn match texTypeStyle "\sl>"
  165. syn match texTypeStyle "\sf>"
  166. syn match texTypeStyle "\sc>"
  167. syn match texTypeStyle "\tt>"
  168. " Type Styles: attributes, commands, families, etc (LaTeX2E): {{{1
  169. syn match texTypeStyle "\textbf>"
  170. syn match texTypeStyle "\textit>"
  171. syn match texTypeStyle "\textmd>"
  172. syn match texTypeStyle "\textrm>"
  173. syn match texTypeStyle "\textsc>"
  174. syn match texTypeStyle "\textsf>"
  175. syn match texTypeStyle "\textsl>"
  176. syn match texTypeStyle "\texttt>"
  177. syn match texTypeStyle "\textup>"
  178. syn match texTypeStyle "\emph>"
  179. syn match texTypeStyle "\mathbb>"
  180. syn match texTypeStyle "\mathbf>"
  181. syn match texTypeStyle "\mathcal>"
  182. syn match texTypeStyle "\mathfrak>"
  183. syn match texTypeStyle "\mathit>"
  184. syn match texTypeStyle "\mathnormal>"
  185. syn match texTypeStyle "\mathrm>"
  186. syn match texTypeStyle "\mathsf>"
  187. syn match texTypeStyle "\mathtt>"
  188. syn match texTypeStyle "\rmfamily>"
  189. syn match texTypeStyle "\sffamily>"
  190. syn match texTypeStyle "\ttfamily>"
  191. syn match texTypeStyle "\itshape>"
  192. syn match texTypeStyle "\scshape>"
  193. syn match texTypeStyle "\slshape>"
  194. syn match texTypeStyle "\upshape>"
  195. syn match texTypeStyle "\bfseries>"
  196. syn match texTypeStyle "\mdseries>"
  197. " Some type sizes: {{{1
  198. syn match texTypeSize "\tiny>"
  199. syn match texTypeSize "\scriptsize>"
  200. syn match texTypeSize "\footnotesize>"
  201. syn match texTypeSize "\small>"
  202. syn match texTypeSize "\normalsize>"
  203. syn match texTypeSize "\large>"
  204. syn match texTypeSize "\Large>"
  205. syn match texTypeSize "\LARGE>"
  206. syn match texTypeSize "\huge>"
  207. syn match texTypeSize "\Huge>"
  208. " Spacecodes (TeX'isms): {{{1
  209. " mathcode`^^@="2201  delcode`(="028300  sfcode`)=0 uccode`X=`X  lccode`x=`x
  210. syn match texSpaceCode "\(math|cat|del|lc|sf|uc)code`"me=e-1 nextgroup=texSpaceCodeChar
  211. syn match texSpaceCodeChar    "`\=.(^.)==(d|"x{1,6}|`.)" contained
  212. " Sections, subsections, etc: {{{1
  213. syn match texSection "\(sub)*section*=>"
  214. syn match texSection "\(title|author|part|chapter|paragraph|subparagraph)>"
  215. syn match texSection "\begins*{s*abstracts*}|\ends*{s*abstracts*}"
  216. " Bad Math (mismatched): {{{1
  217. if !exists("tex_no_math")
  218.  syn match texBadMath "\ends*{s*(array|gathered|bBpvV]matrix|split|subequations|smallmatrix|xxalignat)s*}"
  219.  syn match texBadMath "\ends*{s*(align|alignat|displaymath|displaymath|eqnarray|equation|flalign|gather|math|multline|xalignat)*=s*}"
  220.  syn match texBadMath "\[])]"
  221. endif
  222. " Math Zones: {{{1
  223. if !exists("tex_no_math")
  224.  " TexNewMathZone: creates a mathzone with the given suffix and mathzone name. {{{2
  225.  "                 Starred forms are created if starform is true.  Starred
  226.  "                 forms have syntax group and synchronization groups with a
  227.  "                 "S" appended.  Handles: cluster, syntax, sync, and HiLink.
  228.  fun! TexNewMathZone(sfx,mathzone,starform)
  229.    let grpname  = "texMathZone".a:sfx
  230.    let syncname = "texSyncMathZone".a:sfx
  231.    exe "syn cluster texMathZones add=".grpname
  232.    exe 'syn region '.grpname.' start='."'".'\begins*{s*'.a:mathzone.'s*}'."'".' end='."'".'\ends*{s*'.a:mathzone.'s*}'."'".' keepend contains=@texMathZoneGroup'
  233.    exe 'syn sync match '.syncname.' grouphere '.grpname.' "\begins*{s*'.a:mathzone.'*s*}"'
  234.    exe 'syn sync match '.syncname.' grouphere '.grpname.' "\begins*{s*'.a:mathzone.'*s*}"'
  235.    exe 'HiLink '.grpname.' texMath'
  236.    if a:starform
  237.     let grpname  = "texMathZone".a:sfx.'S'
  238.     let syncname = "texSyncMathZone".a:sfx.'S'
  239.     exe "syn cluster texMathZones add=".grpname
  240.     exe 'syn region '.grpname.' start='."'".'\begins*{s*'.a:mathzone.'*s*}'."'".' end='."'".'\ends*{s*'.a:mathzone.'*s*}'."'".' keepend contains=@texMathZoneGroup'
  241.     exe 'syn sync match '.syncname.' grouphere '.grpname.' "\begins*{s*'.a:mathzone.'*s*}"'
  242.     exe 'syn sync match '.syncname.' grouphere '.grpname.' "\begins*{s*'.a:mathzone.'*s*}"'
  243.     exe 'HiLink '.grpname.' texMath'
  244.    endif
  245.  endfun
  246.  " Standard Math Zones: {{{2
  247.  call TexNewMathZone("A","align",1)
  248.  call TexNewMathZone("B","alignat",1)
  249.  call TexNewMathZone("C","displaymath",1)
  250.  call TexNewMathZone("D","eqnarray",1)
  251.  call TexNewMathZone("E","equation",1)
  252.  call TexNewMathZone("F","flalign",1)
  253.  call TexNewMathZone("G","gather",1)
  254.  call TexNewMathZone("H","math",1)
  255.  call TexNewMathZone("I","multline",1)
  256.  call TexNewMathZone("J","subequations",0)
  257.  call TexNewMathZone("K","xalignat",1)
  258.  call TexNewMathZone("L","xxalignat",0)
  259.  " Inline Math Zones: {{{2
  260.  syn region texMathZoneV matchgroup=Delimiter start="\(" matchgroup=Delimiter end="\)|%stopzone>" keepend contains=@texMathZoneGroup
  261.  syn region texMathZoneW matchgroup=Delimiter start="\[" matchgroup=Delimiter end="\]|%stopzone>" keepend contains=@texMathZoneGroup
  262.  syn region texMathZoneX matchgroup=Delimiter start="$" skip="\\|\$" matchgroup=Delimiter end="$" end="%stopzone>" contains=@texMathZoneGroup
  263.  syn region texMathZoneY matchgroup=Delimiter start="$$" matchgroup=Delimiter end="$$" end="%stopzone>" keepend contains=@texMathZoneGroup
  264.  syn region texMathZoneZ matchgroup=texStatement start="\ensuremaths*{" matchgroup=texStatement end="}" end="%stopzone>" contains=@texMathZoneGroup
  265.  syn match texMathOper "[_^=]" contained
  266.  " left..something.. and right..something.. support: {{{2
  267.  syn match   texMathDelimBad contained "S"
  268.  syn match   texMathDelim contained "\(left|right|[bB]igg=[lr])>" skipwhite nextgroup=texMathDelimSet1,texMathDelimSet2,texMathDelimBad
  269.  syn match   texMathDelim contained "\(left|right)arrow>|<([aA]rrow|brace)=vert>"
  270.  syn match   texMathDelim contained "\lefteqn>"
  271.  syn match   texMathDelimSet2 contained "\" nextgroup=texMathDelimKey,texMathDelimBad
  272.  syn match   texMathDelimSet1 contained "[<>()[]|/.]|\[{}|]"
  273.  syn keyword texMathDelimKey contained backslash       lceil           lVert           rgroup          uparrow
  274.  syn keyword texMathDelimKey contained downarrow       lfloor          rangle          rmoustache      Uparrow
  275.  syn keyword texMathDelimKey contained Downarrow       lgroup          rbrace          rvert           updownarrow
  276.  syn keyword texMathDelimKey contained langle          lmoustache      rceil           rVert           Updownarrow
  277.  syn keyword texMathDelimKey contained lbrace          lvert           rfloor
  278. endif
  279. " Special TeX characters  ( $ & % # { } _ S P ) : {{{1
  280. syn match texSpecialChar "\[$&%#{}_]"
  281. if b:tex_stylish
  282.   syn match texSpecialChar "\[SP@][^a-zA-Z@]"me=e-1
  283. else
  284.   syn match texSpecialChar "\[SP@]A"me=e-1
  285. endif
  286. syn match texSpecialChar "\\"
  287. if !exists("tex_no_math")
  288.  syn match texOnlyMath "[_^]"
  289. endif
  290. syn match texSpecialChar "^^[0-9a-f]{2}|^^S"
  291. " Comments: {{{1
  292. "    Normal TeX LaTeX     :   %....
  293. "    Documented TeX Format:  ^^A... -and- leading %s (only)
  294. syn cluster texCommentGroup contains=texTodo,@Spell
  295. syn case ignore
  296. syn keyword texTodo contained combak fixme todo
  297. syn case match
  298. if b:extfname == "dtx"
  299.   syn match texComment "^^A.*$" contains=@texCommentGroup
  300.   syn match texComment "^%+" contains=@texCommentGroup
  301. else
  302.   syn match texComment "%.*$" contains=@texCommentGroup
  303. endif
  304. " Separate lines used for verb` and verb# so that the end conditions {{{1
  305. " will appropriately terminate.  Ideally vim would let me save a
  306. " character from the start pattern and re-use it in the end-pattern.
  307. syn region texZone start="\begin{verbatim}" end="\end{verbatim}|%stopzone>"
  308. if version < 600
  309.  syn region texZone start="\verb*=`" end="`|%stopzone>"
  310.  syn region texZone start="\verb*=#" end="#|%stopzone>"
  311. else
  312.   if b:tex_stylish
  313.     syn region texZone start="\verb*=z([^ta-zA-Z@])" end="z1|%stopzone>"
  314.   else
  315.     syn region texZone start="\verb*=z([^ta-zA-Z])" end="z1|%stopzone>"
  316.   endif
  317. endif
  318. " Tex Reference Zones: {{{1
  319. syn region texZone start="@samp{" end="}|%stopzone>"
  320. syn region texRefZone matchgroup=texStatement start="\nocite{" keepend end="}|%stopzone>"  contains=texComment,texDelimiter
  321. syn region texRefZone matchgroup=texStatement start="\bibliography{" keepend end="}|%stopzone>"  contains=texComment,texDelimiter
  322. syn region texRefZone matchgroup=texStatement start="\cite([tp]*=)={" keepend end="}|%stopzone>"  contains=texComment,texDelimiter
  323. syn region texRefZone matchgroup=texStatement start="\label{" keepend end="}|%stopzone>"  contains=texComment,texDelimiter
  324. syn region texRefZone matchgroup=texStatement start="\(page|eq)ref{" keepend end="}|%stopzone>"  contains=texComment,texDelimiter
  325. syn region texRefZone matchgroup=texStatement start="\v=ref{" keepend end="}|%stopzone>"  contains=texComment,texDelimiter
  326. " Handle newcommand, newenvironment : {{{1
  327. syn match  texNewCmd "\newcommand>" nextgroup=texCmdName skipwhite skipnl
  328. syn region texCmdName contained matchgroup=Delimiter start="{"rs=s+1  end="}" nextgroup=texCmdArgs,texCmdBody skipwhite skipnl
  329. syn region texCmdArgs contained matchgroup=Delimiter start="["rs=s+1 end="]" nextgroup=texCmdBody skipwhite skipnl
  330. syn region texCmdBody contained matchgroup=Delimiter start="{"rs=s+1 skip="\\|\[{}]" matchgroup=Delimiter end="}" contains=@texCmdGroup
  331. syn match  texNewEnv "\newenvironment>" nextgroup=texEnvName skipwhite skipnl
  332. syn region texEnvName contained matchgroup=Delimiter start="{"rs=s+1  end="}" nextgroup=texEnvBgn skipwhite skipnl
  333. syn region texEnvBgn  contained matchgroup=Delimiter start="{"rs=s+1  end="}" nextgroup=texEnvEnd skipwhite skipnl contains=@texEnvGroup
  334. syn region texEnvEnd  contained matchgroup=Delimiter start="{"rs=s+1  end="}" skipwhite skipnl contains=@texEnvGroup
  335. " Definitions/Commands: {{{1
  336. syn match texDefCmd "\def>" nextgroup=texDefName skipwhite skipnl
  337. if b:tex_stylish
  338.   syn match texDefName contained "\[a-zA-Z@]+" nextgroup=texDefParms,texCmdBody skipwhite skipnl
  339.   syn match texDefName contained "\[^a-zA-Z@]" nextgroup=texDefParms,texCmdBody skipwhite skipnl
  340. else
  341.   syn match texDefName contained "\a+" nextgroup=texDefParms,texCmdBody skipwhite skipnl
  342.   syn match texDefName contained "\A" nextgroup=texDefParms,texCmdBody skipwhite skipnl
  343. endif
  344. syn match texDefParms  contained "#[^{]*" contains=texDefParm nextgroup=texCmdBody skipwhite skipnl
  345. syn match  texDefParm  contained "#d+"
  346. " TeX Lengths: {{{1
  347. syn match  texLength "<d+(.d+)=s*(true)=s*(bp|cc|cm|dd|em|ex|in|mm|pc|pt|sp)>"
  348. " TeX String Delimiters: {{{1
  349. syn match texString "(``|''|,,)"
  350. " LaTeX synchronization: {{{1
  351. syn sync maxlines=200
  352. syn sync minlines=50
  353. syn  sync match texSyncStop groupthere NONE "%stopzone>"
  354. " Synchronization: {{{1
  355. " The $..$ and $$..$$ make for impossible sync patterns
  356. " (one can't tell if a "$$" starts or stops a math zone by itself)
  357. " The following grouptheres coupled with minlines above
  358. " help improve the odds of good syncing.
  359. if !exists("tex_no_math")
  360.  syn sync match texSyncMathZoneA groupthere NONE "\end{abstract}"
  361.  syn sync match texSyncMathZoneA groupthere NONE "\end{center}"
  362.  syn sync match texSyncMathZoneA groupthere NONE "\end{description}"
  363.  syn sync match texSyncMathZoneA groupthere NONE "\end{enumerate}"
  364.  syn sync match texSyncMathZoneA groupthere NONE "\end{itemize}"
  365.  syn sync match texSyncMathZoneA groupthere NONE "\end{table}"
  366.  syn sync match texSyncMathZoneA groupthere NONE "\end{tabular}"
  367.  syn sync match texSyncMathZoneA groupthere NONE "\(sub)*section>"
  368. endif
  369. " Highlighting: {{{1
  370. if did_tex_syntax_inits == 1
  371.  let did_tex_syntax_inits= 2
  372.   " TeX highlighting groups which should share similar highlighting
  373.   if !exists("g:tex_no_error")
  374.    if !exists("tex_no_math")
  375.     HiLink texBadMath texError
  376.     HiLink texMathDelimBad texError
  377.     HiLink texMathError texError
  378.     if !b:tex_stylish
  379.       HiLink texOnlyMath texError
  380.     endif
  381.    endif
  382.    HiLink texError Error
  383.   endif
  384.   HiLink texDefCmd texDef
  385.   HiLink texDefName texDef
  386.   HiLink texDocType texCmdName
  387.   HiLink texDocTypeArgs texCmdArgs
  388.   HiLink texInputFileOpt texCmdArgs
  389.   HiLink texInputCurlies texDelimiter
  390.   HiLink texLigature texSpecialChar
  391.   if !exists("tex_no_math")
  392.    HiLink texMathDelimSet1 texMathDelim
  393.    HiLink texMathDelimSet2 texMathDelim
  394.    HiLink texMathDelimKey texMathDelim
  395.    HiLink texMathMatcher texMath
  396.    HiLink texMathZoneW texMath
  397.    HiLink texMathZoneX texMath
  398.    HiLink texMathZoneY texMath
  399.    HiLink texMathZoneZ texMath
  400.   endif
  401.   HiLink texSectionMarker texCmdName
  402.   HiLink texSectionName texSection
  403.   HiLink texSpaceCode texStatement
  404.   HiLink texTypeSize texType
  405.   HiLink texTypeStyle texType
  406.    " Basic TeX highlighting groups
  407.   HiLink texCmdArgs Number
  408.   HiLink texCmdName Statement
  409.   HiLink texComment Comment
  410.   HiLink texDef Statement
  411.   HiLink texDefParm Special
  412.   HiLink texDelimiter Delimiter
  413.   HiLink texInput Special
  414.   HiLink texInputFile Special
  415.   HiLink texLength Number
  416.   HiLink texMath Special
  417.   HiLink texMathDelim Statement
  418.   HiLink texMathOper Operator
  419.   HiLink texNewCmd Statement
  420.   HiLink texNewEnv Statement
  421.   HiLink texOption Number
  422.   HiLink texRefZone Special
  423.   HiLink texSection PreCondit
  424.   HiLink texSpaceCodeChar Special
  425.   HiLink texSpecialChar SpecialChar
  426.   HiLink texStatement Statement
  427.   HiLink texString String
  428.   HiLink texTodo Todo
  429.   HiLink texType Type
  430.   HiLink texZone PreCondit
  431.   delcommand HiLink
  432. endif
  433. " Current Syntax: {{{1
  434. unlet b:extfname
  435. let   b:current_syntax = "tex"
  436. " vim: ts=8 fdm=marker