Support initial-prefixed \XYtodo.

Tue, 12 May 2020 18:38:00 -0500

author
Tuomo Valkonen <tuomov@iki.fi>
date
Tue, 12 May 2020 18:38:00 -0500
changeset 5
993903fd4434
parent 4
acf39baa1c7d
child 6
0ac9389339bf

Support initial-prefixed \XYtodo.

README.md file | annotate | diff | comparison | revisions
package.json file | annotate | diff | comparison | revisions
syntaxes/LaTeX.tmLanguage.json file | annotate | diff | comparison | revisions
--- 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
--- 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/",
--- 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"

mercurial