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"/> | 329 | <DetectChar char="•" attribute="Bullet" context="#stay"/> | ||
58 | <RegExpr String="[a-zA-Z]+(\+?|\*{0,3})" attribute="Sectioning Macro" context="#pop"/> | 330 | <RegExpr String="[a-zA-Z]+(\+?|\*{0,3})|." attribute="Sectioning Macro" context="#pop" /> | ||
59 | <RegExpr String="[^a-zA-Z]" 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"/> | 342 | <DetectChar char="•" attribute="Bullet" context="#stay"/> | ||
72 | <RegExpr String="[a-zA-Z]+\*?" attribute="Sectioning Macro Mathmode" context="#pop"/> | 343 | <RegExpr String="&envname;|." attribute="Sectioning Macro Mathmode" context="#pop" /> | ||
73 | <RegExpr String="[^a-zA-Z]" 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"> | 354 | <context name="FootnotingInside" attribute="Normal Text" lineEndContext="#stay"> | ||
85 | <DetectChar char="{" attribute="Normal Text" context="FootnotingInside"/> | 355 | <DetectChar char="{" attribute="Normal Text" context="FootnotingInside"/> | ||
86 | <DetectChar char="}" attribute="Normal Text" context="#pop"/> | 356 | <DetectChar char="}" attribute="Normal Text" context="#pop"/> | ||
87 | <StringDetect String="\(" attribute="Math" context="FootnotingMathMode" /> | | |||
88 | <DetectChar char="$" attribute="Math" context="FootnotingMathMode" /> | | |||
89 | <IncludeRules context="Normal Text" /> | 357 | <IncludeRules context="Normal Text"/> | ||
90 | </context> | 358 | </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" /> | | |||
96 | <IncludeRules context="MathMode" /> | | |||
97 | </context> | | |||
98 | 359 | | |||
99 | <!-- LaTeX commands \newcommand and \renewcommand --> | 360 | <!-- LaTeX commands \newcommand and \renewcommand --> | ||
100 | <context name="NewCommand" attribute="Normal Text" lineEndContext="#stay" fallthrough="true" fallthroughContext="#pop"> | 361 | <context name="NewCommand" attribute="Normal Text" lineEndContext="#stay" fallthrough="true" fallthroughContext="#pop"> | ||
101 | <RegExpr String="\s*\{\s*" attribute="Normal Text" context="LabelParameter"/> | 362 | <DetectSpaces/> | ||
102 | <RegExpr String="\s*(\[\d\](\[[^\]]*\])?)?\{" attribute="Normal Text" context="LabelParameter"/> | 363 | <DetectChar char="{" 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"/> | ||
104 | </context> | 366 | </context> | ||
105 | 367 | | |||
106 | <!-- LaTeX command \def --> | 368 | <!-- LaTeX command \def --> | ||
107 | <context name="DefCommand" attribute="Normal Text" lineEndContext="#stay" fallthrough="true" fallthroughContext="#pop"> | 369 | <context name="DefCommand" attribute="Normal Text" lineEndContext="#stay" fallthrough="true" fallthroughContext="#pop"> | ||
108 | <RegExpr String="\s*\\[a-zA-Z]+[^\{]*\{" attribute="Normal Text" context="CommandParameterStart"/> | 370 | <DetectSpaces/> | ||
371 | <RegExpr String="\\[a-zA-Z]+[^\{]*\{" attribute="Normal Text" context="#pop!CommandParameter"/> | ||||
109 | <DetectChar char="}" attribute="Error" context="#pop"/> | 372 | <DetectChar char="}" attribute="Error" context="#pop"/> | ||
110 | </context> | 373 | </context> | ||
111 | 374 | | |||
112 | <!-- parse command argument --> | 375 | <!-- parse command argument --> | ||
113 | <context name="CommandParameterStart" attribute="Normal Text" lineEndContext="#stay"> | | |||
114 | <DetectChar char="{" attribute="Normal Text" context="CommandParameter"/> | | |||
115 | <DetectChar char="}" attribute="Normal Text" context="#pop#pop"/> | | |||
116 | <RegExpr String="\\." attribute="Normal Text" context="#stay" /> | | |||
117 | <DetectChar char="%" attribute="Comment" context="Comment"/> | | |||
118 | </context> | | |||
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 --> | 383 | <!-- LaTeX command in text mode --> | ||
127 | <context name="ContrSeq" attribute="Macro" lineEndContext="#pop"> | 384 | <context name="ContrSeq" attribute="Macro" lineEndContext="#pop"> | ||
128 | <StringDetect String="verb*" attribute="Macro" context="Verb"/> | 385 | <keyword String="Verb" attribute="Macro" context="Verb"/> | ||
129 | <RegExpr String="(Verb|verb)(?=[^a-zA-Z])" attribute="Macro" context="Verb"/> | 386 | <keyword String="Lstinline" attribute="Macro" context="Lstinline"/> | ||
130 | <RegExpr String="(lstinline)(?=[^a-zA-Z])" attribute="Macro" context="Lstinline"/> | 387 | <keyword String="MintParam" attribute="Macro" context="MintParam"/> | ||
131 | <RegExpr String="mint(?=[^a-zA-Z])" attribute="Macro" context="MintParam"/> | 388 | <DetectChar char="•" attribute="Bullet" context="#stay"/> | ||
132 | <DetectChar char="×" attribute="Bullet" context="#stay"/> | 389 | <RegExpr String="[a-zA-Z@]+(\+?|\*{0,3})|." attribute="Macro" context="#pop" /> | ||
133 | <RegExpr String="[a-zA-Z@]+(\+?|\*{0,3})" attribute="Macro" context="#pop"/> | | |||
134 | <RegExpr String="[^a-zA-Z]" 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> | ||
148 | <context name="VerbEnd" attribute="Verbatim" lineEndContext="#pop#pop#pop" dynamic="true" > | 403 | <context name="VerbEnd" attribute="Verbatim" lineEndContext="#pop#pop#pop" dynamic="true" > | ||
149 | <StringDetect String="%1" attribute="Normal Text" context="#pop#pop#pop" dynamic="true" /> | 404 | <StringDetect String="%1" attribute="Normal Text" context="#pop#pop#pop" dynamic="true" /> | ||
150 | <DetectChar char="×" attribute="Bullet" context="#stay"/> | 405 | <DetectChar char="•" attribute="Bullet" context="#stay"/> | ||
151 | <RegExpr String="[^%1\xd7]*" attribute="Verbatim" context="#stay" dynamic="true" /> | 406 | <RegExpr String="[^%1\xd7]*" attribute="Verbatim" context="#stay" dynamic="true" /> | ||
152 | </context> | 407 | </context> | ||
153 | 408 | | |||
154 | <!-- lstinline command, different from verb as it takes options --> | 409 | <!-- lstinline command, different from verb as it takes options --> | ||
155 | <context name="Lstinline" attribute="Verbatim" lineEndContext="#pop#pop" > | 410 | <context name="Lstinline" attribute="Verbatim" lineEndContext="#pop#pop" > | ||
156 | <RegExpr String="\s*\[\s*" attribute="Normal Text" context="FancyLabelOption"/> | 411 | <DetectSpaces/> | ||
157 | <RegExpr String="\s*\{\s*" attribute="Normal Text" context="LstinlineParameter"/> | 412 | <DetectChar char="[" attribute="Normal Text" context="FancyLabelOption"/> | ||
413 | <DetectChar char="{" attribute="Normal Text" context="LstinlineParameter"/> | ||||
158 | <RegExpr String="(.)" attribute="Normal Text" dynamic="true" context="LstinlineEnd" /> | 414 | <RegExpr String="(.)" attribute="Normal Text" dynamic="true" context="LstinlineEnd" /> | ||
159 | </context> | 415 | </context> | ||
160 | <context name="LstinlineEnd" attribute="Verbatim" lineEndContext="#pop#pop#pop" dynamic="true" > | 416 | <context name="LstinlineEnd" attribute="Verbatim" lineEndContext="#pop#pop#pop" dynamic="true" > | ||
417 | <!-- TODO DetectChar segfault --> | ||||
161 | <StringDetect String="%1" attribute="Normal Text" context="#pop#pop#pop" dynamic="true" /> | 418 | <StringDetect String="%1" attribute="Normal Text" context="#pop#pop#pop" dynamic="true" /> | ||
162 | <DetectChar char="×" attribute="Bullet" context="#stay"/> | 419 | <DetectChar char="•" attribute="Bullet" context="#stay"/> | ||
163 | <RegExpr String="[^%1\xd7]*" attribute="Verbatim" context="#stay" dynamic="true" /> | 420 | <RegExpr String="[^%1\xd7]*" attribute="Verbatim" context="#stay" dynamic="true" /> | ||
164 | </context> | 421 | </context> | ||
165 | <context name="LstinlineParameter" attribute="Verbatim" lineEndContext="#stay"> | 422 | <context name="LstinlineParameter" attribute="Verbatim" lineEndContext="#stay"> | ||
166 | <RegExpr String="\s*\}\s*" attribute="Normal Text" context="#pop#pop#pop"/> | 423 | <DetectSpaces/> | ||
424 | <DetectChar char="}" attribute="Normal Text" context="#pop#pop#pop"/> | ||||
167 | </context> | 425 | </context> | ||
168 | 426 | | |||
169 | <!-- label --> | 427 | <!-- label --> | ||
170 | <context name="Label" attribute="Normal Text" lineEndContext="#stay"> | 428 | <context name="Label" attribute="Normal Text" lineEndContext="#stay"> | ||
171 | <RegExpr String="\s*\{\s*" attribute="Normal Text" context="LabelParameter"/> | 429 | <DetectSpaces/> | ||
172 | <RegExpr String="\s*\[\s*" attribute="Normal Text" context="LabelOption"/> | 430 | <DetectChar char="{" attribute="Normal Text" context="LabelParameter"/> | ||
173 | <RegExpr String="[^\[\{]+" attribute="Error" context="#stay"/> | 431 | <DetectChar char="[" attribute="Normal Text" context="LabelOption"/> | ||
174 | </context> | 432 | </context> | ||
175 | 433 | | |||
176 | <context name="LabelOption" attribute="Normal Text" lineEndContext="#stay"> | 434 | <context name="LabelOption" attribute="Normal Text" lineEndContext="#stay"> | ||
177 | <StringDetect String="\(" attribute="Math" context="MathMode" /> | 435 | <DetectSpaces/> | ||
436 | <DetectChar char="(" attribute="Math" context="MathModeTex" /> | ||||
178 | <DetectChar char="\" attribute="Macro" context="ContrSeq"/> | 437 | <DetectChar char="\" attribute="Macro" context="ContrSeq"/> | ||
179 | <DetectChar char="$" attribute="Math" context="MathMode" /> | 438 | <DetectChar char="$" attribute="Math" context="MathModeTex" /> | ||
180 | <DetectChar char="%" attribute="Comment" context="Comment"/> | 439 | <DetectChar char="%" attribute="Comment" context="Comment"/> | ||
181 | <DetectChar char="×" attribute="Bullet" context="#stay"/> | 440 | <DetectChar char="•" attribute="Bullet" context="#stay"/> | ||
182 | <RegExpr String="\s*\]\s*" attribute="Normal Text" context="#pop"/> | 441 | <DetectChar char="]" attribute="Normal Text" context="#pop"/> | ||
183 | </context> | 442 | </context> | ||
184 | 443 | | |||
185 | <context name="LabelParameter" attribute="Environment" lineEndContext="#stay"> | 444 | <context name="LabelParameter" attribute="Reference" lineEndContext="#stay"> | ||
186 | <DetectChar char="×" attribute="Bullet" context="#stay"/> | 445 | <DetectSpaces/> | ||
187 | <RegExpr String="\s*\}\s*" attribute="Normal Text" context="#pop#pop"/> | 446 | <DetectChar char="•" attribute="Bullet" context="#stay"/> | ||
447 | <DetectChar char="}" attribute="Normal Text" context="#pop#pop"/> | ||||
188 | </context> | 448 | </context> | ||
189 | 449 | | |||
190 | <!-- labels from biblatex commands --> | 450 | <!-- labels from biblatex commands --> | ||
191 | <context name="FancyLabel" attribute="Normal Text" lineEndContext="#stay" fallthrough="true" fallthroughContext="#pop"> | 451 | <context name="FancyLabel" attribute="Normal Text" lineEndContext="#stay" fallthrough="true" fallthroughContext="#pop"> | ||
192 | <RegExpr String="\s*\{\s*" attribute="Normal Text" context="FancyLabelParameter"/> | 452 | <DetectSpaces/> | ||
193 | <RegExpr String="\s*\[\s*" attribute="Normal Text" context="FancyLabelOption"/> | 453 | <DetectChar char="{" attribute="Normal Text" context="FancyLabelParameter"/> | ||
194 | <RegExpr String="\s*\(\s*" attribute="Normal Text" context="FancyLabelRoundBrackets"/> | 454 | <DetectChar char="[" attribute="Normal Text" context="FancyLabelOption"/> | ||
455 | <DetectChar char="(" attribute="Normal Text" context="FancyLabelRoundBrackets"/> | ||||
195 | </context> | 456 | </context> | ||
196 | 457 | | |||
197 | <context name="FancyLabelParameter" attribute="Environment" lineEndContext="#stay"> | 458 | <context name="FancyLabelParameter" attribute="Environment" lineEndContext="#stay"> | ||
198 | <StringDetect String="\(" attribute="Math" context="MathMode" /> | 459 | <DetectSpaces/> | ||
460 | <DetectChar char="(" attribute="Math" context="MathModeTex" /> | ||||
199 | <DetectChar char="\" attribute="Macro" context="ContrSeq"/> | 461 | <DetectChar char="\" attribute="Macro" context="ContrSeq"/> | ||
200 | <DetectChar char="$" attribute="Math" context="MathMode" /> | 462 | <DetectChar char="$" attribute="Math" context="MathModeTex" /> | ||
201 | <DetectChar char="%" attribute="Comment" context="Comment"/> | 463 | <DetectChar char="%" attribute="Comment" context="Comment"/> | ||
202 | <DetectChar char="×" attribute="Bullet" context="#stay"/> | 464 | <DetectChar char="•" attribute="Bullet" context="#stay"/> | ||
203 | <RegExpr String="\s*\}\s*" attribute="Normal Text" context="#pop"/> | 465 | <DetectChar char="}" attribute="Normal Text" context="#pop"/> | ||
204 | </context> | 466 | </context> | ||
205 | 467 | | |||
206 | <context name="FancyLabelOption" attribute="Option Text" lineEndContext="#stay"> | 468 | <context name="FancyLabelOption" attribute="Option Text" lineEndContext="#stay"> | ||
207 | <StringDetect String="\(" attribute="Math" context="MathMode" /> | 469 | <IncludeRules context="LabelOption"/> | ||
208 | <DetectChar char="\" attribute="Macro" context="ContrSeq"/> | | |||
209 | <DetectChar char="$" attribute="Math" context="MathMode" /> | | |||
210 | <DetectChar char="%" attribute="Comment" context="Comment"/> | | |||
211 | <DetectChar char="×" attribute="Bullet" context="#stay"/> | | |||
212 | <RegExpr String="\s*\]\s*" attribute="Normal Text" context="#pop"/> | | |||
213 | </context> | 470 | </context> | ||
214 | 471 | | |||
215 | <context name="FancyLabelRoundBrackets" attribute="Normal Text" lineEndContext="#stay"> | 472 | <context name="FancyLabelRoundBrackets" attribute="Normal Text" lineEndContext="#stay"> | ||
216 | <StringDetect String="\(" attribute="Math" context="MathMode" /> | 473 | <DetectSpaces/> | ||
474 | <Detect2Chars char="\" char1="(" attribute="Math" context="MathModeLatex" /> | ||||
217 | <DetectChar char="\" attribute="Macro" context="ContrSeq"/> | 475 | <DetectChar char="\" attribute="Macro" context="ContrSeq"/> | ||
218 | <DetectChar char="$" attribute="Math" context="MathMode" /> | 476 | <DetectChar char="$" attribute="Math" context="MathModeTex" /> | ||
219 | <DetectChar char="%" attribute="Comment" context="Comment"/> | 477 | <DetectChar char="%" attribute="Comment" context="Comment"/> | ||
220 | <DetectChar char="×" attribute="Bullet" context="#stay"/> | 478 | <DetectChar char="•" attribute="Bullet" context="#stay"/> | ||
221 | <RegExpr String="\s*\)\s*" attribute="Normal Text" context="#pop"/> | 479 | <DetectChar char=")" attribute="Normal Text" context="#pop"/> | ||
222 | </context> | 480 | </context> | ||
223 | 481 | | |||
224 | <!-- Special commands --> | 482 | <!-- Special commands --> | ||
225 | <context name="SpecialCommand" attribute="Normal Text" lineEndContext="#stay" fallthrough="true" fallthroughContext="#pop"> | 483 | <context name="SpecialCommand" attribute="Normal Text" lineEndContext="#stay" fallthrough="true" fallthroughContext="#pop"> | ||
226 | <RegExpr String="\s*\{\s*" attribute="Normal Text" context="SpecialCommandParameterOption"/> | 484 | <DetectSpaces/> | ||
485 | <DetectChar char="{" 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/> | ||
490 | <Detect2Chars char="\" char1="(" attribute="Math" context="MathModeTex" /> | ||||
231 | <DetectChar char="\" attribute="Macro" context="ContrSeq"/> | 491 | <DetectChar char="\" attribute="Macro" context="ContrSeq"/> | ||
232 | <DetectChar char="$" attribute="Math" context="MathMode" /> | 492 | <DetectChar char="$" attribute="Math" context="MathModeTex" /> | ||
233 | <DetectChar char="%" attribute="Comment" context="Comment"/> | 493 | <DetectChar char="%" attribute="Comment" context="Comment"/> | ||
234 | <DetectChar char="×" attribute="Bullet" context="#stay"/> | 494 | <DetectChar char="•" attribute="Bullet" context="#stay"/> | ||
235 | <RegExpr String="\s*\}\s*" attribute="Normal Text" context="#pop"/> | 495 | <DetectChar char="}" attribute="Normal Text" context="#pop"/> | ||
236 | </context> | 496 | </context> | ||
237 | 497 | | |||
238 | <!-- end of an environment --> | 498 | <!-- end of an environment --> | ||
239 | <context name="FindEndEnvironment" attribute="Normal Text" lineEndContext="#stay"> | 499 | <context name="FindEndEnvironment" attribute="Normal Text" lineEndContext="#stay"> | ||
240 | <DetectChar char="{" attribute="Normal Text" context="EndEnvironment"/> | 500 | <DetectChar char="{" attribute="Normal Text" context="EndEnvironment"/> | ||
241 | <RegExpr String="\S" attribute="Normal Text" context="#pop"/> | 501 | <RegExpr String="\S" attribute="Normal Text" context="#pop"/> | ||
242 | </context> | 502 | </context> | ||
243 | 503 | | |||
244 | <context name="EndEnvironment" attribute="Environment" lineEndContext="#stay"> | 504 | <context name="EndEnvironment" attribute="Environment" lineEndContext="#stay"> | ||
245 | <RegExpr String="[a-zA-Z]" attribute="Environment" context="EndLatexEnv"/> | 505 | <RegExpr String="&envname;" attribute="Environment" context="LatexEnvEnd"/> | ||
246 | <RegExpr String="\s+" attribute="Error" context="#pop"/> | 506 | <RegExpr String="." attribute="Error" context="#pop#pop"/> | ||
247 | <RegExpr String="[^a-zA-Z]" attribute="Error" context="#pop"/> | | |||
248 | </context> | 507 | </context> | ||
249 | 508 | | |||
250 | <context name="EndLatexEnv" attribute="Environment" lineEndContext="#stay"> | 509 | <context name="LatexEnvEnd" attribute="Environment" lineEndContext="#stay"> | ||
251 | <DetectChar char="}" attribute="Normal Text" endRegion="block" context="#pop#pop#pop"/> | 510 | <DetectChar char="}" attribute="Normal Text" endRegion="block" context="#pop#pop#pop"/> | ||
252 | <RegExpr String="[a-zA-Z]+(\*)?" attribute="Environment" context="#stay"/> | 511 | <RegExpr String="[^}]*" attribute="Error" context="#stay"/> | ||
253 | <RegExpr String="\s+" attribute="Error" context="#stay"/> | | |||
254 | <RegExpr String="[a-zA-Z]" attribute="Error" context="#pop#pop#pop"/> | | |||
255 | </context> | 512 | </context> | ||
256 | 513 | | |||
257 | <!-- start of an environment --> | 514 | <!-- start of an environment --> | ||
258 | <context name="FindBeginEnvironment" attribute="Normal Text" lineEndContext="#stay"> | 515 | <context name="FindBeginEnvironment" attribute="Normal Text" lineEndContext="#stay"> | ||
516 | <DetectSpaces/> | ||||
259 | <DetectChar char="{" attribute="Normal Text" context="BeginEnvironment"/> | 517 | <DetectChar char="{" attribute="Normal Text" context="BeginEnvironment"/> | ||
260 | <RegExpr String="\S" attribute="Normal Text" context="#pop"/> | 518 | <RegExpr String="." attribute="Normal Text" context="#pop"/> | ||
261 | </context> | 519 | </context> | ||
262 | 520 | | |||
263 | <!-- filter the environment name and check the type --> | 521 | <!-- filter the environment name and check the type --> | ||
264 | <context name="BeginEnvironment" attribute="Environment" lineEndContext="#stay"> | 522 | <context name="BeginEnvironment" attribute="Environment" lineEndContext="#stay"> | ||
265 | <WordDetect String="lstlisting" attribute="Environment" context="ListingsEnvParam"/> | 523 | <keyword String="ListingsEnv" attribute="Environment" context="ListingsEnv"/> | ||
266 | <WordDetect String="minted" attribute="Environment" context="MintedEnvParam"/> | 524 | <keyword String="MintedEnv" attribute="Environment" context="MintedEnv"/> | ||
267 | <RegExpr String="((B|L)?Verbatim)" attribute="Environment" context="VerbatimEnvParam"/> | 525 | <keyword String="VerbatimEnv" attribute="Environment" context="VerbatimEnv" lookAhead="true"/> | ||
268 | <RegExpr String="(verbatim|boxedverbatim)" attribute="Environment" context="VerbatimEnv"/> | 526 | <keyword String="CommentEnv" attribute="Environment" context="CommentEnv"/> | ||
269 | <RegExpr String="comment" attribute="Environment" context="CommentEnv"/> | 527 | <keyword String="MathEnvParam" attribute="Environment" context="MathEnvWithParam"/> | ||
270 | <RegExpr String="(alignat|xalignat|xxalignat)" attribute="Environment" context="MathEnvParam"/> | 528 | <keyword String="MathEnv" attribute="Environment" context="MathEnv"/> | ||
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"/> | 529 | <keyword String="TabEnv" attribute="Environment" context="TabEnv"/> | ||
272 | <RegExpr String="(tabularx|tabular|supertabular|mpsupertabular|xtabular|mpxtabular|longtable)" attribute="Environment" context="TabEnv"/> | 530 | <DetectChar char="•" attribute="Bullet" context="#stay"/> | ||
273 | <DetectChar char="×" attribute="Bullet" context="#stay"/> | 531 | <RegExpr String="&envname;" attribute="Environment" context="LatexEnv"/> | ||
274 | <RegExpr String="[a-zA-Z]" attribute="Environment" context="LatexEnv"/> | 532 | <RegExpr String="." attribute="Error" context="#pop"/> | ||
275 | <RegExpr String="\s+" attribute="Error" context="#pop"/> | | |||
276 | <RegExpr String="[^a-zA-Z\xd7]" attribute="Error" context="#pop"/> | | |||
277 | </context> | 533 | </context> | ||
278 | 534 | | |||
279 | <!-- environment type 1: normal --> | 535 | <!-- environment type 1: normal --> | ||
280 | <context name="LatexEnv" attribute="Environment" lineEndContext="#stay"> | 536 | <context name="LatexEnv" attribute="Error" lineEndContext="#stay"> | ||
281 | <DetectChar char="}" attribute="Normal Text" context="#pop#pop#pop"/> | 537 | <DetectChar char="}" attribute="Normal Text" context="#pop#pop#pop"/> | ||
282 | <RegExpr String="[a-zA-Z]+" attribute="Environment" context="#stay"/> | 538 | </context> | ||
283 | <RegExpr String="\s+" attribute="Error" context="#stay"/> | 539 | | ||
284 | <IncludeRules context="EnvCommon" /> | 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"/> | ||||
547 | <WordDetect String="Verbatim" attribute="Environment" context="VerbatimEnv3"/> | ||||
548 | <WordDetect String="BVerbatim*" attribute="Environment" context="VerbatimEnv4"/> | ||||
549 | <WordDetect String="BVerbatim" attribute="Environment" context="VerbatimEnv4"/> | ||||
550 | <WordDetect String="LVerbatim*" attribute="Environment" context="VerbatimEnv5"/> | ||||
551 | <WordDetect String="LVerbatim" attribute="Environment" context="VerbatimEnv5"/> | ||||
285 | </context> | 552 | </context> | ||
286 | 553 | | |||
287 | <!-- environment type 2: verbatim without parameter --> | 554 | <!-- environment type 2: verbatim without parameter --> | ||
288 | <context name="VerbatimEnv" attribute="Environment" lineEndContext="#stay" fallthrough="true" fallthroughContext="#pop#pop#pop"> | 555 | <context name="VerbatimEnv1" attribute="Error" lineEndContext="#stay" fallthrough="true" fallthroughContext="#pop#pop#pop#pop"> | ||
289 | <DetectChar char="}" attribute="Normal Text" context="Verbatim"/> | 556 | <DetectChar char="}" attribute="Normal Text" context="Verbatim1"/> | ||
290 | <RegExpr String="[a-zA-Z]" attribute="Environment" lookAhead="true" context="#pop"/> | 557 | </context> | ||
291 | <IncludeRules context="EnvCommon" /> | 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"/> | ||||
292 | </context> | 573 | </context> | ||
293 | 574 | | |||
294 | <!-- environment type 3: verbatim with optional parameter --> | 575 | <!-- environment type 3: verbatim with optional parameter --> | ||
295 | <context name="VerbatimEnvParam" attribute="Normal Text" lineEndContext="#stay"> | 576 | <context name="VerbatimEnv3" attribute="Error" lineEndContext="#stay" fallthrough="true" fallthroughContext="#pop#pop#pop#pop"> | ||
296 | <Detect2Chars char="}" char1="[" attribute="Normal Text" context="#stay" /> | 577 | <DetectChar char="}" attribute="Normal Text" context="VerbatimEnv3Param"/> | ||
297 | <DetectChar char="}" attribute="Normal Text" context="Verbatim"/> | 578 | </context> | ||
298 | <DetectChar char="]" attribute="Normal Text" context="Verbatim"/> | 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> | ||||
589 | | ||||
590 | <context name="VerbatimEnv4" attribute="Error" lineEndContext="#stay" fallthrough="true" fallthroughContext="#pop#pop#pop#pop"> | ||||
591 | <DetectChar char="}" attribute="Normal Text" context="VerbatimEnv4Param"/> | ||||
592 | </context> | ||||
593 | <context name="VerbatimEnv4Param" attribute="Normal Text" lineEndContext="#stay" fallthrough="true" fallthroughContext="#pop!Verbatim4"> | ||||
594 | <DetectSpaces/> | ||||
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/> | ||||
609 | <RangeDetect char="[" char1="]" attribute="Normal Text" context="#pop!Verbatim5"/> | ||||
610 | </context> | ||||
611 | <context name="Verbatim5" attribute="Verbatim" lineEndContext="#stay"> | ||||
612 | <DetectSpaces/> | ||||
613 | <DetectIdentifier/> | ||||
614 | <DetectChar char="•" attribute="Bullet" context="#stay"/> | ||||
615 | <RegExpr String="\\end(?=\s*\{LVerbatim\*?\})" attribute="Structure" context="VerbFindEnd"/> | ||||
299 | </context> | 616 | </context> | ||
300 | 617 | | |||
301 | <!-- environment type 4: listings environment with optional parameter and HL switching--> | 618 | <!-- environment type 4: listings environment with optional parameter and HL switching--> | ||
302 | <context name="ListingsEnvParam" attribute="Normal Text" fallthrough="true" fallthroughContext="Verbatim" lineEndContext="#stay"> | 619 | <context name="ListingsEnv" attribute="Environment" lineEndContext="#stay"> | ||
303 | <Detect2Chars char="}" char1="[" attribute="Normal Text" context="#stay" /> | 620 | <DetectChar char="}" attribute="Normal Text" context="#pop!ListingsEnvParam"/> | ||
304 | <RegExpr String="language\s*=\s*(?=[^,]+)" minimal="true" attribute="Normal Text" context="HighlightningSelector"/> | 621 | <RegExpr String="[^}]*" attribute="Error" context="#stay"/> | ||
305 | <DetectChar char="}" attribute="Normal Text" context="Verbatim"/> | 622 | </context> | ||
306 | <DetectChar char="]" attribute="Normal Text" context="Verbatim"/> | 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"/> | ||||
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"/> | ||||
307 | </context> | 637 | </context> | ||
308 | 638 | | |||
309 | <!-- environment type 5: minted environment with optional and HL switching --> | 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> | ||||
310 | <context name="MintedEnvParam" attribute="Normal Text" lineEndContext="#stay"> | 644 | <context name="MintedEnvParam" attribute="Normal Text" lineEndContext="#stay"> | ||
311 | <Detect2Chars char="}" char1="[" attribute="Normal Text" context="#stay" /> | 645 | <DetectSpaces/> | ||
312 | <Detect2Chars char="}" char1="{" attribute="Normal Text" context="HighlightningSelector"/> | 646 | <DetectChar char="[" attribute="Normal Text" context="#pop!MintedEnvParamInside"/> | ||
313 | <Detect2Chars char="]" char1="{" attribute="Normal Text" context="HighlightningSelector"/> | 647 | <DetectChar char="{" attribute="Normal Text" context="HighlightingSelector"/> | ||
314 | <DetectChar char="}" attribute="Normal Text" context="Verbatim"/> | 648 | <DetectChar char="%" attribute="Comment" context="Comment"/> | ||
649 | </context> | ||||
650 | <context name="MintedEnvParamInside" attribute="Normal Text" lineEndContext="#stay"> | ||||
651 | <DetectSpaces/> | ||||
652 | <DetectIdentifier/> | ||||
653 | <DetectChar char="]" attribute="Normal Text" context="#pop!MintedEnvLang"/> | ||||
654 | <DetectChar char="%" attribute="Comment" context="Comment"/> | ||||
655 | <RegExpr String="\\&envname;" attribute="Macro" context="#stay"/> | ||||
656 | </context> | ||||
657 | <context name="MintedEnvLang" attribute="Normal Text" lineEndContext="#stay"> | ||||
658 | <DetectSpaces/> | ||||
659 | <DetectChar char="{" attribute="Normal Text" context="HighlightingSelector"/> | ||||
660 | <DetectChar char="%" attribute="Comment" context="Comment"/> | ||||
315 | </context> | 661 | </context> | ||
316 | 662 | | |||
663 | <!-- parse verbatim text for lstinline and minted --> | ||||
664 | <context name="UnknownHighlighting" attribute="Verbatim" lineEndContext="#stay"> | ||||
665 | <DetectSpaces/> | ||||
666 | <DetectIdentifier/> | ||||
667 | <DetectChar char="•" attribute="Bullet" context="#stay"/> | ||||
668 | <RegExpr String="\\end(?=\s*\{(lstlisting|minted)\*?\})" attribute="Structure" context="UnknownHighlightingEnd"/> | ||||
669 | </context> | ||||
670 | <context name="UnknownHighlightingEnd" attribute="Environment" lineEndContext="#stay"> | ||||
671 | <DetectSpaces/> | ||||
672 | <DetectChar char="{" attribute="Normal Text" context="#stay"/> | ||||
673 | <DetectChar char="}" attribute="Normal Text" context="#pop#pop#pop#pop#pop#pop#pop" endRegion="block"/> | ||||
674 | <DetectIdentifier/> | ||||
675 | </context> | ||||
676 | | ||||
677 | | ||||
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"/> | ||||
684 | <RegExpr String="[^]}]*" context="#stay"/> | ||||
322 | </context> | 685 | </context> | ||
323 | 686 | | |||
324 | <context name="HighlightningCommon" attribute="Normal Text" lineEndContext="#stay"> | 687 | <context name="HighlightingCommon" attribute="Normal Text" lineEndContext="#stay"> | ||
325 | <RegExpr String="\\end\s*\{(lstlisting|minted)\*?\}" attribute="Structure" lookAhead="true" context="#pop#pop#pop#pop#pop#pop"/> | 688 | <RegExpr String="\\end\s*\{(lstlisting|minted)\*?\}" attribute="Structure" lookAhead="true" context="#pop#pop#pop#pop#pop#pop"/> | ||
326 | </context> | 689 | </context> | ||
327 | 690 | | |||
328 | <context name="HighlightningBeginC++" attribute="Normal Text" lineEndContext="#stay"> | 691 | <context name="HighlightingBeginC++" attribute="Normal Text" lineEndContext="#stay"> | ||
692 | <DetectChar char="}" context="HighlightingC++"/> | ||||
693 | <DetectChar char="]" context="HighlightingC++"/> | ||||
329 | <!-- Eat the trailing characters including } or ] after the language specification --> | 694 | <!-- Eat the trailing characters including } or ] after the language specification --> | ||
330 | <RegExpr String=".*(\}|\])" context="HighlightningC++"/> | 695 | <RegExpr String="[^]}]*" context="#stay"/> | ||
331 | </context> | 696 | </context> | ||
332 | 697 | | |||
333 | <context name="HighlightningC++" attribute="Normal Text" lineEndContext="#stay"> | 698 | <context name="HighlightingC++" attribute="Normal Text" lineEndContext="#stay"> | ||
334 | <IncludeRules context="HighlightningCommon"/> | 699 | <IncludeRules context="HighlightingCommon"/> | ||
335 | <IncludeRules context="##C++" includeAttrib="true"/> | 700 | <IncludeRules context="##C++" includeAttrib="true"/> | ||
336 | </context> | 701 | </context> | ||
337 | 702 | | |||
338 | <context name="HighlightningBeginPython" attribute="Normal Text" lineEndContext="#stay"> | 703 | <context name="HighlightingBeginPython" attribute="Normal Text" lineEndContext="#stay"> | ||
339 | <RegExpr String=".*(\}|\])" context="HighlightningPython"/> | 704 | <DetectChar char="}" context="HighlightingPython"/> | ||
705 | <DetectChar char="]" context="HighlightingPython"/> | ||||
706 | <RegExpr String="[^]}]*" context="#stay"/> | ||||
340 | </context> | 707 | </context> | ||
341 | 708 | | |||
342 | <context name="HighlightningPython" attribute="Normal Text" lineEndContext="#stay"> | 709 | <context name="HighlightingPython" attribute="Normal Text" lineEndContext="#stay"> | ||
343 | <IncludeRules context="HighlightningCommon"/> | 710 | <IncludeRules context="HighlightingCommon"/> | ||
344 | <IncludeRules context="##Python"/> | 711 | <IncludeRules context="##Python"/> | ||
345 | </context> | 712 | </context> | ||
346 | 713 | | |||
347 | <!-- parse verbatim text --> | | |||
348 | <context name="Verbatim" attribute="Verbatim" lineEndContext="#stay"> | | |||
349 | <DetectChar char="×" attribute="Bullet" context="#stay"/> | | |||
350 | <RegExpr String="\\end(?=\s*\{(verbatim|lstlisting|boxedverbatim|(B|L)?Verbatim|minted)\*?\})" attribute="Structure" context="VerbFindEnd"/> | | |||
351 | </context> | | |||
352 | | ||||
353 | <!-- end of verbatim environment --> | 714 | <!-- end of verbatim environment --> | ||
354 | <context name="VerbFindEnd" attribute="Normal Text" lineEndContext="#pop" fallthrough="true" fallthroughContext="#pop"> | 715 | <context name="VerbFindEnd" attribute="Normal Text" lineEndContext="#pop" fallthrough="true" fallthroughContext="#pop"> | ||
355 | <RegExpr String="\s*\{" attribute="Normal Text" context="#stay"/> | 716 | <DetectSpaces/> | ||
356 | <RegExpr String="(verbatim|lstlisting|boxedverbatim|(B|L)?Verbatim|minted)\*?" attribute="Environment" context="#stay"/> | 717 | <DetectChar char="{" attribute="Normal Text" context="#stay"/> | ||
357 | <DetectChar char="}" attribute="Normal Text" context="#pop#pop#pop#pop#pop" endRegion="block"/> | 718 | <DetectChar char="}" attribute="Normal Text" context="#pop#pop#pop#pop#pop#pop" endRegion="block"/> | ||
719 | <keyword String="VerbatimEnv" attribute="Environment"/> | ||||
358 | </context> | 720 | </context> | ||
359 | 721 | | |||
360 | <!-- begin comment environment --> | 722 | <!-- begin comment environment --> | ||
361 | <context name="CommentEnv" attribute="Environment" lineEndContext="#stay" fallthrough="true" fallthroughContext="#pop#pop#pop"> | 723 | <context name="CommentEnv" attribute="Environment" lineEndContext="#stay"> | ||
362 | <DetectChar char="}" attribute="Normal Text" context="BlockComment"/> | 724 | <DetectChar char="}" attribute="Normal Text" context="BlockComment"/> | ||
363 | <RegExpr String="[a-zA-Z]" attribute="Environment" lookAhead="true" context="#pop"/> | 725 | <RegExpr String="[^}]*" attribute="Error" context="#stay"/> | ||
364 | <IncludeRules context="EnvCommon" /> | | |||
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"/> | 730 | <DetectSpaces/> | ||
731 | <DetectIdentifier/> | ||||
370 | <RegExpr String="\\end(?=\s*\{comment\*?\})" attribute="Structure" context="CommFindEnd"/> | 732 | <RegExpr String="\\end(?=\s*\{comment\*?\})" attribute="Structure" context="CommFindEnd"/> | ||
371 | </context> | 733 | </context> | ||
372 | 734 | | |||
373 | <!-- end of comment environment --> | 735 | <!-- end of comment environment --> | ||
374 | <context name="CommFindEnd" attribute="Normal Text" lineEndContext="#pop" fallthrough="true" fallthroughContext="#pop"> | 736 | <context name="CommFindEnd" attribute="Normal Text" lineEndContext="#pop" fallthrough="true" fallthroughContext="#pop"> | ||
375 | <RegExpr String="\s*\{" attribute="Normal Text" context="#stay"/> | 737 | <DetectSpaces/> | ||
376 | <RegExpr String="comment\*?" attribute="Environment" context="#stay"/> | 738 | <DetectChar char="{" attribute="Normal Text" context="#stay"/> | ||
377 | <DetectChar char="}" attribute="Normal Text" context="#pop#pop#pop#pop#pop" endRegion="block"/> | 739 | <DetectChar char="}" attribute="Normal Text" context="#pop#pop#pop#pop#pop" endRegion="block"/> | ||
740 | <keyword String="CommentEnv" attribute="Environment"/> | ||||
378 | </context> | 741 | </context> | ||
379 | 742 | | |||
380 | <!-- environment type 4: math environment with its own mathmode --> | 743 | <!-- environment type 4: math environment with its own mathmode --> | ||
381 | <context name="MathEnv" attribute="Environment" lineEndContext="#stay"> | 744 | <context name="MathEnv" attribute="Environment" lineEndContext="#stay"> | ||
382 | <DetectChar char="}" attribute="Normal Text" context="MathModeEnv"/> | 745 | <DetectChar char="}" attribute="Normal Text" context="MathModeEnv"/> | ||
383 | <RegExpr String="[a-zA-Z]" attribute="Environment" lookAhead="true" context="#pop"/> | 746 | <RegExpr String="[^}]*" attribute="Error" context="#stay"/> | ||
384 | <IncludeRules context="EnvCommon" /> | | |||
385 | </context> | 747 | </context> | ||
386 | 748 | | |||
387 | <!-- environment type 5: math environment with its own mathmode and parameter --> | 749 | <!-- environment type 5: math environment with its own mathmode and parameter --> | ||
388 | <context name="MathEnvParam" attribute="Normal Text" lineEndContext="#stay"> | 750 | <context name="MathEnvWithParam" attribute="Environment" lineEndContext="#stay"> | ||
389 | <RegExpr String="\}\{[^\}]*\}" attribute="Normal Text" context="MathModeEnv"/> | 751 | <DetectChar char="}" attribute="Normal Text" context="MathEnvWithParamInside"/> | ||
390 | <DetectChar char="}" attribute="Normal Text" context="MathModeEnv"/> | 752 | <RegExpr String="[^}]*" attribute="Error" context="#stay"/> | ||
391 | <RegExpr String="[a-zA-Z]" attribute="Environment" lookAhead="true" context="#pop"/> | 753 | </context> | ||
392 | <IncludeRules context="EnvCommon" /> | 754 | <context name="MathEnvWithParamInside" attribute="Normal Text" lineEndContext="#stay"> | ||
393 | </context> | 755 | <DetectSpaces/> | ||
394 | 756 | <RangeDetect char="[" char1="]" attribute="Normal Text" context="#stay"/> | |||
395 | <!-- environment common --> | 757 | <DetectChar char="{" attribute="Normal Text" context="MathEnvParamInside"/> | ||
396 | <context name="EnvCommon" attribute="Environment" lineEndContext="#stay"> | 758 | </context> | ||
397 | <DetectChar char="×" attribute="Bullet" context="#stay"/> | 759 | <context name="MathEnvParamInside" attribute="Normal Text" lineEndContext="#stay"> | ||
398 | <RegExpr String="\*(?=\})" attribute="Environment" context="#stay"/> | 760 | <DetectSpaces/> | ||
399 | <RegExpr String="\*[^\}]*" attribute="Error" context="#pop#pop#pop"/> | 761 | <DetectChar char="}" attribute="Normal Text" context="#pop#pop!MathModeEnv"/> | ||
400 | <RegExpr String="[^a-zA-Z\xd7][^\}]*" attribute="Error" context="#pop#pop#pop"/> | | |||
401 | </context> | 762 | </context> | ||
402 | 763 | | |||
403 | <!-- parse math environment --> | 764 | <!-- parse math environment --> | ||
404 | <context name="MathModeEnv" attribute="Math" lineEndContext="#stay"> | 765 | <context name="MathModeEnv" attribute="Math" lineEndContext="#stay"> | ||
405 | <RegExpr String="\\begin(?=[^a-zA-Z])" attribute="Structure" context="FindBeginEnvironment" beginRegion="block"/> | 766 | <DetectSpaces/> | ||
406 | <RegExpr String="\\end(?=[^a-zA-Z])" attribute="Structure" context="MathFindEnd" endRegion="block"/> | 767 | <DetectIdentifier/> | ||
407 | <StringDetect String="\(" attribute="Error" context="#stay" /> | 768 | <keyword String="beginEnv" attribute="Structure" context="FindBeginEnvironmentInMathMode" beginRegion="block"/> | ||
408 | <StringDetect String="\[" attribute="Error" context="#stay" /> | 769 | <keyword String="endEnv" attribute="Structure" context="MathFindEnd" endRegion="block"/> | ||
409 | <StringDetect String="\)" attribute="Error" context="#stay" /> | 770 | <keyword String="MathModeText" attribute="Macro Mathmode" context="MathModeText"/> | ||
410 | <StringDetect String="\]" attribute="Error" context="#stay" /> | 771 | <RegExpr String="\\[()\[\]]|\$" attribute="Error" context="#stay"/> | ||
411 | <RegExpr String="\\(text|intertext|mbox)\s*(?=\{)" attribute="Macro Mathmode" context="MathModeText" /> | | |||
412 | <DetectChar char="\" attribute="Macro Mathmode" context="MathContrSeq"/> | 772 | <DetectChar char="\" attribute="Macro Mathmode" context="MathContrSeq"/> | ||
413 | <StringDetect String="$$" attribute="Error" context="#stay" /> | 773 | <RegExpr String="%\s*(BEGIN|END)" attribute="Region Marker" context="RegionComment" firstNonSpace="true"/> | ||
414 | <DetectChar char="$" attribute="Error" context="#stay" /> | | |||
415 | <DetectChar char="%" attribute="Comment" context="Comment"/> | 774 | <DetectChar char="%" attribute="Comment" context="Comment"/> | ||
416 | <DetectChar char="×" attribute="Bullet" context="#stay"/> | 775 | <DetectChar char="•" attribute="Bullet" context="#stay"/> | ||
417 | <RegExpr String="%\s*BEGIN.*$" attribute="Region Marker" context="#stay" beginRegion="regionMarker" firstNonSpace="true"/> | 776 | </context> | ||
418 | <RegExpr String="%\s*END.*$" attribute="Region Marker" context="#stay" endRegion="regionMarker" firstNonSpace="true"/> | 777 | | ||
778 | <!-- start of an environment in math mode --> | ||||
779 | <context name="FindBeginEnvironmentInMathMode" attribute="Normal Text" lineEndContext="#stay"> | ||||
780 | <DetectSpaces/> | ||||
781 | <DetectChar char="{" attribute="Normal Text" context="BeginEnvironmentInMathMode"/> | ||||
782 | <RegExpr String="." attribute="Normal Text" context="#pop"/> | ||||
783 | </context> | ||||
784 | | ||||
785 | <!-- filter the environment name and check the type in math mode --> | ||||
786 | <context name="BeginEnvironmentInMathMode" attribute="Environment" lineEndContext="#stay"> | ||||
787 | <keyword String="ListingsEnv" attribute="Environment" context="ListingsEnv"/> | ||||
788 | <keyword String="MintedEnv" attribute="Environment" context="MintedEnv"/> | ||||
789 | <keyword String="VerbatimEnv" attribute="Environment" context="VerbatimEnv" lookAhead="true"/> | ||||
790 | <keyword String="CommentEnv" attribute="Environment" context="CommentEnv"/> | ||||
791 | <keyword String="TabEnv" attribute="Environment" context="TabEnv"/> | ||||
792 | <DetectChar char="•" attribute="Bullet" 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"/> | ||||
419 | </context> | 797 | </context> | ||
420 | 798 | | |||
421 | <!-- end of math environment --> | 799 | <!-- end of math environment --> | ||
422 | <context name="MathFindEnd" attribute="Normal Text" lineEndContext="#pop" fallthrough="true" fallthroughContext="#pop"> | 800 | <context name="MathFindEnd" attribute="Normal Text" lineEndContext="#pop" fallthrough="true" fallthroughContext="#pop"> | ||
423 | <RegExpr String="\s*\{" attribute="Normal Text" context="#stay"/> | 801 | <DetectSpaces/> | ||
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"/> | 802 | <DetectChar char="{" attribute="Normal Text" context="#stay"/> | ||
425 | <DetectChar char="}" attribute="Normal Text" context="#pop#pop#pop#pop#pop" endRegion="block"/> | 803 | <keyword String="MathEnvParam" attribute="Environment" context="MathFindEndInside"/> | ||
804 | <keyword String="MathEnv" attribute="Environment" context="MathFindEndInside"/> | ||||
805 | <RegExpr String="&envname;" attribute="Environment" context="NoMathFindEndInside"/> | ||||
806 | <RegExpr String="." attribute="Error" context="#pop"/> | ||||
807 | </context> | ||||
808 | <context name="MathFindEndInside" attribute="Normal Text" lineEndContext="#pop#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"/> | ||||
814 | <RegExpr String="[^}]*" attribute="Error" context="#stay"/> | ||||
426 | </context> | 815 | </context> | ||
427 | 816 | | |||
428 | <!-- environment type 9: tabular --> | 817 | <!-- environment type 9: tabular --> | ||
429 | <context name="TabEnv" attribute="Environment" lineEndContext="#stay" fallthrough="true" fallthroughContext="#pop#pop#pop"> | 818 | <context name="TabEnv" attribute="Environment" lineEndContext="#stay" fallthrough="true" fallthroughContext="#pop#pop#pop"> | ||
430 | <DetectChar char="}" attribute="Normal Text" context="Tab"/> | 819 | <DetectChar char="}" attribute="Normal Text" context="Tab"/> | ||
431 | <RegExpr String="[a-zA-Z]" attribute="Environment" lookAhead="true" context="#pop"/> | 820 | <RegExpr String="[^}]*" attribute="Error" context="#stay"/> | ||
432 | <IncludeRules context="EnvCommon" /> | | |||
433 | </context> | 821 | </context> | ||
434 | 822 | | |||
435 | <!-- parse tabular text --> | 823 | <!-- parse tabular text --> | ||
436 | <context name="Tab" attribute="Normal Text" lineEndContext="#stay"> | 824 | <context name="Tab" attribute="Normal Text" lineEndContext="#stay"> | ||
437 | <DetectChar char="&" attribute="Ampersand" context="#stay"/> | 825 | <DetectChar char="&" attribute="Ampersand" context="#stay"/> | ||
438 | <StringDetect String="@{" attribute="Column Separator" context="Column Separator"/> | 826 | <Detect2Chars char="@" char1="{" attribute="Column Separator" context="Column Separator"/> | ||
439 | <RegExpr String="\\end(?=\s*\{(tabularx|tabular|supertabular|mpsupertabular|xtabular|mpxtabular|longtable)\*?\})" attribute="Structure" context="TabFindEnd"/> | 827 | <keyword String="endEnv" attribute="Structure" context="TabFindEnd"/> | ||
440 | <IncludeRules context="Normal Text" /> | 828 | <IncludeRules context="Normal Text" /> | ||
441 | </context> | 829 | </context> | ||
442 | 830 | | |||
443 | <context name="Column Separator" attribute="Column Separator" lineEndContext="#stay"> | 831 | <context name="Column Separator" attribute="Column Separator" lineEndContext="#stay"> | ||
444 | <DetectChar char="{" attribute="Column Separator" context="Column Separator"/> | 832 | <DetectChar char="{" attribute="Column Separator" context="Column Separator"/> | ||
445 | <DetectChar char="}" attribute="Column Separator" context="#pop"/> | 833 | <DetectChar char="}" attribute="Column Separator" context="#pop"/> | ||
446 | <RegExpr String="." attribute="Column Separator" context="#stay"/> | | |||
447 | <!-- the last regexp is very stupid. Suggestions are welcome! Fallthrough did not help--> | | |||
448 | </context> | 834 | </context> | ||
449 | 835 | | |||
450 | <!-- end of tabular environment --> | 836 | <!-- end of tabular environment --> | ||
451 | <context name="TabFindEnd" attribute="Normal Text" lineEndContext="#pop" fallthrough="true" fallthroughContext="#pop"> | 837 | <context name="TabFindEnd" attribute="Normal Text" lineEndContext="#pop" fallthrough="true" fallthroughContext="#pop"> | ||
452 | <RegExpr String="\s*\{" attribute="Normal Text" context="#stay"/> | 838 | <DetectSpaces/> | ||
453 | <RegExpr String="(tabularx|tabular|supertabular|mpsupertabular|xtabular|mpxtabular|longtable)\*?" attribute="Environment" context="#stay"/> | 839 | <DetectChar char="{" attribute="Normal Text" context="#stay"/> | ||
454 | <DetectChar char="}" attribute="Normal Text" context="#pop#pop#pop#pop#pop" endRegion="block"/> | 840 | <DetectChar char="}" attribute="Normal Text" context="#pop#pop#pop#pop#pop" endRegion="block"/> | ||
841 | <keyword String="TabEnv" attribute="Environment" context="#stay"/> | ||||
455 | </context> | 842 | </context> | ||
456 | 843 | | |||
457 | <!-- math mode: starting with $ or \( --> | 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> | ||||
458 | <context name="MathMode" attribute="Math" lineEndContext="#stay"> | 848 | <context name="MathMode" attribute="Math" lineEndContext="#stay"> | ||
459 | <StringDetect String="$$" attribute="Error" context="#stay" /> | | |||
460 | <DetectChar char="$" attribute="Math" context="#pop" /> | 849 | <DetectChar char="$" attribute="Math" context="#pop"/> | ||
461 | <Detect2Chars char="\" char1=")" attribute="Math" context="#pop" /> | | |||
462 | <Detect2Chars char="\" char1="]" attribute="Error" context="#stay" /> | | |||
463 | <IncludeRules context="MathModeCommon" /> | 850 | <IncludeRules context="MathModeCommon"/> | ||
464 | </context> | 851 | </context> | ||
465 | 852 | | |||
466 | <!-- math mode: starting with $$ --> | 853 | <!-- math mode: starting with $$ --> | ||
467 | <context name="MathModeDisplay" attribute="Math" lineEndContext="#stay"> | 854 | <context name="MathModeDisplay" attribute="Math" lineEndContext="#stay"> | ||
468 | <StringDetect String="$$" attribute="Math" context="#pop" endRegion="mathMode" /> | 855 | <Detect2Chars char="$" char1="$" attribute="Math" context="#pop" endRegion="mathMode"/> | ||
469 | <DetectChar char="$" attribute="Error" context="#stay" /> | 856 | <DetectChar char="$" attribute="Error" context="#stay"/> | ||
470 | <Detect2Chars char="\" char1="]" attribute="Error" context="#stay" /> | 857 | <IncludeRules context="MathModeCommon"/> | ||
471 | <Detect2Chars char="\" char1=")" attribute="Error" context="#stay" /> | 858 | </context> | ||
859 | | ||||
860 | <!-- math mode: starting with \( --> | ||||
861 | <context name="MathModeLatex" attribute="Math" lineEndContext="#stay"> | ||||
862 | <Detect2Chars char="\" char1=")" attribute="Math" context="#pop"/> | ||||
472 | <IncludeRules context="MathModeCommon" /> | 863 | <IncludeRules context="MathModeCommon"/> | ||
473 | </context> | 864 | </context> | ||
474 | 865 | | |||
475 | <!-- math mode: starting with \[ --> | 866 | <!-- math mode: starting with \[ --> | ||
476 | <context name="MathModeEquation" attribute="Math" lineEndContext="#stay"> | 867 | <context name="MathModeLatexEquation" attribute="Math" lineEndContext="#stay"> | ||
477 | <Detect2Chars char="\" char1="]" attribute="Math" context="#pop" endRegion="mathMode" /> | 868 | <Detect2Chars char="\" char1="]" attribute="Math" context="#pop" endRegion="mathMode"/> | ||
478 | <StringDetect String="$$" attribute="Error" context="#stay" /> | | |||
479 | <DetectChar char="$" attribute="Error" context="#stay" /> | | |||
480 | <Detect2Chars char="\" char1=")" attribute="Error" context="#stay" /> | | |||
481 | <IncludeRules context="MathModeCommon" /> | 869 | <IncludeRules context="MathModeCommon"/> | ||
482 | </context> | 870 | </context> | ||
483 | 871 | | |||
484 | <!-- math mode: \ensuremath{...} !--> | 872 | <!-- math mode: \ensuremath{...} --> | ||
485 | <context name="MathModeEnsure" attribute="Math" lineEndContext="#stay"> | 873 | <context name="MathModeEnsure" attribute="Math" lineEndContext="#stay"> | ||
486 | <DetectChar char="{" attribute="Math" context="MathModeEnsure" /> | 874 | <DetectSpaces/> | ||
875 | <DetectChar char="{" attribute="Math" context="#pop!MathModeEnsureInside"/> | ||||
876 | <RegExpr String="." attribute="Error" context="#pop"/> | ||||
877 | </context> | ||||
878 | <context name="MathModeEnsureInside" attribute="Math" lineEndContext="#stay"> | ||||
879 | <DetectChar char="{" attribute="Math" context="MathModeEnsureInside" /> | ||||
487 | <DetectChar char="}" attribute="Math" context="#pop" /> | 880 | <DetectChar char="}" attribute="Math" context="#pop" /> | ||
488 | <IncludeRules context="MathModeCommon" /> | 881 | <IncludeRules context="MathModeCommon"/> | ||
489 | </context> | 882 | </context> | ||
490 | 883 | | |||
491 | <!-- math mode common --> | 884 | <!-- math mode common --> | ||
492 | <context name="MathModeCommon" attribute="Math" lineEndContext="#stay"> | 885 | <context name="MathModeCommon" attribute="Math" lineEndContext="#stay"> | ||
493 | <RegExpr String="\\(begin|end)\s*\{(equation|displaymath|eqnarray|subeqnarray|math|multline|gather|align|flalign|alignat|xalignat|xxalignat|IEEEeqnarray)\*?\}" attribute="Error" context="#stay"/> | 886 | <DetectSpaces/> | ||
494 | <RegExpr String="\\begin(?=[^a-zA-Z])" attribute="Macro Mathmode" context="#stay" beginRegion="block" /> | 887 | <DetectIdentifier/> | ||
495 | <RegExpr String="\\end(?=[^a-zA-Z])" attribute="Macro Mathmode" context="#stay" endRegion="block" /> | 888 | <keyword String="beginEnv" attribute="Structure" context="MathEnvironment" beginRegion="block"/> | ||
496 | <RegExpr String="\\(text|intertext|mbox)\s*(?=\{)" attribute="Macro Mathmode" context="MathModeText" /> | 889 | <keyword String="endEnv" attribute="Structure" context="MathEnvironmentEnd" endRegion="block"/> | ||
890 | <keyword String="MathModeText" attribute="Macro Mathmode" context="MathModeText" /> | ||||
497 | <DetectChar char="\" attribute="Macro Mathmode" context="MathContrSeq"/> | 891 | <DetectChar char="\" attribute="Macro Mathmode" context="MathContrSeq"/> | ||
892 | <RegExpr String="%\s*(BEGIN|END)" attribute="Region Marker" context="RegionComment" firstNonSpace="true"/> | ||||
498 | <DetectChar char="%" attribute="Comment" context="Comment"/> | 893 | <DetectChar char="%" attribute="Comment" context="Comment"/> | ||
499 | <RegExpr String="%\s*BEGIN.*$" attribute="Region Marker" context="#stay" beginRegion="regionMarker" firstNonSpace="true"/> | 894 | <DetectChar char="•" attribute="Bullet" context="#stay"/> | ||
500 | <RegExpr String="%\s*END.*$" attribute="Region Marker" context="#stay" endRegion="regionMarker" firstNonSpace="true"/> | 895 | </context> | ||
501 | <DetectChar char="×" attribute="Bullet" context="#stay"/> | 896 | <context name="MathEnvironment" attribute="Math" lineEndContext="#stay"> | ||
897 | <DetectSpaces/> | ||||
898 | <DetectChar char="{" attribute="Normal Text" context="MathEnvironmentInside"/> | ||||
899 | <RegExpr String="." attribute="Error" context="#pop"/> | ||||
900 | </context> | ||||
901 | <context name="MathEnvironmentInside" attribute="Environment" lineEndContext="#stay"> | ||||
902 | <DetectChar char="}" attribute="Normal Text" context="#pop#pop"/> | ||||
903 | <RegExpr String="&envname;" attribute="Environment" context="#stay"/> | ||||
904 | <RegExpr String="[^}a-zA-Z]+|." attribute="Error" context="#stay"/> | ||||
905 | </context> | ||||
906 | <context name="MathEnvironmentEnd" attribute="Math" lineEndContext="#stay"> | ||||
907 | <DetectSpaces/> | ||||
908 | <DetectChar char="{" attribute="Normal Text" context="MathEnvironmentEndInside"/> | ||||
909 | <RegExpr String="." attribute="Error" context="#pop"/> | ||||
910 | </context> | ||||
911 | <context name="MathEnvironmentEndInside" attribute="Environment" lineEndContext="#stay"> | ||||
912 | <DetectChar char="}" attribute="Normal Text" context="#pop#pop"/> | ||||
913 | <WordDetect String="ensuremath" attribute="Environment" context="#pop!LatexEnvEnd"/> | ||||
914 | <RegExpr String="&envname;" attribute="Environment" context="#stay"/> | ||||
915 | <RegExpr String="[^}a-zA-Z]+|." attribute="Error" context="#pop#pop"/> | ||||
502 | </context> | 916 | </context> | ||
503 | 917 | | |||
504 | <!-- command in mathmode --> | 918 | <!-- command in mathmode --> | ||
505 | <context name="MathContrSeq" attribute="Macro Mathmode" lineEndContext="#pop"> | 919 | <context name="MathContrSeq" attribute="Macro Mathmode" lineEndContext="#pop"> | ||
506 | <DetectChar char="×" attribute="Bullet" context="#stay"/> | 920 | <DetectChar char="•" attribute="Bullet" context="#stay"/> | ||
507 | <RegExpr String="[a-zA-Z]+\*?" attribute="Macro Mathmode" context="#pop"/> | 921 | <RegExpr String="&envname;|." attribute="Macro Mathmode" context="#pop" /> | ||
508 | <RegExpr String="[^a-zA-Z]" attribute="Macro Mathmode" context="#pop" /> | | |||
509 | </context> | 922 | </context> | ||
510 | 923 | | |||
511 | <!-- text in mathmode --> | 924 | <!-- text in mathmode --> | ||
512 | <context name="MathModeText" attribute="Normal Text" lineEndContext="#stay" > | 925 | <context name="MathModeText" attribute="Normal Text" lineEndContext="#stay" fallthrough="true" fallthroughContext="MathContrSeq"> | ||
926 | <DetectSpaces/> | ||||
927 | <DetectChar char="{" attribute="Normal Text" context="MathModeTextParameterStart"/> | ||||
928 | </context> | ||||
929 | <context name="MathModeTextInside" attribute="Normal Text" lineEndContext="#stay" > | ||||
513 | <DetectChar char="{" attribute="Normal Text" context="MathModeTextParameterStart"/> | 930 | <DetectChar char="{" attribute="Normal Text" context="MathModeTextParameterStart"/> | ||
514 | </context> | 931 | </context> | ||
515 | 932 | | |||
516 | <context name="MathModeTextParameterStart" attribute="Normal Text" lineEndContext="#stay" > | 933 | <context name="MathModeTextParameterStart" attribute="Normal Text" lineEndContext="#stay" > | ||
517 | <RegExpr String="\\." attribute="Normal Text" context="#stay"/> | 934 | <DetectChar char="•" attribute="Bullet" context="#stay"/> | ||
518 | <DetectChar char="×" attribute="Bullet" context="#stay"/> | 935 | <RangeDetect char="$" char1="$" attribute="Math" context="#stay"/> | ||
519 | <RegExpr String="\$.*\$" minimal="true" attribute="Math" context="#stay"/> | 936 | <DetectChar char="{" attribute="Normal Text" context="MathModeTextInside" lookAhead="true"/> | ||
520 | <DetectChar char="{" attribute="Normal Text" context="MathModeTextParameter"/> | | |||
521 | <DetectChar char="}" attribute="Normal Text" context="#pop#pop"/> | 937 | <DetectChar char="}" attribute="Normal Text" context="#pop#pop"/> | ||
522 | <DetectChar char="%" attribute="Comment" context="Comment"/> | 938 | <DetectChar char="%" attribute="Comment" context="Comment"/> | ||
523 | </context> | 939 | <DetectChar char="\" attribute="Macro Mathmode" context="MathContrSeq"/> | ||
524 | | ||||
525 | <context name="MathModeTextParameter" attribute="Normal Text" lineEndContext="#stay" > | | |||
526 | <RegExpr String="\\." attribute="Normal Text" context="#stay"/> | | |||
527 | <DetectChar char="{" attribute="Normal Text" context="MathModeTextParameter"/> | | |||
528 | <DetectChar char="}" attribute="Normal Text" context="#pop"/> | | |||
529 | <DetectChar char="×" attribute="Bullet" context="#stay"/> | | |||
530 | <DetectChar char="%" attribute="Comment" context="Comment"/> | | |||
531 | </context> | 940 | </context> | ||
532 | 941 | | |||
533 | <!-- iffalse aka multiline comment --> | 942 | <!-- iffalse aka multiline comment --> | ||
534 | <context name="Multiline Comment" attribute="Comment" lineEndContext="#stay"> | 943 | <context name="Multiline Comment" attribute="Comment" lineEndContext="#stay"> | ||
535 | <WordDetect String="\fi" attribute="Comment" context="#pop"/> | 944 | <keyword String="iffalseend" attribute="Comment" context="#pop"/> | ||
536 | <WordDetect String="\else" attribute="Comment" context="#pop"/> | | |||
537 | </context> | 945 | </context> | ||
538 | 946 | | |||
539 | <!-- comment --> | 947 | <!-- comment --> | ||
948 | <context name="RegionComment" attribute="Region Marker" lineEndContext="#pop"/> | ||||
540 | <context name="Comment" attribute="Comment" lineEndContext="#pop"> | 949 | <context name="Comment" attribute="Comment" lineEndContext="#pop"> | ||
541 | <RegExpr String="(FIXME|TODO):?" attribute="Alert" context="#stay"/> | 950 | <DetectSpaces/> | ||
542 | <StringDetect String="\KileResetHL" attribute="Comment" context="Normal Text"/> | 951 | <IncludeRules context="##Alerts" /> | ||
543 | <StringDetect String="\KateResetHL" attribute="Comment" context="Normal Text"/> | 952 | <DetectIdentifier/> | ||
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"/> | ||
969 | <itemData name="Reference" defStyleNum="dsExtension" spellChecking="false"/> | ||||
559 | <itemData name="Verbatim" defStyleNum="dsVerbatimString" spellChecking="false"/> | 970 | <itemData name="Verbatim" defStyleNum="dsVerbatimString" spellChecking="false"/> | ||
560 | <itemData name="Region Marker" defStyleNum="dsRegionMarker" spellChecking="false"/> | 971 | <itemData name="Region Marker" defStyleNum="dsRegionMarker" spellChecking="false"/> | ||
561 | <itemData name="Bullet" defStyleNum="dsInformation" spellChecking="false"/> | 972 | <itemData name="Bullet" defStyleNum="dsInformation" spellChecking="false"/> | ||
562 | <itemData name="Ampersand" defStyleNum="dsOperator" bold="1" spellChecking="false"/> | 973 | <itemData name="Ampersand" defStyleNum="dsOperator" bold="1" spellChecking="false"/> | ||
563 | <itemData name="Column Separator" defStyleNum="dsChar" spellChecking="false"/> | 974 | <itemData name="Column Separator" defStyleNum="dsChar" spellChecking="false"/> | ||
564 | <itemData name="Alert" defStyleNum="dsAlert" 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 |