Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1 | " Vim syntax file |
| 2 | " Language: TeX |
Bram Moolenaar | 488c651 | 2005-08-11 20:09:58 +0000 | [diff] [blame] | 3 | " Maintainer: Dr. Charles E. Campbell, Jr. <NdrchipO@ScampbellPfamily.AbizM> |
Bram Moolenaar | 74cbdf0 | 2010-08-04 23:03:17 +0200 | [diff] [blame] | 4 | " Last Change: Aug 04, 2010 |
| 5 | " Version: 55 |
Bram Moolenaar | 488c651 | 2005-08-11 20:09:58 +0000 | [diff] [blame] | 6 | " URL: http://mysite.verizon.net/astronaut/vim/index.html#vimlinks_syntax |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 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 | |
| 32 | " Version Clears: {{{1 |
| 33 | " For version 5.x: Clear all syntax items |
| 34 | " For version 6.x: Quit when a syntax file was already loaded |
| 35 | if version < 600 |
| 36 | syntax clear |
| 37 | elseif exists("b:current_syntax") |
| 38 | finish |
| 39 | endif |
Bram Moolenaar | 4b22cdb | 2010-08-02 22:12:46 +0200 | [diff] [blame] | 40 | scriptencoding utf-8 |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 41 | |
| 42 | " Define the default highlighting. {{{1 |
| 43 | " For version 5.7 and earlier: only when not done already |
| 44 | " For version 5.8 and later: only when an item doesn't have highlighting yet |
| 45 | if version >= 508 || !exists("did_tex_syntax_inits") |
| 46 | let did_tex_syntax_inits = 1 |
| 47 | if version < 508 |
| 48 | command -nargs=+ HiLink hi link <args> |
| 49 | else |
| 50 | command -nargs=+ HiLink hi def link <args> |
| 51 | endif |
| 52 | endif |
| 53 | if exists("g:tex_tex") && !exists("g:tex_no_error") |
| 54 | let g:tex_no_error= 1 |
| 55 | endif |
| 56 | |
Bram Moolenaar | 4b22cdb | 2010-08-02 22:12:46 +0200 | [diff] [blame] | 57 | " let user determine which classes of concealment will be supported |
| 58 | " a=accents/ligatures m=math symbols g=Greek s=superscripts/subscripts |
| 59 | if !exists("g:tex_conceal") |
| 60 | let s:tex_conceal= 'amgs' |
| 61 | else |
| 62 | let s:tex_conceal= g:tex_conceal |
| 63 | endif |
| 64 | |
Bram Moolenaar | f1f8bc5 | 2005-03-07 23:20:08 +0000 | [diff] [blame] | 65 | " Determine whether or not to use "*.sty" mode {{{1 |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 66 | " The user may override the normal determination by setting |
| 67 | " g:tex_stylish to 1 (for "*.sty" mode) |
| 68 | " or to 0 else (normal "*.tex" mode) |
| 69 | " or on a buffer-by-buffer basis with b:tex_stylish |
| 70 | let b:extfname=expand("%:e") |
| 71 | if exists("g:tex_stylish") |
| 72 | let b:tex_stylish= g:tex_stylish |
| 73 | elseif !exists("b:tex_stylish") |
| 74 | if b:extfname == "sty" || b:extfname == "cls" || b:extfname == "clo" || b:extfname == "dtx" || b:extfname == "ltx" |
| 75 | let b:tex_stylish= 1 |
| 76 | else |
| 77 | let b:tex_stylish= 0 |
| 78 | endif |
| 79 | endif |
| 80 | |
Bram Moolenaar | f1f8bc5 | 2005-03-07 23:20:08 +0000 | [diff] [blame] | 81 | " handle folding {{{1 |
| 82 | if !exists("g:tex_fold_enabled") |
| 83 | let g:tex_fold_enabled= 0 |
| 84 | elseif g:tex_fold_enabled && !has("folding") |
Bram Moolenaar | ab19481 | 2005-09-14 21:40:12 +0000 | [diff] [blame] | 85 | let g:tex_fold_enabled= 0 |
Bram Moolenaar | f1f8bc5 | 2005-03-07 23:20:08 +0000 | [diff] [blame] | 86 | echomsg "Ignoring g:tex_fold_enabled=".g:tex_fold_enabled."; need to re-compile vim for +fold support" |
| 87 | endif |
| 88 | if g:tex_fold_enabled && &fdm == "manual" |
Bram Moolenaar | 00a927d | 2010-05-14 23:24:24 +0200 | [diff] [blame] | 89 | setl fdm=syntax |
Bram Moolenaar | f1f8bc5 | 2005-03-07 23:20:08 +0000 | [diff] [blame] | 90 | endif |
| 91 | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 92 | " (La)TeX keywords: only use the letters a-zA-Z {{{1 |
| 93 | " but _ is the only one that causes problems. |
| 94 | if version < 600 |
| 95 | set isk-=_ |
| 96 | if b:tex_stylish |
| 97 | set isk+=@ |
| 98 | endif |
| 99 | else |
| 100 | setlocal isk-=_ |
| 101 | if b:tex_stylish |
| 102 | setlocal isk+=@ |
| 103 | endif |
| 104 | endif |
| 105 | |
| 106 | " Clusters: {{{1 |
| 107 | " -------- |
| 108 | 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 |
| 109 | if !exists("g:tex_no_error") |
| 110 | syn cluster texCmdGroup add=texMathError |
| 111 | endif |
| 112 | syn cluster texEnvGroup contains=texMatcher,texMathDelim,texSpecialChar,texStatement |
Bram Moolenaar | 488c651 | 2005-08-11 20:09:58 +0000 | [diff] [blame] | 113 | syn 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,texSectionMarker,texSectionZone,texSpaceCode,texSpecialChar,texStatement,texString,texTypeSize,texTypeStyle,texZone,@texMathZones,texTitle,texAbstract |
Bram Moolenaar | 5b8d8fd | 2005-08-16 23:01:50 +0000 | [diff] [blame] | 114 | 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,@Spell |
Bram Moolenaar | 5c73622 | 2010-01-06 20:54:52 +0100 | [diff] [blame] | 115 | syn 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,@Spell,texStyleMatcher |
Bram Moolenaar | cfbc5ee | 2004-07-02 15:38:35 +0000 | [diff] [blame] | 116 | syn cluster texRefGroup contains=texMatcher,texComment,texDelimiter |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 117 | if !exists("tex_no_math") |
| 118 | syn cluster texMathZones contains=texMathZoneV,texMathZoneW,texMathZoneX,texMathZoneY,texMathZoneZ |
| 119 | syn cluster texMatchGroup add=@texMathZones |
| 120 | syn cluster texMathDelimGroup contains=texMathDelimBad,texMathDelimKey,texMathDelimSet1,texMathDelimSet2 |
| 121 | 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 |
Bram Moolenaar | 74cbdf0 | 2010-08-04 23:03:17 +0200 | [diff] [blame] | 122 | syn cluster texMathZoneGroup contains=texComment,texDelimiter,texLength,texMathDelim,texMathMatcher,texMathOper,texMathSymbol,texMathText,texRefZone,texSpecialChar,texStatement,texTypeSize,texTypeStyle |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 123 | if !exists("g:tex_no_error") |
| 124 | syn cluster texMathMatchGroup add=texMathError |
| 125 | syn cluster texMathZoneGroup add=texMathError |
| 126 | endif |
Bram Moolenaar | 5b8d8fd | 2005-08-16 23:01:50 +0000 | [diff] [blame] | 127 | syn cluster texMathZoneGroup add=@NoSpell |
| 128 | " following used in the \part \chapter \section \subsection \subsubsection |
| 129 | " \paragraph \subparagraph \author \title highlighting |
| 130 | syn cluster texDocGroup contains=texPartZone,@texPartGroup |
| 131 | syn cluster texPartGroup contains=texChapterZone,texSectionZone,texParaZone |
| 132 | syn cluster texChapterGroup contains=texSectionZone,texParaZone |
| 133 | syn cluster texSectionGroup contains=texSubSectionZone,texParaZone |
| 134 | syn cluster texSubSectionGroup contains=texSubSubSectionZone,texParaZone |
| 135 | syn cluster texSubSubSectionGroup contains=texParaZone |
| 136 | syn cluster texParaGroup contains=texSubParaZone |
Bram Moolenaar | b2c0350 | 2010-07-02 20:20:09 +0200 | [diff] [blame] | 137 | if has("conceal") && &enc == 'utf-8' |
Bram Moolenaar | e0021c7 | 2010-07-28 17:25:21 +0200 | [diff] [blame] | 138 | syn cluster texMathZoneGroup add=texGreek,texSuperscript,texSubscript,texMathSymbol |
| 139 | syn cluster texMathMatchGroup add=texGreek,texSuperscript,texSubscript,texMathSymbol |
Bram Moolenaar | b2c0350 | 2010-07-02 20:20:09 +0200 | [diff] [blame] | 140 | endif |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 141 | endif |
| 142 | |
| 143 | " Try to flag {} and () mismatches: {{{1 |
| 144 | if !exists("g:tex_no_error") |
| 145 | syn region texMatcher matchgroup=Delimiter start="{" skip="\\\\\|\\[{}]" end="}" contains=@texMatchGroup,texError |
| 146 | syn region texMatcher matchgroup=Delimiter start="\[" end="]" contains=@texMatchGroup,texError |
| 147 | else |
| 148 | syn region texMatcher matchgroup=Delimiter start="{" skip="\\\\\|\\[{}]" end="}" contains=@texMatchGroup |
| 149 | syn region texMatcher matchgroup=Delimiter start="\[" end="]" contains=@texMatchGroup |
| 150 | endif |
Bram Moolenaar | 293ee4d | 2004-12-09 21:34:53 +0000 | [diff] [blame] | 151 | syn region texParen start="(" end=")" contains=@texMatchGroup,@Spell |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 152 | if !exists("g:tex_no_error") |
| 153 | syn match texError "[}\])]" |
| 154 | endif |
| 155 | if !exists("tex_no_math") |
| 156 | if !exists("g:tex_no_error") |
| 157 | syn match texMathError "}" contained |
| 158 | endif |
| 159 | syn region texMathMatcher matchgroup=Delimiter start="{" skip="\\\\\|\\}" end="}" end="%stopzone\>" contained contains=@texMathMatchGroup |
| 160 | endif |
| 161 | |
| 162 | " TeX/LaTeX keywords: {{{1 |
| 163 | " Instead of trying to be All Knowing, I just match \..alphameric.. |
| 164 | " Note that *.tex files may not have "@" in their \commands |
| 165 | if exists("g:tex_tex") || b:tex_stylish |
| 166 | syn match texStatement "\\[a-zA-Z@]\+" |
| 167 | else |
| 168 | syn match texStatement "\\\a\+" |
| 169 | if !exists("g:tex_no_error") |
| 170 | syn match texError "\\\a*@[a-zA-Z@]*" |
| 171 | endif |
| 172 | endif |
| 173 | |
| 174 | " TeX/LaTeX delimiters: {{{1 |
| 175 | syn match texDelimiter "&" |
| 176 | syn match texDelimiter "\\\\" |
| 177 | |
| 178 | " Tex/Latex Options: {{{1 |
| 179 | syn match texOption "[^\\]\zs#\d\+\|^#\d\+" |
| 180 | |
| 181 | " texAccent (tnx to Karim Belabas) avoids annoying highlighting for accents: {{{1 |
| 182 | if b:tex_stylish |
| 183 | syn match texAccent "\\[bcdvuH][^a-zA-Z@]"me=e-1 |
| 184 | syn match texLigature "\\\([ijolL]\|ae\|oe\|ss\|AA\|AE\|OE\)[^a-zA-Z@]"me=e-1 |
| 185 | else |
| 186 | syn match texAccent "\\[bcdvuH]\A"me=e-1 |
| 187 | syn match texLigature "\\\([ijolL]\|ae\|oe\|ss\|AA\|AE\|OE\)\A"me=e-1 |
| 188 | endif |
| 189 | syn match texAccent "\\[bcdvuH]$" |
| 190 | syn match texAccent +\\[=^.\~"`']+ |
| 191 | syn match texAccent +\\['=t'.c^ud"vb~Hr]{\a}+ |
| 192 | syn match texLigature "\\\([ijolL]\|ae\|oe\|ss\|AA\|AE\|OE\)$" |
| 193 | |
| 194 | " \begin{}/\end{} section markers: {{{1 |
| 195 | syn match texSectionMarker "\\begin\>\|\\end\>" nextgroup=texSectionName |
Bram Moolenaar | 5c73622 | 2010-01-06 20:54:52 +0100 | [diff] [blame] | 196 | syn region texSectionName matchgroup=Delimiter start="{" end="}" contained nextgroup=texSectionModifier contains=texComment |
| 197 | syn region texSectionModifier matchgroup=Delimiter start="\[" end="]" contained contains=texComment |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 198 | |
| 199 | " \documentclass, \documentstyle, \usepackage: {{{1 |
| 200 | syn match texDocType "\\documentclass\>\|\\documentstyle\>\|\\usepackage\>" nextgroup=texSectionName,texDocTypeArgs |
Bram Moolenaar | 5c73622 | 2010-01-06 20:54:52 +0100 | [diff] [blame] | 201 | syn region texDocTypeArgs matchgroup=Delimiter start="\[" end="]" contained nextgroup=texSectionName contains=texComment |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 202 | |
Bram Moolenaar | a9a568c | 2006-03-14 23:04:27 +0000 | [diff] [blame] | 203 | " Preamble syntax-based folding support: {{{1 |
| 204 | if g:tex_fold_enabled && has("folding") |
Bram Moolenaar | 5c73622 | 2010-01-06 20:54:52 +0100 | [diff] [blame] | 205 | syn region texPreamble transparent fold start='\zs\\documentclass\>' end='\ze\\begin{document}' contains=texStyle,@texMatchGroup |
Bram Moolenaar | a9a568c | 2006-03-14 23:04:27 +0000 | [diff] [blame] | 206 | endif |
| 207 | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 208 | " TeX input: {{{1 |
| 209 | syn match texInput "\\input\s\+[a-zA-Z/.0-9_^]\+"hs=s+7 contains=texStatement |
Bram Moolenaar | 5c73622 | 2010-01-06 20:54:52 +0100 | [diff] [blame] | 210 | syn match texInputFile "\\include\(graphics\|list\)\=\(\[.\{-}\]\)\=\s*{.\{-}}" contains=texStatement,texInputCurlies,texInputFileOpt |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 211 | syn match texInputFile "\\\(epsfig\|input\|usepackage\)\s*\(\[.*\]\)\={.\{-}}" contains=texStatement,texInputCurlies,texInputFileOpt |
| 212 | syn match texInputCurlies "[{}]" contained |
Bram Moolenaar | 5c73622 | 2010-01-06 20:54:52 +0100 | [diff] [blame] | 213 | syn region texInputFileOpt matchgroup=Delimiter start="\[" end="\]" contained contains=texComment |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 214 | |
| 215 | " Type Styles (LaTeX 2.09): {{{1 |
| 216 | syn match texTypeStyle "\\rm\>" |
| 217 | syn match texTypeStyle "\\em\>" |
| 218 | syn match texTypeStyle "\\bf\>" |
| 219 | syn match texTypeStyle "\\it\>" |
| 220 | syn match texTypeStyle "\\sl\>" |
| 221 | syn match texTypeStyle "\\sf\>" |
| 222 | syn match texTypeStyle "\\sc\>" |
| 223 | syn match texTypeStyle "\\tt\>" |
| 224 | |
| 225 | " Type Styles: attributes, commands, families, etc (LaTeX2E): {{{1 |
| 226 | syn match texTypeStyle "\\textbf\>" |
| 227 | syn match texTypeStyle "\\textit\>" |
| 228 | syn match texTypeStyle "\\textmd\>" |
| 229 | syn match texTypeStyle "\\textrm\>" |
| 230 | syn match texTypeStyle "\\textsc\>" |
| 231 | syn match texTypeStyle "\\textsf\>" |
| 232 | syn match texTypeStyle "\\textsl\>" |
| 233 | syn match texTypeStyle "\\texttt\>" |
| 234 | syn match texTypeStyle "\\textup\>" |
| 235 | syn match texTypeStyle "\\emph\>" |
| 236 | |
| 237 | syn match texTypeStyle "\\mathbb\>" |
| 238 | syn match texTypeStyle "\\mathbf\>" |
| 239 | syn match texTypeStyle "\\mathcal\>" |
| 240 | syn match texTypeStyle "\\mathfrak\>" |
| 241 | syn match texTypeStyle "\\mathit\>" |
| 242 | syn match texTypeStyle "\\mathnormal\>" |
| 243 | syn match texTypeStyle "\\mathrm\>" |
| 244 | syn match texTypeStyle "\\mathsf\>" |
| 245 | syn match texTypeStyle "\\mathtt\>" |
| 246 | |
| 247 | syn match texTypeStyle "\\rmfamily\>" |
| 248 | syn match texTypeStyle "\\sffamily\>" |
| 249 | syn match texTypeStyle "\\ttfamily\>" |
| 250 | |
| 251 | syn match texTypeStyle "\\itshape\>" |
| 252 | syn match texTypeStyle "\\scshape\>" |
| 253 | syn match texTypeStyle "\\slshape\>" |
| 254 | syn match texTypeStyle "\\upshape\>" |
| 255 | |
| 256 | syn match texTypeStyle "\\bfseries\>" |
| 257 | syn match texTypeStyle "\\mdseries\>" |
| 258 | |
| 259 | " Some type sizes: {{{1 |
| 260 | syn match texTypeSize "\\tiny\>" |
| 261 | syn match texTypeSize "\\scriptsize\>" |
| 262 | syn match texTypeSize "\\footnotesize\>" |
| 263 | syn match texTypeSize "\\small\>" |
| 264 | syn match texTypeSize "\\normalsize\>" |
| 265 | syn match texTypeSize "\\large\>" |
| 266 | syn match texTypeSize "\\Large\>" |
| 267 | syn match texTypeSize "\\LARGE\>" |
| 268 | syn match texTypeSize "\\huge\>" |
| 269 | syn match texTypeSize "\\Huge\>" |
| 270 | |
| 271 | " Spacecodes (TeX'isms): {{{1 |
| 272 | " \mathcode`\^^@="2201 \delcode`\(="028300 \sfcode`\)=0 \uccode`X=`X \lccode`x=`x |
| 273 | syn match texSpaceCode "\\\(math\|cat\|del\|lc\|sf\|uc\)code`"me=e-1 nextgroup=texSpaceCodeChar |
| 274 | syn match texSpaceCodeChar "`\\\=.\(\^.\)\==\(\d\|\"\x\{1,6}\|`.\)" contained |
| 275 | |
| 276 | " Sections, subsections, etc: {{{1 |
Bram Moolenaar | f1f8bc5 | 2005-03-07 23:20:08 +0000 | [diff] [blame] | 277 | if g:tex_fold_enabled && has("folding") |
Bram Moolenaar | 3577c6f | 2008-06-24 21:16:56 +0000 | [diff] [blame] | 278 | syn region texDocZone matchgroup=texSection start='\\begin\s*{\s*document\s*}' end='\\end\s*{\s*document\s*}' fold contains=@texFoldGroup,@texDocGroup,@Spell |
| 279 | syn region texPartZone matchgroup=texSection start='\\part\>' end='\ze\s*\\\%(part\>\|end\s*{\s*document\s*}\)' fold contains=@texFoldGroup,@texPartGroup,@Spell |
| 280 | syn region texChapterZone matchgroup=texSection start='\\chapter\>' end='\ze\s*\\\%(chapter\>\|part\>\|end\s*{\s*document\s*}\)' fold contains=@texFoldGroup,@texChapterGroup,@Spell |
| 281 | syn region texSectionZone matchgroup=texSection start='\\section\>' end='\ze\s*\\\%(section\>\|chapter\>\|part\>\|end\s*{\s*document\s*}\)' fold contains=@texFoldGroup,@texSectionGroup,@Spell |
| 282 | syn region texSubSectionZone matchgroup=texSection start='\\subsection\>' end='\ze\s*\\\%(\%(sub\)\=section\>\|chapter\>\|part\>\|end\s*{\s*document\s*}\)' fold contains=@texFoldGroup,@texSubSectionGroup,@Spell |
| 283 | syn region texSubSubSectionZone matchgroup=texSection start='\\subsubsection\>' end='\ze\s*\\\%(\%(sub\)\{,2}section\>\|chapter\>\|part\>\|end\s*{\s*document\s*}\)' fold contains=@texFoldGroup,@texSubSubSectionGroup,@Spell |
| 284 | syn region texParaZone matchgroup=texSection start='\\paragraph\>' end='\ze\s*\\\%(paragraph\>\|\%(sub\)*section\>\|chapter\>\|part\>\|end\s*{\s*document\s*}\)' fold contains=@texFoldGroup,@texParaGroup,@Spell |
| 285 | syn region texSubParaZone matchgroup=texSection start='\\subparagraph\>' end='\ze\s*\\\%(\%(sub\)\=paragraph\>\|\%(sub\)*section\>\|chapter\>\|part\>\|end\s*{\s*document\s*}\)' fold contains=@texFoldGroup,@Spell |
| 286 | syn region texTitle matchgroup=texSection start='\\\%(author\|title\)\>\s*{' end='}' fold contains=@texFoldGroup,@Spell |
| 287 | syn region texAbstract matchgroup=texSection start='\\begin\s*{\s*abstract\s*}' end='\\end\s*{\s*abstract\s*}' fold contains=@texFoldGroup,@Spell |
Bram Moolenaar | 293ee4d | 2004-12-09 21:34:53 +0000 | [diff] [blame] | 288 | else |
Bram Moolenaar | 3577c6f | 2008-06-24 21:16:56 +0000 | [diff] [blame] | 289 | syn region texDocZone matchgroup=texSection start='\\begin\s*{\s*document\s*}' end='\\end\s*{\s*document\s*}' contains=@texFoldGroup,@texDocGroup,@Spell |
| 290 | syn region texPartZone matchgroup=texSection start='\\part\>' end='\ze\s*\\\%(part\>\|end\s*{\s*document\s*}\)' contains=@texFoldGroup,@texPartGroup,@Spell |
| 291 | syn region texChapterZone matchgroup=texSection start='\\chapter\>' end='\ze\s*\\\%(chapter\>\|part\>\|end\s*{\s*document\s*}\)' contains=@texFoldGroup,@texChapterGroup,@Spell |
| 292 | syn region texSectionZone matchgroup=texSection start='\\section\>' end='\ze\s*\\\%(section\>\|chapter\>\|part\>\|end\s*{\s*document\s*}\)' contains=@texFoldGroup,@texSectionGroup,@Spell |
| 293 | syn region texSubSectionZone matchgroup=texSection start='\\subsection\>' end='\ze\s*\\\%(\%(sub\)\=section\>\|chapter\>\|part\>\|end\s*{\s*document\s*}\)' contains=@texFoldGroup,@texSubSectionGroup,@Spell |
| 294 | syn region texSubSubSectionZone matchgroup=texSection start='\\subsubsection\>' end='\ze\s*\\\%(\%(sub\)\{,2}section\>\|chapter\>\|part\>\|end\s*{\s*document\s*}\)' contains=@texFoldGroup,@texSubSubSectionGroup,@Spell |
| 295 | syn region texParaZone matchgroup=texSection start='\\paragraph\>' end='\ze\s*\\\%(paragraph\>\|\%(sub\)*section\>\|chapter\>\|part\>\|end\s*{\s*document\s*}\)' contains=@texFoldGroup,@texParaGroup,@Spell |
| 296 | syn region texSubParaZone matchgroup=texSection start='\\subparagraph\>' end='\ze\s*\\\%(\%(sub\)\=paragraph\>\|\%(sub\)*section\>\|chapter\>\|part\>\|end\s*{\s*document\s*}\)' contains=@texFoldGroup,@Spell |
| 297 | syn region texTitle matchgroup=texSection start='\\\%(author\|title\)\>\s*{' end='}' contains=@texFoldGroup,@Spell |
| 298 | syn region texAbstract matchgroup=texSection start='\\begin\s*{\s*abstract\s*}' end='\\end\s*{\s*abstract\s*}' contains=@texFoldGroup,@Spell |
Bram Moolenaar | 293ee4d | 2004-12-09 21:34:53 +0000 | [diff] [blame] | 299 | endif |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 300 | |
| 301 | " Bad Math (mismatched): {{{1 |
| 302 | if !exists("tex_no_math") |
| 303 | syn match texBadMath "\\end\s*{\s*\(array\|gathered\|bBpvV]matrix\|split\|subequations\|smallmatrix\|xxalignat\)\s*}" |
| 304 | syn match texBadMath "\\end\s*{\s*\(align\|alignat\|displaymath\|displaymath\|eqnarray\|equation\|flalign\|gather\|math\|multline\|xalignat\)\*\=\s*}" |
| 305 | syn match texBadMath "\\[\])]" |
| 306 | endif |
| 307 | |
| 308 | " Math Zones: {{{1 |
| 309 | if !exists("tex_no_math") |
Bram Moolenaar | 488c651 | 2005-08-11 20:09:58 +0000 | [diff] [blame] | 310 | " TexNewMathZone: function creates a mathzone with the given suffix and mathzone name. {{{2 |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 311 | " Starred forms are created if starform is true. Starred |
| 312 | " forms have syntax group and synchronization groups with a |
| 313 | " "S" appended. Handles: cluster, syntax, sync, and HiLink. |
| 314 | fun! TexNewMathZone(sfx,mathzone,starform) |
| 315 | let grpname = "texMathZone".a:sfx |
| 316 | let syncname = "texSyncMathZone".a:sfx |
Bram Moolenaar | 3577c6f | 2008-06-24 21:16:56 +0000 | [diff] [blame] | 317 | if g:tex_fold_enabled |
| 318 | let foldcmd= " fold" |
| 319 | else |
| 320 | let foldcmd= "" |
| 321 | endif |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 322 | exe "syn cluster texMathZones add=".grpname |
Bram Moolenaar | 3577c6f | 2008-06-24 21:16:56 +0000 | [diff] [blame] | 323 | exe 'syn region '.grpname.' start='."'".'\\begin\s*{\s*'.a:mathzone.'\s*}'."'".' end='."'".'\\end\s*{\s*'.a:mathzone.'\s*}'."'".' keepend contains=@texMathZoneGroup'.foldcmd |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 324 | exe 'syn sync match '.syncname.' grouphere '.grpname.' "\\begin\s*{\s*'.a:mathzone.'\*\s*}"' |
| 325 | exe 'syn sync match '.syncname.' grouphere '.grpname.' "\\begin\s*{\s*'.a:mathzone.'\*\s*}"' |
Bram Moolenaar | 5c73622 | 2010-01-06 20:54:52 +0100 | [diff] [blame] | 326 | exe 'hi def link '.grpname.' texMath' |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 327 | if a:starform |
| 328 | let grpname = "texMathZone".a:sfx.'S' |
| 329 | let syncname = "texSyncMathZone".a:sfx.'S' |
| 330 | exe "syn cluster texMathZones add=".grpname |
Bram Moolenaar | 3577c6f | 2008-06-24 21:16:56 +0000 | [diff] [blame] | 331 | exe 'syn region '.grpname.' start='."'".'\\begin\s*{\s*'.a:mathzone.'\*\s*}'."'".' end='."'".'\\end\s*{\s*'.a:mathzone.'\*\s*}'."'".' keepend contains=@texMathZoneGroup'.foldcmd |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 332 | exe 'syn sync match '.syncname.' grouphere '.grpname.' "\\begin\s*{\s*'.a:mathzone.'\*\s*}"' |
| 333 | exe 'syn sync match '.syncname.' grouphere '.grpname.' "\\begin\s*{\s*'.a:mathzone.'\*\s*}"' |
Bram Moolenaar | 5c73622 | 2010-01-06 20:54:52 +0100 | [diff] [blame] | 334 | exe 'hi def link '.grpname.' texMath' |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 335 | endif |
| 336 | endfun |
| 337 | |
| 338 | " Standard Math Zones: {{{2 |
| 339 | call TexNewMathZone("A","align",1) |
| 340 | call TexNewMathZone("B","alignat",1) |
| 341 | call TexNewMathZone("C","displaymath",1) |
| 342 | call TexNewMathZone("D","eqnarray",1) |
| 343 | call TexNewMathZone("E","equation",1) |
| 344 | call TexNewMathZone("F","flalign",1) |
| 345 | call TexNewMathZone("G","gather",1) |
| 346 | call TexNewMathZone("H","math",1) |
| 347 | call TexNewMathZone("I","multline",1) |
| 348 | call TexNewMathZone("J","subequations",0) |
| 349 | call TexNewMathZone("K","xalignat",1) |
| 350 | call TexNewMathZone("L","xxalignat",0) |
| 351 | |
| 352 | " Inline Math Zones: {{{2 |
Bram Moolenaar | e0021c7 | 2010-07-28 17:25:21 +0200 | [diff] [blame] | 353 | if has("conceal") && &enc == 'utf-8' |
| 354 | syn region texMathZoneV matchgroup=Delimiter start="\\(" matchgroup=Delimiter end="\\)\|%stopzone\>" keepend concealends contains=@texMathZoneGroup |
| 355 | syn region texMathZoneW matchgroup=Delimiter start="\\\[" matchgroup=Delimiter end="\\]\|%stopzone\>" keepend concealends contains=@texMathZoneGroup |
| 356 | syn region texMathZoneX matchgroup=Delimiter start="\$" skip="\\\\\|\\\$" matchgroup=Delimiter end="\$" end="%stopzone\>" concealends contains=@texMathZoneGroup |
| 357 | syn region texMathZoneY matchgroup=Delimiter start="\$\$" matchgroup=Delimiter end="\$\$" end="%stopzone\>" concealends keepend contains=@texMathZoneGroup |
| 358 | else |
| 359 | syn region texMathZoneV matchgroup=Delimiter start="\\(" matchgroup=Delimiter end="\\)\|%stopzone\>" keepend contains=@texMathZoneGroup |
| 360 | syn region texMathZoneW matchgroup=Delimiter start="\\\[" matchgroup=Delimiter end="\\]\|%stopzone\>" keepend contains=@texMathZoneGroup |
| 361 | syn region texMathZoneX matchgroup=Delimiter start="\$" skip="\\\\\|\\\$" matchgroup=Delimiter end="\$" end="%stopzone\>" contains=@texMathZoneGroup |
| 362 | syn region texMathZoneY matchgroup=Delimiter start="\$\$" matchgroup=Delimiter end="\$\$" end="%stopzone\>" keepend contains=@texMathZoneGroup |
| 363 | endif |
Bram Moolenaar | b2c0350 | 2010-07-02 20:20:09 +0200 | [diff] [blame] | 364 | syn region texMathZoneZ matchgroup=texStatement start="\\ensuremath\s*{" matchgroup=texStatement end="}" end="%stopzone\>" contains=@texMathZoneGroup |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 365 | |
| 366 | syn match texMathOper "[_^=]" contained |
| 367 | |
Bram Moolenaar | 74cbdf0 | 2010-08-04 23:03:17 +0200 | [diff] [blame] | 368 | " Text Inside Math Zones: {{{2 |
| 369 | syn region texMathText matchgroup=texStatement start='\\\(\(inter\)\=text\|mbox\)\s*{' end='}' contains=@texFoldGroup,@Spell |
| 370 | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 371 | " \left..something.. and \right..something.. support: {{{2 |
| 372 | syn match texMathDelimBad contained "\S" |
Bram Moolenaar | 4b22cdb | 2010-08-02 22:12:46 +0200 | [diff] [blame] | 373 | if has("conceal") && &enc == 'utf-8' && s:tex_conceal =~ 'm' |
| 374 | syn match texMathDelim contained "\\left\\{\>" skipwhite nextgroup=texMathDelimSet1,texMathDelimSet2,texMathDelimBad contains=texMathSymbol cchar={ |
| 375 | syn match texMathDelim contained "\\right\\}\>" skipwhite nextgroup=texMathDelimSet1,texMathDelimSet2,texMathDelimBad contains=texMathSymbol cchar=} |
| 376 | else |
| 377 | syn match texMathDelim contained "\\\(left\|right\)\>" skipwhite nextgroup=texMathDelimSet1,texMathDelimSet2,texMathDelimBad |
| 378 | endif |
| 379 | syn match texMathDelim contained "\\\([bB]igg\=[lr]\)\>" skipwhite nextgroup=texMathDelimSet1,texMathDelimSet2,texMathDelimBad |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 380 | syn match texMathDelim contained "\\\(left\|right\)arrow\>\|\<\([aA]rrow\|brace\)\=vert\>" |
| 381 | syn match texMathDelim contained "\\lefteqn\>" |
| 382 | syn match texMathDelimSet2 contained "\\" nextgroup=texMathDelimKey,texMathDelimBad |
| 383 | syn match texMathDelimSet1 contained "[<>()[\]|/.]\|\\[{}|]" |
| 384 | syn keyword texMathDelimKey contained backslash lceil lVert rgroup uparrow |
| 385 | syn keyword texMathDelimKey contained downarrow lfloor rangle rmoustache Uparrow |
| 386 | syn keyword texMathDelimKey contained Downarrow lgroup rbrace rvert updownarrow |
| 387 | syn keyword texMathDelimKey contained langle lmoustache rceil rVert Updownarrow |
| 388 | syn keyword texMathDelimKey contained lbrace lvert rfloor |
| 389 | endif |
| 390 | |
| 391 | " Special TeX characters ( \$ \& \% \# \{ \} \_ \S \P ) : {{{1 |
| 392 | syn match texSpecialChar "\\[$&%#{}_]" |
| 393 | if b:tex_stylish |
| 394 | syn match texSpecialChar "\\[SP@][^a-zA-Z@]"me=e-1 |
| 395 | else |
| 396 | syn match texSpecialChar "\\[SP@]\A"me=e-1 |
| 397 | endif |
| 398 | syn match texSpecialChar "\\\\" |
| 399 | if !exists("tex_no_math") |
| 400 | syn match texOnlyMath "[_^]" |
| 401 | endif |
| 402 | syn match texSpecialChar "\^\^[0-9a-f]\{2}\|\^\^\S" |
| 403 | |
| 404 | " Comments: {{{1 |
| 405 | " Normal TeX LaTeX : %.... |
| 406 | " Documented TeX Format: ^^A... -and- leading %s (only) |
Bram Moolenaar | 3577c6f | 2008-06-24 21:16:56 +0000 | [diff] [blame] | 407 | if !exists("g:tex_comment_nospell") || !g:tex_comment_nospell |
| 408 | syn cluster texCommentGroup contains=texTodo,@Spell |
| 409 | else |
| 410 | syn cluster texCommentGroup contains=texTodo,@NoSpell |
| 411 | endif |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 412 | syn case ignore |
Bram Moolenaar | 18144c8 | 2006-04-12 21:52:12 +0000 | [diff] [blame] | 413 | syn keyword texTodo contained combak fixme todo xxx |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 414 | syn case match |
| 415 | if b:extfname == "dtx" |
| 416 | syn match texComment "\^\^A.*$" contains=@texCommentGroup |
| 417 | syn match texComment "^%\+" contains=@texCommentGroup |
| 418 | else |
Bram Moolenaar | fd2ac76 | 2006-03-01 22:09:21 +0000 | [diff] [blame] | 419 | if g:tex_fold_enabled |
| 420 | " allows syntax-folding of 2 or more contiguous comment lines |
| 421 | " single-line comments are not folded |
| 422 | syn match texComment "%.*$" contains=@texCommentGroup |
| 423 | syn region texComment start="^\zs\s*%.*\_s*%" skip="^\s*%" end='^\ze\s*[^%]' fold |
| 424 | else |
| 425 | syn match texComment "%.*$" contains=@texCommentGroup |
| 426 | endif |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 427 | endif |
| 428 | |
| 429 | " Separate lines used for verb` and verb# so that the end conditions {{{1 |
Bram Moolenaar | 74cbdf0 | 2010-08-04 23:03:17 +0200 | [diff] [blame] | 430 | " will appropriately terminate. |
| 431 | " If g:tex_verbspell exists, then verbatim texZones will permit spellchecking there. |
| 432 | if exists("g:tex_verbspell") && g:tex_verbspell |
| 433 | syn region texZone start="\\begin{[vV]erbatim}" end="\\end{[vV]erbatim}\|%stopzone\>" contains=@Spell |
| 434 | " listings package: |
| 435 | syn region texZone start="\\begin{lstlisting}" end="\\end{lstlisting}\|%stopzone\>" contains=@Spell |
| 436 | " moreverb package: |
| 437 | syn region texZone start="\\begin{verbatimtab}" end="\\end{verbatimtab}\|%stopzone\>" contains=@Spell |
| 438 | syn region texZone start="\\begin{verbatimwrite}" end="\\end{verbatimwrite}\|%stopzone\>" contains=@Spell |
| 439 | syn region texZone start="\\begin{boxedverbatim}" end="\\end{boxedverbatim}\|%stopzone\>" contains=@Spell |
| 440 | if version < 600 |
| 441 | syn region texZone start="\\verb\*\=`" end="`\|%stopzone\>" contains=@Spell |
| 442 | syn region texZone start="\\verb\*\=#" end="#\|%stopzone\>" contains=@Spell |
| 443 | else |
| 444 | if b:tex_stylish |
| 445 | syn region texZone start="\\verb\*\=\z([^\ta-zA-Z@]\)" end="\z1\|%stopzone\>" contains=@Spell |
| 446 | else |
| 447 | syn region texZone start="\\verb\*\=\z([^\ta-zA-Z]\)" end="\z1\|%stopzone\>" contains=@Spell |
| 448 | endif |
| 449 | endif |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 450 | else |
Bram Moolenaar | 74cbdf0 | 2010-08-04 23:03:17 +0200 | [diff] [blame] | 451 | syn region texZone start="\\begin{[vV]erbatim}" end="\\end{[vV]erbatim}\|%stopzone\>" |
| 452 | " listings package: |
| 453 | syn region texZone start="\\begin{lstlisting}" end="\\end{lstlisting}\|%stopzone\>" |
| 454 | " moreverb package: |
| 455 | syn region texZone start="\\begin{verbatimtab}" end="\\end{verbatimtab}\|%stopzone\>" |
| 456 | syn region texZone start="\\begin{verbatimwrite}" end="\\end{verbatimwrite}\|%stopzone\>" |
| 457 | syn region texZone start="\\begin{boxedverbatim}" end="\\end{boxedverbatim}\|%stopzone\>" |
| 458 | if version < 600 |
| 459 | syn region texZone start="\\verb\*\=`" end="`\|%stopzone\>" |
| 460 | syn region texZone start="\\verb\*\=#" end="#\|%stopzone\>" |
| 461 | else |
| 462 | if b:tex_stylish |
| 463 | syn region texZone start="\\verb\*\=\z([^\ta-zA-Z@]\)" end="\z1\|%stopzone\>" |
| 464 | else |
| 465 | syn region texZone start="\\verb\*\=\z([^\ta-zA-Z]\)" end="\z1\|%stopzone\>" |
| 466 | endif |
| 467 | endif |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 468 | endif |
| 469 | |
| 470 | " Tex Reference Zones: {{{1 |
Bram Moolenaar | cfbc5ee | 2004-07-02 15:38:35 +0000 | [diff] [blame] | 471 | syn region texZone matchgroup=texStatement start="@samp{" end="}\|%stopzone\>" contains=@texRefGroup |
| 472 | syn region texRefZone matchgroup=texStatement start="\\nocite{" end="}\|%stopzone\>" contains=@texRefGroup |
| 473 | syn region texRefZone matchgroup=texStatement start="\\bibliography{" end="}\|%stopzone\>" contains=@texRefGroup |
Bram Moolenaar | cfbc5ee | 2004-07-02 15:38:35 +0000 | [diff] [blame] | 474 | syn region texRefZone matchgroup=texStatement start="\\label{" end="}\|%stopzone\>" contains=@texRefGroup |
| 475 | syn region texRefZone matchgroup=texStatement start="\\\(page\|eq\)ref{" end="}\|%stopzone\>" contains=@texRefGroup |
| 476 | syn region texRefZone matchgroup=texStatement start="\\v\=ref{" end="}\|%stopzone\>" contains=@texRefGroup |
Bram Moolenaar | cc016f5 | 2005-12-10 20:23:46 +0000 | [diff] [blame] | 477 | syn match texRefZone '\\cite\%([tp]\*\=\)\=' nextgroup=texRefOption,texCite |
Bram Moolenaar | 74cbdf0 | 2010-08-04 23:03:17 +0200 | [diff] [blame] | 478 | syn region texRefOption contained matchgroup=Delimiter start='\[' end=']' contains=@texRefGroup,texRefZone nextgroup=texRefOption,texCite |
| 479 | syn region texCite contained matchgroup=Delimiter start='{' end='}' contains=@texRefGroup,texRefZone,texCite |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 480 | |
| 481 | " Handle newcommand, newenvironment : {{{1 |
| 482 | syn match texNewCmd "\\newcommand\>" nextgroup=texCmdName skipwhite skipnl |
| 483 | syn region texCmdName contained matchgroup=Delimiter start="{"rs=s+1 end="}" nextgroup=texCmdArgs,texCmdBody skipwhite skipnl |
| 484 | syn region texCmdArgs contained matchgroup=Delimiter start="\["rs=s+1 end="]" nextgroup=texCmdBody skipwhite skipnl |
| 485 | syn region texCmdBody contained matchgroup=Delimiter start="{"rs=s+1 skip="\\\\\|\\[{}]" matchgroup=Delimiter end="}" contains=@texCmdGroup |
| 486 | syn match texNewEnv "\\newenvironment\>" nextgroup=texEnvName skipwhite skipnl |
| 487 | syn region texEnvName contained matchgroup=Delimiter start="{"rs=s+1 end="}" nextgroup=texEnvBgn skipwhite skipnl |
| 488 | syn region texEnvBgn contained matchgroup=Delimiter start="{"rs=s+1 end="}" nextgroup=texEnvEnd skipwhite skipnl contains=@texEnvGroup |
| 489 | syn region texEnvEnd contained matchgroup=Delimiter start="{"rs=s+1 end="}" skipwhite skipnl contains=@texEnvGroup |
| 490 | |
| 491 | " Definitions/Commands: {{{1 |
| 492 | syn match texDefCmd "\\def\>" nextgroup=texDefName skipwhite skipnl |
| 493 | if b:tex_stylish |
| 494 | syn match texDefName contained "\\[a-zA-Z@]\+" nextgroup=texDefParms,texCmdBody skipwhite skipnl |
| 495 | syn match texDefName contained "\\[^a-zA-Z@]" nextgroup=texDefParms,texCmdBody skipwhite skipnl |
| 496 | else |
| 497 | syn match texDefName contained "\\\a\+" nextgroup=texDefParms,texCmdBody skipwhite skipnl |
| 498 | syn match texDefName contained "\\\A" nextgroup=texDefParms,texCmdBody skipwhite skipnl |
| 499 | endif |
| 500 | syn match texDefParms contained "#[^{]*" contains=texDefParm nextgroup=texCmdBody skipwhite skipnl |
| 501 | syn match texDefParm contained "#\d\+" |
| 502 | |
| 503 | " TeX Lengths: {{{1 |
Bram Moolenaar | 9964e46 | 2007-05-05 17:54:07 +0000 | [diff] [blame] | 504 | syn match texLength "\<\d\+\([.,]\d\+\)\=\s*\(true\)\=\s*\(bp\|cc\|cm\|dd\|em\|ex\|in\|mm\|pc\|pt\|sp\)\>" |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 505 | |
| 506 | " TeX String Delimiters: {{{1 |
| 507 | syn match texString "\(``\|''\|,,\)" |
| 508 | |
Bram Moolenaar | 5c73622 | 2010-01-06 20:54:52 +0100 | [diff] [blame] | 509 | " makeatletter -- makeatother sections |
| 510 | if !exists("g:tex_no_error") |
| 511 | syn region texStyle matchgroup=texStatement start='\\makeatletter' end='\\makeatother' contains=@texStyleGroup contained |
| 512 | syn match texStyleStatement "\\[a-zA-Z@]\+" contained |
| 513 | syn region texStyleMatcher matchgroup=Delimiter start="{" skip="\\\\\|\\[{}]" end="}" contains=@texStyleGroup,texError contained |
| 514 | syn region texStyleMatcher matchgroup=Delimiter start="\[" end="]" contains=@texStyleGroup,texError contained |
| 515 | endif |
| 516 | |
Bram Moolenaar | 611df5b | 2010-07-26 22:51:56 +0200 | [diff] [blame] | 517 | " Conceal mode support (supports set cole=1) {{{1 |
Bram Moolenaar | b2c0350 | 2010-07-02 20:20:09 +0200 | [diff] [blame] | 518 | if has("conceal") && &enc == 'utf-8' |
Bram Moolenaar | 611df5b | 2010-07-26 22:51:56 +0200 | [diff] [blame] | 519 | |
| 520 | " Math Symbols {{{2 |
Bram Moolenaar | 4b22cdb | 2010-08-02 22:12:46 +0200 | [diff] [blame] | 521 | if s:tex_conceal =~ 'm' |
Bram Moolenaar | 74cbdf0 | 2010-08-04 23:03:17 +0200 | [diff] [blame] | 522 | syn match texMathSymbol '\\angle\>' contained conceal cchar=∠ |
Bram Moolenaar | 4b22cdb | 2010-08-02 22:12:46 +0200 | [diff] [blame] | 523 | syn match texMathSymbol '\\approx\>' contained conceal cchar=≈ |
| 524 | syn match texMathSymbol '\\ast\>' contained conceal cchar=∗ |
Bram Moolenaar | 74cbdf0 | 2010-08-04 23:03:17 +0200 | [diff] [blame] | 525 | syn match texMathSymbol '\\asymp\>' contained conceal cchar=≍ |
| 526 | syn match texMathSymbol '\\backepsilon\>' contained conceal cchar=∍ |
| 527 | syn match texMathSymbol '\\backsimeq\>' contained conceal cchar=≃ |
| 528 | syn match texMathSymbol '\\barwedge\>' contained conceal cchar=⊼ |
Bram Moolenaar | 5aae419 | 2010-08-03 23:00:38 +0200 | [diff] [blame] | 529 | syn match texMathSymbol '\\because\>' contained conceal cchar=∵ |
Bram Moolenaar | 74cbdf0 | 2010-08-04 23:03:17 +0200 | [diff] [blame] | 530 | syn match texMathSymbol '\\between\>' contained conceal cchar=≬ |
Bram Moolenaar | 5aae419 | 2010-08-03 23:00:38 +0200 | [diff] [blame] | 531 | syn match texMathSymbol '\\bigcap\>' contained conceal cchar=∩ |
| 532 | syn match texMathSymbol '\\bigcup\>' contained conceal cchar=∪ |
| 533 | syn match texMathSymbol '\\bigodot\>' contained conceal cchar=⊙ |
| 534 | syn match texMathSymbol '\\bigoplus\>' contained conceal cchar=⊕ |
| 535 | syn match texMathSymbol '\\bigotimes\>' contained conceal cchar=⊗ |
| 536 | syn match texMathSymbol '\\bigsqcup\>' contained conceal cchar=⊔ |
Bram Moolenaar | 4b22cdb | 2010-08-02 22:12:46 +0200 | [diff] [blame] | 537 | syn match texMathSymbol '\\bigtriangledown\>' contained conceal cchar=∇ |
| 538 | syn match texMathSymbol '\\bigvee\>' contained conceal cchar=⋁ |
| 539 | syn match texMathSymbol '\\bigwedge\>' contained conceal cchar=⋀ |
| 540 | syn match texMathSymbol '\\blacksquare\>' contained conceal cchar=∎ |
Bram Moolenaar | 5aae419 | 2010-08-03 23:00:38 +0200 | [diff] [blame] | 541 | syn match texMathSymbol '\\bot\>' contained conceal cchar=⊥ |
Bram Moolenaar | 74cbdf0 | 2010-08-04 23:03:17 +0200 | [diff] [blame] | 542 | syn match texMathSymbol '\\boxdot\>' contained conceal cchar=⊡ |
| 543 | syn match texMathSymbol '\\boxminus\>' contained conceal cchar=⊟ |
| 544 | syn match texMathSymbol '\\boxplus\>' contained conceal cchar=⊞ |
| 545 | syn match texMathSymbol '\\boxtimes\>' contained conceal cchar=⊠ |
| 546 | syn match texMathSymbol '\\bumpeq\>' contained conceal cchar=≏ |
| 547 | syn match texMathSymbol '\\Bumpeq\>' contained conceal cchar=≎ |
Bram Moolenaar | 4b22cdb | 2010-08-02 22:12:46 +0200 | [diff] [blame] | 548 | syn match texMathSymbol '\\cap\>' contained conceal cchar=∩ |
Bram Moolenaar | 74cbdf0 | 2010-08-04 23:03:17 +0200 | [diff] [blame] | 549 | syn match texMathSymbol '\\Cap\>' contained conceal cchar=⋒ |
Bram Moolenaar | 4b22cdb | 2010-08-02 22:12:46 +0200 | [diff] [blame] | 550 | syn match texMathSymbol '\\cdot\>' contained conceal cchar=· |
Bram Moolenaar | 5aae419 | 2010-08-03 23:00:38 +0200 | [diff] [blame] | 551 | syn match texMathSymbol '\\cdots\>' contained conceal cchar=⋯ |
Bram Moolenaar | 4b22cdb | 2010-08-02 22:12:46 +0200 | [diff] [blame] | 552 | syn match texMathSymbol '\\circ\>' contained conceal cchar=∘ |
Bram Moolenaar | 74cbdf0 | 2010-08-04 23:03:17 +0200 | [diff] [blame] | 553 | syn match texMathSymbol '\\circeq\>' contained conceal cchar=≗ |
| 554 | syn match texMathSymbol '\\circledast\>' contained conceal cchar=⊛ |
Bram Moolenaar | 4b22cdb | 2010-08-02 22:12:46 +0200 | [diff] [blame] | 555 | syn match texMathSymbol '\\circledcirc\>' contained conceal cchar=⊚ |
Bram Moolenaar | 74cbdf0 | 2010-08-04 23:03:17 +0200 | [diff] [blame] | 556 | syn match texMathSymbol '\\complement\>' contained conceal cchar=∁ |
Bram Moolenaar | 4b22cdb | 2010-08-02 22:12:46 +0200 | [diff] [blame] | 557 | syn match texMathSymbol '\\cong\>' contained conceal cchar=≅ |
Bram Moolenaar | 5aae419 | 2010-08-03 23:00:38 +0200 | [diff] [blame] | 558 | syn match texMathSymbol '\\coprod\>' contained conceal cchar=∐ |
Bram Moolenaar | 4b22cdb | 2010-08-02 22:12:46 +0200 | [diff] [blame] | 559 | syn match texMathSymbol '\\cup\>' contained conceal cchar=∪ |
Bram Moolenaar | 74cbdf0 | 2010-08-04 23:03:17 +0200 | [diff] [blame] | 560 | syn match texMathSymbol '\\Cup\>' contained conceal cchar=⋓ |
| 561 | syn match texMathSymbol '\\curlyeqprec\>' contained conceal cchar=⋞ |
| 562 | syn match texMathSymbol '\\curlyeqsucc\>' contained conceal cchar=⋟ |
| 563 | syn match texMathSymbol '\\curlyvee\>' contained conceal cchar=⋎ |
| 564 | syn match texMathSymbol '\\curlywedge\>' contained conceal cchar=⋏ |
| 565 | syn match texMathSymbol '\\dashv\>' contained conceal cchar=⊣ |
Bram Moolenaar | 4b22cdb | 2010-08-02 22:12:46 +0200 | [diff] [blame] | 566 | syn match texMathSymbol '\\diamond\>' contained conceal cchar=⋄ |
| 567 | syn match texMathSymbol '\\div\>' contained conceal cchar=÷ |
| 568 | syn match texMathSymbol '\\doteq\>' contained conceal cchar=≐ |
Bram Moolenaar | 74cbdf0 | 2010-08-04 23:03:17 +0200 | [diff] [blame] | 569 | syn match texMathSymbol '\\doteqdot\>' contained conceal cchar=≑ |
| 570 | syn match texMathSymbol '\\dotplus\>' contained conceal cchar=∔ |
Bram Moolenaar | 4b22cdb | 2010-08-02 22:12:46 +0200 | [diff] [blame] | 571 | syn match texMathSymbol '\\dotsb\>' contained conceal cchar=⋯ |
Bram Moolenaar | 5aae419 | 2010-08-03 23:00:38 +0200 | [diff] [blame] | 572 | syn match texMathSymbol '\\dotsc\>' contained conceal cchar=… |
| 573 | syn match texMathSymbol '\\dots\>' contained conceal cchar=… |
| 574 | syn match texMathSymbol '\\dotsi\>' contained conceal cchar=⋯ |
| 575 | syn match texMathSymbol '\\dotso\>' contained conceal cchar=… |
Bram Moolenaar | 74cbdf0 | 2010-08-04 23:03:17 +0200 | [diff] [blame] | 576 | syn match texMathSymbol '\\doublebarwedge\>' contained conceal cchar=⩞ |
Bram Moolenaar | 4b22cdb | 2010-08-02 22:12:46 +0200 | [diff] [blame] | 577 | syn match texMathSymbol '\\emptyset\>' contained conceal cchar=∅ |
Bram Moolenaar | 74cbdf0 | 2010-08-04 23:03:17 +0200 | [diff] [blame] | 578 | syn match texMathSymbol '\\eqcirc\>' contained conceal cchar=≖ |
| 579 | syn match texMathSymbol '\\eqsim\>' contained conceal cchar=≂ |
| 580 | syn match texMathSymbol '\\eqslantgtr\>' contained conceal cchar=⪖ |
| 581 | syn match texMathSymbol '\\eqslantless\>' contained conceal cchar=⪕ |
Bram Moolenaar | 4b22cdb | 2010-08-02 22:12:46 +0200 | [diff] [blame] | 582 | syn match texMathSymbol '\\equiv\>' contained conceal cchar=≡ |
Bram Moolenaar | 5aae419 | 2010-08-03 23:00:38 +0200 | [diff] [blame] | 583 | syn match texMathSymbol '\\exists\>' contained conceal cchar=∃ |
Bram Moolenaar | 74cbdf0 | 2010-08-04 23:03:17 +0200 | [diff] [blame] | 584 | syn match texMathSymbol '\\fallingdotseq\>' contained conceal cchar=≒ |
Bram Moolenaar | 4b22cdb | 2010-08-02 22:12:46 +0200 | [diff] [blame] | 585 | syn match texMathSymbol '\\forall\>' contained conceal cchar=∀ |
Bram Moolenaar | 74cbdf0 | 2010-08-04 23:03:17 +0200 | [diff] [blame] | 586 | syn match texMathSymbol '\\ge\>' contained conceal cchar=≥ |
Bram Moolenaar | 4b22cdb | 2010-08-02 22:12:46 +0200 | [diff] [blame] | 587 | syn match texMathSymbol '\\geq\>' contained conceal cchar=≥ |
Bram Moolenaar | 74cbdf0 | 2010-08-04 23:03:17 +0200 | [diff] [blame] | 588 | syn match texMathSymbol '\\geqq\>' contained conceal cchar=≧ |
| 589 | syn match texMathSymbol '\\gneqq\>' contained conceal cchar=≩ |
| 590 | syn match texMathSymbol '\\gtrdot\>' contained conceal cchar=⋗ |
Bram Moolenaar | 4b22cdb | 2010-08-02 22:12:46 +0200 | [diff] [blame] | 591 | syn match texMathSymbol '\\gtreqless\>' contained conceal cchar=⋛ |
| 592 | syn match texMathSymbol '\\gtrless\>' contained conceal cchar=≷ |
Bram Moolenaar | 74cbdf0 | 2010-08-04 23:03:17 +0200 | [diff] [blame] | 593 | syn match texMathSymbol '\\gtrsim\>' contained conceal cchar=≳ |
Bram Moolenaar | 5aae419 | 2010-08-03 23:00:38 +0200 | [diff] [blame] | 594 | syn match texMathSymbol '\\iiint\>' contained conceal cchar=∭ |
| 595 | syn match texMathSymbol '\\iint\>' contained conceal cchar=∬ |
Bram Moolenaar | 4b22cdb | 2010-08-02 22:12:46 +0200 | [diff] [blame] | 596 | syn match texMathSymbol '\\Im\>' contained conceal cchar=ℑ |
| 597 | syn match texMathSymbol '\\in\>' contained conceal cchar=∈ |
| 598 | syn match texMathSymbol '\\infty\>' contained conceal cchar=∞ |
Bram Moolenaar | 5aae419 | 2010-08-03 23:00:38 +0200 | [diff] [blame] | 599 | syn match texMathSymbol '\\int\>' contained conceal cchar=∫ |
Bram Moolenaar | 4b22cdb | 2010-08-02 22:12:46 +0200 | [diff] [blame] | 600 | syn match texMathSymbol '\\lceil\>' contained conceal cchar=⌈ |
Bram Moolenaar | 5aae419 | 2010-08-03 23:00:38 +0200 | [diff] [blame] | 601 | syn match texMathSymbol '\\ldots\>' contained conceal cchar=… |
Bram Moolenaar | 74cbdf0 | 2010-08-04 23:03:17 +0200 | [diff] [blame] | 602 | syn match texMathSymbol '\\le\>' contained conceal cchar=≤ |
Bram Moolenaar | 5aae419 | 2010-08-03 23:00:38 +0200 | [diff] [blame] | 603 | syn match texMathSymbol '\\leftarrow\>' contained conceal cchar=⟵ |
| 604 | syn match texMathSymbol '\\Leftarrow\>' contained conceal cchar=⟸ |
Bram Moolenaar | 4b22cdb | 2010-08-02 22:12:46 +0200 | [diff] [blame] | 605 | syn match texMathSymbol '\\left(' contained conceal cchar=( |
| 606 | syn match texMathSymbol '\\left\[' contained conceal cchar=[ |
| 607 | syn match texMathSymbol '\\left\\{' contained conceal cchar={ |
Bram Moolenaar | 74cbdf0 | 2010-08-04 23:03:17 +0200 | [diff] [blame] | 608 | syn match texMathSymbol '\\leftthreetimes\>' contained conceal cchar=⋋ |
Bram Moolenaar | 4b22cdb | 2010-08-02 22:12:46 +0200 | [diff] [blame] | 609 | syn match texMathSymbol '\\leq\>' contained conceal cchar=≤ |
Bram Moolenaar | 74cbdf0 | 2010-08-04 23:03:17 +0200 | [diff] [blame] | 610 | syn match texMathSymbol '\\leqq\>' contained conceal cchar=≦ |
| 611 | syn match texMathSymbol '\\lessdot\>' contained conceal cchar=⋖ |
Bram Moolenaar | 4b22cdb | 2010-08-02 22:12:46 +0200 | [diff] [blame] | 612 | syn match texMathSymbol '\\lesseqgtr\>' contained conceal cchar=⋚ |
Bram Moolenaar | 74cbdf0 | 2010-08-04 23:03:17 +0200 | [diff] [blame] | 613 | syn match texMathSymbol '\\lesssim\>' contained conceal cchar=≲ |
Bram Moolenaar | 4b22cdb | 2010-08-02 22:12:46 +0200 | [diff] [blame] | 614 | syn match texMathSymbol '\\lfloor\>' contained conceal cchar=⌊ |
Bram Moolenaar | 74cbdf0 | 2010-08-04 23:03:17 +0200 | [diff] [blame] | 615 | syn match texMathSymbol '\\lneqq\>' contained conceal cchar=≨ |
| 616 | syn match texMathSymbol '\\ltimes\>' contained conceal cchar=⋉ |
Bram Moolenaar | 4b22cdb | 2010-08-02 22:12:46 +0200 | [diff] [blame] | 617 | syn match texMathSymbol '\\mapsto\>' contained conceal cchar=↦ |
Bram Moolenaar | 74cbdf0 | 2010-08-04 23:03:17 +0200 | [diff] [blame] | 618 | syn match texMathSymbol '\\measuredangle\>' contained conceal cchar=∡ |
Bram Moolenaar | 5aae419 | 2010-08-03 23:00:38 +0200 | [diff] [blame] | 619 | syn match texMathSymbol '\\mid\>' contained conceal cchar=∣ |
Bram Moolenaar | 4b22cdb | 2010-08-02 22:12:46 +0200 | [diff] [blame] | 620 | syn match texMathSymbol '\\mp\>' contained conceal cchar=∓ |
Bram Moolenaar | 5aae419 | 2010-08-03 23:00:38 +0200 | [diff] [blame] | 621 | syn match texMathSymbol '\\nabla\>' contained conceal cchar=∇ |
Bram Moolenaar | 74cbdf0 | 2010-08-04 23:03:17 +0200 | [diff] [blame] | 622 | syn match texMathSymbol '\\ncong\>' contained conceal cchar=≇ |
| 623 | syn match texMathSymbol '\\ne\>' contained conceal cchar=≠ |
| 624 | syn match texMathSymbol '\\neg\>' contained conceal cchar=¬ |
Bram Moolenaar | 4b22cdb | 2010-08-02 22:12:46 +0200 | [diff] [blame] | 625 | syn match texMathSymbol '\\neq\>' contained conceal cchar=≠ |
Bram Moolenaar | 5aae419 | 2010-08-03 23:00:38 +0200 | [diff] [blame] | 626 | syn match texMathSymbol '\\nexists\>' contained conceal cchar=∄ |
Bram Moolenaar | 4b22cdb | 2010-08-02 22:12:46 +0200 | [diff] [blame] | 627 | syn match texMathSymbol '\\ngeq\>' contained conceal cchar=≱ |
Bram Moolenaar | 74cbdf0 | 2010-08-04 23:03:17 +0200 | [diff] [blame] | 628 | syn match texMathSymbol '\\ngeqq\>' contained conceal cchar=≱ |
Bram Moolenaar | 4b22cdb | 2010-08-02 22:12:46 +0200 | [diff] [blame] | 629 | syn match texMathSymbol '\\ngtr\>' contained conceal cchar=≯ |
Bram Moolenaar | 74cbdf0 | 2010-08-04 23:03:17 +0200 | [diff] [blame] | 630 | syn match texMathSymbol '\\ni\>' contained conceal cchar=∋ |
Bram Moolenaar | 4b22cdb | 2010-08-02 22:12:46 +0200 | [diff] [blame] | 631 | syn match texMathSymbol '\\nleq\>' contained conceal cchar=≰ |
Bram Moolenaar | 74cbdf0 | 2010-08-04 23:03:17 +0200 | [diff] [blame] | 632 | syn match texMathSymbol '\\nleqq\>' contained conceal cchar=≰ |
Bram Moolenaar | 4b22cdb | 2010-08-02 22:12:46 +0200 | [diff] [blame] | 633 | syn match texMathSymbol '\\nless\>' contained conceal cchar=≮ |
Bram Moolenaar | 5aae419 | 2010-08-03 23:00:38 +0200 | [diff] [blame] | 634 | syn match texMathSymbol '\\nmid\>' contained conceal cchar=∤ |
Bram Moolenaar | 4b22cdb | 2010-08-02 22:12:46 +0200 | [diff] [blame] | 635 | syn match texMathSymbol '\\notin\>' contained conceal cchar=∉ |
Bram Moolenaar | 74cbdf0 | 2010-08-04 23:03:17 +0200 | [diff] [blame] | 636 | syn match texMathSymbol '\\nprec\>' contained conceal cchar=⊀ |
Bram Moolenaar | 5aae419 | 2010-08-03 23:00:38 +0200 | [diff] [blame] | 637 | syn match texMathSymbol '\\nsim\>' contained conceal cchar=≁ |
Bram Moolenaar | 74cbdf0 | 2010-08-04 23:03:17 +0200 | [diff] [blame] | 638 | syn match texMathSymbol '\\nsucc\>' contained conceal cchar=⊁ |
| 639 | syn match texMathSymbol '\\ntriangleleft\>' contained conceal cchar=⋪ |
| 640 | syn match texMathSymbol '\\ntrianglelefteq\>' contained conceal cchar=⋬ |
| 641 | syn match texMathSymbol '\\ntriangleright\>' contained conceal cchar=⋫ |
| 642 | syn match texMathSymbol '\\ntrianglerighteq\>' contained conceal cchar=⋭ |
| 643 | syn match texMathSymbol '\\nvdash\>' contained conceal cchar=⊬ |
| 644 | syn match texMathSymbol '\\nvDash\>' contained conceal cchar=⊭ |
| 645 | syn match texMathSymbol '\\nVdash\>' contained conceal cchar=⊮ |
Bram Moolenaar | 4b22cdb | 2010-08-02 22:12:46 +0200 | [diff] [blame] | 646 | syn match texMathSymbol '\\odot\>' contained conceal cchar=⊙ |
| 647 | syn match texMathSymbol '\\oint\>' contained conceal cchar=∮ |
Bram Moolenaar | 74cbdf0 | 2010-08-04 23:03:17 +0200 | [diff] [blame] | 648 | syn match texMathSymbol '\\ominus\>' contained conceal cchar=⊖ |
Bram Moolenaar | 4b22cdb | 2010-08-02 22:12:46 +0200 | [diff] [blame] | 649 | syn match texMathSymbol '\\oplus\>' contained conceal cchar=⊕ |
| 650 | syn match texMathSymbol '\\oslash\>' contained conceal cchar=⊘ |
| 651 | syn match texMathSymbol '\\otimes\>' contained conceal cchar=⊗ |
Bram Moolenaar | 74cbdf0 | 2010-08-04 23:03:17 +0200 | [diff] [blame] | 652 | syn match texMathSymbol '\\owns\>' contained conceal cchar=∋ |
Bram Moolenaar | 4b22cdb | 2010-08-02 22:12:46 +0200 | [diff] [blame] | 653 | syn match texMathSymbol '\\partial\>' contained conceal cchar=∂ |
| 654 | syn match texMathSymbol '\\perp\>' contained conceal cchar=⊥ |
Bram Moolenaar | 74cbdf0 | 2010-08-04 23:03:17 +0200 | [diff] [blame] | 655 | syn match texMathSymbol '\\pitchfork\>' contained conceal cchar=⋔ |
Bram Moolenaar | 4b22cdb | 2010-08-02 22:12:46 +0200 | [diff] [blame] | 656 | syn match texMathSymbol '\\pm\>' contained conceal cchar=± |
Bram Moolenaar | 74cbdf0 | 2010-08-04 23:03:17 +0200 | [diff] [blame] | 657 | syn match texMathSymbol '\\precapprox\>' contained conceal cchar=⪷ |
Bram Moolenaar | 4b22cdb | 2010-08-02 22:12:46 +0200 | [diff] [blame] | 658 | syn match texMathSymbol '\\prec\>' contained conceal cchar=≺ |
Bram Moolenaar | 74cbdf0 | 2010-08-04 23:03:17 +0200 | [diff] [blame] | 659 | syn match texMathSymbol '\\preccurlyeq\>' contained conceal cchar=≼ |
| 660 | syn match texMathSymbol '\\preceq\>' contained conceal cchar=⪯ |
| 661 | syn match texMathSymbol '\\precnapprox\>' contained conceal cchar=⪹ |
| 662 | syn match texMathSymbol '\\precneqq\>' contained conceal cchar=⪵ |
| 663 | syn match texMathSymbol '\\precsim\>' contained conceal cchar=≾ |
Bram Moolenaar | 4b22cdb | 2010-08-02 22:12:46 +0200 | [diff] [blame] | 664 | syn match texMathSymbol '\\prod\>' contained conceal cchar=∏ |
| 665 | syn match texMathSymbol '\\propto\>' contained conceal cchar=∝ |
| 666 | syn match texMathSymbol '\\rceil\>' contained conceal cchar=⌉ |
| 667 | syn match texMathSymbol '\\Re\>' contained conceal cchar=ℜ |
| 668 | syn match texMathSymbol '\\rfloor\>' contained conceal cchar=⌋ |
Bram Moolenaar | 5aae419 | 2010-08-03 23:00:38 +0200 | [diff] [blame] | 669 | syn match texMathSymbol '\\rightarrow\>' contained conceal cchar=⟶ |
| 670 | syn match texMathSymbol '\\Rightarrow\>' contained conceal cchar=⟹ |
Bram Moolenaar | 4b22cdb | 2010-08-02 22:12:46 +0200 | [diff] [blame] | 671 | syn match texMathSymbol '\\right)' contained conceal cchar=) |
| 672 | syn match texMathSymbol '\\right]' contained conceal cchar=] |
| 673 | syn match texMathSymbol '\\right\\}' contained conceal cchar=} |
Bram Moolenaar | 74cbdf0 | 2010-08-04 23:03:17 +0200 | [diff] [blame] | 674 | syn match texMathSymbol '\\rightthreetimes\>' contained conceal cchar=⋌ |
| 675 | syn match texMathSymbol '\\risingdotseq\>' contained conceal cchar=≓ |
| 676 | syn match texMathSymbol '\\rtimes\>' contained conceal cchar=⋊ |
Bram Moolenaar | 5aae419 | 2010-08-03 23:00:38 +0200 | [diff] [blame] | 677 | syn match texMathSymbol '\\setminus\>' contained conceal cchar=∖ |
| 678 | syn match texMathSymbol '\\sim\>' contained conceal cchar=∼ |
Bram Moolenaar | 74cbdf0 | 2010-08-04 23:03:17 +0200 | [diff] [blame] | 679 | syn match texMathSymbol '\\sphericalangle\>' contained conceal cchar=∢ |
Bram Moolenaar | 4b22cdb | 2010-08-02 22:12:46 +0200 | [diff] [blame] | 680 | syn match texMathSymbol '\\sqcap\>' contained conceal cchar=⊓ |
| 681 | syn match texMathSymbol '\\sqcup\>' contained conceal cchar=⊔ |
Bram Moolenaar | 74cbdf0 | 2010-08-04 23:03:17 +0200 | [diff] [blame] | 682 | syn match texMathSymbol '\\sqsubset\>' contained conceal cchar=⊏ |
| 683 | syn match texMathSymbol '\\sqsubseteq\>' contained conceal cchar=⊑ |
| 684 | syn match texMathSymbol '\\sqsupset\>' contained conceal cchar=⊐ |
| 685 | syn match texMathSymbol '\\sqsupseteq\>' contained conceal cchar=⊒ |
Bram Moolenaar | 4b22cdb | 2010-08-02 22:12:46 +0200 | [diff] [blame] | 686 | syn match texMathSymbol '\\subset\>' contained conceal cchar=⊂ |
Bram Moolenaar | 74cbdf0 | 2010-08-04 23:03:17 +0200 | [diff] [blame] | 687 | syn match texMathSymbol '\\Subset\>' contained conceal cchar=⋐ |
Bram Moolenaar | 4b22cdb | 2010-08-02 22:12:46 +0200 | [diff] [blame] | 688 | syn match texMathSymbol '\\subseteq\>' contained conceal cchar=⊆ |
Bram Moolenaar | 74cbdf0 | 2010-08-04 23:03:17 +0200 | [diff] [blame] | 689 | syn match texMathSymbol '\\subseteqq\>' contained conceal cchar=⫅ |
Bram Moolenaar | 4b22cdb | 2010-08-02 22:12:46 +0200 | [diff] [blame] | 690 | syn match texMathSymbol '\\subsetneq\>' contained conceal cchar=⊊ |
Bram Moolenaar | 74cbdf0 | 2010-08-04 23:03:17 +0200 | [diff] [blame] | 691 | syn match texMathSymbol '\\subsetneqq\>' contained conceal cchar=⫋ |
| 692 | syn match texMathSymbol '\\succapprox\>' contained conceal cchar=⪸ |
Bram Moolenaar | 4b22cdb | 2010-08-02 22:12:46 +0200 | [diff] [blame] | 693 | syn match texMathSymbol '\\succ\>' contained conceal cchar=≻ |
Bram Moolenaar | 74cbdf0 | 2010-08-04 23:03:17 +0200 | [diff] [blame] | 694 | syn match texMathSymbol '\\succcurlyeq\>' contained conceal cchar=≽ |
| 695 | syn match texMathSymbol '\\succeq\>' contained conceal cchar=⪰ |
| 696 | syn match texMathSymbol '\\succnapprox\>' contained conceal cchar=⪺ |
| 697 | syn match texMathSymbol '\\succneqq\>' contained conceal cchar=⪶ |
| 698 | syn match texMathSymbol '\\succsim\>' contained conceal cchar=≿ |
Bram Moolenaar | 4b22cdb | 2010-08-02 22:12:46 +0200 | [diff] [blame] | 699 | syn match texMathSymbol '\\sum\>' contained conceal cchar=∑ |
Bram Moolenaar | 74cbdf0 | 2010-08-04 23:03:17 +0200 | [diff] [blame] | 700 | syn match texMathSymbol '\\Supset\>' contained conceal cchar=⋑ |
Bram Moolenaar | 4b22cdb | 2010-08-02 22:12:46 +0200 | [diff] [blame] | 701 | syn match texMathSymbol '\\supseteq\>' contained conceal cchar=⊇ |
Bram Moolenaar | 74cbdf0 | 2010-08-04 23:03:17 +0200 | [diff] [blame] | 702 | syn match texMathSymbol '\\supseteqq\>' contained conceal cchar=⫆ |
Bram Moolenaar | 4b22cdb | 2010-08-02 22:12:46 +0200 | [diff] [blame] | 703 | syn match texMathSymbol '\\supsetneq\>' contained conceal cchar=⊋ |
Bram Moolenaar | 74cbdf0 | 2010-08-04 23:03:17 +0200 | [diff] [blame] | 704 | syn match texMathSymbol '\\supsetneqq\>' contained conceal cchar=⫌ |
Bram Moolenaar | 4b22cdb | 2010-08-02 22:12:46 +0200 | [diff] [blame] | 705 | syn match texMathSymbol '\\surd\>' contained conceal cchar=√ |
| 706 | syn match texMathSymbol '\\therefore\>' contained conceal cchar=∴ |
| 707 | syn match texMathSymbol '\\times\>' contained conceal cchar=× |
| 708 | syn match texMathSymbol '\\to\>' contained conceal cchar=→ |
Bram Moolenaar | 74cbdf0 | 2010-08-04 23:03:17 +0200 | [diff] [blame] | 709 | syn match texMathSymbol '\\top\>' contained conceal cchar=⊤ |
| 710 | syn match texMathSymbol '\\triangleleft\>' contained conceal cchar=⊲ |
Bram Moolenaar | 4b22cdb | 2010-08-02 22:12:46 +0200 | [diff] [blame] | 711 | syn match texMathSymbol '\\trianglelefteq\>' contained conceal cchar=⊴ |
Bram Moolenaar | 74cbdf0 | 2010-08-04 23:03:17 +0200 | [diff] [blame] | 712 | syn match texMathSymbol '\\triangleq\>' contained conceal cchar=≜ |
| 713 | syn match texMathSymbol '\\triangleright\>' contained conceal cchar=⊳ |
Bram Moolenaar | 4b22cdb | 2010-08-02 22:12:46 +0200 | [diff] [blame] | 714 | syn match texMathSymbol '\\trianglerighteq\>' contained conceal cchar=⊵ |
Bram Moolenaar | 74cbdf0 | 2010-08-04 23:03:17 +0200 | [diff] [blame] | 715 | syn match texMathSymbol '\\varnothing\>' contained conceal cchar=∅ |
Bram Moolenaar | 4b22cdb | 2010-08-02 22:12:46 +0200 | [diff] [blame] | 716 | syn match texMathSymbol '\\vartriangle\>' contained conceal cchar=∆ |
Bram Moolenaar | 74cbdf0 | 2010-08-04 23:03:17 +0200 | [diff] [blame] | 717 | syn match texMathSymbol '\\vdash\>' contained conceal cchar=⊢ |
| 718 | syn match texMathSymbol '\\vDash\>' contained conceal cchar=⊨ |
| 719 | syn match texMathSymbol '\\Vdash\>' contained conceal cchar=⊩ |
Bram Moolenaar | 4b22cdb | 2010-08-02 22:12:46 +0200 | [diff] [blame] | 720 | syn match texMathSymbol '\\vdots\>' contained conceal cchar=⋮ |
Bram Moolenaar | 74cbdf0 | 2010-08-04 23:03:17 +0200 | [diff] [blame] | 721 | syn match texMathSymbol '\\veebar\>' contained conceal cchar=⊻ |
Bram Moolenaar | 5aae419 | 2010-08-03 23:00:38 +0200 | [diff] [blame] | 722 | syn match texMathSymbol '\\vee\>' contained conceal cchar=∨ |
Bram Moolenaar | 74cbdf0 | 2010-08-04 23:03:17 +0200 | [diff] [blame] | 723 | syn match texMathSymbol '\\Vvdash\>' contained conceal cchar=⊪ |
Bram Moolenaar | 5aae419 | 2010-08-03 23:00:38 +0200 | [diff] [blame] | 724 | syn match texMathSymbol '\\wedge\>' contained conceal cchar=∧ |
Bram Moolenaar | 74cbdf0 | 2010-08-04 23:03:17 +0200 | [diff] [blame] | 725 | syn match texMathSymbol '\\wr\>' contained conceal cchar=≀ |
| 726 | |
| 727 | if &ambw == "double" |
| 728 | syn match texMathSymbol '\\gg\>' contained conceal cchar=≫ |
| 729 | syn match texMathSymbol '\\ll\>' contained conceal cchar=≪ |
| 730 | else |
| 731 | syn match texMathSymbol '\\gg\>' contained conceal cchar=⟫ |
| 732 | syn match texMathSymbol '\\ll\>' contained conceal cchar=⟪ |
| 733 | endif |
Bram Moolenaar | 4b22cdb | 2010-08-02 22:12:46 +0200 | [diff] [blame] | 734 | endif |
Bram Moolenaar | 611df5b | 2010-07-26 22:51:56 +0200 | [diff] [blame] | 735 | |
| 736 | " Greek {{{2 |
Bram Moolenaar | 4b22cdb | 2010-08-02 22:12:46 +0200 | [diff] [blame] | 737 | if s:tex_conceal =~ 'g' |
| 738 | fun! s:Greek(group,pat,cchar) |
| 739 | exe 'syn match '.a:group." '".a:pat."' contained conceal cchar=".a:cchar |
| 740 | endfun |
| 741 | call s:Greek('texGreek','\\alpha\>' ,'α') |
| 742 | call s:Greek('texGreek','\\beta\>' ,'β') |
| 743 | call s:Greek('texGreek','\\gamma\>' ,'γ') |
| 744 | call s:Greek('texGreek','\\delta\>' ,'δ') |
| 745 | call s:Greek('texGreek','\\epsilon\>' ,'ϵ') |
| 746 | call s:Greek('texGreek','\\varepsilon\>' ,'ε') |
| 747 | call s:Greek('texGreek','\\zeta\>' ,'ζ') |
| 748 | call s:Greek('texGreek','\\eta\>' ,'η') |
| 749 | call s:Greek('texGreek','\\theta\>' ,'θ') |
| 750 | call s:Greek('texGreek','\\vartheta\>' ,'ϑ') |
| 751 | call s:Greek('texGreek','\\kappa\>' ,'κ') |
| 752 | call s:Greek('texGreek','\\lambda\>' ,'λ') |
| 753 | call s:Greek('texGreek','\\mu\>' ,'μ') |
| 754 | call s:Greek('texGreek','\\nu\>' ,'ν') |
| 755 | call s:Greek('texGreek','\\xi\>' ,'ξ') |
| 756 | call s:Greek('texGreek','\\pi\>' ,'π') |
| 757 | call s:Greek('texGreek','\\varpi\>' ,'ϖ') |
| 758 | call s:Greek('texGreek','\\rho\>' ,'ρ') |
| 759 | call s:Greek('texGreek','\\varrho\>' ,'ϱ') |
| 760 | call s:Greek('texGreek','\\sigma\>' ,'σ') |
| 761 | call s:Greek('texGreek','\\varsigma\>' ,'ς') |
| 762 | call s:Greek('texGreek','\\tau\>' ,'τ') |
| 763 | call s:Greek('texGreek','\\upsilon\>' ,'υ') |
| 764 | call s:Greek('texGreek','\\phi\>' ,'φ') |
| 765 | call s:Greek('texGreek','\\varphi\>' ,'ϕ') |
| 766 | call s:Greek('texGreek','\\chi\>' ,'χ') |
| 767 | call s:Greek('texGreek','\\psi\>' ,'ψ') |
| 768 | call s:Greek('texGreek','\\omega\>' ,'ω') |
| 769 | call s:Greek('texGreek','\\Gamma\>' ,'Γ') |
| 770 | call s:Greek('texGreek','\\Delta\>' ,'Δ') |
| 771 | call s:Greek('texGreek','\\Theta\>' ,'Θ') |
| 772 | call s:Greek('texGreek','\\Lambda\>' ,'Λ') |
| 773 | call s:Greek('texGreek','\\Xi\>' ,'Χ') |
| 774 | call s:Greek('texGreek','\\Pi\>' ,'Π') |
| 775 | call s:Greek('texGreek','\\Sigma\>' ,'Σ') |
| 776 | call s:Greek('texGreek','\\Upsilon\>' ,'Υ') |
| 777 | call s:Greek('texGreek','\\Phi\>' ,'Φ') |
| 778 | call s:Greek('texGreek','\\Psi\>' ,'Ψ') |
| 779 | call s:Greek('texGreek','\\Omega\>' ,'Ω') |
| 780 | delfun s:Greek |
| 781 | endif |
Bram Moolenaar | 611df5b | 2010-07-26 22:51:56 +0200 | [diff] [blame] | 782 | |
| 783 | " Superscripts/Subscripts {{{2 |
Bram Moolenaar | 4b22cdb | 2010-08-02 22:12:46 +0200 | [diff] [blame] | 784 | if s:tex_conceal =~ 's' |
| 785 | syn region texSuperscript matchgroup=Delimiter start='\^{' end='}' contained concealends contains=texSuperscripts,texStatement |
| 786 | syn region texSubscript matchgroup=Delimiter start='_{' end='}' contained concealends contains=texSubscripts,texStatement |
| 787 | fun! s:SuperSub(group,leader,pat,cchar) |
| 788 | exe 'syn match '.a:group." '".a:leader.a:pat."' contained conceal cchar=".a:cchar |
| 789 | exe 'syn match '.a:group."s '".a:pat."' contained conceal cchar=".a:cchar.' nextgroup='.a:group.'s' |
| 790 | endfun |
| 791 | call s:SuperSub('texSuperscript','\^','0','⁰') |
| 792 | call s:SuperSub('texSuperscript','\^','1','¹') |
| 793 | call s:SuperSub('texSuperscript','\^','2','²') |
| 794 | call s:SuperSub('texSuperscript','\^','3','³') |
| 795 | call s:SuperSub('texSuperscript','\^','4','⁴') |
| 796 | call s:SuperSub('texSuperscript','\^','5','⁵') |
| 797 | call s:SuperSub('texSuperscript','\^','6','⁶') |
| 798 | call s:SuperSub('texSuperscript','\^','7','⁷') |
| 799 | call s:SuperSub('texSuperscript','\^','8','⁸') |
| 800 | call s:SuperSub('texSuperscript','\^','9','⁹') |
| 801 | call s:SuperSub('texSuperscript','\^','a','ᵃ') |
| 802 | call s:SuperSub('texSuperscript','\^','b','ᵇ') |
| 803 | call s:SuperSub('texSuperscript','\^','c','ᶜ') |
| 804 | call s:SuperSub('texSuperscript','\^','d','ᵈ') |
| 805 | call s:SuperSub('texSuperscript','\^','e','ᵉ') |
| 806 | call s:SuperSub('texSuperscript','\^','f','ᶠ') |
| 807 | call s:SuperSub('texSuperscript','\^','g','ᵍ') |
| 808 | call s:SuperSub('texSuperscript','\^','h','ʰ') |
| 809 | call s:SuperSub('texSuperscript','\^','i','ⁱ') |
| 810 | call s:SuperSub('texSuperscript','\^','j','ʲ') |
| 811 | call s:SuperSub('texSuperscript','\^','k','ᵏ') |
| 812 | call s:SuperSub('texSuperscript','\^','l','ˡ') |
| 813 | call s:SuperSub('texSuperscript','\^','m','ᵐ') |
| 814 | call s:SuperSub('texSuperscript','\^','n','ⁿ') |
| 815 | call s:SuperSub('texSuperscript','\^','o','ᵒ') |
| 816 | call s:SuperSub('texSuperscript','\^','p','ᵖ') |
| 817 | call s:SuperSub('texSuperscript','\^','r','ʳ') |
| 818 | call s:SuperSub('texSuperscript','\^','s','ˢ') |
| 819 | call s:SuperSub('texSuperscript','\^','t','ᵗ') |
| 820 | call s:SuperSub('texSuperscript','\^','u','ᵘ') |
| 821 | call s:SuperSub('texSuperscript','\^','v','ᵛ') |
| 822 | call s:SuperSub('texSuperscript','\^','w','ʷ') |
| 823 | call s:SuperSub('texSuperscript','\^','x','ˣ') |
| 824 | call s:SuperSub('texSuperscript','\^','y','ʸ') |
| 825 | call s:SuperSub('texSuperscript','\^','z','ᶻ') |
| 826 | call s:SuperSub('texSuperscript','\^','A','ᴬ') |
| 827 | call s:SuperSub('texSuperscript','\^','B','ᴮ') |
| 828 | call s:SuperSub('texSuperscript','\^','D','ᴰ') |
| 829 | call s:SuperSub('texSuperscript','\^','E','ᴱ') |
| 830 | call s:SuperSub('texSuperscript','\^','G','ᴳ') |
| 831 | call s:SuperSub('texSuperscript','\^','H','ᴴ') |
| 832 | call s:SuperSub('texSuperscript','\^','I','ᴵ') |
| 833 | call s:SuperSub('texSuperscript','\^','J','ᴶ') |
| 834 | call s:SuperSub('texSuperscript','\^','K','ᴷ') |
| 835 | call s:SuperSub('texSuperscript','\^','L','ᴸ') |
| 836 | call s:SuperSub('texSuperscript','\^','M','ᴹ') |
| 837 | call s:SuperSub('texSuperscript','\^','N','ᴺ') |
| 838 | call s:SuperSub('texSuperscript','\^','O','ᴼ') |
| 839 | call s:SuperSub('texSuperscript','\^','P','ᴾ') |
| 840 | call s:SuperSub('texSuperscript','\^','R','ᴿ') |
| 841 | call s:SuperSub('texSuperscript','\^','T','ᵀ') |
| 842 | call s:SuperSub('texSuperscript','\^','U','ᵁ') |
| 843 | call s:SuperSub('texSuperscript','\^','W','ᵂ') |
| 844 | call s:SuperSub('texSuperscript','\^','+','⁺') |
| 845 | call s:SuperSub('texSuperscript','\^','-','⁻') |
| 846 | call s:SuperSub('texSuperscript','\^','<','˂') |
| 847 | call s:SuperSub('texSuperscript','\^','>','˃') |
| 848 | call s:SuperSub('texSuperscript','\^','/','ˊ') |
| 849 | call s:SuperSub('texSuperscript','\^','(','⁽') |
| 850 | call s:SuperSub('texSuperscript','\^',')','⁾') |
| 851 | call s:SuperSub('texSuperscript','\^','\.','˙') |
| 852 | call s:SuperSub('texSuperscript','\^','=','˭') |
| 853 | call s:SuperSub('texSubscript','_','0','₀') |
| 854 | call s:SuperSub('texSubscript','_','1','₁') |
| 855 | call s:SuperSub('texSubscript','_','2','₂') |
| 856 | call s:SuperSub('texSubscript','_','3','₃') |
| 857 | call s:SuperSub('texSubscript','_','4','₄') |
| 858 | call s:SuperSub('texSubscript','_','5','₅') |
| 859 | call s:SuperSub('texSubscript','_','6','₆') |
| 860 | call s:SuperSub('texSubscript','_','7','₇') |
| 861 | call s:SuperSub('texSubscript','_','8','₈') |
| 862 | call s:SuperSub('texSubscript','_','9','₉') |
| 863 | call s:SuperSub('texSubscript','_','a','ₐ') |
| 864 | call s:SuperSub('texSubscript','_','e','ₑ') |
| 865 | call s:SuperSub('texSubscript','_','i','ᵢ') |
| 866 | call s:SuperSub('texSubscript','_','o','ₒ') |
| 867 | call s:SuperSub('texSubscript','_','u','ᵤ') |
| 868 | call s:SuperSub('texSubscript','_','+','₊') |
| 869 | call s:SuperSub('texSubscript','_','-','₋') |
| 870 | call s:SuperSub('texSubscript','_','/','ˏ') |
| 871 | call s:SuperSub('texSubscript','_','(','₍') |
| 872 | call s:SuperSub('texSubscript','_',')','₎') |
| 873 | call s:SuperSub('texSubscript','_','\.','‸') |
| 874 | call s:SuperSub('texSubscript','_','r','ᵣ') |
| 875 | call s:SuperSub('texSubscript','_','v','ᵥ') |
| 876 | call s:SuperSub('texSubscript','_','x','ₓ') |
| 877 | call s:SuperSub('texSubscript','_','\\beta\>' ,'ᵦ') |
| 878 | call s:SuperSub('texSubscript','_','\\delta\>','ᵨ') |
| 879 | call s:SuperSub('texSubscript','_','\\phi\>' ,'ᵩ') |
| 880 | call s:SuperSub('texSubscript','_','\\gamma\>','ᵧ') |
| 881 | call s:SuperSub('texSubscript','_','\\chi\>' ,'ᵪ') |
| 882 | delfun s:SuperSub |
| 883 | endif |
Bram Moolenaar | 611df5b | 2010-07-26 22:51:56 +0200 | [diff] [blame] | 884 | |
| 885 | " Accented characters: {{{2 |
Bram Moolenaar | 4b22cdb | 2010-08-02 22:12:46 +0200 | [diff] [blame] | 886 | if s:tex_conceal =~ 'a' |
| 887 | if b:tex_stylish |
| 888 | syn match texAccent "\\[bcdvuH][^a-zA-Z@]"me=e-1 |
| 889 | syn match texLigature "\\\([ijolL]\|ae\|oe\|ss\|AA\|AE\|OE\)[^a-zA-Z@]"me=e-1 |
| 890 | else |
| 891 | fun! s:Accents(chr,...) |
| 892 | let i= 1 |
| 893 | for accent in ["`","\\'","^",'"','\~',"r","v"] |
| 894 | if i > a:0 |
| 895 | break |
| 896 | endif |
| 897 | if strlen(a:{i}) == 0 |
| 898 | let i= i + 1 |
| 899 | continue |
| 900 | endif |
| 901 | exe "syn match texAccent '\\\\".accent."{".a:chr."}' conceal cchar=".a:{i} |
Bram Moolenaar | e0021c7 | 2010-07-28 17:25:21 +0200 | [diff] [blame] | 902 | let i= i + 1 |
Bram Moolenaar | 4b22cdb | 2010-08-02 22:12:46 +0200 | [diff] [blame] | 903 | endfor |
| 904 | endfun |
| 905 | call s:Accents('a','à','á','â','ä','ã','å','ă') |
| 906 | call s:Accents('A','À','Á','Â','Ä','Ã','Å','Ă') |
| 907 | call s:Accents('C',"" ,'Ć','Ĉ',"" ,"" ,"" ,'Ć') |
| 908 | call s:Accents('e','è','é','ê','ë','ẽ',"" ,'ĕ') |
| 909 | call s:Accents('E','È','É','Ê','Ë','Ẽ',"" ,'Ė') |
| 910 | call s:Accents('i','ì','í','î','ï','ĩ',"" ,"ĭ") |
| 911 | call s:Accents('I','Ì','Í','Î','Ï','Ĩ',"" ,'Ĭ') |
| 912 | call s:Accents('o','ò','ó','ô','ö','õ',"" ,'ŏ') |
| 913 | call s:Accents('O','Ò','Ó','Ô','Ö','Õ',"" ,'Ŏ') |
| 914 | call s:Accents('r',"" ,'ŕ',"" ,"" ,"" ,"" ,'ř') |
| 915 | call s:Accents('R',"" ,'Ŕ',"" ,"" ,"" ,"" ,'Ř') |
| 916 | call s:Accents('s',"" ,'ś','ŝ',"" ,"" ,"" ,'š') |
| 917 | call s:Accents('S',"" ,'Ś','Ŝ',"" ,"" ,"" ,'Š') |
| 918 | call s:Accents('u','ù','ú','û','ü','ũ',"" ,'ŭ') |
| 919 | call s:Accents('U','Ù','Ú','Û','Ü','Ũ',"" ,'Ŭ') |
| 920 | call s:Accents('y','ỳ','ý','ŷ','ÿ','ỹ',"" ,"" ) |
| 921 | call s:Accents('Y','Ỳ','Ý','Ŷ','Ÿ','Ỹ',"" ,"" ) |
| 922 | delfun s:Accents |
| 923 | syn match texAccent '\\aa\>' conceal cchar=å |
| 924 | syn match texAccent '\\AA\>' conceal cchar=Å |
| 925 | syn match texAccent '\\k{a}' conceal cchar=ą |
| 926 | syn match texAccent '\\k{A}' conceal cchar=Ą |
| 927 | syn match texAccent '\\c{C}' conceal cchar=Ç |
| 928 | syn match texAccent '\\c{c}' conceal cchar=ç |
| 929 | syn match texAccent '\\\~{n}' conceal cchar=ñ |
| 930 | syn match texAccent '\\\~{N}' conceal cchar=Ñ |
| 931 | syn match texAccent '\\o\>' conceal cchar=ø |
| 932 | syn match texAccent '\\O\>' conceal cchar=Ø |
| 933 | syn match texAccent '\\H{o}' conceal cchar=ő |
| 934 | syn match texAccent '\\H{O}' conceal cchar=Ő |
| 935 | syn match texAccent '\\c{r}' conceal cchar=ŗ |
| 936 | syn match texLigature '\\AE\>' conceal cchar=Æ |
| 937 | syn match texLigature '\\ae\>' conceal cchar=æ |
| 938 | syn match texLigature '\\oe\>' conceal cchar=œ |
| 939 | syn match texLigature '\\OE\>' conceal cchar=Œ |
| 940 | syn match texLigature '\\ss\>' conceal cchar=ß |
| 941 | endif |
Bram Moolenaar | 611df5b | 2010-07-26 22:51:56 +0200 | [diff] [blame] | 942 | endif |
Bram Moolenaar | b2c0350 | 2010-07-02 20:20:09 +0200 | [diff] [blame] | 943 | endif |
| 944 | |
| 945 | " --------------------------------------------------------------------- |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 946 | " LaTeX synchronization: {{{1 |
| 947 | syn sync maxlines=200 |
| 948 | syn sync minlines=50 |
| 949 | |
| 950 | syn sync match texSyncStop groupthere NONE "%stopzone\>" |
| 951 | |
| 952 | " Synchronization: {{{1 |
| 953 | " The $..$ and $$..$$ make for impossible sync patterns |
| 954 | " (one can't tell if a "$$" starts or stops a math zone by itself) |
| 955 | " The following grouptheres coupled with minlines above |
| 956 | " help improve the odds of good syncing. |
| 957 | if !exists("tex_no_math") |
| 958 | syn sync match texSyncMathZoneA groupthere NONE "\\end{abstract}" |
| 959 | syn sync match texSyncMathZoneA groupthere NONE "\\end{center}" |
| 960 | syn sync match texSyncMathZoneA groupthere NONE "\\end{description}" |
| 961 | syn sync match texSyncMathZoneA groupthere NONE "\\end{enumerate}" |
| 962 | syn sync match texSyncMathZoneA groupthere NONE "\\end{itemize}" |
| 963 | syn sync match texSyncMathZoneA groupthere NONE "\\end{table}" |
| 964 | syn sync match texSyncMathZoneA groupthere NONE "\\end{tabular}" |
| 965 | syn sync match texSyncMathZoneA groupthere NONE "\\\(sub\)*section\>" |
| 966 | endif |
| 967 | |
Bram Moolenaar | b2c0350 | 2010-07-02 20:20:09 +0200 | [diff] [blame] | 968 | " --------------------------------------------------------------------- |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 969 | " Highlighting: {{{1 |
| 970 | if did_tex_syntax_inits == 1 |
| 971 | let did_tex_syntax_inits= 2 |
| 972 | " TeX highlighting groups which should share similar highlighting |
| 973 | if !exists("g:tex_no_error") |
| 974 | if !exists("tex_no_math") |
| 975 | HiLink texBadMath texError |
| 976 | HiLink texMathDelimBad texError |
| 977 | HiLink texMathError texError |
| 978 | if !b:tex_stylish |
| 979 | HiLink texOnlyMath texError |
| 980 | endif |
| 981 | endif |
| 982 | HiLink texError Error |
| 983 | endif |
| 984 | |
Bram Moolenaar | cc016f5 | 2005-12-10 20:23:46 +0000 | [diff] [blame] | 985 | HiLink texCite texRefZone |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 986 | HiLink texDefCmd texDef |
| 987 | HiLink texDefName texDef |
| 988 | HiLink texDocType texCmdName |
| 989 | HiLink texDocTypeArgs texCmdArgs |
| 990 | HiLink texInputFileOpt texCmdArgs |
| 991 | HiLink texInputCurlies texDelimiter |
| 992 | HiLink texLigature texSpecialChar |
| 993 | if !exists("tex_no_math") |
| 994 | HiLink texMathDelimSet1 texMathDelim |
| 995 | HiLink texMathDelimSet2 texMathDelim |
| 996 | HiLink texMathDelimKey texMathDelim |
| 997 | HiLink texMathMatcher texMath |
Bram Moolenaar | 5c73622 | 2010-01-06 20:54:52 +0100 | [diff] [blame] | 998 | HiLink texMathZoneV texMath |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 999 | HiLink texMathZoneW texMath |
| 1000 | HiLink texMathZoneX texMath |
| 1001 | HiLink texMathZoneY texMath |
Bram Moolenaar | 3577c6f | 2008-06-24 21:16:56 +0000 | [diff] [blame] | 1002 | HiLink texMathZoneV texMath |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1003 | HiLink texMathZoneZ texMath |
| 1004 | endif |
| 1005 | HiLink texSectionMarker texCmdName |
| 1006 | HiLink texSectionName texSection |
| 1007 | HiLink texSpaceCode texStatement |
Bram Moolenaar | 5c73622 | 2010-01-06 20:54:52 +0100 | [diff] [blame] | 1008 | HiLink texStyleStatement texStatement |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 1009 | HiLink texTypeSize texType |
| 1010 | HiLink texTypeStyle texType |
| 1011 | |
| 1012 | " Basic TeX highlighting groups |
| 1013 | HiLink texCmdArgs Number |
| 1014 | HiLink texCmdName Statement |
| 1015 | HiLink texComment Comment |
| 1016 | HiLink texDef Statement |
| 1017 | HiLink texDefParm Special |
| 1018 | HiLink texDelimiter Delimiter |
| 1019 | HiLink texInput Special |
| 1020 | HiLink texInputFile Special |
| 1021 | HiLink texLength Number |
| 1022 | HiLink texMath Special |
| 1023 | HiLink texMathDelim Statement |
| 1024 | HiLink texMathOper Operator |
| 1025 | HiLink texNewCmd Statement |
| 1026 | HiLink texNewEnv Statement |
| 1027 | HiLink texOption Number |
| 1028 | HiLink texRefZone Special |
| 1029 | HiLink texSection PreCondit |
| 1030 | HiLink texSpaceCodeChar Special |
| 1031 | HiLink texSpecialChar SpecialChar |
| 1032 | HiLink texStatement Statement |
| 1033 | HiLink texString String |
| 1034 | HiLink texTodo Todo |
| 1035 | HiLink texType Type |
| 1036 | HiLink texZone PreCondit |
| 1037 | |
| 1038 | delcommand HiLink |
| 1039 | endif |
| 1040 | |
| 1041 | " Current Syntax: {{{1 |
| 1042 | unlet b:extfname |
| 1043 | let b:current_syntax = "tex" |
Bram Moolenaar | e90ee31 | 2010-08-05 22:08:47 +0200 | [diff] [blame] | 1044 | " vim: ts=8 fdm=marker |