Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
microsoft
GitHub Repository: microsoft/vscode
Path: blob/main/extensions/latex/syntaxes/TeX.tmLanguage.json
3291 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/6bd99800f7b2cbd0e36cecb56fe1936da5affadb",
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": "#macro-general"
36
}
37
],
38
"repository": {
39
"catcode": {
40
"match": "((\\\\)catcode)`(?:\\\\)?.(=)(\\d+)",
41
"captures": {
42
"1": {
43
"name": "keyword.control.catcode.tex"
44
},
45
"2": {
46
"name": "punctuation.definition.keyword.tex"
47
},
48
"3": {
49
"name": "punctuation.separator.key-value.tex"
50
},
51
"4": {
52
"name": "constant.numeric.category.tex"
53
}
54
},
55
"name": "meta.catcode.tex"
56
},
57
"iffalse-block": {
58
"begin": "(?<=^\\s*)((\\\\)iffalse)(?!\\s*[{}]\\s*\\\\fi\\b)",
59
"beginCaptures": {
60
"1": {
61
"name": "keyword.control.tex"
62
},
63
"2": {
64
"name": "punctuation.definition.keyword.tex"
65
}
66
},
67
"contentName": "comment.line.percentage.tex",
68
"end": "((\\\\)(?:else|fi)\\b)",
69
"endCaptures": {
70
"1": {
71
"name": "keyword.control.tex"
72
},
73
"2": {
74
"name": "punctuation.definition.keyword.tex"
75
}
76
},
77
"patterns": [
78
{
79
"include": "#comment"
80
},
81
{
82
"include": "#braces"
83
},
84
{
85
"include": "#conditionals"
86
}
87
]
88
},
89
"macro-control": {
90
"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@])",
91
"captures": {
92
"1": {
93
"name": "punctuation.definition.keyword.tex"
94
}
95
},
96
"name": "keyword.control.tex"
97
},
98
"braces": {
99
"begin": "(?<!\\\\)\\{",
100
"beginCaptures": {
101
"0": {
102
"name": "punctuation.group.begin.tex"
103
}
104
},
105
"end": "(?<!\\\\)\\}",
106
"endCaptures": {
107
"0": {
108
"name": "punctuation.group.end.tex"
109
}
110
},
111
"name": "meta.group.braces.tex",
112
"patterns": [
113
{
114
"include": "#braces"
115
}
116
]
117
},
118
"comment": {
119
"begin": "(^[ \\t]+)?(?=%)",
120
"beginCaptures": {
121
"1": {
122
"name": "punctuation.whitespace.comment.leading.tex"
123
}
124
},
125
"end": "(?!\\G)",
126
"patterns": [
127
{
128
"begin": "%:?",
129
"beginCaptures": {
130
"0": {
131
"name": "punctuation.definition.comment.tex"
132
}
133
},
134
"end": "$\\n?",
135
"name": "comment.line.percentage.tex"
136
},
137
{
138
"begin": "^(%!TEX) (\\S*) =",
139
"beginCaptures": {
140
"1": {
141
"name": "punctuation.definition.comment.tex"
142
}
143
},
144
"end": "$\\n?",
145
"name": "comment.line.percentage.directive.tex"
146
}
147
]
148
},
149
"conditionals": {
150
"begin": "(?<=^\\s*)\\\\if[a-z]*",
151
"end": "(?<=^\\s*)\\\\fi",
152
"patterns": [
153
{
154
"include": "#comment"
155
},
156
{
157
"include": "#conditionals"
158
}
159
]
160
},
161
"dollar-math": {
162
"begin": "(\\$\\$|\\$)",
163
"beginCaptures": {
164
"1": {
165
"name": "punctuation.definition.string.begin.tex"
166
}
167
},
168
"end": "(\\1)",
169
"endCaptures": {
170
"1": {
171
"name": "punctuation.definition.string.end.tex"
172
}
173
},
174
"name": "meta.math.block.tex support.class.math.block.tex",
175
"patterns": [
176
{
177
"match": "\\\\\\$",
178
"name": "constant.character.escape.tex"
179
},
180
{
181
"include": "#math-content"
182
},
183
{
184
"include": "$self"
185
}
186
]
187
},
188
"math-content": {
189
"patterns": [
190
{
191
"begin": "((\\\\)(?:text|mbox))(\\{)",
192
"beginCaptures": {
193
"1": {
194
"name": "constant.other.math.tex"
195
},
196
"2": {
197
"name": "punctuation.definition.function.tex"
198
},
199
"3": {
200
"name": "punctuation.definition.arguments.begin.tex meta.text.normal.tex"
201
}
202
},
203
"contentName": "meta.text.normal.tex",
204
"end": "\\}",
205
"endCaptures": {
206
"0": {
207
"name": "punctuation.definition.arguments.end.tex meta.text.normal.tex"
208
}
209
},
210
"patterns": [
211
{
212
"include": "#math-content"
213
},
214
{
215
"include": "$self"
216
}
217
]
218
},
219
{
220
"match": "\\\\{|\\\\}",
221
"name": "punctuation.math.bracket.pair.tex"
222
},
223
{
224
"match": "\\\\(left|right|((big|bigg|Big|Bigg)[lr]?))([\\(\\[\\<\\>\\]\\)\\.\\|]|\\\\[{}|]|\\\\[lr]?[Vv]ert|\\\\[lr]angle)",
225
"name": "punctuation.math.bracket.pair.big.tex"
226
},
227
{
228
"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)|Arrownot)(?![a-zA-Z@])",
229
"captures": {
230
"1": {
231
"name": "punctuation.definition.constant.math.tex"
232
}
233
},
234
"name": "constant.character.math.tex"
235
},
236
{
237
"match": "(\\\\)(sum|prod|coprod|int|oint|bigcap|bigcup|bigsqcup|bigvee|bigwedge|bigodot|bigotimes|bogoplus|biguplus)\\b",
238
"captures": {
239
"1": {
240
"name": "punctuation.definition.constant.math.tex"
241
}
242
},
243
"name": "constant.character.math.tex"
244
},
245
{
246
"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",
247
"captures": {
248
"1": {
249
"name": "punctuation.definition.constant.math.tex"
250
}
251
},
252
"name": "constant.other.math.tex"
253
},
254
{
255
"begin": "((\\\\)Sexpr(\\{))",
256
"beginCaptures": {
257
"1": {
258
"name": "support.function.sexpr.math.tex"
259
},
260
"2": {
261
"name": "punctuation.definition.function.math.tex"
262
},
263
"3": {
264
"name": "punctuation.section.embedded.begin.math.tex"
265
}
266
},
267
"contentName": "support.function.sexpr.math.tex",
268
"end": "(((\\})))",
269
"endCaptures": {
270
"1": {
271
"name": "support.function.sexpr.math.tex"
272
},
273
"2": {
274
"name": "punctuation.section.embedded.end.math.tex"
275
},
276
"3": {
277
"name": "source.r"
278
}
279
},
280
"name": "meta.embedded.line.r",
281
"patterns": [
282
{
283
"begin": "\\G(?!\\})",
284
"end": "(?=\\})",
285
"name": "source.r",
286
"patterns": [
287
{
288
"include": "source.r"
289
}
290
]
291
}
292
]
293
},
294
{
295
"captures": {
296
"1": {
297
"name": "punctuation.definition.constant.math.tex"
298
}
299
},
300
"match": "(\\\\)(?!begin\\{|verb)([A-Za-z]+)",
301
"name": "constant.other.general.math.tex"
302
},
303
{
304
"match": "(?<!\\\\)\\{",
305
"name": "punctuation.math.begin.bracket.curly.tex"
306
},
307
{
308
"match": "(?<!\\\\)\\}",
309
"name": "punctuation.math.end.bracket.curly.tex"
310
},
311
{
312
"match": "(?<!\\\\)\\(",
313
"name": "punctuation.math.begin.bracket.round.tex"
314
},
315
{
316
"match": "(?<!\\\\)\\)",
317
"name": "punctuation.math.end.bracket.round.tex"
318
},
319
{
320
"match": "(([0-9]*[\\.][0-9]+)|[0-9]+)",
321
"name": "constant.numeric.math.tex"
322
},
323
{
324
"match": "[\\+\\*/-]|(?:(?<!\\^)\\^(?!\\^))|(?:(?<!\\_)\\_(?!\\_))",
325
"name": "punctuation.math.operator.tex"
326
}
327
]
328
},
329
"macro-general": {
330
"patterns": [
331
{
332
"match": "(\\\\)_*[\\p{Alphabetic}@]+(?:_[\\p{Alphabetic}@]+)*:[NncVvoxefTFpwD]*",
333
"captures": {
334
"1": {
335
"name": "punctuation.definition.function.tex"
336
}
337
},
338
"name": "support.class.general.latex3.tex"
339
},
340
{
341
"match": "(\\.)[\\p{Alphabetic}@]+(?:_[\\p{Alphabetic}@]+)*:[NncVvoxefTFpwD]*",
342
"captures": {
343
"1": {
344
"name": "punctuation.definition.function.tex"
345
}
346
},
347
"name": "support.class.general.latex3.tex"
348
},
349
{
350
"match": "(\\\\)(?:[,;]|(?:[\\p{Alphabetic}@]+))",
351
"captures": {
352
"1": {
353
"name": "punctuation.definition.function.tex"
354
}
355
},
356
"name": "support.function.general.tex"
357
},
358
{
359
"match": "(\\\\)[^a-zA-Z@]",
360
"captures": {
361
"1": {
362
"name": "punctuation.definition.keyword.tex"
363
}
364
},
365
"name": "constant.character.escape.tex"
366
}
367
]
368
}
369
}
370
}
371