Changeset View
Changeset View
Standalone View
Standalone View
data/syntax/latex.xml
1 | <?xml version="1.0" encoding="UTF-8"?> | 1 | <?xml version="1.0" encoding="UTF-8"?> | ||
---|---|---|---|---|---|
2 | <!DOCTYPE language SYSTEM "language.dtd"> | 2 | <!DOCTYPE language SYSTEM "language.dtd" | ||
3 | <language name="LaTeX" version="8" section="Markup" kateversion="5.0" priority="10" extensions="*.tex;*.ltx;*.dtx;*.sty;*.cls;*.bbx;*.cbx;*.lbx;*.tikz;*.pgf" mimetype="text/x-tex" casesensitive="1" author="Jeroen Wijnhout (Jeroen.Wijnhout@kdemail.net)+Holger Danielsson (holger.danielsson@versanet.de)+Michel Ludwig (michel.ludwig@kdemail.net)+Thomas Braun (thomas.braun@virtuell-zuhause.de)" license="LGPL" > | 3 | [ | ||
4 | <!ENTITY bullet "×"> | ||||
5 | <!ENTITY envname "[a-zA-Z]+\*?"> | ||||
6 | ]> | ||||
7 | <language name="LaTeX" version="9" section="Markup" kateversion="5.0" priority="10" extensions="*.tex;*.ltx;*.dtx;*.sty;*.cls;*.bbx;*.cbx;*.lbx;*.tikz;*.pgf" mimetype="text/x-tex" casesensitive="1" author="Jeroen Wijnhout (Jeroen.Wijnhout@kdemail.net)+Holger Danielsson (holger.danielsson@versanet.de)+Michel Ludwig (michel.ludwig@kdemail.net)+Thomas Braun (thomas.braun@virtuell-zuhause.de)" license="LGPL" > | ||||
4 | <highlighting> | 8 | <highlighting> | ||
9 | <list name="beginEnv"> | ||||
10 | <item>\begin</item> | ||||
11 | </list> | ||||
12 | | ||||
13 | <list name="endEnv"> | ||||
14 | <item>\end</item> | ||||
15 | </list> | ||||
16 | | ||||
17 | <list name="Label"> | ||||
18 | <item>\Autocite</item> | ||||
19 | <item>\autocite</item> | ||||
20 | <item>\autoref</item> | ||||
21 | <item>\Cite</item> | ||||
22 | <item>\cite</item> | ||||
23 | <item>\Citeauthor</item> | ||||
24 | <item>\citeauthor</item> | ||||
25 | <item>\citep</item> | ||||
26 | <item>\citet</item> | ||||
27 | <item>\citetitle</item> | ||||
28 | <item>\citeurl</item> | ||||
29 | <item>\citeyear</item> | ||||
30 | <item>\cref</item> | ||||
31 | <item>\Cref</item> | ||||
32 | <item>\cref*</item> | ||||
33 | <item>\Cref*</item> | ||||
34 | <item>\eqref</item> | ||||
35 | <item>\Footcite</item> | ||||
36 | <item>\footcite</item> | ||||
37 | <item>\footfullcite</item> | ||||
38 | <item>\fullcite</item> | ||||
39 | <item>\label</item> | ||||
40 | <item>\nocite</item> | ||||
41 | <item>\pagecite</item> | ||||
42 | <item>\pageref</item> | ||||
43 | <item>\Parencite</item> | ||||
44 | <item>\parencite</item> | ||||
45 | <item>\ref</item> | ||||
46 | <item>\subref</item> | ||||
47 | <item>\subref*</item> | ||||
48 | <item>\supercite</item> | ||||
49 | <item>\Textcite</item> | ||||
50 | <item>\textcite</item> | ||||
51 | <item>\vpageref</item> | ||||
52 | <item>\vref</item> | ||||
53 | </list> | ||||
54 | | ||||
55 | <list name="macroFancyLabel"> | ||||
56 | <item>\documentclass</item> | ||||
57 | <item>\includegraphics</item> | ||||
58 | <item>\include</item> | ||||
59 | <item>\usepackage</item> | ||||
60 | <item>\bibliography</item> | ||||
61 | <item>\bibliographystyle</item> | ||||
62 | </list> | ||||
63 | | ||||
64 | <list name="FancyLabel"> | ||||
65 | <item>\cites</item> | ||||
66 | <item>\Cites</item> | ||||
67 | <item>\parencites</item> | ||||
68 | <item>\Parencites</item> | ||||
69 | <item>\autocites</item> | ||||
70 | <item>\Autocites</item> | ||||
71 | <item>\supercites</item> | ||||
72 | <item>\footcites</item> | ||||
73 | <item>\Footcites</item> | ||||
74 | </list> | ||||
75 | | ||||
76 | <list name="Sectioning"> | ||||
77 | <item>\part*</item> | ||||
78 | <item>\part</item> | ||||
79 | <item>\chapter*</item> | ||||
80 | <item>\chapter</item> | ||||
81 | <item>\section*</item> | ||||
82 | <item>\section</item> | ||||
83 | <item>\subsection*</item> | ||||
84 | <item>\subsection</item> | ||||
85 | <item>\subsubsection*</item> | ||||
86 | <item>\subsubsection</item> | ||||
87 | <item>\paragraph*</item> | ||||
88 | <item>\paragraph</item> | ||||
89 | <item>\subparagraph*</item> | ||||
90 | <item>\subparagraph</item> | ||||
91 | </list> | ||||
92 | | ||||
93 | <list name="SpecialCommand"> | ||||
94 | <item>\column</item> | ||||
95 | <item>\definecolor</item> | ||||
96 | <item>\geometry</item> | ||||
97 | <item>\hspace*</item> | ||||
98 | <item>\hspace</item> | ||||
99 | <item>\input</item> | ||||
100 | <item>\newboolean</item> | ||||
101 | <item>\rule</item> | ||||
102 | <item>\setboolean</item> | ||||
103 | <item>\setcounter</item> | ||||
104 | <item>\setlength</item> | ||||
105 | <item>\special</item> | ||||
106 | <item>\textcolor</item> | ||||
107 | <item>\vspace*</item> | ||||
108 | <item>\vspace</item> | ||||
109 | </list> | ||||
110 | | ||||
111 | <list name="Footnoting"> | ||||
112 | <item>\footnote*</item> | ||||
113 | <item>\footnote</item> | ||||
114 | </list> | ||||
115 | | ||||
116 | <list name="NewCommand"> | ||||
117 | <item>\renewcommand*</item> | ||||
118 | <item>\renewcommand</item> | ||||
119 | <item>\providecommand*</item> | ||||
120 | <item>\providecommand</item> | ||||
121 | <item>\newcommand*</item> | ||||
122 | <item>\newcommand</item> | ||||
123 | </list> | ||||
124 | | ||||
125 | <list name="DefCommand"> | ||||
126 | <item>\edef</item> | ||||
127 | <item>\gdef</item> | ||||
128 | <item>\xdef</item> | ||||
129 | </list> | ||||
130 | | ||||
131 | <list name="MathModeEnsure"> | ||||
132 | <item>\ensuremath</item> | ||||
133 | </list> | ||||
134 | | ||||
135 | <list name="iffalse"> | ||||
136 | <item>\iffalse</item> | ||||
137 | </list> | ||||
138 | | ||||
139 | <list name="iffalseend"> | ||||
140 | <item>\fi</item> | ||||
141 | <item>\else</item> | ||||
142 | </list> | ||||
143 | | ||||
144 | <list name="Verb"> | ||||
145 | <item>verb*</item> | ||||
146 | <item>verb</item> | ||||
147 | <item>Verb</item> | ||||
148 | </list> | ||||
149 | | ||||
150 | <list name="Lstinline"> | ||||
151 | <item>lstinline</item> | ||||
152 | </list> | ||||
153 | | ||||
154 | <list name="MintParam"> | ||||
155 | <item>mint</item> | ||||
156 | </list> | ||||
157 | | ||||
158 | <list name="ListingsEnv"> | ||||
159 | <item>lstlisting*</item> | ||||
160 | <item>lstlisting</item> | ||||
161 | </list> | ||||
162 | | ||||
163 | <list name="MintedEnv"> | ||||
164 | <item>minted*</item> | ||||
165 | <item>minted</item> | ||||
166 | </list> | ||||
167 | | ||||
168 | <list name="VerbatimEnv"> | ||||
169 | <item>Verbatim*</item> | ||||
170 | <item>Verbatim</item> | ||||
171 | <item>BVerbatim*</item> | ||||
172 | <item>BVerbatim</item> | ||||
173 | <item>LVerbatim*</item> | ||||
174 | <item>LVerbatim</item> | ||||
175 | <item>verbatim*</item> | ||||
176 | <item>verbatim</item> | ||||
177 | <item>boxedverbatim*</item> | ||||
178 | <item>boxedverbatim</item> | ||||
179 | </list> | ||||
180 | | ||||
181 | <list name="CommentEnv"> | ||||
182 | <item>comment*</item> | ||||
183 | <item>comment</item> | ||||
184 | </list> | ||||
185 | | ||||
186 | <list name="MathEnvParam"> | ||||
187 | <item>alignat*</item> | ||||
188 | <item>alignat</item> | ||||
189 | <item>xalignat*</item> | ||||
190 | <item>xalignat</item> | ||||
191 | <item>xxalignat*</item> | ||||
192 | <item>xxalignat</item> | ||||
193 | </list> | ||||
194 | | ||||
195 | <list name="MathEnv"> | ||||
196 | <item>Bmatrix*</item> | ||||
197 | <item>Bmatrix</item> | ||||
198 | <item>IEEEeqnarray*</item> | ||||
199 | <item>IEEEeqnarray</item> | ||||
200 | <item>IEEEeqnarraybox*</item> | ||||
201 | <item>IEEEeqnarraybox</item> | ||||
202 | <item>Vmatrix*</item> | ||||
203 | <item>Vmatrix</item> | ||||
204 | <item>align*</item> | ||||
205 | <item>align</item> | ||||
206 | <item>bmatrix*</item> | ||||
207 | <item>bmatrix</item> | ||||
208 | <item>cases*</item> | ||||
209 | <item>cases</item> | ||||
210 | <item>displaymath*</item> | ||||
211 | <item>displaymath</item> | ||||
212 | <item>eqnarray*</item> | ||||
213 | <item>eqnarray</item> | ||||
214 | <item>equation*</item> | ||||
215 | <item>equation</item> | ||||
216 | <item>flalign*</item> | ||||
217 | <item>flalign</item> | ||||
218 | <item>gather*</item> | ||||
219 | <item>gather</item> | ||||
220 | <item>math*</item> | ||||
221 | <item>math</item> | ||||
222 | <item>multline*</item> | ||||
223 | <item>multline</item> | ||||
224 | <item>pmatrix*</item> | ||||
225 | <item>pmatrix</item> | ||||
226 | <item>smallmatrix*</item> | ||||
227 | <item>smallmatrix</item> | ||||
228 | <item>subeqnarray*</item> | ||||
229 | <item>subeqnarray</item> | ||||
230 | <item>vmatrix*</item> | ||||
231 | <item>vmatrix</item> | ||||
232 | </list> | ||||
233 | | ||||
234 | <list name="TabEnv"> | ||||
235 | <item>tabularx*</item> | ||||
236 | <item>tabularx</item> | ||||
237 | <item>tabular*</item> | ||||
238 | <item>tabular</item> | ||||
239 | <item>supertabular*</item> | ||||
240 | <item>supertabular</item> | ||||
241 | <item>mpsupertabular*</item> | ||||
242 | <item>mpsupertabular</item> | ||||
243 | <item>xtabular*</item> | ||||
244 | <item>xtabular</item> | ||||
245 | <item>mpxtabular*</item> | ||||
246 | <item>mpxtabular</item> | ||||
247 | <item>longtable*</item> | ||||
248 | <item>longtable</item> | ||||
249 | </list> | ||||
250 | | ||||
251 | <list name="MathModeText"> | ||||
252 | <item>\text</item> | ||||
253 | <item>\textit</item> | ||||
254 | <item>\textbf</item> | ||||
255 | <item>\textmd</item> | ||||
256 | <item>\textsl</item> | ||||
257 | <item>\textsc</item> | ||||
258 | <item>\textrm</item> | ||||
259 | <item>\textsf</item> | ||||
260 | <item>\texttt</item> | ||||
261 | <item>\textup</item> | ||||
262 | <item>\textlf</item> | ||||
263 | <item>\textnormal</item> | ||||
264 | <item>\shortintertext</item> | ||||
265 | <item>\intertext</item> | ||||
266 | <item>\mbox</item> | ||||
267 | <item>\emph</item> | ||||
268 | </list> | ||||
269 | | ||||
270 | <list name="ResetHL"> | ||||
271 | <item>\KileResetHL</item> | ||||
272 | <item>\KateResetHL</item> | ||||
273 | </list> | ||||
274 | | ||||
5 | <contexts> | 275 | <contexts> | ||
6 | <!-- Normal text --> | 276 | <!-- Normal text --> | ||
7 | <context name="Normal Text" attribute="Normal Text" lineEndContext="#stay"> | 277 | <context name="Normal Text" attribute="Normal Text" lineEndContext="#stay"> | ||
8 | <RegExpr String="\\begin(?=[^a-zA-Z])" attribute="Structure" context="FindBeginEnvironment" beginRegion="block" /> | 278 | <DetectSpaces/> | ||
9 | <RegExpr String="\\end(?=[^a-zA-Z])" attribute="Structure" context="FindEndEnvironment" /> | 279 | <DetectIdentifier/> | ||
10 | <RegExpr String="\\(cite|citet|citep|parencite|autocite|Autocite|citetitle)\*(?=[^a-zA-Z])" attribute="Structure" context="Label"/> | 280 | <DetectChar char="\" attribute="Normal Text" context="LatexMacro" lookAhead="true"/> | ||
11 | <RegExpr String="\\(documentclass|includegraphics|include|usepackage|bibliography|bibliographystyle)(?=[^a-zA-Z])" attribute="Builtin Macro" context="FancyLabel"/> | 281 | <DetectChar char="$" attribute="Math" context="MathModeTex"/> | ||
12 | <RegExpr String="\\(cites|Cites|parencites|Parencites|autocites|Autocites|supercites|footcites|Footcites)(?=[^a-zA-Z])" attribute="Structure" context="FancyLabel"/> | 282 | <RegExpr String="<<.*>>=" attribute="Normal Text" context="NoWeb" column="0"/> | ||
13 | <RegExpr String="\\(cite|citet|citep|nocite|Cite|parencite|Parencite|footcite|Footcite|textcite|Textcite|supercite|autocite|Autocite|citeauthor|Citeauthor|citetitle|citeyear|citeurl|nocite|fullcite|footfullcite)(?=[^a-zA-Z])" attribute="Structure" context="Label"/> | 283 | <RegExpr String="%\s*(BEGIN|END)" attribute="Region Marker" context="RegionComment" firstNonSpace="true"/> | ||
14 | <RegExpr String="\\(subref\*?|cref\*?|label|pageref|autoref|ref|vpageref|vref|pagecite|eqref)(?=[^a-zA-Z])" attribute="Structure" context="Label"/> | | |||
15 | <RegExpr String="\\(part|chapter|section|subsection|subsubsection|paragraph|subparagraph)\*?\s*(?=[\{\[])" attribute="Structure" context="Sectioning"/> | | |||
16 | <RegExpr String="\\(input|hspace|hspace\*|vspace|vspace\*|rule|special|setlength|newboolean|setboolean|setcounter|geometry|textcolor|definecolor|column)(?=[^a-zA-Z])" attribute="Macro" context="SpecialCommand"/> | | |||
17 | <RegExpr String="\\(footnote)\*?\s*(?=[\{\[])" attribute="Macro" context="Footnoting"/> | | |||
18 | <RegExpr String="\\(renewcommand|providenewcommand|newcommand)\*?(?=[^a-zA-Z])" attribute="Macro" context="NewCommand"/> | | |||
19 | <RegExpr String="\\(e|g|x)?def(?=[^a-zA-Z])" attribute="Macro" context="DefCommand"/> | | |||
20 | <RegExpr String="<<.*>>=" attribute="Normal Text" context="NoWeb" /> | | |||
21 | <StringDetect String="\(" attribute="Math" context="MathMode" /> | | |||
22 | <StringDetect String="\[" attribute="Math" context="MathModeEquation" beginRegion="mathMode" /> | | |||
23 | <WordDetect String="\iffalse" attribute="Comment" context="Multiline Comment"/> | | |||
24 | <StringDetect String="\ensuremath{" attribute="Math" context="MathModeEnsure"/> | | |||
25 | <DetectChar char="\" attribute="Macro" context="ContrSeq"/> | | |||
26 | <StringDetect String="$$" attribute="Math" context="MathModeDisplay" beginRegion="mathMode" /> | | |||
27 | <DetectChar char="$" attribute="Math" context="MathMode" /> | | |||
28 | <RegExpr String="%\s*BEGIN.*$" attribute="Region Marker" context="#stay" beginRegion="regionMarker" firstNonSpace="true" /> | | |||
29 | <RegExpr String="%\s*END.*$" attribute="Region Marker" context="#stay" endRegion="regionMarker" firstNonSpace="true" /> | | |||
30 | <DetectChar char="%" attribute="Comment" context="Comment"/> | 284 | <DetectChar char="%" attribute="Comment" context="Comment"/> | ||
31 | <DetectChar char="×" attribute="Bullet" context="#stay"/> | 285 | <DetectChar char="•" attribute="Bullet" context="#stay"/> | ||
286 | </context> | ||||
287 | | ||||
288 | <context name="LatexMacro" attribute="Normal Text" lineEndContext="#pop"> | ||||
289 | <keyword String="beginEnv" attribute="Structure" context="#pop!FindBeginEnvironment" beginRegion="block"/> | ||||
290 | <keyword String="endEnv" attribute="Structure" context="#pop!FindEndEnvironment" endRegion="block"/> | ||||
291 | <keyword String="Label" attribute="Structure" context="#pop!Label"/> | ||||
292 | <keyword String="macroFancyLabel" attribute="Builtin Macro" context="#pop!FancyLabel"/> | ||||
293 | <keyword String="FancyLabel" attribute="Structure" context="#pop!FancyLabel"/> | ||||
294 | <keyword String="Sectioning" attribute="Structure" context="#pop!Sectioning"/> | ||||
295 | <keyword String="SpecialCommand" attribute="Macro" context="#pop!SpecialCommand"/> | ||||
296 | <keyword String="Footnoting" attribute="Macro" context="#pop!Footnoting"/> | ||||
297 | <keyword String="NewCommand" attribute="Macro" context="#pop!NewCommand"/> | ||||
298 | <keyword String="DefCommand" attribute="Macro" context="#pop!DefCommand"/> | ||||
299 | <Detect2Chars char="\" char1="(" attribute="Math" context="#pop!MathModeLatex"/> | ||||
300 | <Detect2Chars char="\" char1="[" attribute="Math" context="#pop!MathModeLatexEquation" beginRegion="mathMode"/> | ||||
301 | <keyword String="MathModeEnsure" attribute="Math" context="#pop!MathModeEnsure"/> | ||||
302 | <keyword String="iffalse" attribute="Comment" context="#pop!Multiline Comment"/> | ||||
303 | <DetectChar char="\" attribute="Macro" context="#pop!ContrSeq"/> | ||||
32 | </context> | 304 | </context> | ||
33 | 305 | | |||
34 | <!-- NoWeb --> | 306 | <!-- NoWeb --> | ||
35 | <context name="NoWeb" attribute="Normal Text" lineEndContext="#stay" > | 307 | <context name="NoWeb" attribute="Normal Text" lineEndContext="#stay"> | ||
36 | <RegExpr String="^\s*@\s*" attribute="Normal Text" context="#pop" /> | 308 | <RegExpr String="@\s*$" attribute="Normal Text" context="#pop" column="0"/> | ||
37 | </context> | 309 | </context> | ||
38 | 310 | | |||
39 | <!-- LaTeX sectioning commands --> | 311 | <!-- LaTeX sectioning commands --> | ||
40 | <context name="Sectioning" attribute="Normal Text" lineEndContext="#stay" fallthrough="true" fallthroughContext="#pop"> | 312 | <context name="Sectioning" attribute="Normal Text" lineEndContext="#stay" fallthrough="true" fallthroughContext="#pop"> | ||
41 | <RegExpr String="\[[^\]]*\]" attribute="Normal Text" context="#stay"/> | 313 | <DetectSpaces/> | ||
42 | <DetectChar char=" " attribute="Normal Text" context="#stay"/> | 314 | <RangeDetect char="[" char1="]" attribute="Normal Text" context="#stay"/> | ||
43 | <DetectChar char="{" attribute="Normal Text" context="SectioningInside"/> | 315 | <DetectChar char="{" attribute="Normal Text" context="SectioningInside"/> | ||
44 | <DetectChar char="}" attribute="Normal Text" context="#pop"/> | 316 | <DetectChar char="}" attribute="Normal Text" context="#pop"/> | ||
45 | <DetectChar char="%" attribute="Comment" context="Comment"/> | 317 | <DetectChar char="%" attribute="Comment" context="Comment"/> | ||
46 | </context> | 318 | </context> | ||
47 | <context name="SectioningInside" attribute="Sectioning Text" lineEndContext="#stay"> | 319 | <context name="SectioningInside" attribute="Sectioning Text" lineEndContext="#stay"> | ||
48 | <DetectChar char="{" attribute="Normal Text" context="SectioningInside"/> | 320 | <DetectChar char="{" attribute="Normal Text" context="SectioningInside"/> | ||
49 | <DetectChar char="}" attribute="Normal Text" context="#pop"/> | 321 | <DetectChar char="}" attribute="Normal Text" context="#pop"/> | ||
50 | <StringDetect String="\(" attribute="Sectioning Math" context="SectioningMathMode" /> | 322 | <Detect2Chars char="\" char1="(" attribute="Sectioning Math" context="SectioningMathMode" /> | ||
51 | <DetectChar char="\" attribute="Sectioning Macro" context="SectioningContrSeq"/> | 323 | <DetectChar char="\" attribute="Sectioning Macro" context="SectioningContrSeq"/> | ||
52 | <DetectChar char="$" attribute="Sectioning Math" context="SectioningMathMode" /> | 324 | <DetectChar char="$" attribute="Sectioning Math" context="SectioningMathMode" /> | ||
53 | <DetectChar char="%" attribute="Comment" context="Comment"/> | 325 | <DetectChar char="%" attribute="Comment" context="Comment"/> | ||
54 | <DetectChar char="×" attribute="Bullet" context="#stay"/> | 326 | <DetectChar char="•" attribute="Bullet" context="#stay"/> | ||
55 | </context> | 327 | </context> | ||
56 | <context name="SectioningContrSeq" attribute="Macro" lineEndContext="#pop"> | 328 | <context name="SectioningContrSeq" attribute="Macro" lineEndContext="#pop"> | ||
57 | <DetectChar char="×" attribute="Bullet" context="#stay"/> | | |||
58 | <RegExpr String="[a-zA-Z]+(\+?|\*{0,3})" attribute="Sectioning Macro" context="#pop"/> | 329 | <DetectChar char="•" attribute="Bullet" context="#stay"/> | ||
59 | <RegExpr String="[^a-zA-Z]" attribute="Sectioning Macro" context="#pop" /> | 330 | <RegExpr String="[a-zA-Z]+(\+?|\*{0,3})|." attribute="Sectioning Macro" context="#pop" /> | ||
60 | </context> | 331 | </context> | ||
61 | <context name="SectioningMathMode" attribute="Sectioning Math" lineEndContext="#stay"> | 332 | <context name="SectioningMathMode" attribute="Sectioning Math" lineEndContext="#stay"> | ||
62 | <StringDetect String="$$" attribute="Error" context="#stay" /> | 333 | <Detect2Chars char="$" char1="$" attribute="Error" context="#stay" /> | ||
63 | <DetectChar char="$" attribute="Sectioning Math" context="#pop" /> | 334 | <DetectChar char="$" attribute="Sectioning Math" context="#pop" /> | ||
64 | <Detect2Chars char="\" char1=")" attribute="Sectioning Math" context="#pop" /> | 335 | <Detect2Chars char="\" char1=")" attribute="Sectioning Math" context="#pop" /> | ||
65 | <Detect2Chars char="\" char1="]" attribute="Error" context="#stay" /> | 336 | <Detect2Chars char="\" char1="]" attribute="Error" context="#stay" /> | ||
66 | <DetectChar char="\" attribute="Sectioning Macro Mathmode" context="SectioningMathContrSeq"/> | 337 | <DetectChar char="\" attribute="Sectioning Macro Mathmode" context="SectioningMathContrSeq"/> | ||
67 | <DetectChar char="%" attribute="Comment" context="Comment"/> | 338 | <DetectChar char="%" attribute="Comment" context="Comment"/> | ||
68 | <DetectChar char="×" attribute="Bullet" context="#stay"/> | 339 | <DetectChar char="•" attribute="Bullet" context="#stay"/> | ||
69 | </context> | 340 | </context> | ||
70 | <context name="SectioningMathContrSeq" attribute="Sectioning Macro Mathmode" lineEndContext="#pop"> | 341 | <context name="SectioningMathContrSeq" attribute="Sectioning Macro Mathmode" lineEndContext="#pop"> | ||
71 | <DetectChar char="×" attribute="Bullet" context="#stay"/> | | |||
72 | <RegExpr String="[a-zA-Z]+\*?" attribute="Sectioning Macro Mathmode" context="#pop"/> | 342 | <DetectChar char="•" attribute="Bullet" context="#stay"/> | ||
73 | <RegExpr String="[^a-zA-Z]" attribute="Sectioning Macro Mathmode" context="#pop" /> | 343 | <RegExpr String="&envname;|." attribute="Sectioning Macro Mathmode" context="#pop" /> | ||
74 | </context> | 344 | </context> | ||
75 | 345 | | |||
76 | <!-- LaTeX Footnote commands --> | 346 | <!-- LaTeX Footnote commands --> | ||
77 | <context name="Footnoting" attribute="Normal Text" lineEndContext="#stay" fallthrough="true" fallthroughContext="#pop"> | 347 | <context name="Footnoting" attribute="Normal Text" lineEndContext="#stay" fallthrough="true" fallthroughContext="#pop"> | ||
78 | <RegExpr String="\[[^\]]*\]" attribute="Normal Text" context="#stay"/> | 348 | <DetectSpaces/> | ||
79 | <DetectChar char=" " attribute="Normal Text" context="#stay"/> | 349 | <RangeDetect char="[" char1="]" attribute="Normal Text" context="#stay"/> | ||
80 | <DetectChar char="{" attribute="Normal Text" context="FootnotingInside"/> | 350 | <DetectChar char="{" attribute="Normal Text" context="FootnotingInside"/> | ||
81 | <DetectChar char="}" attribute="Normal Text" context="#pop"/> | 351 | <DetectChar char="}" attribute="Normal Text" context="#pop"/> | ||
82 | <DetectChar char="%" attribute="Comment" context="Comment"/> | 352 | <DetectChar char="%" attribute="Comment" context="Comment"/> | ||
83 | </context> | 353 | </context> | ||
84 | <context name="FootnotingInside" attribute="Normal Text" lineEndContext="#stay"> | | |||
85 | <DetectChar char="{" attribute="Normal Text" context="FootnotingInside"/> | | |||
86 | <DetectChar char="}" attribute="Normal Text" context="#pop"/> | 354 | <context name="FootnotingInside" attribute="Normal Text" lineEndContext="#stay"> | ||
87 | <StringDetect String="\(" attribute="Math" context="FootnotingMathMode" /> | 355 | <DetectChar char="{" attribute="Normal Text" context="FootnotingInside"/> | ||
88 | <DetectChar char="$" attribute="Math" context="FootnotingMathMode" /> | | |||
89 | <IncludeRules context="Normal Text" /> | | |||
90 | </context> | | |||
91 | <context name="FootnotingMathMode" attribute="Math" lineEndContext="#stay"> | | |||
92 | <StringDetect String="$$" attribute="Error" context="#stay" /> | | |||
93 | <DetectChar char="$" attribute="Math" context="#pop" /> | | |||
94 | <Detect2Chars char="\" char1=")" attribute="Math" context="#pop" /> | | |||
95 | <Detect2Chars char="\" char1="]" attribute="Error" context="#stay" /> | 356 | <DetectChar char="}" attribute="Normal Text" context="#pop"/> | ||
96 | <IncludeRules context="MathMode" /> | 357 | <IncludeRules context="Normal Text"/> | ||
97 | </context> | 358 | </context> | ||
98 | 359 | | |||
360 | <!-- LaTeX commands \newcommand and \renewcommand --> | ||||
99 | <!-- LaTeX commands \newcommand and \renewcommand --> | 361 | <context name="NewCommand" attribute="Normal Text" lineEndContext="#stay" fallthrough="true" fallthroughContext="#pop"> | ||
100 | <context name="NewCommand" attribute="Normal Text" lineEndContext="#stay" fallthrough="true" fallthroughContext="#pop"> | 362 | <DetectSpaces/> | ||
101 | <RegExpr String="\s*\{\s*" attribute="Normal Text" context="LabelParameter"/> | 363 | <DetectChar char="{" attribute="Normal Text" context="LabelParameter"/> | ||
102 | <RegExpr String="\s*(\[\d\](\[[^\]]*\])?)?\{" attribute="Normal Text" context="LabelParameter"/> | 364 | <RegExpr String="(\[\d\](\[[^\]]*\])?)?\{" attribute="Normal Text" context="LabelParameter"/> | ||
103 | <DetectChar char="}" attribute="Error" context="#pop"/> | 365 | <DetectChar char="}" attribute="Error" context="#pop"/> | ||
366 | </context> | ||||
104 | </context> | 367 | | ||
105 | 368 | <!-- LaTeX command \def --> | |||
106 | <!-- LaTeX command \def --> | 369 | <context name="DefCommand" attribute="Normal Text" lineEndContext="#stay" fallthrough="true" fallthroughContext="#pop"> | ||
107 | <context name="DefCommand" attribute="Normal Text" lineEndContext="#stay" fallthrough="true" fallthroughContext="#pop"> | | |||
108 | <RegExpr String="\s*\\[a-zA-Z]+[^\{]*\{" attribute="Normal Text" context="CommandParameterStart"/> | | |||
109 | <DetectChar char="}" attribute="Error" context="#pop"/> | | |||
110 | </context> | | |||
111 | | ||||
112 | <!-- parse command argument --> | | |||
113 | <context name="CommandParameterStart" attribute="Normal Text" lineEndContext="#stay"> | 370 | <DetectSpaces/> | ||
114 | <DetectChar char="{" attribute="Normal Text" context="CommandParameter"/> | 371 | <RegExpr String="\\[a-zA-Z]+[^\{]*\{" attribute="Normal Text" context="#pop!CommandParameter"/> | ||
115 | <DetectChar char="}" attribute="Normal Text" context="#pop#pop"/> | 372 | <DetectChar char="}" attribute="Error" context="#pop"/> | ||
116 | <RegExpr String="\\." attribute="Normal Text" context="#stay" /> | 373 | </context> | ||
117 | <DetectChar char="%" attribute="Comment" context="Comment"/> | 374 | | ||
118 | </context> | 375 | <!-- parse command argument --> | ||
119 | <context name="CommandParameter" attribute="Normal Text" lineEndContext="#stay"> | 376 | <context name="CommandParameter" attribute="Normal Text" lineEndContext="#stay"> | ||
120 | <DetectChar char="{" attribute="Normal Text" context="CommandParameter"/> | 377 | <DetectChar char="{" attribute="Normal Text" context="CommandParameter"/> | ||
121 | <DetectChar char="}" attribute="Normal Text" context="#pop"/> | 378 | <DetectChar char="}" attribute="Normal Text" context="#pop"/> | ||
122 | <RegExpr String="\\." attribute="Normal Text" context="#stay" /> | 379 | <RegExpr String="\\." attribute="Normal Text" context="#stay"/> | ||
123 | <DetectChar char="%" attribute="Comment" context="Comment"/> | 380 | <DetectChar char="%" attribute="Comment" context="Comment"/> | ||
124 | </context> | 381 | </context> | ||
125 | 382 | | |||
126 | <!-- LaTeX command in text mode --> | | |||
127 | <context name="ContrSeq" attribute="Macro" lineEndContext="#pop"> | | |||
128 | <StringDetect String="verb*" attribute="Macro" context="Verb"/> | 383 | <!-- LaTeX command in text mode --> | ||
129 | <RegExpr String="(Verb|verb)(?=[^a-zA-Z])" attribute="Macro" context="Verb"/> | 384 | <context name="ContrSeq" attribute="Macro" lineEndContext="#pop"> | ||
130 | <RegExpr String="(lstinline)(?=[^a-zA-Z])" attribute="Macro" context="Lstinline"/> | 385 | <keyword String="Verb" attribute="Macro" context="Verb"/> | ||
131 | <RegExpr String="mint(?=[^a-zA-Z])" attribute="Macro" context="MintParam"/> | 386 | <keyword String="Lstinline" attribute="Macro" context="Lstinline"/> | ||
132 | <DetectChar char="×" attribute="Bullet" context="#stay"/> | 387 | <keyword String="MintParam" attribute="Macro" context="MintParam"/> | ||
133 | <RegExpr String="[a-zA-Z@]+(\+?|\*{0,3})" attribute="Macro" context="#pop"/> | 388 | <DetectChar char="•" attribute="Bullet" context="#stay"/> | ||
134 | <RegExpr String="[^a-zA-Z]" attribute="Macro" context="#pop" /> | 389 | <RegExpr String="[a-zA-Z@]+(\+?|\*{0,3})|." attribute="Macro" context="#pop" /> | ||
135 | </context> | 390 | </context> | ||
136 | 391 | | |||
137 | <!-- \mint command with parameter--> | 392 | <!-- \mint command with parameter--> | ||
138 | <context name="MintParam" attribute="Normal Text" lineEndContext="#stay"> | 393 | <context name="MintParam" attribute="Normal Text" lineEndContext="#stay"> | ||
139 | <Detect2Chars char="}" char1="[" attribute="Normal Text" context="#stay"/> | 394 | <Detect2Chars char="}" char1="[" attribute="Normal Text" context="#stay"/> | ||
140 | <DetectChar char="}" attribute="Normal Text" context="Verb"/> | 395 | <DetectChar char="}" attribute="Normal Text" context="Verb"/> | ||
141 | <DetectChar char="]" attribute="Normal Text" context="Verb"/> | 396 | <DetectChar char="]" attribute="Normal Text" context="Verb"/> | ||
142 | </context> | 397 | </context> | ||
143 | 398 | | |||
144 | <!-- verb command --> | 399 | <!-- verb command --> | ||
145 | <context name="Verb" attribute="Verbatim" lineEndContext="#pop#pop" > | 400 | <context name="Verb" attribute="Verbatim" lineEndContext="#pop#pop" > | ||
146 | <RegExpr String="(.)" attribute="Normal Text" dynamic="true" context="VerbEnd" /> | 401 | <RegExpr String="(.)" attribute="Normal Text" dynamic="true" context="VerbEnd" /> | ||
147 | </context> | 402 | </context> | ||
403 | <context name="VerbEnd" attribute="Verbatim" lineEndContext="#pop#pop#pop" dynamic="true" > | ||||
148 | <context name="VerbEnd" attribute="Verbatim" lineEndContext="#pop#pop#pop" dynamic="true" > | 404 | <StringDetect String="%1" attribute="Normal Text" context="#pop#pop#pop" dynamic="true" /> | ||
149 | <StringDetect String="%1" attribute="Normal Text" context="#pop#pop#pop" dynamic="true" /> | 405 | <DetectChar char="•" attribute="Bullet" context="#stay"/> | ||
150 | <DetectChar char="×" attribute="Bullet" context="#stay"/> | 406 | <RegExpr String="[^%1\xd7]*" attribute="Verbatim" context="#stay" dynamic="true" /> | ||
407 | </context> | ||||
151 | <RegExpr String="[^%1\xd7]*" attribute="Verbatim" context="#stay" dynamic="true" /> | 408 | | ||
152 | </context> | 409 | <!-- lstinline command, different from verb as it takes options --> | ||
153 | 410 | <context name="Lstinline" attribute="Verbatim" lineEndContext="#pop#pop" > | |||
154 | <!-- lstinline command, different from verb as it takes options --> | 411 | <DetectSpaces/> | ||
155 | <context name="Lstinline" attribute="Verbatim" lineEndContext="#pop#pop" > | 412 | <DetectChar char="[" attribute="Normal Text" context="FancyLabelOption"/> | ||
156 | <RegExpr String="\s*\[\s*" attribute="Normal Text" context="FancyLabelOption"/> | 413 | <DetectChar char="{" attribute="Normal Text" context="LstinlineParameter"/> | ||
414 | <RegExpr String="(.)" attribute="Normal Text" dynamic="true" context="LstinlineEnd" /> | ||||
157 | <RegExpr String="\s*\{\s*" attribute="Normal Text" context="LstinlineParameter"/> | 415 | </context> | ||
158 | <RegExpr String="(.)" attribute="Normal Text" dynamic="true" context="LstinlineEnd" /> | 416 | <context name="LstinlineEnd" attribute="Verbatim" lineEndContext="#pop#pop#pop" dynamic="true" > | ||
159 | </context> | 417 | <!-- TODO DetectChar segfault --> | ||
160 | <context name="LstinlineEnd" attribute="Verbatim" lineEndContext="#pop#pop#pop" dynamic="true" > | 418 | <StringDetect String="%1" attribute="Normal Text" context="#pop#pop#pop" dynamic="true" /> | ||
161 | <StringDetect String="%1" attribute="Normal Text" context="#pop#pop#pop" dynamic="true" /> | 419 | <DetectChar char="•" attribute="Bullet" context="#stay"/> | ||
162 | <DetectChar char="×" attribute="Bullet" context="#stay"/> | 420 | <RegExpr String="[^%1\xd7]*" attribute="Verbatim" context="#stay" dynamic="true" /> | ||
163 | <RegExpr String="[^%1\xd7]*" attribute="Verbatim" context="#stay" dynamic="true" /> | 421 | </context> | ||
164 | </context> | 422 | <context name="LstinlineParameter" attribute="Verbatim" lineEndContext="#stay"> | ||
165 | <context name="LstinlineParameter" attribute="Verbatim" lineEndContext="#stay"> | 423 | <DetectSpaces/> | ||
424 | <DetectChar char="}" attribute="Normal Text" context="#pop#pop#pop"/> | ||||
166 | <RegExpr String="\s*\}\s*" attribute="Normal Text" context="#pop#pop#pop"/> | 425 | </context> | ||
167 | </context> | 426 | | ||
168 | 427 | <!-- label --> | |||
169 | <!-- label --> | 428 | <context name="Label" attribute="Normal Text" lineEndContext="#stay"> | ||
170 | <context name="Label" attribute="Normal Text" lineEndContext="#stay"> | 429 | <DetectSpaces/> | ||
171 | <RegExpr String="\s*\{\s*" attribute="Normal Text" context="LabelParameter"/> | 430 | <DetectChar char="{" attribute="Normal Text" context="LabelParameter"/> | ||
172 | <RegExpr String="\s*\[\s*" attribute="Normal Text" context="LabelOption"/> | 431 | <DetectChar char="[" attribute="Normal Text" context="LabelOption"/> | ||
173 | <RegExpr String="[^\[\{]+" attribute="Error" context="#stay"/> | 432 | </context> | ||
174 | </context> | 433 | | ||
434 | <context name="LabelOption" attribute="Normal Text" lineEndContext="#stay"> | ||||
175 | 435 | <DetectSpaces/> | |||
176 | <context name="LabelOption" attribute="Normal Text" lineEndContext="#stay"> | 436 | <DetectChar char="(" attribute="Math" context="MathModeTex" /> | ||
177 | <StringDetect String="\(" attribute="Math" context="MathMode" /> | 437 | <DetectChar char="\" attribute="Macro" context="ContrSeq"/> | ||
178 | <DetectChar char="\" attribute="Macro" context="ContrSeq"/> | 438 | <DetectChar char="$" attribute="Math" context="MathModeTex" /> | ||
179 | <DetectChar char="$" attribute="Math" context="MathMode" /> | 439 | <DetectChar char="%" attribute="Comment" context="Comment"/> | ||
180 | <DetectChar char="%" attribute="Comment" context="Comment"/> | 440 | <DetectChar char="•" attribute="Bullet" context="#stay"/> | ||
441 | <DetectChar char="]" attribute="Normal Text" context="#pop"/> | ||||
181 | <DetectChar char="×" attribute="Bullet" context="#stay"/> | 442 | </context> | ||
182 | <RegExpr String="\s*\]\s*" attribute="Normal Text" context="#pop"/> | 443 | | ||
183 | </context> | 444 | <context name="LabelParameter" attribute="Reference" lineEndContext="#stay"> | ||
445 | <DetectSpaces/> | ||||
184 | 446 | <DetectChar char="•" attribute="Bullet" context="#stay"/> | |||
185 | <context name="LabelParameter" attribute="Environment" lineEndContext="#stay"> | 447 | <DetectChar char="}" attribute="Normal Text" context="#pop#pop"/> | ||
186 | <DetectChar char="×" attribute="Bullet" context="#stay"/> | 448 | </context> | ||
187 | <RegExpr String="\s*\}\s*" attribute="Normal Text" context="#pop#pop"/> | 449 | | ||
188 | </context> | 450 | <!-- labels from biblatex commands --> | ||
189 | 451 | <context name="FancyLabel" attribute="Normal Text" lineEndContext="#stay" fallthrough="true" fallthroughContext="#pop"> | |||
190 | <!-- labels from biblatex commands --> | 452 | <DetectSpaces/> | ||
191 | <context name="FancyLabel" attribute="Normal Text" lineEndContext="#stay" fallthrough="true" fallthroughContext="#pop"> | 453 | <DetectChar char="{" attribute="Normal Text" context="FancyLabelParameter"/> | ||
192 | <RegExpr String="\s*\{\s*" attribute="Normal Text" context="FancyLabelParameter"/> | | |||
193 | <RegExpr String="\s*\[\s*" attribute="Normal Text" context="FancyLabelOption"/> | | |||
194 | <RegExpr String="\s*\(\s*" attribute="Normal Text" context="FancyLabelRoundBrackets"/> | | |||
195 | </context> | | |||
196 | | ||||
197 | <context name="FancyLabelParameter" attribute="Environment" lineEndContext="#stay"> | 454 | <DetectChar char="[" attribute="Normal Text" context="FancyLabelOption"/> | ||
198 | <StringDetect String="\(" attribute="Math" context="MathMode" /> | 455 | <DetectChar char="(" attribute="Normal Text" context="FancyLabelRoundBrackets"/> | ||
199 | <DetectChar char="\" attribute="Macro" context="ContrSeq"/> | 456 | </context> | ||
457 | | ||||
200 | <DetectChar char="$" attribute="Math" context="MathMode" /> | 458 | <context name="FancyLabelParameter" attribute="Environment" lineEndContext="#stay"> | ||
201 | <DetectChar char="%" attribute="Comment" context="Comment"/> | 459 | <DetectSpaces/> | ||
202 | <DetectChar char="×" attribute="Bullet" context="#stay"/> | 460 | <DetectChar char="(" attribute="Math" context="MathModeTex" /> | ||
203 | <RegExpr String="\s*\}\s*" attribute="Normal Text" context="#pop"/> | 461 | <DetectChar char="\" attribute="Macro" context="ContrSeq"/> | ||
204 | </context> | 462 | <DetectChar char="$" attribute="Math" context="MathModeTex" /> | ||
205 | 463 | <DetectChar char="%" attribute="Comment" context="Comment"/> | |||
206 | <context name="FancyLabelOption" attribute="Option Text" lineEndContext="#stay"> | 464 | <DetectChar char="•" attribute="Bullet" context="#stay"/> | ||
207 | <StringDetect String="\(" attribute="Math" context="MathMode" /> | 465 | <DetectChar char="}" attribute="Normal Text" context="#pop"/> | ||
208 | <DetectChar char="\" attribute="Macro" context="ContrSeq"/> | 466 | </context> | ||
467 | | ||||
209 | <DetectChar char="$" attribute="Math" context="MathMode" /> | 468 | <context name="FancyLabelOption" attribute="Option Text" lineEndContext="#stay"> | ||
210 | <DetectChar char="%" attribute="Comment" context="Comment"/> | 469 | <IncludeRules context="LabelOption"/> | ||
211 | <DetectChar char="×" attribute="Bullet" context="#stay"/> | 470 | </context> | ||
471 | | ||||
212 | <RegExpr String="\s*\]\s*" attribute="Normal Text" context="#pop"/> | 472 | <context name="FancyLabelRoundBrackets" attribute="Normal Text" lineEndContext="#stay"> | ||
213 | </context> | 473 | <DetectSpaces/> | ||
214 | 474 | <Detect2Chars char="\" char1="(" attribute="Math" context="MathModeLatex" /> | |||
215 | <context name="FancyLabelRoundBrackets" attribute="Normal Text" lineEndContext="#stay"> | 475 | <DetectChar char="\" attribute="Macro" context="ContrSeq"/> | ||
216 | <StringDetect String="\(" attribute="Math" context="MathMode" /> | 476 | <DetectChar char="$" attribute="Math" context="MathModeTex" /> | ||
217 | <DetectChar char="\" attribute="Macro" context="ContrSeq"/> | 477 | <DetectChar char="%" attribute="Comment" context="Comment"/> | ||
218 | <DetectChar char="$" attribute="Math" context="MathMode" /> | 478 | <DetectChar char="•" attribute="Bullet" context="#stay"/> | ||
219 | <DetectChar char="%" attribute="Comment" context="Comment"/> | 479 | <DetectChar char=")" attribute="Normal Text" context="#pop"/> | ||
220 | <DetectChar char="×" attribute="Bullet" context="#stay"/> | 480 | </context> | ||
221 | <RegExpr String="\s*\)\s*" attribute="Normal Text" context="#pop"/> | 481 | | ||
222 | </context> | 482 | <!-- Special commands --> | ||
223 | 483 | <context name="SpecialCommand" attribute="Normal Text" lineEndContext="#stay" fallthrough="true" fallthroughContext="#pop"> | |||
224 | <!-- Special commands --> | 484 | <DetectSpaces/> | ||
225 | <context name="SpecialCommand" attribute="Normal Text" lineEndContext="#stay" fallthrough="true" fallthroughContext="#pop"> | 485 | <DetectChar char="{" attribute="Normal Text" context="SpecialCommandParameterOption"/> | ||
226 | <RegExpr String="\s*\{\s*" attribute="Normal Text" context="SpecialCommandParameterOption"/> | | |||
227 | </context> | 486 | </context> | ||
228 | 487 | | |||
229 | <context name="SpecialCommandParameterOption" attribute="Option Text" lineEndContext="#stay"> | 488 | <context name="SpecialCommandParameterOption" attribute="Option Text" lineEndContext="#stay"> | ||
230 | <StringDetect String="\(" attribute="Math" context="MathMode" /> | 489 | <DetectSpaces/> | ||
231 | <DetectChar char="\" attribute="Macro" context="ContrSeq"/> | | |||
232 | <DetectChar char="$" attribute="Math" context="MathMode" /> | | |||
233 | <DetectChar char="%" attribute="Comment" context="Comment"/> | 490 | <Detect2Chars char="\" char1="(" attribute="Math" context="MathModeTex" /> | ||
234 | <DetectChar char="×" attribute="Bullet" context="#stay"/> | 491 | <DetectChar char="\" attribute="Macro" context="ContrSeq"/> | ||
235 | <RegExpr String="\s*\}\s*" attribute="Normal Text" context="#pop"/> | 492 | <DetectChar char="$" attribute="Math" context="MathModeTex" /> | ||
493 | <DetectChar char="%" attribute="Comment" context="Comment"/> | ||||
236 | </context> | 494 | <DetectChar char="•" attribute="Bullet" context="#stay"/> | ||
237 | 495 | <DetectChar char="}" attribute="Normal Text" context="#pop"/> | |||
238 | <!-- end of an environment --> | 496 | </context> | ||
239 | <context name="FindEndEnvironment" attribute="Normal Text" lineEndContext="#stay"> | 497 | | ||
240 | <DetectChar char="{" attribute="Normal Text" context="EndEnvironment"/> | 498 | <!-- end of an environment --> | ||
241 | <RegExpr String="\S" attribute="Normal Text" context="#pop"/> | 499 | <context name="FindEndEnvironment" attribute="Normal Text" lineEndContext="#stay"> | ||
242 | </context> | 500 | <DetectChar char="{" attribute="Normal Text" context="EndEnvironment"/> | ||
243 | 501 | <RegExpr String="\S" attribute="Normal Text" context="#pop"/> | |||
244 | <context name="EndEnvironment" attribute="Environment" lineEndContext="#stay"> | 502 | </context> | ||
245 | <RegExpr String="[a-zA-Z]" attribute="Environment" context="EndLatexEnv"/> | 503 | | ||
246 | <RegExpr String="\s+" attribute="Error" context="#pop"/> | 504 | <context name="EndEnvironment" attribute="Environment" lineEndContext="#stay"> | ||
247 | <RegExpr String="[^a-zA-Z]" attribute="Error" context="#pop"/> | 505 | <RegExpr String="&envname;" attribute="Environment" context="LatexEnvEnd"/> | ||
248 | </context> | 506 | <RegExpr String="." attribute="Error" context="#pop#pop"/> | ||
249 | 507 | </context> | |||
250 | <context name="EndLatexEnv" attribute="Environment" lineEndContext="#stay"> | 508 | | ||
251 | <DetectChar char="}" attribute="Normal Text" endRegion="block" context="#pop#pop#pop"/> | | |||
252 | <RegExpr String="[a-zA-Z]+(\*)?" attribute="Environment" context="#stay"/> | | |||
253 | <RegExpr String="\s+" attribute="Error" context="#stay"/> | 509 | <context name="LatexEnvEnd" attribute="Environment" lineEndContext="#stay"> | ||
254 | <RegExpr String="[a-zA-Z]" attribute="Error" context="#pop#pop#pop"/> | 510 | <DetectChar char="}" attribute="Normal Text" endRegion="block" context="#pop#pop#pop"/> | ||
255 | </context> | 511 | <RegExpr String="[^}]*" attribute="Error" context="#stay"/> | ||
256 | 512 | </context> | |||
257 | <!-- start of an environment --> | 513 | | ||
258 | <context name="FindBeginEnvironment" attribute="Normal Text" lineEndContext="#stay"> | 514 | <!-- start of an environment --> | ||
259 | <DetectChar char="{" attribute="Normal Text" context="BeginEnvironment"/> | 515 | <context name="FindBeginEnvironment" attribute="Normal Text" lineEndContext="#stay"> | ||
516 | <DetectSpaces/> | ||||
517 | <DetectChar char="{" attribute="Normal Text" context="BeginEnvironment"/> | ||||
518 | <RegExpr String="." attribute="Normal Text" context="#pop"/> | ||||
519 | </context> | ||||
520 | | ||||
521 | <!-- filter the environment name and check the type --> | ||||
522 | <context name="BeginEnvironment" attribute="Environment" lineEndContext="#stay"> | ||||
523 | <keyword String="ListingsEnv" attribute="Environment" context="ListingsEnv"/> | ||||
524 | <keyword String="MintedEnv" attribute="Environment" context="MintedEnv"/> | ||||
525 | <keyword String="VerbatimEnv" attribute="Environment" context="VerbatimEnv" lookAhead="true"/> | ||||
526 | <keyword String="CommentEnv" attribute="Environment" context="CommentEnv"/> | ||||
260 | <RegExpr String="\S" attribute="Normal Text" context="#pop"/> | 527 | <keyword String="MathEnvParam" attribute="Environment" context="MathEnvWithParam"/> | ||
261 | </context> | 528 | <keyword String="MathEnv" attribute="Environment" context="MathEnv"/> | ||
262 | 529 | <keyword String="TabEnv" attribute="Environment" context="TabEnv"/> | |||
263 | <!-- filter the environment name and check the type --> | 530 | <DetectChar char="•" attribute="Bullet" context="#stay"/> | ||
264 | <context name="BeginEnvironment" attribute="Environment" lineEndContext="#stay"> | 531 | <RegExpr String="&envname;" attribute="Environment" context="LatexEnv"/> | ||
265 | <WordDetect String="lstlisting" attribute="Environment" context="ListingsEnvParam"/> | 532 | <RegExpr String="." attribute="Error" context="#pop"/> | ||
533 | </context> | ||||
534 | | ||||
535 | <!-- environment type 1: normal --> | ||||
536 | <context name="LatexEnv" attribute="Error" lineEndContext="#stay"> | ||||
537 | <DetectChar char="}" attribute="Normal Text" context="#pop#pop#pop"/> | ||||
538 | </context> | ||||
539 | | ||||
540 | <context name="VerbatimEnv" attribute="Environment" lineEndContext="#stay"> | ||||
541 | <WordDetect String="verbatim*" attribute="Environment" context="VerbatimEnv1"/> | ||||
542 | <WordDetect String="verbatim" attribute="Environment" context="VerbatimEnv1"/> | ||||
543 | <WordDetect String="boxedverbatim*" attribute="Environment" context="VerbatimEnv2"/> | ||||
544 | <WordDetect String="boxedverbatim" attribute="Environment" context="VerbatimEnv2"/> | ||||
545 | | ||||
546 | <WordDetect String="Verbatim*" attribute="Environment" context="VerbatimEnv3"/> | ||||
266 | <WordDetect String="minted" attribute="Environment" context="MintedEnvParam"/> | 547 | <WordDetect String="Verbatim" attribute="Environment" context="VerbatimEnv3"/> | ||
267 | <RegExpr String="((B|L)?Verbatim)" attribute="Environment" context="VerbatimEnvParam"/> | 548 | <WordDetect String="BVerbatim*" attribute="Environment" context="VerbatimEnv4"/> | ||
268 | <RegExpr String="(verbatim|boxedverbatim)" attribute="Environment" context="VerbatimEnv"/> | 549 | <WordDetect String="BVerbatim" attribute="Environment" context="VerbatimEnv4"/> | ||
269 | <RegExpr String="comment" attribute="Environment" context="CommentEnv"/> | 550 | <WordDetect String="LVerbatim*" attribute="Environment" context="VerbatimEnv5"/> | ||
270 | <RegExpr String="(alignat|xalignat|xxalignat)" attribute="Environment" context="MathEnvParam"/> | 551 | <WordDetect String="LVerbatim" attribute="Environment" context="VerbatimEnv5"/> | ||
271 | <RegExpr String="(equation|displaymath|eqnarray|subeqnarray|math|multline|gather|align|flalign|IEEEeqnarray|IEEEeqnarraybox|smallmatrix|pmatrix|bmatrix|Bmatrix|vmatrix|Vmatrix|cases)" attribute="Environment" context="MathEnv"/> | 552 | </context> | ||
553 | | ||||
554 | <!-- environment type 2: verbatim without parameter --> | ||||
555 | <context name="VerbatimEnv1" attribute="Error" lineEndContext="#stay" fallthrough="true" fallthroughContext="#pop#pop#pop#pop"> | ||||
556 | <DetectChar char="}" attribute="Normal Text" context="Verbatim1"/> | ||||
557 | </context> | ||||
558 | <context name="Verbatim1" attribute="Verbatim" lineEndContext="#stay"> | ||||
559 | <DetectSpaces/> | ||||
560 | <DetectIdentifier/> | ||||
561 | <DetectChar char="•" attribute="Bullet" context="#stay"/> | ||||
562 | <RegExpr String="\\end(?=\s*\{verbatim\*?\})" attribute="Structure" context="VerbFindEnd"/> | ||||
563 | </context> | ||||
564 | | ||||
565 | <context name="VerbatimEnv2" attribute="Error" lineEndContext="#stay" fallthrough="true" fallthroughContext="#pop#pop#pop#pop"> | ||||
566 | <DetectChar char="}" attribute="Normal Text" context="Verbatim2"/> | ||||
567 | </context> | ||||
568 | <context name="Verbatim2" attribute="Verbatim" lineEndContext="#stay"> | ||||
569 | <DetectSpaces/> | ||||
570 | <DetectIdentifier/> | ||||
571 | <DetectChar char="•" attribute="Bullet" context="#stay"/> | ||||
572 | <RegExpr String="\\end(?=\s*\{boxedverbatim\*?\})" attribute="Structure" context="VerbFindEnd"/> | ||||
573 | </context> | ||||
574 | | ||||
575 | <!-- environment type 3: verbatim with optional parameter --> | ||||
576 | <context name="VerbatimEnv3" attribute="Error" lineEndContext="#stay" fallthrough="true" fallthroughContext="#pop#pop#pop#pop"> | ||||
577 | <DetectChar char="}" attribute="Normal Text" context="VerbatimEnv3Param"/> | ||||
578 | </context> | ||||
579 | <context name="VerbatimEnv3Param" attribute="Normal Text" lineEndContext="#stay" fallthrough="true" fallthroughContext="#pop!Verbatim3"> | ||||
580 | <DetectSpaces/> | ||||
581 | <RangeDetect char="[" char1="]" attribute="Normal Text" context="#pop!Verbatim3"/> | ||||
582 | </context> | ||||
583 | <context name="Verbatim3" attribute="Verbatim" lineEndContext="#stay"> | ||||
584 | <DetectSpaces/> | ||||
585 | <DetectIdentifier/> | ||||
586 | <DetectChar char="•" attribute="Bullet" context="#stay"/> | ||||
587 | <RegExpr String="\\end(?=\s*\{Verbatim\*?\})" attribute="Structure" context="VerbFindEnd"/> | ||||
588 | </context> | ||||
272 | <RegExpr String="(tabularx|tabular|supertabular|mpsupertabular|xtabular|mpxtabular|longtable)" attribute="Environment" context="TabEnv"/> | 589 | | ||
273 | <DetectChar char="×" attribute="Bullet" context="#stay"/> | 590 | <context name="VerbatimEnv4" attribute="Error" lineEndContext="#stay" fallthrough="true" fallthroughContext="#pop#pop#pop#pop"> | ||
274 | <RegExpr String="[a-zA-Z]" attribute="Environment" context="LatexEnv"/> | 591 | <DetectChar char="}" attribute="Normal Text" context="VerbatimEnv4Param"/> | ||
275 | <RegExpr String="\s+" attribute="Error" context="#pop"/> | 592 | </context> | ||
276 | <RegExpr String="[^a-zA-Z\xd7]" attribute="Error" context="#pop"/> | 593 | <context name="VerbatimEnv4Param" attribute="Normal Text" lineEndContext="#stay" fallthrough="true" fallthroughContext="#pop!Verbatim4"> | ||
277 | </context> | 594 | <DetectSpaces/> | ||
278 | 595 | <RangeDetect char="[" char1="]" attribute="Normal Text" context="#pop!Verbatim4"/> | |||
596 | </context> | ||||
597 | <context name="Verbatim4" attribute="Verbatim" lineEndContext="#stay"> | ||||
598 | <DetectSpaces/> | ||||
599 | <DetectIdentifier/> | ||||
600 | <DetectChar char="•" attribute="Bullet" context="#stay"/> | ||||
601 | <RegExpr String="\\end(?=\s*\{BVerbatim\*?\})" attribute="Structure" context="VerbFindEnd"/> | ||||
602 | </context> | ||||
603 | | ||||
604 | <context name="VerbatimEnv5" attribute="Error" lineEndContext="#stay" fallthrough="true" fallthroughContext="#pop#pop#pop#pop"> | ||||
605 | <DetectChar char="}" attribute="Normal Text" context="VerbatimEnv5Param"/> | ||||
606 | </context> | ||||
607 | <context name="VerbatimEnv5Param" attribute="Normal Text" lineEndContext="#stay" fallthrough="true" fallthroughContext="#pop!Verbatim5"> | ||||
608 | <DetectSpaces/> | ||||
279 | <!-- environment type 1: normal --> | 609 | <RangeDetect char="[" char1="]" attribute="Normal Text" context="#pop!Verbatim5"/> | ||
280 | <context name="LatexEnv" attribute="Environment" lineEndContext="#stay"> | 610 | </context> | ||
611 | <context name="Verbatim5" attribute="Verbatim" lineEndContext="#stay"> | ||||
612 | <DetectSpaces/> | ||||
613 | <DetectIdentifier/> | ||||
614 | <DetectChar char="•" attribute="Bullet" context="#stay"/> | ||||
281 | <DetectChar char="}" attribute="Normal Text" context="#pop#pop#pop"/> | 615 | <RegExpr String="\\end(?=\s*\{LVerbatim\*?\})" attribute="Structure" context="VerbFindEnd"/> | ||
282 | <RegExpr String="[a-zA-Z]+" attribute="Environment" context="#stay"/> | 616 | </context> | ||
283 | <RegExpr String="\s+" attribute="Error" context="#stay"/> | 617 | | ||
284 | <IncludeRules context="EnvCommon" /> | 618 | <!-- environment type 4: listings environment with optional parameter and HL switching--> | ||
285 | </context> | 619 | <context name="ListingsEnv" attribute="Environment" lineEndContext="#stay"> | ||
620 | <DetectChar char="}" attribute="Normal Text" context="#pop!ListingsEnvParam"/> | ||||
621 | <RegExpr String="[^}]*" attribute="Error" context="#stay"/> | ||||
622 | </context> | ||||
623 | <context name="ListingsEnvParam" attribute="Normal Text" lineEndContext="#pop!UnknownHighlighting" fallthrough="true" fallthroughContext="#pop!UnknownHighlighting"> | ||||
624 | <DetectSpaces/> | ||||
625 | <DetectChar char="[" attribute="Normal Text" context="#pop!ListingsEnvParamInside"/> | ||||
626 | <DetectChar char="%" attribute="Comment" context="Comment"/> | ||||
286 | 627 | </context> | |||
628 | <context name="ListingsEnvParamInside" attribute="Normal Text" lineEndContext="#stay"> | ||||
629 | <DetectIdentifier/> | ||||
630 | <RegExpr String="\s*language\s*=\s*(?=[^],])" attribute="Normal Text" context="HighlightingSelector"/> | ||||
631 | <DetectChar char="]" attribute="Normal Text" context="ListingsEnvParamEnd"/> | ||||
632 | <DetectChar char="%" attribute="Comment" context="Comment"/> | ||||
633 | </context> | ||||
634 | <context name="ListingsEnvParamEnd" attribute="Normal Text" lineEndContext="#pop#pop!UnknownHighlighting" fallthrough="true" fallthroughContext="#pop#pop!UnknownHighlighting"> | ||||
635 | <DetectSpaces/> | ||||
636 | <DetectChar char="%" attribute="Comment" context="Comment"/> | ||||
637 | </context> | ||||
638 | | ||||
639 | <!-- environment type 5: minted environment with optional and HL switching --> | ||||
640 | <context name="MintedEnv" attribute="Environment" lineEndContext="#stay"> | ||||
641 | <DetectChar char="}" attribute="Normal Text" context="#pop!MintedEnvParam"/> | ||||
642 | <RegExpr String="[^}]*" attribute="Error" context="#stay"/> | ||||
643 | </context> | ||||
644 | <context name="MintedEnvParam" attribute="Normal Text" lineEndContext="#stay"> | ||||
645 | <DetectSpaces/> | ||||
646 | <DetectChar char="[" attribute="Normal Text" context="#pop!MintedEnvParamInside"/> | ||||
647 | <DetectChar char="{" attribute="Normal Text" context="HighlightingSelector"/> | ||||
287 | <!-- environment type 2: verbatim without parameter --> | 648 | <DetectChar char="%" attribute="Comment" context="Comment"/> | ||
288 | <context name="VerbatimEnv" attribute="Environment" lineEndContext="#stay" fallthrough="true" fallthroughContext="#pop#pop#pop"> | 649 | </context> | ||
289 | <DetectChar char="}" attribute="Normal Text" context="Verbatim"/> | 650 | <context name="MintedEnvParamInside" attribute="Normal Text" lineEndContext="#stay"> | ||
290 | <RegExpr String="[a-zA-Z]" attribute="Environment" lookAhead="true" context="#pop"/> | 651 | <DetectSpaces/> | ||
291 | <IncludeRules context="EnvCommon" /> | 652 | <DetectIdentifier/> | ||
653 | <DetectChar char="]" attribute="Normal Text" context="#pop!MintedEnvLang"/> | ||||
654 | <DetectChar char="%" attribute="Comment" context="Comment"/> | ||||
292 | </context> | 655 | <RegExpr String="\\&envname;" attribute="Macro" context="#stay"/> | ||
293 | 656 | </context> | |||
294 | <!-- environment type 3: verbatim with optional parameter --> | 657 | <context name="MintedEnvLang" attribute="Normal Text" lineEndContext="#stay"> | ||
295 | <context name="VerbatimEnvParam" attribute="Normal Text" lineEndContext="#stay"> | 658 | <DetectSpaces/> | ||
296 | <Detect2Chars char="}" char1="[" attribute="Normal Text" context="#stay" /> | 659 | <DetectChar char="{" attribute="Normal Text" context="HighlightingSelector"/> | ||
660 | <DetectChar char="%" attribute="Comment" context="Comment"/> | ||||
661 | </context> | ||||
297 | <DetectChar char="}" attribute="Normal Text" context="Verbatim"/> | 662 | | ||
298 | <DetectChar char="]" attribute="Normal Text" context="Verbatim"/> | 663 | <!-- parse verbatim text for lstinline and minted --> | ||
299 | </context> | 664 | <context name="UnknownHighlighting" attribute="Verbatim" lineEndContext="#stay"> | ||
300 | 665 | <DetectSpaces/> | |||
301 | <!-- environment type 4: listings environment with optional parameter and HL switching--> | 666 | <DetectIdentifier/> | ||
302 | <context name="ListingsEnvParam" attribute="Normal Text" fallthrough="true" fallthroughContext="Verbatim" lineEndContext="#stay"> | 667 | <DetectChar char="•" attribute="Bullet" context="#stay"/> | ||
303 | <Detect2Chars char="}" char1="[" attribute="Normal Text" context="#stay" /> | 668 | <RegExpr String="\\end(?=\s*\{(lstlisting|minted)\*?\})" attribute="Structure" context="UnknownHighlightingEnd"/> | ||
304 | <RegExpr String="language\s*=\s*(?=[^,]+)" minimal="true" attribute="Normal Text" context="HighlightningSelector"/> | 669 | </context> | ||
305 | <DetectChar char="}" attribute="Normal Text" context="Verbatim"/> | 670 | <context name="UnknownHighlightingEnd" attribute="Environment" lineEndContext="#stay"> | ||
671 | <DetectSpaces/> | ||||
672 | <DetectChar char="{" attribute="Normal Text" context="#stay"/> | ||||
306 | <DetectChar char="]" attribute="Normal Text" context="Verbatim"/> | 673 | <DetectChar char="}" attribute="Normal Text" context="#pop#pop#pop#pop#pop#pop#pop" endRegion="block"/> | ||
307 | </context> | 674 | <DetectIdentifier/> | ||
308 | 675 | </context> | |||
309 | <!-- environment type 5: minted environment with optional and HL switching --> | 676 | | ||
310 | <context name="MintedEnvParam" attribute="Normal Text" lineEndContext="#stay"> | 677 | | ||
311 | <Detect2Chars char="}" char1="[" attribute="Normal Text" context="#stay" /> | | |||
312 | <Detect2Chars char="}" char1="{" attribute="Normal Text" context="HighlightningSelector"/> | | |||
313 | <Detect2Chars char="]" char1="{" attribute="Normal Text" context="HighlightningSelector"/> | | |||
314 | <DetectChar char="}" attribute="Normal Text" context="Verbatim"/> | | |||
315 | </context> | | |||
316 | | ||||
317 | <!-- Selector for different highlightning schemes, in case the language is not implemented we pop and thus fallback to verbatim --> | 678 | <!-- Selector for different highlightning schemes, in case the language is not implemented we pop and thus fallback to verbatim --> | ||
318 | <context name="HighlightningSelector" attribute="Normal Text" lineEndContext="#stay"> | 679 | <context name="HighlightingSelector" attribute="Normal Text" lineEndContext="#stay"> | ||
319 | <WordDetect String="C++" insensitive="true" context="HighlightningBeginC++"/> | 680 | <WordDetect String="C++" insensitive="true" context="HighlightingBeginC++"/> | ||
320 | <WordDetect String="Python" insensitive="true" context="HighlightningBeginPython"/> | 681 | <WordDetect String="Python" insensitive="true" context="HighlightingBeginPython"/> | ||
321 | <RegExpr String=".*(?=\}|\])" context="#pop"/> | 682 | <DetectChar char="}" context="#pop!UnknownHighlighting"/> | ||
683 | <DetectChar char="]" context="#pop!UnknownHighlighting"/> | ||||
322 | </context> | 684 | <RegExpr String="[^]}]*" context="#stay"/> | ||
323 | 685 | </context> | |||
324 | <context name="HighlightningCommon" attribute="Normal Text" lineEndContext="#stay"> | 686 | | ||
325 | <RegExpr String="\\end\s*\{(lstlisting|minted)\*?\}" attribute="Structure" lookAhead="true" context="#pop#pop#pop#pop#pop#pop"/> | 687 | <context name="HighlightingCommon" attribute="Normal Text" lineEndContext="#stay"> | ||
326 | </context> | 688 | <RegExpr String="\\end\s*\{(lstlisting|minted)\*?\}" attribute="Structure" lookAhead="true" context="#pop#pop#pop#pop#pop#pop"/> | ||
327 | | ||||
328 | <context name="HighlightningBeginC++" attribute="Normal Text" lineEndContext="#stay"> | 689 | </context> | ||
329 | <!-- Eat the trailing characters including } or ] after the language specification --> | 690 | | ||
330 | <RegExpr String=".*(\}|\])" context="HighlightningC++"/> | 691 | <context name="HighlightingBeginC++" attribute="Normal Text" lineEndContext="#stay"> | ||
331 | </context> | 692 | <DetectChar char="}" context="HighlightingC++"/> | ||
693 | <DetectChar char="]" context="HighlightingC++"/> | ||||
332 | 694 | <!-- Eat the trailing characters including } or ] after the language specification --> | |||
333 | <context name="HighlightningC++" attribute="Normal Text" lineEndContext="#stay"> | 695 | <RegExpr String="[^]}]*" context="#stay"/> | ||
334 | <IncludeRules context="HighlightningCommon"/> | 696 | </context> | ||
335 | <IncludeRules context="##C++" includeAttrib="true"/> | 697 | | ||
336 | </context> | 698 | <context name="HighlightingC++" attribute="Normal Text" lineEndContext="#stay"> | ||
337 | 699 | <IncludeRules context="HighlightingCommon"/> | |||
338 | <context name="HighlightningBeginPython" attribute="Normal Text" lineEndContext="#stay"> | 700 | <IncludeRules context="##C++" includeAttrib="true"/> | ||
701 | </context> | ||||
339 | <RegExpr String=".*(\}|\])" context="HighlightningPython"/> | 702 | | ||
340 | </context> | 703 | <context name="HighlightingBeginPython" attribute="Normal Text" lineEndContext="#stay"> | ||
341 | 704 | <DetectChar char="}" context="HighlightingPython"/> | |||
342 | <context name="HighlightningPython" attribute="Normal Text" lineEndContext="#stay"> | 705 | <DetectChar char="]" context="HighlightingPython"/> | ||
343 | <IncludeRules context="HighlightningCommon"/> | 706 | <RegExpr String="[^]}]*" context="#stay"/> | ||
344 | <IncludeRules context="##Python"/> | | |||
345 | </context> | 707 | </context> | ||
346 | 708 | | |||
347 | <!-- parse verbatim text --> | 709 | <context name="HighlightingPython" attribute="Normal Text" lineEndContext="#stay"> | ||
348 | <context name="Verbatim" attribute="Verbatim" lineEndContext="#stay"> | 710 | <IncludeRules context="HighlightingCommon"/> | ||
349 | <DetectChar char="×" attribute="Bullet" context="#stay"/> | 711 | <IncludeRules context="##Python"/> | ||
350 | <RegExpr String="\\end(?=\s*\{(verbatim|lstlisting|boxedverbatim|(B|L)?Verbatim|minted)\*?\})" attribute="Structure" context="VerbFindEnd"/> | 712 | </context> | ||
351 | </context> | 713 | | ||
352 | 714 | <!-- end of verbatim environment --> | |||
353 | <!-- end of verbatim environment --> | 715 | <context name="VerbFindEnd" attribute="Normal Text" lineEndContext="#pop" fallthrough="true" fallthroughContext="#pop"> | ||
354 | <context name="VerbFindEnd" attribute="Normal Text" lineEndContext="#pop" fallthrough="true" fallthroughContext="#pop"> | 716 | <DetectSpaces/> | ||
355 | <RegExpr String="\s*\{" attribute="Normal Text" context="#stay"/> | 717 | <DetectChar char="{" attribute="Normal Text" context="#stay"/> | ||
356 | <RegExpr String="(verbatim|lstlisting|boxedverbatim|(B|L)?Verbatim|minted)\*?" attribute="Environment" context="#stay"/> | 718 | <DetectChar char="}" attribute="Normal Text" context="#pop#pop#pop#pop#pop#pop" endRegion="block"/> | ||
357 | <DetectChar char="}" attribute="Normal Text" context="#pop#pop#pop#pop#pop" endRegion="block"/> | 719 | <keyword String="VerbatimEnv" attribute="Environment"/> | ||
358 | </context> | 720 | </context> | ||
359 | | ||||
360 | <!-- begin comment environment --> | 721 | | ||
361 | <context name="CommentEnv" attribute="Environment" lineEndContext="#stay" fallthrough="true" fallthroughContext="#pop#pop#pop"> | 722 | <!-- begin comment environment --> | ||
362 | <DetectChar char="}" attribute="Normal Text" context="BlockComment"/> | 723 | <context name="CommentEnv" attribute="Environment" lineEndContext="#stay"> | ||
363 | <RegExpr String="[a-zA-Z]" attribute="Environment" lookAhead="true" context="#pop"/> | 724 | <DetectChar char="}" attribute="Normal Text" context="BlockComment"/> | ||
364 | <IncludeRules context="EnvCommon" /> | 725 | <RegExpr String="[^}]*" attribute="Error" context="#stay"/> | ||
365 | </context> | 726 | </context> | ||
366 | 727 | | |||
367 | <!-- parse comment text --> | 728 | <!-- parse comment text --> | ||
368 | <context name="BlockComment" attribute="Comment" lineEndContext="#stay"> | 729 | <context name="BlockComment" attribute="Comment" lineEndContext="#stay"> | ||
369 | <DetectChar char="×" attribute="Bullet" context="#stay"/> | | |||
370 | <RegExpr String="\\end(?=\s*\{comment\*?\})" attribute="Structure" context="CommFindEnd"/> | 730 | <DetectSpaces/> | ||
371 | </context> | 731 | <DetectIdentifier/> | ||
372 | | ||||
373 | <!-- end of comment environment --> | 732 | <RegExpr String="\\end(?=\s*\{comment\*?\})" attribute="Structure" context="CommFindEnd"/> | ||
374 | <context name="CommFindEnd" attribute="Normal Text" lineEndContext="#pop" fallthrough="true" fallthroughContext="#pop"> | 733 | </context> | ||
375 | <RegExpr String="\s*\{" attribute="Normal Text" context="#stay"/> | 734 | | ||
376 | <RegExpr String="comment\*?" attribute="Environment" context="#stay"/> | 735 | <!-- end of comment environment --> | ||
736 | <context name="CommFindEnd" attribute="Normal Text" lineEndContext="#pop" fallthrough="true" fallthroughContext="#pop"> | ||||
737 | <DetectSpaces/> | ||||
738 | <DetectChar char="{" attribute="Normal Text" context="#stay"/> | ||||
739 | <DetectChar char="}" attribute="Normal Text" context="#pop#pop#pop#pop#pop" endRegion="block"/> | ||||
740 | <keyword String="CommentEnv" attribute="Environment"/> | ||||
741 | </context> | ||||
742 | | ||||
743 | <!-- environment type 4: math environment with its own mathmode --> | ||||
744 | <context name="MathEnv" attribute="Environment" lineEndContext="#stay"> | ||||
745 | <DetectChar char="}" attribute="Normal Text" context="MathModeEnv"/> | ||||
746 | <RegExpr String="[^}]*" attribute="Error" context="#stay"/> | ||||
747 | </context> | ||||
748 | | ||||
749 | <!-- environment type 5: math environment with its own mathmode and parameter --> | ||||
750 | <context name="MathEnvWithParam" attribute="Environment" lineEndContext="#stay"> | ||||
751 | <DetectChar char="}" attribute="Normal Text" context="MathEnvWithParamInside"/> | ||||
752 | <RegExpr String="[^}]*" attribute="Error" context="#stay"/> | ||||
753 | </context> | ||||
754 | <context name="MathEnvWithParamInside" attribute="Normal Text" lineEndContext="#stay"> | ||||
377 | <DetectChar char="}" attribute="Normal Text" context="#pop#pop#pop#pop#pop" endRegion="block"/> | 755 | <DetectSpaces/> | ||
378 | </context> | 756 | <RangeDetect char="[" char1="]" attribute="Normal Text" context="#stay"/> | ||
379 | 757 | <DetectChar char="{" attribute="Normal Text" context="MathEnvParamInside"/> | |||
380 | <!-- environment type 4: math environment with its own mathmode --> | 758 | </context> | ||
381 | <context name="MathEnv" attribute="Environment" lineEndContext="#stay"> | 759 | <context name="MathEnvParamInside" attribute="Normal Text" lineEndContext="#stay"> | ||
382 | <DetectChar char="}" attribute="Normal Text" context="MathModeEnv"/> | 760 | <DetectSpaces/> | ||
761 | <DetectChar char="}" attribute="Normal Text" context="#pop#pop!MathModeEnv"/> | ||||
762 | </context> | ||||
763 | | ||||
764 | <!-- parse math environment --> | ||||
765 | <context name="MathModeEnv" attribute="Math" lineEndContext="#stay"> | ||||
766 | <DetectSpaces/> | ||||
767 | <DetectIdentifier/> | ||||
768 | <keyword String="beginEnv" attribute="Structure" context="FindBeginEnvironmentInMathMode" beginRegion="block"/> | ||||
769 | <keyword String="endEnv" attribute="Structure" context="MathFindEnd" endRegion="block"/> | ||||
770 | <keyword String="MathModeText" attribute="Macro Mathmode" context="MathModeText"/> | ||||
771 | <RegExpr String="\\[()\[\]]|\$" attribute="Error" context="#stay"/> | ||||
383 | <RegExpr String="[a-zA-Z]" attribute="Environment" lookAhead="true" context="#pop"/> | 772 | <DetectChar char="\" attribute="Macro Mathmode" context="MathContrSeq"/> | ||
384 | <IncludeRules context="EnvCommon" /> | 773 | <RegExpr String="%\s*(BEGIN|END)" attribute="Region Marker" context="RegionComment" firstNonSpace="true"/> | ||
385 | </context> | 774 | <DetectChar char="%" attribute="Comment" context="Comment"/> | ||
386 | 775 | <DetectChar char="•" attribute="Bullet" context="#stay"/> | |||
387 | <!-- environment type 5: math environment with its own mathmode and parameter --> | 776 | </context> | ||
388 | <context name="MathEnvParam" attribute="Normal Text" lineEndContext="#stay"> | | |||
389 | <RegExpr String="\}\{[^\}]*\}" attribute="Normal Text" context="MathModeEnv"/> | 777 | | ||
390 | <DetectChar char="}" attribute="Normal Text" context="MathModeEnv"/> | 778 | <!-- start of an environment in math mode --> | ||
391 | <RegExpr String="[a-zA-Z]" attribute="Environment" lookAhead="true" context="#pop"/> | 779 | <context name="FindBeginEnvironmentInMathMode" attribute="Normal Text" lineEndContext="#stay"> | ||
392 | <IncludeRules context="EnvCommon" /> | 780 | <DetectSpaces/> | ||
393 | </context> | 781 | <DetectChar char="{" attribute="Normal Text" context="BeginEnvironmentInMathMode"/> | ||
394 | 782 | <RegExpr String="." attribute="Normal Text" context="#pop"/> | |||
395 | <!-- environment common --> | 783 | </context> | ||
396 | <context name="EnvCommon" attribute="Environment" lineEndContext="#stay"> | 784 | | ||
397 | <DetectChar char="×" attribute="Bullet" context="#stay"/> | 785 | <!-- filter the environment name and check the type in math mode --> | ||
398 | <RegExpr String="\*(?=\})" attribute="Environment" context="#stay"/> | 786 | <context name="BeginEnvironmentInMathMode" attribute="Environment" lineEndContext="#stay"> | ||
399 | <RegExpr String="\*[^\}]*" attribute="Error" context="#pop#pop#pop"/> | 787 | <keyword String="ListingsEnv" attribute="Environment" context="ListingsEnv"/> | ||
400 | <RegExpr String="[^a-zA-Z\xd7][^\}]*" attribute="Error" context="#pop#pop#pop"/> | | |||
401 | </context> | | |||
402 | 788 | <keyword String="MintedEnv" attribute="Environment" context="MintedEnv"/> | |||
403 | <!-- parse math environment --> | 789 | <keyword String="VerbatimEnv" attribute="Environment" context="VerbatimEnv" lookAhead="true"/> | ||
404 | <context name="MathModeEnv" attribute="Math" lineEndContext="#stay"> | 790 | <keyword String="CommentEnv" attribute="Environment" context="CommentEnv"/> | ||
405 | <RegExpr String="\\begin(?=[^a-zA-Z])" attribute="Structure" context="FindBeginEnvironment" beginRegion="block"/> | 791 | <keyword String="TabEnv" attribute="Environment" context="TabEnv"/> | ||
406 | <RegExpr String="\\end(?=[^a-zA-Z])" attribute="Structure" context="MathFindEnd" endRegion="block"/> | 792 | <DetectChar char="•" attribute="Bullet" context="#stay"/> | ||
407 | <StringDetect String="\(" attribute="Error" context="#stay" /> | 793 | <!-- keywords in MathEnvParam and MathEnv. Do not use keyword to avoid autocomplete --> | ||
794 | <RegExpr String="(equation|IEEEeqnarray(box)?|([BVvbp]|small)matrix|(fl)?align|x{0,2}alignat|cases|displaymath|gather|math|multline|(sub)?eqnarray)(?=[^a-zA-Z]|$)\*?" attribute="Error" context="#pop"/> | ||||
795 | <RegExpr String="&envname;" attribute="Environment" context="LatexEnv"/> | ||||
796 | <RegExpr String="." attribute="Error" context="#pop"/> | ||||
797 | </context> | ||||
798 | | ||||
408 | <StringDetect String="\[" attribute="Error" context="#stay" /> | 799 | <!-- end of math environment --> | ||
409 | <StringDetect String="\)" attribute="Error" context="#stay" /> | | |||
410 | <StringDetect String="\]" attribute="Error" context="#stay" /> | 800 | <context name="MathFindEnd" attribute="Normal Text" lineEndContext="#pop" fallthrough="true" fallthroughContext="#pop"> | ||
411 | <RegExpr String="\\(text|intertext|mbox)\s*(?=\{)" attribute="Macro Mathmode" context="MathModeText" /> | | |||
412 | <DetectChar char="\" attribute="Macro Mathmode" context="MathContrSeq"/> | 801 | <DetectSpaces/> | ||
413 | <StringDetect String="$$" attribute="Error" context="#stay" /> | | |||
414 | <DetectChar char="$" attribute="Error" context="#stay" /> | | |||
415 | <DetectChar char="%" attribute="Comment" context="Comment"/> | 802 | <DetectChar char="{" attribute="Normal Text" context="#stay"/> | ||
416 | <DetectChar char="×" attribute="Bullet" context="#stay"/> | 803 | <keyword String="MathEnvParam" attribute="Environment" context="MathFindEndInside"/> | ||
417 | <RegExpr String="%\s*BEGIN.*$" attribute="Region Marker" context="#stay" beginRegion="regionMarker" firstNonSpace="true"/> | 804 | <keyword String="MathEnv" attribute="Environment" context="MathFindEndInside"/> | ||
418 | <RegExpr String="%\s*END.*$" attribute="Region Marker" context="#stay" endRegion="regionMarker" firstNonSpace="true"/> | 805 | <RegExpr String="&envname;" attribute="Environment" context="NoMathFindEndInside"/> | ||
419 | </context> | 806 | <RegExpr String="." attribute="Error" context="#pop"/> | ||
420 | 807 | </context> | |||
421 | <!-- end of math environment --> | 808 | <context name="MathFindEndInside" attribute="Normal Text" lineEndContext="#pop#pop"> | ||
422 | <context name="MathFindEnd" attribute="Normal Text" lineEndContext="#pop" fallthrough="true" fallthroughContext="#pop"> | 809 | <DetectChar char="}" attribute="Normal Text" context="#pop#pop#pop#pop#pop#pop" endRegion="block"/> | ||
810 | <RegExpr String="[^}]*" attribute="Error" context="#stay"/> | ||||
811 | </context> | ||||
812 | <context name="NoMathFindEndInside" attribute="Normal Text" lineEndContext="#pop#pop"> | ||||
813 | <DetectChar char="}" attribute="Normal Text" context="#pop#pop" endRegion="block"/> | ||||
423 | <RegExpr String="\s*\{" attribute="Normal Text" context="#stay"/> | 814 | <RegExpr String="[^}]*" attribute="Error" context="#stay"/> | ||
424 | <RegExpr String="(equation|displaymath|eqnarray|subeqnarray|math|multline|gather|align(at)?|flalign|xalignat|xxalignat|IEEEeqnarray|IEEEeqnarraybox|smallmatrix|pmatrix|bmatrix|Bmatrix|vmatrix|Vmatrix|cases)\*?" attribute="Environment" context="#stay"/> | 815 | </context> | ||
425 | <DetectChar char="}" attribute="Normal Text" context="#pop#pop#pop#pop#pop" endRegion="block"/> | 816 | | ||
426 | </context> | 817 | <!-- environment type 9: tabular --> | ||
427 | 818 | <context name="TabEnv" attribute="Environment" lineEndContext="#stay" fallthrough="true" fallthroughContext="#pop#pop#pop"> | |||
428 | <!-- environment type 9: tabular --> | | |||
429 | <context name="TabEnv" attribute="Environment" lineEndContext="#stay" fallthrough="true" fallthroughContext="#pop#pop#pop"> | | |||
430 | <DetectChar char="}" attribute="Normal Text" context="Tab"/> | | |||
431 | <RegExpr String="[a-zA-Z]" attribute="Environment" lookAhead="true" context="#pop"/> | 819 | <DetectChar char="}" attribute="Normal Text" context="Tab"/> | ||
432 | <IncludeRules context="EnvCommon" /> | 820 | <RegExpr String="[^}]*" attribute="Error" context="#stay"/> | ||
433 | </context> | 821 | </context> | ||
434 | 822 | | |||
435 | <!-- parse tabular text --> | 823 | <!-- parse tabular text --> | ||
824 | <context name="Tab" attribute="Normal Text" lineEndContext="#stay"> | ||||
825 | <DetectChar char="&" attribute="Ampersand" context="#stay"/> | ||||
826 | <Detect2Chars char="@" char1="{" attribute="Column Separator" context="Column Separator"/> | ||||
827 | <keyword String="endEnv" attribute="Structure" context="TabFindEnd"/> | ||||
828 | <IncludeRules context="Normal Text" /> | ||||
436 | <context name="Tab" attribute="Normal Text" lineEndContext="#stay"> | 829 | </context> | ||
437 | <DetectChar char="&" attribute="Ampersand" context="#stay"/> | 830 | | ||
438 | <StringDetect String="@{" attribute="Column Separator" context="Column Separator"/> | 831 | <context name="Column Separator" attribute="Column Separator" lineEndContext="#stay"> | ||
439 | <RegExpr String="\\end(?=\s*\{(tabularx|tabular|supertabular|mpsupertabular|xtabular|mpxtabular|longtable)\*?\})" attribute="Structure" context="TabFindEnd"/> | 832 | <DetectChar char="{" attribute="Column Separator" context="Column Separator"/> | ||
440 | <IncludeRules context="Normal Text" /> | 833 | <DetectChar char="}" attribute="Column Separator" context="#pop"/> | ||
441 | </context> | 834 | </context> | ||
442 | 835 | | |||
443 | <context name="Column Separator" attribute="Column Separator" lineEndContext="#stay"> | 836 | <!-- end of tabular environment --> | ||
444 | <DetectChar char="{" attribute="Column Separator" context="Column Separator"/> | 837 | <context name="TabFindEnd" attribute="Normal Text" lineEndContext="#pop" fallthrough="true" fallthroughContext="#pop"> | ||
838 | <DetectSpaces/> | ||||
445 | <DetectChar char="}" attribute="Column Separator" context="#pop"/> | 839 | <DetectChar char="{" attribute="Normal Text" context="#stay"/> | ||
840 | <DetectChar char="}" attribute="Normal Text" context="#pop#pop#pop#pop#pop" endRegion="block"/> | ||||
446 | <RegExpr String="." attribute="Column Separator" context="#stay"/> | 841 | <keyword String="TabEnv" attribute="Environment" context="#stay"/> | ||
447 | <!-- the last regexp is very stupid. Suggestions are welcome! Fallthrough did not help--> | 842 | </context> | ||
448 | </context> | 843 | | ||
449 | 844 | <!-- math mode: starting with $ --> | |||
845 | <context name="MathModeTex" attribute="Math" lineEndContext="#stay" fallthrough="true" fallthroughContext="#pop!MathMode"> | ||||
846 | <DetectChar char="$" attribute="Math" context="#pop!MathModeDisplay" beginRegion="mathMode"/> | ||||
847 | </context> | ||||
848 | <context name="MathMode" attribute="Math" lineEndContext="#stay"> | ||||
849 | <DetectChar char="$" attribute="Math" context="#pop"/> | ||||
850 | <IncludeRules context="MathModeCommon"/> | ||||
851 | </context> | ||||
852 | | ||||
853 | <!-- math mode: starting with $$ --> | ||||
854 | <context name="MathModeDisplay" attribute="Math" lineEndContext="#stay"> | ||||
855 | <Detect2Chars char="$" char1="$" attribute="Math" context="#pop" endRegion="mathMode"/> | ||||
856 | <DetectChar char="$" attribute="Error" context="#stay"/> | ||||
857 | <IncludeRules context="MathModeCommon"/> | ||||
858 | </context> | ||||
859 | | ||||
860 | <!-- math mode: starting with \( --> | ||||
861 | <context name="MathModeLatex" attribute="Math" lineEndContext="#stay"> | ||||
862 | <Detect2Chars char="\" char1=")" attribute="Math" context="#pop"/> | ||||
863 | <IncludeRules context="MathModeCommon"/> | ||||
450 | <!-- end of tabular environment --> | 864 | </context> | ||
451 | <context name="TabFindEnd" attribute="Normal Text" lineEndContext="#pop" fallthrough="true" fallthroughContext="#pop"> | 865 | | ||
452 | <RegExpr String="\s*\{" attribute="Normal Text" context="#stay"/> | 866 | <!-- math mode: starting with \[ --> | ||
453 | <RegExpr String="(tabularx|tabular|supertabular|mpsupertabular|xtabular|mpxtabular|longtable)\*?" attribute="Environment" context="#stay"/> | 867 | <context name="MathModeLatexEquation" attribute="Math" lineEndContext="#stay"> | ||
454 | <DetectChar char="}" attribute="Normal Text" context="#pop#pop#pop#pop#pop" endRegion="block"/> | 868 | <Detect2Chars char="\" char1="]" attribute="Math" context="#pop" endRegion="mathMode"/> | ||
455 | </context> | | |||
456 | 869 | <IncludeRules context="MathModeCommon"/> | |||
457 | <!-- math mode: starting with $ or \( --> | 870 | </context> | ||
458 | <context name="MathMode" attribute="Math" lineEndContext="#stay"> | 871 | | ||
872 | <!-- math mode: \ensuremath{...} --> | ||||
873 | <context name="MathModeEnsure" attribute="Math" lineEndContext="#stay"> | ||||
874 | <DetectSpaces/> | ||||
875 | <DetectChar char="{" attribute="Math" context="#pop!MathModeEnsureInside"/> | ||||
459 | <StringDetect String="$$" attribute="Error" context="#stay" /> | 876 | <RegExpr String="." attribute="Error" context="#pop"/> | ||
460 | <DetectChar char="$" attribute="Math" context="#pop" /> | 877 | </context> | ||
461 | <Detect2Chars char="\" char1=")" attribute="Math" context="#pop" /> | 878 | <context name="MathModeEnsureInside" attribute="Math" lineEndContext="#stay"> | ||
462 | <Detect2Chars char="\" char1="]" attribute="Error" context="#stay" /> | 879 | <DetectChar char="{" attribute="Math" context="MathModeEnsureInside" /> | ||
463 | <IncludeRules context="MathModeCommon" /> | 880 | <DetectChar char="}" attribute="Math" context="#pop" /> | ||
464 | </context> | 881 | <IncludeRules context="MathModeCommon"/> | ||
465 | | ||||
466 | <!-- math mode: starting with $$ --> | 882 | </context> | ||
467 | <context name="MathModeDisplay" attribute="Math" lineEndContext="#stay"> | 883 | | ||
468 | <StringDetect String="$$" attribute="Math" context="#pop" endRegion="mathMode" /> | 884 | <!-- math mode common --> | ||
469 | <DetectChar char="$" attribute="Error" context="#stay" /> | | |||
470 | <Detect2Chars char="\" char1="]" attribute="Error" context="#stay" /> | | |||
471 | <Detect2Chars char="\" char1=")" attribute="Error" context="#stay" /> | | |||
472 | <IncludeRules context="MathModeCommon" /> | | |||
473 | </context> | | |||
474 | | ||||
475 | <!-- math mode: starting with \[ --> | 885 | <context name="MathModeCommon" attribute="Math" lineEndContext="#stay"> | ||
476 | <context name="MathModeEquation" attribute="Math" lineEndContext="#stay"> | 886 | <DetectSpaces/> | ||
477 | <Detect2Chars char="\" char1="]" attribute="Math" context="#pop" endRegion="mathMode" /> | 887 | <DetectIdentifier/> | ||
478 | <StringDetect String="$$" attribute="Error" context="#stay" /> | 888 | <keyword String="beginEnv" attribute="Structure" context="MathEnvironment" beginRegion="block"/> | ||
479 | <DetectChar char="$" attribute="Error" context="#stay" /> | | |||
480 | <Detect2Chars char="\" char1=")" attribute="Error" context="#stay" /> | 889 | <keyword String="endEnv" attribute="Structure" context="MathEnvironmentEnd" endRegion="block"/> | ||
481 | <IncludeRules context="MathModeCommon" /> | | |||
482 | </context> | 890 | <keyword String="MathModeText" attribute="Macro Mathmode" context="MathModeText" /> | ||
891 | <DetectChar char="\" attribute="Macro Mathmode" context="MathContrSeq"/> | ||||
483 | 892 | <RegExpr String="%\s*(BEGIN|END)" attribute="Region Marker" context="RegionComment" firstNonSpace="true"/> | |||
484 | <!-- math mode: \ensuremath{...} !--> | 893 | <DetectChar char="%" attribute="Comment" context="Comment"/> | ||
485 | <context name="MathModeEnsure" attribute="Math" lineEndContext="#stay"> | 894 | <DetectChar char="•" attribute="Bullet" context="#stay"/> | ||
486 | <DetectChar char="{" attribute="Math" context="MathModeEnsure" /> | 895 | </context> | ||
896 | <context name="MathEnvironment" attribute="Math" lineEndContext="#stay"> | ||||
487 | <DetectChar char="}" attribute="Math" context="#pop" /> | 897 | <DetectSpaces/> | ||
488 | <IncludeRules context="MathModeCommon" /> | 898 | <DetectChar char="{" attribute="Normal Text" context="MathEnvironmentInside"/> | ||
489 | </context> | 899 | <RegExpr String="." attribute="Error" context="#pop"/> | ||
490 | 900 | </context> | |||
491 | <!-- math mode common --> | 901 | <context name="MathEnvironmentInside" attribute="Environment" lineEndContext="#stay"> | ||
492 | <context name="MathModeCommon" attribute="Math" lineEndContext="#stay"> | 902 | <DetectChar char="}" attribute="Normal Text" context="#pop#pop"/> | ||
493 | <RegExpr String="\\(begin|end)\s*\{(equation|displaymath|eqnarray|subeqnarray|math|multline|gather|align|flalign|alignat|xalignat|xxalignat|IEEEeqnarray)\*?\}" attribute="Error" context="#stay"/> | 903 | <RegExpr String="&envname;" attribute="Environment" context="#stay"/> | ||
494 | <RegExpr String="\\begin(?=[^a-zA-Z])" attribute="Macro Mathmode" context="#stay" beginRegion="block" /> | 904 | <RegExpr String="[^}a-zA-Z]+|." attribute="Error" context="#stay"/> | ||
495 | <RegExpr String="\\end(?=[^a-zA-Z])" attribute="Macro Mathmode" context="#stay" endRegion="block" /> | 905 | </context> | ||
496 | <RegExpr String="\\(text|intertext|mbox)\s*(?=\{)" attribute="Macro Mathmode" context="MathModeText" /> | 906 | <context name="MathEnvironmentEnd" attribute="Math" lineEndContext="#stay"> | ||
497 | <DetectChar char="\" attribute="Macro Mathmode" context="MathContrSeq"/> | 907 | <DetectSpaces/> | ||
498 | <DetectChar char="%" attribute="Comment" context="Comment"/> | 908 | <DetectChar char="{" attribute="Normal Text" context="MathEnvironmentEndInside"/> | ||
499 | <RegExpr String="%\s*BEGIN.*$" attribute="Region Marker" context="#stay" beginRegion="regionMarker" firstNonSpace="true"/> | 909 | <RegExpr String="." attribute="Error" context="#pop"/> | ||
500 | <RegExpr String="%\s*END.*$" attribute="Region Marker" context="#stay" endRegion="regionMarker" firstNonSpace="true"/> | 910 | </context> | ||
911 | <context name="MathEnvironmentEndInside" attribute="Environment" lineEndContext="#stay"> | ||||
501 | <DetectChar char="×" attribute="Bullet" context="#stay"/> | 912 | <DetectChar char="}" attribute="Normal Text" context="#pop#pop"/> | ||
502 | </context> | 913 | <WordDetect String="ensuremath" attribute="Environment" context="#pop!LatexEnvEnd"/> | ||
503 | 914 | <RegExpr String="&envname;" attribute="Environment" context="#stay"/> | |||
504 | <!-- command in mathmode --> | 915 | <RegExpr String="[^}a-zA-Z]+|." attribute="Error" context="#pop#pop"/> | ||
505 | <context name="MathContrSeq" attribute="Macro Mathmode" lineEndContext="#pop"> | 916 | </context> | ||
506 | <DetectChar char="×" attribute="Bullet" context="#stay"/> | | |||
507 | <RegExpr String="[a-zA-Z]+\*?" attribute="Macro Mathmode" context="#pop"/> | 917 | | ||
508 | <RegExpr String="[^a-zA-Z]" attribute="Macro Mathmode" context="#pop" /> | 918 | <!-- command in mathmode --> | ||
509 | </context> | 919 | <context name="MathContrSeq" attribute="Macro Mathmode" lineEndContext="#pop"> | ||
510 | 920 | <DetectChar char="•" attribute="Bullet" context="#stay"/> | |||
511 | <!-- text in mathmode --> | 921 | <RegExpr String="&envname;|." attribute="Macro Mathmode" context="#pop" /> | ||
512 | <context name="MathModeText" attribute="Normal Text" lineEndContext="#stay" > | 922 | </context> | ||
513 | <DetectChar char="{" attribute="Normal Text" context="MathModeTextParameterStart"/> | 923 | | ||
514 | </context> | 924 | <!-- text in mathmode --> | ||
515 | 925 | <context name="MathModeText" attribute="Normal Text" lineEndContext="#stay" fallthrough="true" fallthroughContext="MathContrSeq"> | |||
516 | <context name="MathModeTextParameterStart" attribute="Normal Text" lineEndContext="#stay" > | 926 | <DetectSpaces/> | ||
517 | <RegExpr String="\\." attribute="Normal Text" context="#stay"/> | 927 | <DetectChar char="{" attribute="Normal Text" context="MathModeTextParameterStart"/> | ||
518 | <DetectChar char="×" attribute="Bullet" context="#stay"/> | 928 | </context> | ||
519 | <RegExpr String="\$.*\$" minimal="true" attribute="Math" context="#stay"/> | 929 | <context name="MathModeTextInside" attribute="Normal Text" lineEndContext="#stay" > | ||
520 | <DetectChar char="{" attribute="Normal Text" context="MathModeTextParameter"/> | 930 | <DetectChar char="{" attribute="Normal Text" context="MathModeTextParameterStart"/> | ||
521 | <DetectChar char="}" attribute="Normal Text" context="#pop#pop"/> | 931 | </context> | ||
522 | <DetectChar char="%" attribute="Comment" context="Comment"/> | 932 | | ||
523 | </context> | 933 | <context name="MathModeTextParameterStart" attribute="Normal Text" lineEndContext="#stay" > | ||
524 | 934 | <DetectChar char="•" attribute="Bullet" context="#stay"/> | |||
525 | <context name="MathModeTextParameter" attribute="Normal Text" lineEndContext="#stay" > | 935 | <RangeDetect char="$" char1="$" attribute="Math" context="#stay"/> | ||
526 | <RegExpr String="\\." attribute="Normal Text" context="#stay"/> | 936 | <DetectChar char="{" attribute="Normal Text" context="MathModeTextInside" lookAhead="true"/> | ||
527 | <DetectChar char="{" attribute="Normal Text" context="MathModeTextParameter"/> | 937 | <DetectChar char="}" attribute="Normal Text" context="#pop#pop"/> | ||
528 | <DetectChar char="}" attribute="Normal Text" context="#pop"/> | 938 | <DetectChar char="%" attribute="Comment" context="Comment"/> | ||
529 | <DetectChar char="×" attribute="Bullet" context="#stay"/> | 939 | <DetectChar char="\" attribute="Macro Mathmode" context="MathContrSeq"/> | ||
530 | <DetectChar char="%" attribute="Comment" context="Comment"/> | 940 | </context> | ||
531 | </context> | 941 | | ||
532 | 942 | <!-- iffalse aka multiline comment --> | |||
533 | <!-- iffalse aka multiline comment --> | 943 | <context name="Multiline Comment" attribute="Comment" lineEndContext="#stay"> | ||
534 | <context name="Multiline Comment" attribute="Comment" lineEndContext="#stay"> | 944 | <keyword String="iffalseend" attribute="Comment" context="#pop"/> | ||
535 | <WordDetect String="\fi" attribute="Comment" context="#pop"/> | 945 | </context> | ||
536 | <WordDetect String="\else" attribute="Comment" context="#pop"/> | 946 | | ||
537 | </context> | 947 | <!-- comment --> | ||
538 | 948 | <context name="RegionComment" attribute="Region Marker" lineEndContext="#pop"/> | |||
539 | <!-- comment --> | 949 | <context name="Comment" attribute="Comment" lineEndContext="#pop"> | ||
540 | <context name="Comment" attribute="Comment" lineEndContext="#pop"> | 950 | <DetectSpaces/> | ||
541 | <RegExpr String="(FIXME|TODO):?" attribute="Alert" context="#stay"/> | 951 | <IncludeRules context="##Alerts" /> | ||
542 | <StringDetect String="\KileResetHL" attribute="Comment" context="Normal Text"/> | 952 | <DetectIdentifier/> | ||
543 | <StringDetect String="\KateResetHL" attribute="Comment" context="Normal Text"/> | 953 | <keyword String="ResetHL" attribute="Comment" context="Normal Text"/> | ||
544 | </context> | 954 | </context> | ||
545 | </contexts> | 955 | </contexts> | ||
546 | 956 | | |||
547 | <itemDatas> | 957 | <itemDatas> | ||
548 | <itemData name="Normal Text" defStyleNum="dsNormal"/> | 958 | <itemData name="Normal Text" defStyleNum="dsNormal"/> | ||
549 | <itemData name="Option Text" defStyleNum="dsNormal" spellChecking="false"/> | 959 | <itemData name="Option Text" defStyleNum="dsNormal" spellChecking="false"/> | ||
550 | <itemData name="Macro" defStyleNum="dsFunction" spellChecking="false"/> | 960 | <itemData name="Macro" defStyleNum="dsFunction" spellChecking="false"/> | ||
551 | <itemData name="Comment" defStyleNum="dsComment" spellChecking="false"/> | 961 | <itemData name="Comment" defStyleNum="dsComment" spellChecking="false"/> | ||
552 | <itemData name="Error" defStyleNum="dsError" spellChecking="false"/> | 962 | <itemData name="Error" defStyleNum="dsError" spellChecking="false"/> | ||
553 | <itemData name="Math" defStyleNum="dsSpecialString" spellChecking="false"/> | 963 | <itemData name="Math" defStyleNum="dsSpecialString" spellChecking="false"/> | ||
554 | <!-- begin/end --> | 964 | <!-- begin/end --> | ||
555 | <itemData name="Structure" defStyleNum="dsKeyword" spellChecking="false"/> | 965 | <itemData name="Structure" defStyleNum="dsKeyword" spellChecking="false"/> | ||
556 | <itemData name="Builtin Macro" defStyleNum="dsBuiltIn" spellChecking="false"/> | 966 | <itemData name="Builtin Macro" defStyleNum="dsBuiltIn" spellChecking="false"/> | ||
557 | <itemData name="Macro Mathmode" defStyleNum="dsSpecialChar" spellChecking="false"/> | 967 | <itemData name="Macro Mathmode" defStyleNum="dsSpecialChar" spellChecking="false"/> | ||
558 | <itemData name="Environment" defStyleNum="dsExtension" spellChecking="false"/> | 968 | <itemData name="Environment" defStyleNum="dsExtension" spellChecking="false"/> | ||
559 | <itemData name="Verbatim" defStyleNum="dsVerbatimString" spellChecking="false"/> | 969 | <itemData name="Reference" defStyleNum="dsExtension" spellChecking="false"/> | ||
560 | <itemData name="Region Marker" defStyleNum="dsRegionMarker" spellChecking="false"/> | 970 | <itemData name="Verbatim" defStyleNum="dsVerbatimString" spellChecking="false"/> | ||
561 | <itemData name="Bullet" defStyleNum="dsInformation" spellChecking="false"/> | 971 | <itemData name="Region Marker" defStyleNum="dsRegionMarker" spellChecking="false"/> | ||
562 | <itemData name="Ampersand" defStyleNum="dsOperator" bold="1" spellChecking="false"/> | 972 | <itemData name="Bullet" defStyleNum="dsInformation" spellChecking="false"/> | ||
563 | <itemData name="Column Separator" defStyleNum="dsChar" spellChecking="false"/> | 973 | <itemData name="Ampersand" defStyleNum="dsOperator" bold="1" spellChecking="false"/> | ||
564 | <itemData name="Alert" defStyleNum="dsAlert" spellChecking="false"/> | 974 | <itemData name="Column Separator" defStyleNum="dsChar" spellChecking="false"/> | ||
565 | <!-- in section headers --> | 975 | <!-- in section headers --> | ||
566 | <itemData name="Sectioning Text" defStyleNum="dsNormal" bold="1"/> | 976 | <itemData name="Sectioning Text" defStyleNum="dsNormal" bold="1"/> | ||
567 | <itemData name="Sectioning Macro" defStyleNum="dsFunction" bold="1" spellChecking="false"/> | 977 | <itemData name="Sectioning Macro" defStyleNum="dsFunction" bold="1" spellChecking="false"/> | ||
568 | <itemData name="Sectioning Math" defStyleNum="dsSpecialString" bold="1"/> | 978 | <itemData name="Sectioning Math" defStyleNum="dsSpecialString" bold="1"/> | ||
569 | <itemData name="Sectioning Macro Mathmode" defStyleNum="dsSpecialChar" bold="1" spellChecking="false"/> | 979 | <itemData name="Sectioning Macro Mathmode" defStyleNum="dsSpecialChar" bold="1" spellChecking="false"/> | ||
570 | </itemDatas> | 980 | </itemDatas> | ||
571 | </highlighting> | 981 | </highlighting> | ||
572 | 982 | | |||
573 | <general> | 983 | <general> | ||
574 | <keywords weakDeliminator="\" wordWrapDeliminator=",{}[]"/> | 984 | <keywords weakDeliminator="\*" additionalDeliminator="$" wordWrapDeliminator=",{}[]"/> | ||
575 | <comments> | 985 | <comments> | ||
576 | <comment name="singleLine" start="%" /> | 986 | <comment name="singleLine" start="%" /> | ||
577 | </comments> | 987 | </comments> | ||
578 | </general> | 988 | </general> | ||
579 | 989 | | |||
580 | <spellchecking> | 990 | <spellchecking> | ||
581 | <encodings> | 991 | <encodings> | ||
582 | <encoding char="À" string="\`{A}" /> | 992 | <encoding char="À" string="\`{A}" /> | ||
▲ Show 20 Lines • Show All 115 Lines • Show Last 20 Lines |