# HG changeset patch # User Tuomo Valkonen # Date 1589237417 18000 # Node ID aa9fc390ce91e5a09ff659546ac5963f3e248dcf Initial version. diff -r 000000000000 -r aa9fc390ce91 .vscode/launch.json --- /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 diff -r 000000000000 -r aa9fc390ce91 .vscodeignore --- /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/** diff -r 000000000000 -r aa9fc390ce91 LICENSE.md --- /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. diff -r 000000000000 -r aa9fc390ce91 README.md --- /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 diff -r 000000000000 -r aa9fc390ce91 languages/latex.json --- /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,})" +} diff -r 000000000000 -r aa9fc390ce91 languages/tex.json --- /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,})" +} diff -r 000000000000 -r aa9fc390ce91 package.json --- /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 diff -r 000000000000 -r aa9fc390ce91 syntaxes/Bibtex.tmLanguage.json --- /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": "(?]*\\>)", + "name": "entity.name.function.filename.latex" + } + }, + "scopeName": "text.tex.doctex", + "uuid": "6BC8DE6F-9360-4C7E-AC3C-971385945346" +} \ No newline at end of file diff -r 000000000000 -r aa9fc390ce91 syntaxes/LaTeX-Expl3.tmLanguage.json --- /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 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" +} diff -r 000000000000 -r aa9fc390ce91 syntaxes/TeX.tmLanguage.json --- /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": "(?/.vscode/extensions` folder and restart Code. +* To share your extension with the world, read on https://code.visualstudio.com/docs about publishing an extension.