# HG changeset patch # User Tuomo Valkonen # Date 1589326680 18000 # Node ID 993903fd443453810ba4a5afeb52c76dab83aead # Parent acf39baa1c7db51e02dea300cab2ffffdae0fc5e Support initial-prefixed \XYtodo. diff -r acf39baa1c7d -r 993903fd4434 README.md --- a/README.md Tue May 12 18:17:39 2020 -0500 +++ b/README.md Tue May 12 18:38:00 2020 -0500 @@ -7,12 +7,16 @@ The present package complements texlab with richer syntax highlighting. The grammar is derived from LaTeX-Workshop, but has improvements including - a) Highlighting of `todonotes` (see below). + a) Highlighting for the `todonotes` package: `\todo` as well as custom-defined + `\XYtodo` for author initials `X` and `Y`. b) Footnote highlighting. c) Highlighting of `comment` environments as comment blocks. +The highlighting of todo-notes and footnotes has to be specifically configured: +see below. + ### How to enable This package does not override the standard “LaTeX” grammar. It provides the @@ -59,4 +63,12 @@ }, ``` +Initial-prefixed `\XYtodo` custom todonotes commands are also supported. +For example, `\lstodo{a latex-syntax todo}` will be highlighted if you do +the above colour customisations and in your LaTeX source define +```tex +\newcommand{\abtodo}[2][]{\todo[color=DarkRed!40,#1]{#2}} +``` +(The colour setting here only affects LaTeX output, not VSCode.) + [texlab]: https://marketplace.visualstudio.com/items?itemName=efoerster.texlab diff -r acf39baa1c7d -r 993903fd4434 package.json --- a/package.json Tue May 12 18:17:39 2020 -0500 +++ b/package.json Tue May 12 18:38:00 2020 -0500 @@ -2,7 +2,7 @@ "name": "latex-syntax", "displayName": "latex-syntax", "description": "Rich LaTeX syntax highlighting (for use with Texlab)", - "version": "0.0.1", + "version": "0.0.2", "publisher": "vomout", "license": "MIT", "homepage": "https://tuomov.iki.fi/software/", diff -r acf39baa1c7d -r 993903fd4434 syntaxes/LaTeX.tmLanguage.json --- a/syntaxes/LaTeX.tmLanguage.json Tue May 12 18:17:39 2020 -0500 +++ b/syntaxes/LaTeX.tmLanguage.json Tue May 12 18:38:00 2020 -0500 @@ -959,7 +959,7 @@ ] }, { - "begin": "((\\\\)todo)((?:\\[[^\\[]*?\\])*)(\\{)", + "begin": "((\\\\)(?:[a-zA-Z][a-zA-Z])?todo)((?:\\[[^\\[]*?\\])*)(\\{)", "beginCaptures": { "1": { "name": "support.function.todo.latex"