Mon, 11 May 2020 17:50:17 -0500
Initial version.
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/.vscode/launch.json Mon May 11 17:50:17 2020 -0500 @@ -0,0 +1,18 @@ +// A launch configuration that launches the extension inside a new window +// Use IntelliSense to learn about possible attributes. +// Hover to view descriptions of existing attributes. +// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 +{ + "version": "0.2.0", + "configurations": [ + { + "name": "Extension", + "type": "extensionHost", + "request": "launch", + "runtimeExecutable": "${execPath}", + "args": [ + "--extensionDevelopmentPath=${workspaceFolder}" + ] + } + ] +} \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/.vscodeignore Mon May 11 17:50:17 2020 -0500 @@ -0,0 +1,5 @@ +.vscode/** +.vscode-test/** +.gitignore +vsc-extension-quickstart.md +.hg/**
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/LICENSE.md Mon May 11 17:50:17 2020 -0500 @@ -0,0 +1,29 @@ + +# License + +This package is written by Tuomo Valkonen. The grammar files have been +extracted from LaTeX-Workshop, whose license notice is below. + +## LaTeX-Workshop license + +The MIT License (MIT) + +Copyright (c) 2016 James Yu + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE.
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/README.md Mon May 11 17:50:17 2020 -0500 @@ -0,0 +1,59 @@ +# latex-syntax + +This package provides syntax highlighting for LaTeX to VSCode. It is intended +to be used as together with [texlab][] to provide richer syntax highlighting. +The grammar is derived from LaTeX-Workshop, but has improvements including + + a) Highlighting of `todonotes` (see below). + + b) Footnote highlighting. + + c) Highlighting of `comment` environments as comment blocks. + +### How to enable + +This package does not override the standard “LaTeX” grammar. It provides the +“LaTeX+” grammar. Please select that as the default grammar for `.tex` files. + +### Regarding `todonotes` and `footnote` support + +To enable syntax highlighting for `\todo` and `\footnote`, add the following +to your `settings.json` (Cmd+Shift+P, “Open Settings (JSON)”): + +```json + + "editor.tokenColorCustomizations": { + "textMateRules": [ + { + "scope": "entity.name.todo.latex", + "settings": { + "foreground": "#d17000", + "fontStyle": "italic", + } + }, + { + "scope": "support.function.todo.latex", + "settings": { + "foreground": "#d17000", + "fontStyle": "italic", + } + }, + { + "scope": "entity.name.footnote.latex", + "settings": { + "foreground": "#e28000", + "fontStyle": "italic", + } + }, + { + "scope": "support.function.footnote.latex", + "settings": { + "foreground": "#e28000", + "fontStyle": "italic", + } + } + ], + }, +``` + + [texlab]: https://marketplace.visualstudio.com/items?itemName=efoerster.texlab
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/languages/latex.json Mon May 11 17:50:17 2020 -0500 @@ -0,0 +1,38 @@ +{ + "comments": { + "lineComment": "%" + }, + "brackets": [ + ["{", "}"], + ["[", "]"], + ["(", ")"], + ["\\left", "\\right"] + ], + "autoClosingPairs": [ + ["{", "}"], + ["[", "]"], + ["(", ")"], + ["`", "'"] + ], + "surroundingPairs": [ + ["{", "}"], + ["[", "]"], + ["(", ")"], + ["\"", "\""], + ["'", "'"], + ["`", "'"], + ["$", "$"] + ], + "indentationRules": { + "increaseIndentPattern": "(\\\\begin{(?!document))", + "decreaseIndentPattern": "(\\\\end{(?!document))" + }, + "folding": { + "markers": { + "start": "^\\s*%\\s*#?region\\b.*", + "end": "^\\s*%\\s*#?endregion\\b.*" + } + }, + "autoCloseBefore": ";:.,=}])>\\` \n\t$", + "wordPattern": "(__)|(\\*\\*)|(@.)|(\\.\\.\\.)|([^\\s`'\"~_!?|$#@%^&*\\-=+;:,.<>(){}[\\]\\\\\\/]{2,})" +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/languages/tex.json Mon May 11 17:50:17 2020 -0500 @@ -0,0 +1,38 @@ +{ + "comments": { + "lineComment": "%" + }, + "brackets": [ + ["{", "}"], + ["[", "]"], + ["(", ")"], + ["\\left", "\\right"] + ], + "autoClosingPairs": [ + ["{", "}"], + ["[", "]"], + ["(", ")"], + ["`", "'"] + ], + "surroundingPairs": [ + ["{", "}"], + ["[", "]"], + ["(", ")"], + ["\"", "\""], + ["'", "'"], + ["`", "'"], + ["$", "$"] + ], + "indentationRules": { + "increaseIndentPattern": "(\\\\begin{(?!document))", + "decreaseIndentPattern": "(\\\\end{(?!document))" + }, + "folding": { + "markers": { + "start": "^\\s*%\\s*#?region\\b.*", + "end": "^\\s*%\\s*#?endregion\\b.*" + } + }, + "autoCloseBefore": ";:.,=}])>\\` \n\t$", + "wordPattern": "(__)|(\\*\\*)|(@.)|(\\.\\.\\.)|([^\\s`'\"~_!?|$#@%^&*\\-=+;:,.<>(){}[\\]\\\\\\/]{2,})" +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/package.json Mon May 11 17:50:17 2020 -0500 @@ -0,0 +1,88 @@ +{ + "name": "latex-syntax", + "displayName": "latex-syntax", + "description": "Rich LaTeX syntax highlighting (for use with Texlab)", + "version": "0.0.1", + "publisher": "vomout", + "license": "MIT", + "homepage": "https://tuomov.iki.fi/software/", + "repository": { + "type": "mercurial", + "url": "https://tuomov.iki.fi/repos/latex-syntax/" + }, + "engines": { + "vscode": "^1.45.0" + }, + "categories": [ + "Programming Languages" + ], + "keywords": [ + "latex", + "tex", + "bibtex" + ], + "contributes": { + "languages": [ + { + "id": "tex", + "aliases": [ + "TeX+", + "texplus" + ], + "extensions": [ + ".sty", + ".cls" + ], + "configuration": "./languages/tex.json" + }, + { + "id": "latex", + "aliases": [ + "LaTeX+", + "latexplus" + ], + "extensions": [ + ".tex" + ], + "configuration": "./languages/latex.json" + } + ], + "grammars": [ + { + "language": "tex", + "scopeName": "text.tex", + "path": "./syntaxes/TeX.tmLanguage.json" + }, + { + "language": "latex", + "scopeName": "text.tex.latex", + "path": "./syntaxes/LaTeX.tmLanguage.json", + "embeddedLanguages": { + "source.asymptote": "asymptote", + "source.cpp": "cpp", + "source.css": "css", + "source.dot": "dot", + "source.gnuplot": "gnuplot", + "text.html": "html", + "source.java": "java", + "source.js": "js", + "source.lua": "lua", + "source.python": "python", + "source.scala": "scala", + "text.xtml": "xtml", + "source.yaml": "yaml" + } + }, + { + "scopeName": "markdown.latex.codeblock", + "path": "./syntax/latexblock.json", + "injectTo": [ + "text.html.markdown" + ], + "embeddedLanguages": { + "meta.embedded.block.latex": "latex" + } + } + ] + } +} \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/syntaxes/Bibtex.tmLanguage.json Mon May 11 17:50:17 2020 -0500 @@ -0,0 +1,251 @@ +{ + "comment": "Grammar based on description from http://artis.imag.fr/~Xavier.Decoret/resources/xdkbibtex/bibtex_summary.html#comment\n\t\n\tTODO: Does not support @preamble\n\t", + "fileTypes": [ + "bib" + ], + "name": "BibTeX+", + "patterns": [ + { + "begin": "@Comment", + "beginCaptures": { + "0": { + "name": "punctuation.definition.comment.bibtex" + } + }, + "end": "$\\n?", + "name": "comment.line.at-sign.bibtex" + }, + { + "begin": "((@)String)\\s*(\\{)\\s*([a-zA-Z]*)", + "beginCaptures": { + "1": { + "name": "keyword.other.string-constant.bibtex" + }, + "2": { + "name": "punctuation.definition.keyword.bibtex" + }, + "3": { + "name": "punctuation.section.string-constant.begin.bibtex" + }, + "4": { + "name": "variable.other.bibtex" + } + }, + "end": "\\}", + "endCaptures": { + "0": { + "name": "punctuation.section.string-constant.end.bibtex" + } + }, + "name": "meta.string-constant.braces.bibtex", + "patterns": [ + { + "include": "#string_content" + } + ] + }, + { + "begin": "((@)String)\\s*(\\()\\s*([a-zA-Z]*)", + "beginCaptures": { + "1": { + "name": "keyword.other.string-constant.bibtex" + }, + "2": { + "name": "punctuation.definition.keyword.bibtex" + }, + "3": { + "name": "punctuation.section.string-constant.begin.bibtex" + }, + "4": { + "name": "variable.other.bibtex" + } + }, + "end": "\\)", + "endCaptures": { + "0": { + "name": "punctuation.section.string-constant.end.bibtex" + } + }, + "name": "meta.string-constant.parenthesis.bibtex", + "patterns": [ + { + "include": "#string_content" + } + ] + }, + { + "begin": "((@)[a-zA-Z]+)\\s*(\\{)\\s*([^\\s,]*)", + "beginCaptures": { + "1": { + "name": "keyword.other.entry-type.bibtex" + }, + "2": { + "name": "punctuation.definition.keyword.bibtex" + }, + "3": { + "name": "punctuation.section.entry.begin.bibtex" + }, + "4": { + "name": "entity.name.type.entry-key.bibtex" + } + }, + "end": "\\}", + "endCaptures": { + "0": { + "name": "punctuation.section.entry.end.bibtex" + } + }, + "name": "meta.entry.braces.bibtex", + "patterns": [ + { + "begin": "([a-zA-Z0-9\\!\\$\\&\\*\\+\\-\\.\\/\\:\\;\\<\\>\\?\\[\\]\\^\\_\\`\\|]+)\\s*(\\=)", + "beginCaptures": { + "1": { + "name": "support.function.key.bibtex" + }, + "2": { + "name": "punctuation.separator.key-value.bibtex" + } + }, + "end": "(?=[,}])", + "name": "meta.key-assignment.bibtex", + "patterns": [ + { + "include": "#string_content" + }, + { + "include": "#integer" + } + ] + } + ] + }, + { + "begin": "((@)[a-zA-Z]+)\\s*(\\()\\s*([^\\s,]*)", + "beginCaptures": { + "1": { + "name": "keyword.other.entry-type.bibtex" + }, + "2": { + "name": "punctuation.definition.keyword.bibtex" + }, + "3": { + "name": "punctuation.section.entry.begin.bibtex" + }, + "4": { + "name": "entity.name.type.entry-key.bibtex" + } + }, + "end": "\\)", + "endCaptures": { + "0": { + "name": "punctuation.section.entry.end.bibtex" + } + }, + "name": "meta.entry.parenthesis.bibtex", + "patterns": [ + { + "begin": "([a-zA-Z0-9\\!\\$\\&\\*\\+\\-\\.\\/\\:\\;\\<\\>\\?\\[\\]\\^\\_\\`\\|]+)\\s*(\\=)", + "beginCaptures": { + "1": { + "name": "support.function.key.bibtex" + }, + "2": { + "name": "punctuation.separator.key-value.bibtex" + } + }, + "end": "(?=[,)])", + "name": "meta.key-assignment.bibtex", + "patterns": [ + { + "include": "#string_content" + }, + { + "include": "#integer" + } + ] + } + ] + }, + { + "begin": "[^@\\n]", + "end": "(?=@)", + "name": "comment.block.bibtex" + } + ], + "repository": { + "integer": { + "match": "\\d+", + "name": "constant.numeric.bibtex" + }, + "nested_braces": { + "begin": "(?<!\\\\)\\{", + "beginCaptures": { + "0": { + "name": "punctuation.definition.group.begin.bibtex" + } + }, + "end": "(?<!\\\\)\\}", + "endCaptures": { + "0": { + "name": "punctuation.definition.group.end.bibtex" + } + }, + "patterns": [ + { + "include": "#nested_braces" + } + ] + }, + "string_content": { + "patterns": [ + { + "begin": "\\{", + "beginCaptures": { + "0": { + "name": "punctuation.definition.string.begin.bibtex" + } + }, + "end": "\\}(?=,?\\s*\\n)", + "endCaptures": { + "0": { + "name": "punctuation.definition.string.end.bibtex" + } + }, + "patterns": [ + { + "match": "@", + "name": "invalid.illegal.at-sign.bibtex" + }, + { + "include": "#nested_braces" + } + ] + }, + { + "begin": "\"", + "beginCaptures": { + "0": { + "name": "punctuation.definition.string.begin.bibtex" + } + }, + "end": "\"(?=,?\\s*\\n)", + "endCaptures": { + "0": { + "name": "punctuation.definition.string.end.bibtex" + } + }, + "patterns": [ + { + "match": "@", + "name": "invalid.illegal.at-sign.bibtex" + } + ] + } + + ] + } + }, + "scopeName": "text.bibtex", + "uuid": "47F30BA1-6B1D-11D9-9A60-000D93589AF6" +} \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/syntaxes/DocTeX.tmLanguage.json Mon May 11 17:50:17 2020 -0500 @@ -0,0 +1,72 @@ +{ + "fileTypes": [ + "dtx" + ], + "name": "DocTeX+", + "patterns": [ + { + "captures": { + "1": { + "name": "punctuation.definition.verb.latex" + }, + "2": { + "name": "markup.raw.verb.latex" + }, + "3": { + "name": "punctuation.definition.verb.latex" + } + }, + "match": "(\\|)([^\\|]*)(\\|)", + "name": "meta.function.verb.latex" + }, + { + "begin": "^(%)(\\\\begin\\{macrocode\\})", + "captures": { + "1": { + "name": "comment.line.percentage.doctex" + }, + "2": { + "name": "entity.name.tag.macrocode.doctex" + } + }, + "end": "^(%)(\\\\end\\{macrocode\\})", + "patterns": [ + { + "include": "#guards" + }, + { + "include": "text.tex.latex.expl3" + }, + { + "include": "text.tex" + } + ] + }, + { + "include": "#guards" + }, + { + "match": "(^[ \\t]*)%?%", + "name": "comment.line.percentage.doctex" + }, + { + "match": "\\^\\^A.*$\\n?", + "name": "comment.line.percentage.tex" + }, + { + "match": "(?<=[^%\\\\])%", + "name": "invalid" + }, + { + "include": "text.tex.latex.expl3" + } + ], + "repository": { + "guards": { + "match": "^%(\\<[^\\>]*\\>)", + "name": "entity.name.function.filename.latex" + } + }, + "scopeName": "text.tex.doctex", + "uuid": "6BC8DE6F-9360-4C7E-AC3C-971385945346" +} \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/syntaxes/LaTeX-Expl3.tmLanguage.json Mon May 11 17:50:17 2020 -0500 @@ -0,0 +1,122 @@ +{ + "fileTypes": [], + "firstLineMatch": "^\\\\documentclass(\\[.*\\])?\\{.*\\}", + "keyEquivalent": "^~M", + "name": "LaTeX-Expl3+", + "patterns": [ + { + "begin": "(\\$\\$|\\$)", + "beginCaptures": { + "1": { + "name": "punctuation.section.group.begin.tex" + } + }, + "end": "(\\1)", + "endCaptures": { + "1": { + "name": "punctuation.section.group.end.tex" + } + }, + "name": "support.class.math.tex", + "patterns": [ + { + "match": "\\\\\\$", + "name": "constant.character.escape.tex" + }, + { + "include": "#latex3" + }, + { + "include": "text.tex#math" + }, + { + "include": "$base" + } + ] + }, + { + "begin": "\\\\\\(", + "beginCaptures": { + "0": { + "name": "punctuation.section.group.begin.tex" + } + }, + "end": "\\\\\\)", + "endCaptures": { + "0": { + "name": "punctuation.section.group.end.tex" + } + }, + "name": "support.class.math.tex", + "patterns": [ + { + "include": "#latex3" + }, + { + "include": "text.tex#math" + }, + { + "include": "$base" + } + ] + }, + { + "begin": "\\\\\\[", + "beginCaptures": { + "0": { + "name": "punctuation.section.group.begin.tex" + } + }, + "end": "\\\\\\]", + "endCaptures": { + "0": { + "name": "punctuation.section.group.end.tex" + } + }, + "name": "support.class.math.tex", + "patterns": [ + { + "include": "#latex3" + }, + { + "include": "text.tex#math" + }, + { + "include": "$base" + } + ] + }, + { + "include": "#latex3" + }, + { + "include": "text.tex.latex" + } + ], + "repository": { + "latex3": { + "patterns": [ + { + "captures": { + "1": { + "name": "punctuation.definition.function.expl.latex" + } + }, + "match": "(\\\\|\\.)[\\w@]+:\\w*", + "name": "keyword.control.expl.latex" + }, + { + "captures": { + "1": { + "name": "punctuation.definition.variable.expl.latex" + } + }, + "match": "(\\\\)[\\w@]+_[\\w@]+", + "name": "variable.expl.latex" + } + ] + } + }, + "scopeName": "text.tex.latex.expl3", + "uuid": "3BEEA00C-6B1D-11D9-B8AD-000D93589AF6" +} \ No newline at end of file
--- /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": "keyword.control.equation.align.latex" + }, + { + "match": "\\\\\\\\", + "name": "keyword.control.equation.newline.latex" + }, + { + "include": "#definition-label" + }, + { + "include": "text.tex#math" + }, + { + "include": "$base" + } + ] + }, + { + "begin": "(?:\\s*)((\\\\)begin)(\\{)(array|tabular[xy*]?|xltabular)(\\})(\\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": "meta.data.environment.tabular.latex", + "end": "(?:\\s*)((\\\\)end)(\\{)(\\4)(\\})(?:\\s*\\n)?", + "name": "meta.function.environment.tabular.latex", + "patterns": [ + { + "match": "(?<!\\\\)&", + "name": "keyword.control.table.cell.latex" + }, + { + "match": "\\\\\\\\", + "name": "keyword.control.table.newline.latex" + }, + { + "include": "$base" + } + ] + }, + { + "begin": "(?:\\s*)((\\\\)begin)(\\{)(itemize|enumerate|description|list)(\\})", + "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" + } + }, + "end": "((\\\\)end)(\\{)(\\4)(\\})(?:\\s*\\n)?", + "name": "meta.function.environment.list.latex", + "patterns": [ + { + "include": "$base" + } + ] + }, + { + "begin": "(?:\\s*)((\\\\)begin)(\\{)(tikzpicture)(\\})", + "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" + } + }, + "end": "((\\\\)end)(\\{)(tikzpicture)(\\})(?:\\s*\\n)?", + "name": "meta.function.environment.latex.tikz", + "patterns": [ + { + "include": "$base" + } + ] + }, + { + "begin": "(?:\\s*)((\\\\)begin)(\\{)(frame)(\\})", + "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" + } + }, + "end": "((\\\\)end)(\\{)(frame)(\\})", + "name": "meta.function.environment.frame.latex", + "patterns": [ + { + "include": "$base" + } + ] + }, + { + "begin": "(?:\\s*)((\\\\)begin)(\\{)(mpost[*]?)(\\})", + "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" + } + }, + "end": "((\\\\)end)(\\{)(\\4)(\\})(?:\\s*\\n)?", + "name": "meta.function.environment.latex.mpost" + },{ + "begin": "(?:\\s*)((\\\\)begin)(\\{)(\\w+[*]?)(\\})", + "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" + } + }, + "end": "((\\\\)end)(\\{)(\\4)(\\})(?:\\s*\\n)?", + "name": "meta.function.environment.general.latex", + "patterns": [ + { + "include": "$base" + } + ] + }, + { + "captures": { + "1": { + "name": "storage.type.function.latex" + }, + "2": { + "name": "punctuation.definition.function.latex" + }, + "3": { + "name": "punctuation.definition.begin.latex" + }, + "4": { + "name": "support.function.general.tex" + }, + "5": { + "name": "punctuation.definition.function.latex" + }, + "6": { + "name": "punctuation.definition.end.latex" + } + }, + "match": "((\\\\)(?:newcommand|renewcommand|(?:re)?newrobustcmd|DeclareRobustCommand))\\*?({)((\\\\)[^}]*)(})" + }, + { + "begin": "((\\\\)marginpar)((?:\\[[^\\[]*?\\])*)(\\{)", + "beginCaptures": { + "1": { + "name": "support.function.marginpar.latex" + }, + "2": { + "name": "punctuation.definition.function.latex" + }, + "3": { + "patterns": [ + { + "include": "#optional-arg" + } + ] + }, + "4": { + "name": "punctuation.definition.marginpar.begin.latex" + } + }, + "contentName": "meta.paragraph.margin.latex", + "end": "\\}", + "endCaptures": { + "0": { + "name": "punctuation.definition.marginpar.end.latex" + } + }, + "patterns": [ + { + "include": "text.tex#braces" + }, + { + "include": "$base" + } + ] + }, + { + "begin": "((\\\\)footnote)((?:\\[[^\\[]*?\\])*)(\\{)", + "beginCaptures": { + "1": { + "name": "support.function.footnote.latex" + }, + "2": { + "name": "punctuation.definition.function.latex" + }, + "3": { + "patterns": [ + { + "include": "#optional-arg" + } + ] + }, + "4": { + "name": "punctuation.definition.footnote.begin.latex" + } + }, + "contentName": "entity.name.footnote.latex", + "end": "\\}", + "endCaptures": { + "0": { + "name": "punctuation.definition.footnote.end.latex" + } + }, + "patterns": [ + { + "include": "text.tex#braces" + }, + { + "include": "$base" + } + ] + }, + { + "begin": "((\\\\)todo)((?:\\[[^\\[]*?\\])*)(\\{)", + "beginCaptures": { + "1": { + "name": "support.function.todo.latex" + }, + "2": { + "name": "punctuation.definition.function.latex" + }, + "3": { + "patterns": [ + { + "include": "#optional-arg" + } + ] + }, + "4": { + "name": "punctuation.definition.todo.begin.latex" + } + }, + "contentName": "entity.name.todo.latex", + "end": "\\}", + "endCaptures": { + "0": { + "name": "punctuation.definition.todo.end.latex" + } + }, + "patterns": [ + { + "include": "text.tex#braces" + }, + { + "include": "$base" + } + ] + }, + { + "begin": "((\\\\)emph)(\\{)", + "beginCaptures": { + "1": { + "name": "support.function.emph.latex" + }, + "2": { + "name": "punctuation.definition.function.latex" + }, + "3": { + "name": "punctuation.definition.emph.begin.latex" + } + }, + "contentName": "markup.italic.emph.latex", + "end": "\\}", + "endCaptures": { + "0": { + "name": "punctuation.definition.emph.end.latex" + } + }, + "name": "meta.function.emph.latex", + "patterns": [ + { + "include": "text.tex#braces" + }, + { + "include": "$base" + } + ] + }, + { + "begin": "((\\\\)textit)(\\{)", + "captures": { + "1": { + "name": "support.function.textit.latex" + }, + "2": { + "name": "punctuation.definition.function.latex" + }, + "3": { + "name": "punctuation.definition.textit.begin.latex" + } + }, + "comment": "We put the keyword in a capture and name this capture, so that disabling spell checking for “keyword” won't be inherited by the argument to \\textit{...}.\n\nPut specific matches for particular LaTeX keyword.functions before the last two more general functions", + "contentName": "markup.italic.textit.latex", + "end": "\\}", + "endCaptures": { + "0": { + "name": "punctuation.definition.textit.end.latex" + } + }, + "name": "meta.function.textit.latex", + "patterns": [ + { + "include": "text.tex#braces" + }, + { + "include": "$base" + } + ] + }, + { + "begin": "((\\\\)textbf)(\\{)", + "captures": { + "1": { + "name": "support.function.textbf.latex" + }, + "2": { + "name": "punctuation.definition.function.latex" + }, + "3": { + "name": "punctuation.definition.textbf.begin.latex" + } + }, + "contentName": "markup.bold.textbf.latex", + "end": "\\}", + "endCaptures": { + "0": { + "name": "punctuation.definition.textbf.end.latex" + } + }, + "name": "meta.function.textbf.latex", + "patterns": [ + { + "include": "text.tex#braces" + }, + { + "include": "$base" + } + ] + }, + { + "begin": "((\\\\)texttt)(\\{)", + "captures": { + "1": { + "name": "support.function.texttt.latex" + }, + "2": { + "name": "punctuation.definition.function.latex" + }, + "3": { + "name": "punctuation.definition.texttt.begin.latex" + } + }, + "contentName": "markup.raw.texttt.latex", + "end": "\\}", + "endCaptures": { + "0": { + "name": "punctuation.definition.texttt.end.latex" + } + }, + "name": "meta.function.texttt.latex", + "patterns": [ + { + "include": "text.tex#braces" + }, + { + "include": "$base" + } + ] + }, + { + "captures": { + "0": { + "name": "keyword.other.item.latex" + }, + "1": { + "name": "punctuation.definition.keyword.latex" + } + }, + "match": "(\\\\)item\\b", + "name": "meta.scope.item.latex" + }, + { + "begin": "((\\\\)(?:auto|foot|full|no|short|text|paren)?[cC]ite(?:al)?(?:p|s|t|author|year(?:par)?|title)?[ANP]*\\*?)((?:(?:\\[[^\\]]*\\]){0,2}\\{[\\w:.]+\\})*)(?:(\\[)[^\\]]*(\\]))?(?:(\\[)[^\\]]*(\\]))?(\\{)", + "captures": { + "1": { + "name": "keyword.control.cite.latex" + }, + "2": { + "name": "punctuation.definition.keyword.latex" + }, + "3": { + "patterns": [ + { + "include": "#autocites-arg" + } + ] + }, + "4": { + "name": "punctuation.definition.arguments.optional.begin.latex" + }, + "5": { + "name": "punctuation.definition.arguments.optional.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" + } + }, + "end": "\\}", + "endCaptures": { + "0": { + "name": "punctuation.definition.arguments.end.latex" + } + }, + "name": "meta.citation.latex", + "patterns": [ + { + "match": "[\\w:.]+", + "name": "constant.other.reference.citation.latex" + } + ] + }, + { + "begin": "((\\\\)(?:\\w*[r|R]ef\\*?))(\\{)", + "beginCaptures": { + "1": { + "name": "keyword.control.ref.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.reference.label.latex", + "patterns": [ + { + "match": "[a-zA-Z0-9\\.,:/*!^_-]", + "name": "constant.other.reference.label.latex" + } + ] + }, + { + "include": "#definition-label" + }, + { + "begin": "((\\\\)verb[\\*]?)\\s*((\\\\)scantokens)(\\{)", + "beginCaptures": { + "1": { + "name": "support.function.verb.latex" + }, + "2": { + "name": "punctuation.definition.function.latex" + }, + "3": { + "name": "support.function.verb.latex" + }, + "4": { + "name": "punctuation.definition.verb.latex" + }, + "5": { + "name": "punctuation.definition.begin.latex" + } + }, + "contentName": "markup.raw.verb.latex", + "end": "(\\})", + "endCaptures": { + "1": { + "name": "punctuation.definition.end.latex" + } + }, + "name": "meta.function.verb.latex", + "patterns": [ + { + "include": "$self" + } + ] + }, + { + "captures": { + "1": { + "name": "support.function.verb.latex" + }, + "2": { + "name": "punctuation.definition.function.latex" + }, + "3": { + "name": "punctuation.definition.verb.latex" + }, + "4": { + "name": "markup.raw.verb.latex" + }, + "5": { + "name": "punctuation.definition.verb.latex" + } + }, + "match": "((\\\\)verb[\\*]?)\\s*((?<=\\s)\\S|[^a-zA-Z])(.*?)(\\3|$)", + "name": "meta.function.verb.latex" + }, + { + "captures": { + "1": { + "name": "support.function.verb.latex" + }, + "2": { + "name": "punctuation.definition.function.latex" + }, + "3": { + "patterns": [ + { + "include": "#optional-arg" + } + ] + }, + "4": { + "name": "punctuation.definition.arguments.begin.latex" + }, + "5": { + "name": "punctuation.definition.arguments.end.latex" + }, + "6": { + "name": "punctuation.definition.verb.latex" + }, + "7": { + "name": "markup.raw.verb.latex" + }, + "8": { + "name": "punctuation.definition.verb.latex" + }, + "9": { + "name": "punctuation.definition.verb.latex" + }, + "10": { + "name": "markup.raw.verb.latex" + }, + "11": { + "name": "punctuation.definition.verb.latex" + } + }, + "match": "((\\\\)(?:mint|mintinline))((?:\\[[^\\[]*?\\])?)(\\{)[a-zA-Z]*(\\})(?:(?:([^a-zA-Z\\{])(.*?)(\\6))|(?:(\\{)(.*?)(\\})))", + "name": "meta.function.verb.latex" + }, + { + "captures": { + "1": { + "name": "support.function.verb.latex" + }, + "2": { + "name": "punctuation.definition.function.latex" + }, + "3": { + "patterns": [ + { + "include": "#optional-arg" + } + ] + }, + "4": { + "name": "punctuation.definition.verb.latex" + }, + "5": { + "name": "markup.raw.verb.latex" + }, + "6": { + "name": "punctuation.definition.verb.latex" + }, + "7": { + "name": "punctuation.definition.verb.latex" + }, + "8": { + "name": "markup.raw.verb.latex" + }, + "9": { + "name": "punctuation.definition.verb.latex" + } + }, + "match": "((\\\\)[a-z]+inline)((?:\\[[^\\[]*?\\])?)(?:(?:([^a-zA-Z\\{])(.*?)(\\4))|(?:(\\{)(.*?)(\\})))", + "name": "meta.function.verb.latex" + }, + { + "match": "\\\\(?:newline|pagebreak|clearpage|linebreak|pause)(?:\\b)", + "name": "keyword.control.layout.tex" + }, + { + "begin": "\\\\\\(", + "beginCaptures": { + "0": { + "name": "punctuation.definition.string.begin.latex" + } + }, + "end": "\\\\\\)", + "endCaptures": { + "0": { + "name": "punctuation.definition.string.end.latex" + } + }, + "name": "support.class.math.latex", + "patterns": [ + { + "include": "text.tex#math" + }, + { + "include": "$base" + } + ] + }, + { + "begin": "\\$\\$", + "beginCaptures": { + "0": { + "name": "punctuation.definition.string.begin.latex" + } + }, + "end": "\\$\\$", + "endCaptures": { + "0": { + "name": "punctuation.definition.string.end.latex" + } + }, + "name": "support.class.math.latex", + "patterns": [ + { + "match": "\\\\\\$", + "name": "constant.character.escape.tex" + }, + { + "include": "text.tex#math" + }, + { + "include": "$base" + } + ] + }, + { + "begin": "\\\\\\[", + "beginCaptures": { + "0": { + "name": "punctuation.definition.string.begin.latex" + } + }, + "end": "\\\\\\]", + "endCaptures": { + "0": { + "name": "punctuation.definition.string.end.latex" + } + }, + "name": "support.class.math.latex", + "patterns": [ + { + "include": "text.tex#math" + }, + { + "include": "$base" + } + ] + }, + { + "captures": { + "1": { + "name": "punctuation.definition.constant.latex" + } + }, + "match": "(\\\\)(text(s(terling|ixoldstyle|urd|e(ction|venoldstyle|rvicemark))|yen|n(ineoldstyle|umero|aira)|c(ircledP|o(py(left|right)|lonmonetary)|urrency|e(nt(oldstyle)?|lsius))|t(hree(superior|oldstyle|quarters(emdash)?)|i(ldelow|mes)|w(o(superior|oldstyle)|elveudash)|rademark)|interrobang(down)?|zerooldstyle|o(hm|ne(superior|half|oldstyle|quarter)|penbullet|rd(feminine|masculine))|d(i(scount|ed|v(orced)?)|o(ng|wnarrow|llar(oldstyle)?)|egree|agger(dbl)?|blhyphen(char)?)|uparrow|p(ilcrow|e(so|r(t(housand|enthousand)|iodcentered))|aragraph|m)|e(stimated|ightoldstyle|uro)|quotes(traight(dblbase|base)|ingle)|f(iveoldstyle|ouroldstyle|lorin|ractionsolidus)|won|l(not|ira|e(ftarrow|af)|quill|angle|brackdbl)|a(s(cii(caron|dieresis|acute|grave|macron|breve)|teriskcentered)|cutedbl)|r(ightarrow|e(cipe|ferencemark|gistered)|quill|angle|brackdbl)|g(uarani|ravedbl)|m(ho|inus|u(sicalnote)?|arried)|b(igcircle|orn|ullet|lank|a(ht|rdbl)|rokenbar)))\\b", + "name": "constant.character.latex" + }, + { + "captures": { + "1": { + "name": "punctuation.definition.column-specials.begin.latex" + }, + "2": { + "name": "punctuation.definition.column-specials.end.latex" + } + }, + "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" +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/syntaxes/TeX.tmLanguage.json Mon May 11 17:50:17 2020 -0500 @@ -0,0 +1,264 @@ +{ + "fileTypes": [ + "sty", + "cls", + "bbx", + "cbx", + "ltx" + ], + "name": "TeX+", + "patterns": [ + { + "captures": { + "1": { + "name": "punctuation.definition.keyword.tex" + } + }, + "match": "(\\\\)(backmatter|else|fi|frontmatter|ftrue|mainmatter|if(case|cat|dim|eof|false|hbox|hmode|inner|mmode|num|odd|undefined|vbox|vmode|void|x)?)\\b", + "name": "keyword.control.tex" + }, + { + "captures": { + "1": { + "name": "keyword.control.catcode.tex" + }, + "2": { + "name": "punctuation.definition.keyword.tex" + }, + "3": { + "name": "punctuation.separator.key-value.tex" + }, + "4": { + "name": "constant.numeric.category.tex" + } + }, + "match": "((\\\\)catcode)`(?:\\\\)?.(=)(\\d+)", + "name": "meta.catcode.tex" + }, + { + "begin": "(^[ \\t]+)?(?=%)", + "beginCaptures": { + "1": { + "name": "punctuation.whitespace.comment.leading.tex" + } + }, + "end": "(?!\\G)", + "patterns": [ + { + "begin": "%:", + "beginCaptures": { + "0": { + "name": "punctuation.definition.comment.tex" + } + }, + "end": "$\\n?", + "name": "comment.line.percentage.semicolon.texshop.tex" + }, + { + "begin": "^(%!TEX) (\\S*) =", + "beginCaptures": { + "1": { + "name": "punctuation.definition.comment.tex" + } + }, + "end": "$\\n?", + "name": "comment.line.percentage.directive.texshop.tex" + }, + { + "begin": "%", + "beginCaptures": { + "0": { + "name": "punctuation.definition.comment.tex" + } + }, + "end": "$\\n?", + "name": "comment.line.percentage.tex" + } + ] + }, + { + "match": "[\\[\\]]", + "name": "punctuation.definition.brackets.tex" + }, + { + "begin": "(\\$\\$|\\$)", + "beginCaptures": { + "1": { + "name": "punctuation.definition.string.begin.tex" + } + }, + "end": "(\\1)", + "endCaptures": { + "1": { + "name": "punctuation.definition.string.end.tex" + } + }, + "name": "support.class.math.block.tex", + "patterns": [ + { + "match": "\\\\\\$", + "name": "constant.character.escape.tex" + }, + { + "include": "#math" + }, + { + "include": "$self" + } + ] + }, + { + "match": "\\\\\\\\", + "name": "keyword.control.newline.tex" + }, + { + "captures": { + "1": { + "name": "punctuation.definition.function.tex" + } + }, + "match": "(\\\\)[A-Za-z@]+", + "name": "support.function.general.tex" + }, + { + "captures": { + "1": { + "name": "punctuation.definition.keyword.tex" + } + }, + "match": "(\\\\)[^a-zA-Z@]", + "name": "constant.character.escape.tex" + }, + { + "match": "«press a-z and space for greek letter»[a-zA-Z]*", + "name": "meta.placeholder.greek.tex" + } + ], + "repository": { + "math": { + "patterns": [ + { + "captures": { + "1": { + "name": "punctuation.definition.constant.math.tex" + } + }, + "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)(?=\\b|_)", + "name": "constant.character.math.tex" + }, + { + "captures": { + "1": { + "name": "punctuation.definition.constant.math.tex" + } + }, + "match": "(\\\\)(sum|prod|coprod|int|oint|bigcap|bigcup|bigsqcup|bigvee|bigwedge|bigodot|bigotimes|bogoplus|biguplus)\\b", + "name": "constant.character.math.tex" + }, + { + "captures": { + "1": { + "name": "punctuation.definition.constant.math.tex" + } + }, + "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", + "name": "constant.other.math.tex" + }, + { + "begin": "((\\\\)Sexpr(\\{))", + "beginCaptures": { + "1": { + "name": "support.function.sexpr.math.tex" + }, + "2": { + "name": "punctuation.definition.function.math.tex" + }, + "3": { + "name": "punctuation.section.embedded.begin.math.tex" + } + }, + "contentName": "support.function.sexpr.math.tex", + "end": "(((\\})))", + "endCaptures": { + "1": { + "name": "support.function.sexpr.math.tex" + }, + "2": { + "name": "punctuation.section.embedded.end.math.tex" + }, + "3": { + "name": "source.r" + } + }, + "name": "meta.embedded.line.r", + "patterns": [ + { + "begin": "\\G(?!\\})", + "end": "(?=\\})", + "name": "source.r", + "patterns": [ + { + "include": "source.r" + } + ] + } + ] + }, + { + "captures": { + "1": { + "name": "punctuation.definition.constant.math.tex" + } + }, + "match": "(\\\\)(?!begin\\{|verb)([A-Za-z]+)", + "name": "constant.other.general.math.tex" + }, + { + "match": "(?<!\\\\)\\{", + "name": "punctuation.math.begin.bracket.curly" + }, + { + "match": "(?<!\\\\)\\}", + "name": "punctuation.math.end.bracket.curly" + }, + { + "match": "\\(", + "name": "punctuation.math.begin.bracket.round" + }, + { + "match": "\\)", + "name": "punctuation.math.end.bracket.round" + }, + { + "match": "(([0-9]*[\\.][0-9]+)|[0-9]+)", + "name": "constant.numeric.math.tex" + }, + { + "match": "«press a-z and space for greek letter»[a-zA-Z]*", + "name": "meta.placeholder.greek.math.tex" + } + ] + }, + "braces": { + "begin": "(?<!\\\\)\\{", + "beginCaptures": { + "0": { + "name": "punctuation.group.begin.tex" + } + }, + "end": "(?<!\\\\)\\}", + "endCaptures": { + "0": { + "name": "punctuation.group.end.tex" + } + }, + "name": "meta.group.braces.tex", + "patterns": [ + { + "include": "#braces" + } + ] + } + }, + "scopeName": "text.tex" +} \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/syntaxes/latexblock.json Mon May 11 17:50:17 2020 -0500 @@ -0,0 +1,43 @@ + +{ + "fileTypes": [], + "injectionSelector": "L:text.html.markdown", + "patterns": [ + { + "include": "#fenced_code_block_latex" + } + ], + "repository": { + "fenced_code_block_latex": { + "begin": "(^|\\G)(\\s*)(`{3,}|~{3,})\\s*(latex)\\s*(?:\\{[^\\{\\}]*\\})?\\s*$", + "name": "markup.fenced_code.block.markdown", + "end": "(^|\\G)(\\2|\\s{0,3})(\\3)\\s*$", + "beginCaptures": { + "3": { + "name": "punctuation.definition.markdown" + }, + "4": { + "name": "fenced_code.block.language" + } + }, + "endCaptures": { + "3": { + "name": "punctuation.definition.markdown" + } + }, + "patterns": [ + { + "begin": "(^|\\G)(\\s*)(.*)", + "while": "(^|\\G)(?!\\s*([`~]{3,})\\s*$)", + "contentName": "meta.embedded.block.latex", + "patterns": [ + { + "include": "text.tex.latex" + } + ] + } + ] + } + }, + "scopeName": "markdown.latex.codeblock" +} \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vsc-extension-quickstart.md Mon May 11 17:50:17 2020 -0500 @@ -0,0 +1,29 @@ +# Welcome to your VS Code Extension + +## What's in the folder + +* This folder contains all of the files necessary for your extension. +* `package.json` - this is the manifest file in which you declare your language support and define the location of the grammar file that has been copied into your extension. +* `syntaxes/latex.tmLanguage.json` - this is the Text mate grammar file that is used for tokenization. +* `language-configuration.json` - this is the language configuration, defining the tokens that are used for comments and brackets. + +## Get up and running straight away + +* Make sure the language configuration settings in `language-configuration.json` are accurate. +* Press `F5` to open a new window with your extension loaded. +* Create a new file with a file name suffix matching your language. +* Verify that syntax highlighting works and that the language configuration settings are working. + +## Make changes + +* You can relaunch the extension from the debug toolbar after making changes to the files listed above. +* You can also reload (`Ctrl+R` or `Cmd+R` on Mac) the VS Code window with your extension to load your changes. + +## Add more language features + +* To add features such as intellisense, hovers and validators check out the VS Code extenders documentation at https://code.visualstudio.com/docs + +## Install your extension + +* To start using your extension with Visual Studio Code copy it into the `<user home>/.vscode/extensions` folder and restart Code. +* To share your extension with the world, read on https://code.visualstudio.com/docs about publishing an extension.