Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
microsoft
GitHub Repository: microsoft/vscode
Path: blob/main/extensions/latex/syntaxes/TeX.tmLanguage.json
5247 views
1
{
2
"information_for_contributors": [
3
"This file has been converted from https://github.com/jlelong/vscode-latex-basics/blob/master/syntaxes/TeX.tmLanguage.json",
4
"If you want to provide a fix or improvement, please create a pull request against the original repository.",
5
"Once accepted there, we are happy to receive an update request."
6
],
7
"version": "https://github.com/jlelong/vscode-latex-basics/commit/76dc409348227db00f6779772f7763dc90cdf22e",
8
"name": "TeX",
9
"scopeName": "text.tex",
10
"patterns": [
11
{
12
"include": "#iffalse-block"
13
},
14
{
15
"include": "#macro-control"
16
},
17
{
18
"include": "#catcode"
19
},
20
{
21
"include": "#comment"
22
},
23
{
24
"match": "[\\[\\]]",
25
"name": "punctuation.definition.brackets.tex"
26
},
27
{
28
"include": "#dollar-math"
29
},
30
{
31
"match": "\\\\\\\\",
32
"name": "keyword.control.newline.tex"
33
},
34
{
35
"include": "#ifnextchar"
36
},
37
{
38
"include": "#macro-general"
39
}
40
],
41
"repository": {
42
"catcode": {
43
"match": "((\\\\)catcode)`(?:\\\\)?.(=)(\\d+)",
44
"captures": {
45
"1": {
46
"name": "keyword.control.catcode.tex"
47
},
48
"2": {
49
"name": "punctuation.definition.keyword.tex"
50
},
51
"3": {
52
"name": "punctuation.separator.key-value.tex"
53
},
54
"4": {
55
"name": "constant.numeric.category.tex"
56
}
57
},
58
"name": "meta.catcode.tex"
59
},
60
"iffalse-block": {
61
"begin": "(?<=^\\s*)((\\\\)iffalse)(?!\\s*[{}]\\s*\\\\fi\\b)",
62
"beginCaptures": {
63
"1": {
64
"name": "keyword.control.tex"
65
},
66
"2": {
67
"name": "punctuation.definition.keyword.tex"
68
}
69
},
70
"contentName": "comment.line.percentage.tex",
71
"end": "((\\\\)(?:else|fi)\\b)",
72
"endCaptures": {
73
"1": {
74
"name": "keyword.control.tex"
75
},
76
"2": {
77
"name": "punctuation.definition.keyword.tex"
78
}
79
},
80
"patterns": [
81
{
82
"include": "#comment"
83
},
84
{
85
"include": "#braces"
86
},
87
{
88
"include": "#conditionals"
89
}
90
]
91
},
92
"ifnextchar": {
93
"match": "\\\\@ifnextchar[({\\[]",
94
"name": "keyword.control.ifnextchar.tex"
95
},
96
"macro-control": {
97
"match": "(\\\\)(backmatter|csname|else|endcsname|fi|frontmatter|mainmatter|unless|if(case|cat|csname|defined|dim|eof|false|fontchar|hbox|hmode|inner|mmode|num|odd|true|vbox|vmode|void|x)?)(?![a-zA-Z@])",
98
"captures": {
99
"1": {
100
"name": "punctuation.definition.keyword.tex"
101
}
102
},
103
"name": "keyword.control.tex"
104
},
105
"braces": {
106
"begin": "(?<!\\\\)\\{",
107
"beginCaptures": {
108
"0": {
109
"name": "punctuation.group.begin.tex"
110
}
111
},
112
"end": "(?<!\\\\)\\}",
113
"endCaptures": {
114
"0": {
115
"name": "punctuation.group.end.tex"
116
}
117
},
118
"name": "meta.group.braces.tex",
119
"patterns": [
120
{
121
"include": "#braces"
122
}
123
]
124
},
125
"comment": {
126
"begin": "(^[ \\t]+)?(?=%)",
127
"beginCaptures": {
128
"1": {
129
"name": "punctuation.whitespace.comment.leading.tex"
130
}
131
},
132
"end": "(?!\\G)",
133
"patterns": [
134
{
135
"begin": "%:?",
136
"beginCaptures": {
137
"0": {
138
"name": "punctuation.definition.comment.tex"
139
}
140
},
141
"end": "$\\n?",
142
"name": "comment.line.percentage.tex"
143
},
144
{
145
"begin": "^(%!TEX) (\\S*) =",
146
"beginCaptures": {
147
"1": {
148
"name": "punctuation.definition.comment.tex"
149
}
150
},
151
"end": "$\\n?",
152
"name": "comment.line.percentage.directive.tex"
153
}
154
]
155
},
156
"conditionals": {
157
"begin": "(?<=^\\s*)\\\\if(?!f\\b)[a-z]*",
158
"end": "(?<=^\\s*)\\\\fi",
159
"patterns": [
160
{
161
"include": "#comment"
162
},
163
{
164
"include": "#conditionals"
165
}
166
]
167
},
168
"dollar-math": {
169
"begin": "(\\$\\$|\\$)",
170
"beginCaptures": {
171
"1": {
172
"name": "punctuation.definition.string.begin.tex"
173
}
174
},
175
"end": "(\\1)",
176
"endCaptures": {
177
"1": {
178
"name": "punctuation.definition.string.end.tex"
179
}
180
},
181
"name": "meta.math.block.tex support.class.math.block.tex",
182
"patterns": [
183
{
184
"match": "\\\\\\$",
185
"name": "constant.character.escape.tex"
186
},
187
{
188
"include": "#math-content"
189
},
190
{
191
"include": "$self"
192
}
193
]
194
},
195
"math-content": {
196
"patterns": [
197
{
198
"begin": "((\\\\)(?:text|mbox))(\\{)",
199
"beginCaptures": {
200
"1": {
201
"name": "constant.other.math.tex"
202
},
203
"2": {
204
"name": "punctuation.definition.function.tex"
205
},
206
"3": {
207
"name": "punctuation.definition.arguments.begin.tex meta.text.normal.tex"
208
}
209
},
210
"contentName": "meta.text.normal.tex",
211
"end": "\\}",
212
"endCaptures": {
213
"0": {
214
"name": "punctuation.definition.arguments.end.tex meta.text.normal.tex"
215
}
216
},
217
"patterns": [
218
{
219
"include": "#math-content"
220
},
221
{
222
"include": "$self"
223
}
224
]
225
},
226
{
227
"match": "\\\\{|\\\\}",
228
"name": "punctuation.math.bracket.pair.tex"
229
},
230
{
231
"match": "\\\\(left|right|((big|bigg|Big|Bigg)[lr]?))([\\(\\[\\<\\>\\]\\)\\.\\|]|\\\\[{}|]|\\\\[lr]?[Vv]ert|\\\\[lr]angle)",
232
"name": "punctuation.math.bracket.pair.big.tex"
233
},
234
{
235
"match": "(\\\\)(s(s(earrow|warrow|lash)|h(ort(downarrow|uparrow|parallel|leftarrow|rightarrow|mid)|arp)|tar|i(gma|m(eq)?)|u(cc(sim|n(sim|approx)|curlyeq|eq|approx)?|pset(neq(q)?|plus(eq)?|eq(q)?)?|rd|m|bset(neq(q)?|plus(eq)?|eq(q)?)?)|p(hericalangle|adesuit)|e(tminus|arrow)|q(su(pset(eq)?|bset(eq)?)|c(up|ap)|uare)|warrow|m(ile|all(s(etminus|mile)|frown)))|h(slash|ook(leftarrow|rightarrow)|eartsuit|bar)|R(sh|ightarrow|e|bag)|Gam(e|ma)|n(s(hort(parallel|mid)|im|u(cc(eq)?|pseteq(q)?|bseteq))|Rightarrow|n(earrow|warrow)|cong|triangle(left(eq(slant)?)?|right(eq(slant)?)?)|i(plus)?|u|p(lus|arallel|rec(eq)?)|e(q|arrow|g|xists)|v(dash|Dash)|warrow|le(ss|q(slant|q)?|ft(arrow|rightarrow))|a(tural|bla)|VDash|rightarrow|g(tr|eq(slant|q)?)|mid|Left(arrow|rightarrow))|c(hi|irc(eq|le(d(circ|S|dash|ast)|arrow(left|right)))?|o(ng|prod|lon|mplement)|dot(s|p)?|u(p|r(vearrow(left|right)|ly(eq(succ|prec)|vee(downarrow|uparrow)?|wedge(downarrow|uparrow)?)))|enterdot|lubsuit|ap)|Xi|Maps(to(char)?|from(char)?)|B(ox|umpeq|bbk)|t(h(ick(sim|approx)|e(ta|refore))|imes|op|wohead(leftarrow|rightarrow)|a(u|lloblong)|riangle(down|q|left(eq(slant)?)?|right(eq(slant)?)?)?)|i(n(t(er(cal|leave))?|plus|fty)?|ota|math)|S(igma|u(pset|bset))|zeta|o(slash|times|int|dot|plus|vee|wedge|lessthan|greaterthan|m(inus|ega)|b(slash|long|ar))|d(i(v(ideontimes)?|a(g(down|up)|mond(suit)?)|gamma)|o(t(plus|eq(dot)?)|ublebarwedge|wn(harpoon(left|right)|downarrows|arrow))|d(ots|agger)|elta|a(sh(v|leftarrow|rightarrow)|leth|gger))|Y(down|up|left|right)|C(up|ap)|u(n(lhd|rhd)|p(silon|harpoon(left|right)|downarrow|uparrows|lus|arrow)|lcorner|rcorner)|jmath|Theta|Im|p(si|hi|i(tchfork)?|erp|ar(tial|allel)|r(ime|o(d|pto)|ec(sim|n(sim|approx)|curlyeq|eq|approx)?)|m)|e(t(h|a)|psilon|q(slant(less|gtr)|circ|uiv)|ll|xists|mptyset)|Omega|D(iamond|ownarrow|elta)|v(d(ots|ash)|ee(bar)?|Dash|ar(s(igma|u(psetneq(q)?|bsetneq(q)?))|nothing|curly(vee|wedge)|t(heta|imes|riangle(left|right)?)|o(slash|circle|times|dot|plus|vee|wedge|lessthan|ast|greaterthan|minus|b(slash|ar))|p(hi|i|ropto)|epsilon|kappa|rho|bigcirc))|kappa|Up(silon|downarrow|arrow)|Join|f(orall|lat|a(t(s(emi|lash)|bslash)|llingdotseq)|rown)|P(si|hi|i)|w(p|edge|r)|l(hd|n(sim|eq(q)?|approx)|ceil|times|ightning|o(ng(left(arrow|rightarrow)|rightarrow|maps(to|from))|zenge|oparrow(left|right))|dot(s|p)|e(ss(sim|dot|eq(qgtr|gtr)|approx|gtr)|q(slant|q)?|ft(slice|harpoon(down|up)|threetimes|leftarrows|arrow(t(ail|riangle))?|right(squigarrow|harpoons|arrow(s|triangle|eq)?))|adsto)|vertneqq|floor|l(c(orner|eil)|floor|l|bracket)?|a(ngle|mbda)|rcorner|bag)|a(s(ymp|t)|ngle|pprox(eq)?|l(pha|eph)|rrownot|malg)|V(dash|vdash)|r(h(o|d)|ceil|times|i(singdotseq|ght(s(quigarrow|lice)|harpoon(down|up)|threetimes|left(harpoons|arrows)|arrow(t(ail|riangle))?|rightarrows))|floor|angle|r(ceil|parenthesis|floor|bracket)|bag)|g(n(sim|eq(q)?|approx)|tr(sim|dot|eq(qless|less)|less|approx)|imel|eq(slant|q)?|vertneqq|amma|g(g)?)|Finv|xi|m(ho|i(nuso|d)|o(o|dels)|u(ltimap)?|p|e(asuredangle|rge)|aps(to|from(char)?))|b(i(n(dnasrepma|ampersand)|g(s(tar|qc(up|ap))|nplus|c(irc|u(p|rly(vee|wedge))|ap)|triangle(down|up)|interleave|o(times|dot|plus)|uplus|parallel|vee|wedge|box))|o(t|wtie|x(slash|circle|times|dot|plus|empty|ast|minus|b(slash|ox|ar)))|u(llet|mpeq)|e(cause|t(h|ween|a))|lack(square|triangle(down|left|right)?|lozenge)|a(ck(s(im(eq)?|lash)|prime|epsilon)|r(o|wedge))|bslash)|L(sh|ong(left(arrow|rightarrow)|rightarrow|maps(to|from))|eft(arrow|rightarrow)|leftarrow|ambda|bag)|ge|le|Arrownot)(?![a-zA-Z@])",
236
"captures": {
237
"1": {
238
"name": "punctuation.definition.constant.math.tex"
239
}
240
},
241
"name": "constant.character.math.tex"
242
},
243
{
244
"match": "(\\\\)(sum|prod|coprod|int|oint|bigcap|bigcup|bigsqcup|bigvee|bigwedge|bigodot|bigotimes|bogoplus|biguplus)\\b",
245
"captures": {
246
"1": {
247
"name": "punctuation.definition.constant.math.tex"
248
}
249
},
250
"name": "constant.character.math.tex"
251
},
252
{
253
"match": "(\\\\)(arccos|arcsin|arctan|arg|cos|cosh|cot|coth|csc|deg|det|dim|exp|gcd|hom|inf|ker|lg|lim|liminf|limsup|ln|log|max|min|pr|sec|sin|sinh|sup|tan|tanh)\\b",
254
"captures": {
255
"1": {
256
"name": "punctuation.definition.constant.math.tex"
257
}
258
},
259
"name": "constant.other.math.tex"
260
},
261
{
262
"begin": "((\\\\)Sexpr(\\{))",
263
"beginCaptures": {
264
"1": {
265
"name": "support.function.sexpr.math.tex"
266
},
267
"2": {
268
"name": "punctuation.definition.function.math.tex"
269
},
270
"3": {
271
"name": "punctuation.section.embedded.begin.math.tex"
272
}
273
},
274
"contentName": "support.function.sexpr.math.tex",
275
"end": "(((\\})))",
276
"endCaptures": {
277
"1": {
278
"name": "support.function.sexpr.math.tex"
279
},
280
"2": {
281
"name": "punctuation.section.embedded.end.math.tex"
282
},
283
"3": {
284
"name": "source.r"
285
}
286
},
287
"name": "meta.embedded.line.r",
288
"patterns": [
289
{
290
"begin": "\\G(?!\\})",
291
"end": "(?=\\})",
292
"name": "source.r",
293
"patterns": [
294
{
295
"include": "source.r"
296
}
297
]
298
}
299
]
300
},
301
{
302
"captures": {
303
"1": {
304
"name": "punctuation.definition.constant.math.tex"
305
}
306
},
307
"match": "(\\\\)(?!begin\\{|verb)([A-Za-z]+)",
308
"name": "constant.other.general.math.tex"
309
},
310
{
311
"match": "(?<!\\\\)\\{",
312
"name": "punctuation.math.begin.bracket.curly.tex"
313
},
314
{
315
"match": "(?<!\\\\)\\}",
316
"name": "punctuation.math.end.bracket.curly.tex"
317
},
318
{
319
"match": "(?<!\\\\)\\(",
320
"name": "punctuation.math.begin.bracket.round.tex"
321
},
322
{
323
"match": "(?<!\\\\)\\)",
324
"name": "punctuation.math.end.bracket.round.tex"
325
},
326
{
327
"match": "(([0-9]*[\\.][0-9]+)|[0-9]+)",
328
"name": "constant.numeric.math.tex"
329
},
330
{
331
"match": "[\\+\\*/-]|(?:(?<!\\^)\\^(?!\\^))|(?:(?<!\\_)\\_(?!\\_))",
332
"name": "punctuation.math.operator.tex"
333
}
334
]
335
},
336
"macro-general": {
337
"patterns": [
338
{
339
"match": "(\\\\)_*[\\p{Alphabetic}@]+(?:_[\\p{Alphabetic}@]+)*:[NncVvoxefTFpwD]*",
340
"captures": {
341
"1": {
342
"name": "punctuation.definition.function.tex"
343
}
344
},
345
"name": "support.class.general.latex3.tex"
346
},
347
{
348
"match": "(\\.)[\\p{Alphabetic}@]+(?:_[\\p{Alphabetic}@]+)*:[NncVvoxefTFpwD]*",
349
"captures": {
350
"1": {
351
"name": "punctuation.definition.function.tex"
352
}
353
},
354
"name": "support.class.general.latex3.tex"
355
},
356
{
357
"match": "(\\\\)(?:[,;]|(?:[\\p{Alphabetic}@]+))",
358
"captures": {
359
"1": {
360
"name": "punctuation.definition.function.tex"
361
}
362
},
363
"name": "support.function.general.tex"
364
},
365
{
366
"match": "(\\\\)[^a-zA-Z@]",
367
"captures": {
368
"1": {
369
"name": "punctuation.definition.keyword.tex"
370
}
371
},
372
"name": "constant.character.escape.tex"
373
}
374
]
375
}
376
}
377
}
378