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