diff -r 000000000000 -r aa9fc390ce91 syntaxes/LaTeX.tmLanguage.json --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/syntaxes/LaTeX.tmLanguage.json Mon May 11 17:50:17 2020 -0500 @@ -0,0 +1,1588 @@ +{ + "fileTypes": [ + "tex" + ], + "firstLineMatch": "^\\\\documentclass(\\[.*\\])?\\{.*\\}", + "keyEquivalent": "^~L", + "name": "LaTeX+", + "patterns": [ + { + "comment": "This scope identifies partially typed commands such as `\\tab`. We use this to trigger “Command Completion” only when it makes sense.", + "match": "(?<=\\\\[\\w@]|\\\\[\\w@]{2}|\\\\[\\w@]{3}|\\\\[\\w@]{4}|\\\\[\\w@]{5}|\\\\[\\w@]{6})\\s", + "name": "meta.space-after-command.latex" + }, + { + "begin": "((\\\\)(?:usepackage|documentclass))((?:\\[[^\\[]*?\\])*)(\\{)", + "beginCaptures": { + "1": { + "name": "keyword.control.preamble.latex" + }, + "2": { + "name": "punctuation.definition.function.latex" + }, + "3": { + "patterns": [ + { + "include": "#optional-arg" + } + ] + }, + "4": { + "name": "punctuation.definition.arguments.begin.latex" + } + }, + "contentName": "support.class.latex", + "end": "\\}", + "endCaptures": { + "0": { + "name": "punctuation.definition.arguments.end.latex" + } + }, + "name": "meta.preamble.latex", + "patterns": [ + { + "include": "$self" + } + ] + }, + { + "begin": "((\\\\)(?:include|input))(\\{)", + "beginCaptures": { + "1": { + "name": "keyword.control.include.latex" + }, + "2": { + "name": "punctuation.definition.function.latex" + }, + "3": { + "name": "punctuation.definition.arguments.begin.latex" + } + }, + "contentName": "support.class.latex", + "end": "\\}", + "endCaptures": { + "0": { + "name": "punctuation.definition.arguments.end.latex" + } + }, + "name": "meta.include.latex", + "patterns": [ + { + "include": "$self" + } + ] + }, + { + "begin": "((\\\\)((?:sub){0,2}section|(?:sub)?paragraph|chapter|part|addpart|addchap|addsec|minisec|frametitle)(?:\\*)?)((?:\\[[^\\[]*?\\]){0,2})(\\{)", + "beginCaptures": { + "1": { + "name": "support.function.section.latex" + }, + "2": { + "name": "punctuation.definition.function.latex" + }, + "4": { + "patterns": [ + { + "include": "#optional-arg" + } + ] + }, + "5": { + "name": "punctuation.definition.arguments.begin.latex" + } + }, + "comment": "this works OK with all kinds of crazy stuff as long as section is one line", + "contentName": "entity.name.section.latex", + "end": "\\}", + "endCaptures": { + "0": { + "name": "punctuation.definition.arguments.end.latex" + } + }, + "name": "meta.function.section.$3.latex", + "patterns": [ + { + "include": "text.tex#braces" + }, + { + "include": "$base" + } + ] + }, + { + "begin": "(^\\s*)?(?=\\\\begin\\{(lstlisting|minted|pyglist)\\})", + "beginCaptures": { + "0": { + "name": "punctuation.whitespace.embedded.leading.latex" + } + }, + "end": "(?!\\G)(\\s*$\\n?)?", + "endCaptures": { + "0": { + "name": "punctuation.whitespace.embedded.trailing.latex" + } + }, + "patterns": [ + { + "begin": "(\\\\begin\\{minted\\}(?:\\[.*\\])?\\{(?:cpp|c)\\})", + "captures": { + "1": { + "patterns": [ + { + "include": "#minted-env" + } + ] + } + }, + "contentName": "source.cpp.embedded.latex", + "patterns": [ + { + "include": "source.cpp.embedded.latex" + } + ], + "end": "(\\\\end\\{minted\\})" + }, + { + "begin": "(\\\\begin\\{minted\\}(?:\\[.*\\])?\\{css\\})", + "captures": { + "1": { + "patterns": [ + { + "include": "#minted-env" + } + ] + } + }, + "contentName": "source.css", + "patterns": [ + { + "include": "source.css" + } + ], + "end": "(\\\\end\\{minted\\})" + }, + { + "begin": "(\\\\begin\\{minted\\}(?:\\[.*\\])?\\{html\\})", + "captures": { + "1": { + "patterns": [ + { + "include": "#minted-env" + } + ] + } + }, + "contentName": "text.html", + "patterns": [ + { + "include": "text.html" + } + ], + "end": "(\\\\end\\{minted\\})" + }, + { + "begin": "(\\\\begin\\{minted\\}(?:\\[.*\\])?\\{java\\})", + "captures": { + "1": { + "patterns": [ + { + "include": "#minted-env" + } + ] + } + }, + "contentName": "source.java", + "patterns": [ + { + "include": "source.java" + } + ], + "end": "(\\\\end\\{minted\\})" + }, + { + "begin": "(\\\\begin\\{minted\\}(?:\\[.*\\])?\\{(?:js|javascript)\\})", + "captures": { + "1": { + "patterns": [ + { + "include": "#minted-env" + } + ] + } + }, + "contentName": "source.js", + "patterns": [ + { + "include": "source.js" + } + ], + "end": "(\\\\end\\{minted\\})" + }, + { + "begin": "(\\\\begin\\{minted\\}(?:\\[.*\\])?\\{lua\\})", + "captures": { + "1": { + "patterns": [ + { + "include": "#minted-env" + } + ] + } + }, + "contentName": "source.lua", + "patterns": [ + { + "include": "source.lua" + } + ], + "end": "(\\\\end\\{minted\\})" + }, + { + "begin": "(\\\\begin\\{minted\\}(?:\\[.*\\])?\\{(?:python|py)\\})", + "captures": { + "1": { + "patterns": [ + { + "include": "#minted-env" + } + ] + } + }, + "contentName": "source.python", + "patterns": [ + { + "include": "source.python" + } + ], + "end": "(\\\\end\\{minted\\})" + }, + { + "begin": "(\\\\begin\\{minted\\}(?:\\[.*\\])?\\{xml\\})", + "captures": { + "1": { + "patterns": [ + { + "include": "#minted-env" + } + ] + } + }, + "contentName": "yaml.xml", + "patterns": [ + { + "include": "yaml.xml" + } + ], + "end": "(\\\\end\\{minted\\})" + }, + { + "begin": "(\\\\begin\\{minted\\}(?:\\[.*\\])?\\{yaml\\})", + "captures": { + "1": { + "patterns": [ + { + "include": "#minted-env" + } + ] + } + }, + "contentName": "source.yaml", + "patterns": [ + { + "include": "source.yaml" + } + ], + "end": "(\\\\end\\{minted\\})" + }, + { + "begin": "(\\\\begin\\{(?:lstlisting|minted|pyglist)\\}(?:\\[.*\\])?)", + "captures": { + "1": { + "patterns": [ + { + "include": "#minted-env" + } + ] + } + }, + "contentName": "meta.function.embedded.latex", + "end": "(\\\\end\\{(?:lstlisting|minted|pyglist)\\})", + "name": "meta.embedded.block.generic" + } + ] + }, + { + "begin": "((?:\\s*)\\\\begin\\{(cppcode(?:\\*)?)\\}(?:\\[.*\\])?)", + "captures": { + "1": { + "patterns": [ + { + "include": "#code-env" + } + ] + } + }, + "contentName": "source.cpp.embedded.latex", + "patterns": [ + { + "include": "source.cpp.embedded.latex" + }, + { + "include": "source.cpp" + } + ], + "end": "(\\\\end\\{\\2\\}(?:\\s*\\n)?)" + }, + { + "begin": "((?:\\s*)\\\\begin\\{(hscode(?:\\*)?)\\}(?:\\[.*\\])?)", + "captures": { + "1": { + "patterns": [ + { + "include": "#code-env" + } + ] + } + }, + "contentName": "source.haskell", + "patterns": [ + { + "include": "source.haskell" + } + ], + "end": "(\\\\end\\{\\2\\}(?:\\s*\\n)?)" + }, + { + "begin": "((?:\\s*)\\\\begin\\{(luacode(?:\\*)?)\\}(?:\\[.*\\])?)", + "captures": { + "1": { + "patterns": [ + { + "include": "#code-env" + } + ] + } + }, + "contentName": "source.lua", + "patterns": [ + { + "include": "source.lua" + } + ], + "end": "(\\\\end\\{\\2\\}(?:\\s*\\n)?)" + }, + { + "begin": "((?:\\s*)\\\\begin\\{((?:pycode|sageblock|sagesilent|sageverbatim|sageexample|sagecommandline)(?:\\*)?)\\}(?:\\[.*\\])?)", + "captures": { + "1": { + "patterns": [ + { + "include": "#code-env" + } + ] + } + }, + "contentName": "source.python", + "patterns": [ + { + "include": "source.python" + } + ], + "end": "(\\\\end\\{\\2\\}(?:\\s*\\n)?)" + }, + { + "begin": "((?:\\s*)\\\\begin\\{(scalacode(?:\\*)?)\\}(?:\\[.*\\])?)", + "captures": { + "1": { + "patterns": [ + { + "include": "#code-env" + } + ] + } + }, + "contentName": "source.scala", + "patterns": [ + { + "include": "source.scala" + } + ], + "end": "(\\\\end\\{\\2\\}(?:\\s*\\n)?)" + }, + { + "begin": "((?:\\s*)\\\\begin\\{([a-z]*code(?:\\*)?)\\}(?:\\[.*\\])?)", + "captures": { + "1": { + "patterns": [ + { + "include": "#code-env" + } + ] + } + }, + "end": "(\\\\end\\{\\2\\}(?:\\s*\\n)?)" + }, + { + "begin": "((?:\\s*)\\\\begin\\{asy\\}(?:\\[.*\\])?)", + "captures": { + "1": { + "patterns": [ + { + "include": "#code-env" + } + ] + } + }, + "contentName": "source.asymptote", + "patterns": [ + { + "include": "source.asymptote" + } + ], + "end": "(\\\\end\\{asy\\}(?:\\s*\\n)?)" + }, + { + "begin": "((?:\\s*)\\\\begin\\{dot2tex\\}(?:\\[.*\\])?)", + "captures": { + "1": { + "patterns": [ + { + "include": "#code-env" + } + ] + } + }, + "contentName": "source.dot", + "patterns": [ + { + "include": "source.dot" + } + ], + "end": "(\\\\end\\{dot2tex\\}(?:\\s*\\n)?)" + }, + { + "begin": "((?:\\s*)\\\\begin\\{gnuplot\\}(?:\\[.*\\])?)", + "captures": { + "1": { + "patterns": [ + { + "include": "#code-env" + } + ] + } + }, + "contentName": "source.gnuplot", + "patterns": [ + { + "include": "source.gnuplot" + } + ], + "end": "(\\\\end\\{gnuplot\\}(?:\\s*\\n)?)" + }, + { + "begin": "(?:\\s*)((\\\\)begin)(\\{)((?:fboxv|boxedv|V|v)erbatim)(\\})", + "captures": { + "1": { + "name": "support.function.be.latex" + }, + "2": { + "name": "punctuation.definition.function.latex" + }, + "3": { + "name": "punctuation.definition.arguments.begin.latex" + }, + "4": { + "name": "variable.parameter.function.latex" + }, + "5": { + "name": "punctuation.definition.arguments.end.latex" + } + }, + "contentName": "markup.raw.verbatim.latex", + "end": "((\\\\)end)(\\{)(\\4)(\\})", + "name": "meta.function.verbatim.latex" + }, + { + "begin": "(?:\\s*)((\\\\)begin)(\\{)(VerbatimOut)(\\})(\\{)([^\\}]*)(\\})", + "captures": { + "1": { + "name": "support.function.be.latex" + }, + "2": { + "name": "punctuation.definition.function.latex" + }, + "3": { + "name": "punctuation.definition.arguments.begin.latex" + }, + "4": { + "name": "variable.parameter.function.latex" + }, + "5": { + "name": "punctuation.definition.arguments.end.latex" + }, + "6": { + "name": "punctuation.definition.arguments.begin.latex" + }, + "7": { + "name": "support.class.latex" + }, + "8": { + "name": "punctuation.definition.arguments.end.latex" + } + }, + "contentName": "markup.raw.verbatim.latex", + "end": "((\\\\)end)(\\{)(\\VerbatimOut)(\\})", + "name": "meta.function.verbatim.latex" + }, + { + "begin": "(?:\\s*)((\\\\)begin)(\\{)(alltt)(\\})", + "captures": { + "1": { + "name": "support.function.be.latex" + }, + "2": { + "name": "punctuation.definition.function.latex" + }, + "3": { + "name": "punctuation.definition.arguments.begin.latex" + }, + "4": { + "name": "variable.parameter.function.latex" + }, + "5": { + "name": "punctuation.definition.arguments.end.latex" + } + }, + "contentName": "markup.raw.verbatim.latex", + "end": "((\\\\)end)(\\{)(alltt)(\\})", + "name": "meta.function.alltt.latex", + "patterns": [ + { + "captures": { + "1": { + "name": "punctuation.definition.function.tex" + } + }, + "match": "(\\\\)[A-Za-z]+", + "name": "support.function.general.tex" + } + ] + }, + { + "begin": "(?:\\s*)((\\\\)begin)(\\{)((?:C|c)omment)(\\})", + "captures": { + "1": { + "name": "support.function.be.latex" + }, + "2": { + "name": "punctuation.definition.function.latex" + }, + "3": { + "name": "punctuation.definition.arguments.begin.latex" + }, + "4": { + "name": "variable.parameter.function.latex" + }, + "5": { + "name": "punctuation.definition.arguments.end.latex" + } + }, + "contentName": "comment.block.environment.tex", + "end": "((\\\\)end)(\\{)(\\4)(\\})", + "name": "meta.function.verbatim.latex" + }, + { + "captures": { + "1": { + "name": "support.function.url.latex" + }, + "2": { + "name": "punctuation.definition.function.latex" + }, + "3": { + "name": "punctuation.definition.arguments.begin.latex" + }, + "4": { + "name": "markup.underline.link.latex" + }, + "5": { + "name": "punctuation.definition.arguments.end.latex" + } + }, + "match": "(?:\\s*)((\\\\)(?:url|href))(\\{)([^}]*)(\\})", + "name": "meta.function.link.url.latex" + }, + { + "captures": { + "1": { + "name": "support.function.be.latex" + }, + "2": { + "name": "punctuation.definition.function.latex" + }, + "3": { + "name": "punctuation.definition.arguments.begin.latex" + }, + "4": { + "name": "variable.parameter.function.latex" + }, + "5": { + "name": "punctuation.definition.arguments.end.latex" + } + }, + "comment": "These two patterns match the \\begin{document} and \\end{document} commands, so that the environment matching pattern following them will ignore those commands.", + "match": "(?:\\s*)((\\\\)begin)(\\{)(document)(\\})", + "name": "meta.function.begin-document.latex" + }, + { + "captures": { + "1": { + "name": "support.function.be.latex" + }, + "2": { + "name": "punctuation.definition.function.latex" + }, + "3": { + "name": "punctuation.definition.arguments.begin.latex" + }, + "4": { + "name": "variable.parameter.function.latex" + }, + "5": { + "name": "punctuation.definition.arguments.end.latex" + } + }, + "match": "(?:\\s*)((\\\\)end)(\\{)(document)(\\})", + "name": "meta.function.end-document.latex" + }, + { + "begin": "(?:\\s*)((\\\\)begin)(\\{)((?:align|equation|(?:IEEE)?eqnarray|multline|aligned|alignat|split|gather|gathered|cases|displaymath|[a-zA-Z]*matrix)(?:\\*)?)(\\})(\\s*\\n)?", + "captures": { + "1": { + "name": "support.function.be.latex" + }, + "2": { + "name": "punctuation.definition.function.latex" + }, + "3": { + "name": "punctuation.definition.arguments.begin.latex" + }, + "4": { + "name": "variable.parameter.function.latex" + }, + "5": { + "name": "punctuation.definition.arguments.end.latex" + } + }, + "contentName": "support.class.math.block.environment.latex", + "end": "(?:\\s*)((\\\\)end)(\\{)(\\4)(\\})(?:\\s*\\n)?", + "name": "meta.function.environment.math.latex", + "patterns": [ + { + "match": "(?)(\\{)\\$(\\})", + "name": "meta.column-specials.latex" + }, + { + "include": "text.tex" + } + ], + "repository": { + "optional-arg": { + "patterns": [ + { + "captures": { + "1": { + "name": "punctuation.definition.optional.arguments.begin.latex" + }, + "2": { + "name": "variable.parameter.latex" + }, + "3": { + "name": "punctuation.definition.optional.arguments.end.latex" + } + }, + "match": "(\\[)([^\\[]*?)(\\])" + } + ] + }, + "autocites-arg": { + "patterns": [ + { + "captures": { + "1": { + "name": "punctuation.definition.arguments.optional.begin.latex" + }, + "2": { + "name": "punctuation.definition.arguments.optional.end.latex" + }, + "3": { + "name": "punctuation.definition.arguments.optional.begin.latex" + }, + "4": { + "name": "punctuation.definition.arguments.optional.end.latex" + }, + "5": { + "name": "punctuation.definition.arguments.begin.latex" + }, + "6": { + "name": "constant.other.reference.citation.latex" + }, + "7": { + "name": "punctuation.definition.arguments.end.latex" + }, + "8": { + "patterns": [ + { + "include": "#autocites-arg" + } + ] + } + }, + "match": "(?:(\\[)[^\\]]*(\\]))?(?:(\\[)[^\\]]*(\\]))?(\\{)([\\w:.]+)(\\})(.*)" + } + ] + }, + "minted-env": { + "captures": { + "1": { + "name": "support.function.be.latex" + }, + "2": { + "name": "punctuation.definition.function.latex" + }, + "3": { + "name": "punctuation.definition.arguments.begin.latex" + }, + "4": { + "name": "variable.parameter.function.latex" + }, + "5": { + "name": "punctuation.definition.arguments.end.latex" + }, + "6": { + "name": "punctuation.definition.arguments.optional.begin.latex" + }, + "7": { + "name": "punctuation.definition.arguments.optional.end.latex" + }, + "8": { + "name": "punctuation.definition.arguments.begin.latex" + }, + "9": { + "name": "variable.parameter.function.latex" + }, + "10": { + "name": "punctuation.definition.arguments.end.latex" + } + }, + "match": "((\\\\)(?:begin|end))(\\{)(lstlisting|minted|pyglist)(\\})(?:(\\[).*(\\]))?(?:(\\{)([a-z]*)(\\}))?" + }, + "code-env": { + "captures": { + "1": { + "name": "support.function.be.latex" + }, + "2": { + "name": "punctuation.definition.function.latex" + }, + "3": { + "name": "punctuation.definition.arguments.begin.latex" + }, + "4": { + "name": "variable.parameter.function.latex" + }, + "5": { + "name": "punctuation.definition.arguments.end.latex" + }, + "6": { + "name": "punctuation.definition.arguments.optional.begin.latex" + }, + "7": { + "name": "punctuation.definition.arguments.optional.end.latex" + } + }, + "match": "(?:\\s*)((\\\\)(?:begin|end))(\\{)([a-z]*code(?:\\*)?|gnuplot|dot2tex|asy|sage[a-z]*)(\\})(?:(\\[).*(\\]))?" + }, + "definition-label": { + "begin": "((\\\\)label)(\\{)", + "beginCaptures": { + "1": { + "name": "keyword.control.label.latex" + }, + "2": { + "name": "punctuation.definition.keyword.latex" + }, + "3": { + "name": "punctuation.definition.arguments.begin.latex" + } + }, + "end": "\\}", + "endCaptures": { + "0": { + "name": "punctuation.definition.arguments.end.latex" + } + }, + "name": "meta.definition.label.latex", + "patterns": [ + { + "match": "[a-zA-Z0-9\\.,:/*!^_-]", + "name": "variable.parameter.definition.label.latex" + } + ] + } + }, + "scopeName": "text.tex.latex" +}