# HG changeset patch # User Tuomo Valkonen # Date 1589401073 18000 # Node ID 1dc4f331d3d5aa4413ca0c88f52cf2c0ad2393af # Parent 2f22cc1afaad81e0d301aba02913dc32b06960ee Failed attempt at injecting token colour customisations diff -r 2f22cc1afaad -r 1dc4f331d3d5 README.md --- a/README.md Thu May 14 17:45:50 2020 -0500 +++ b/README.md Wed May 13 15:17:53 2020 -0500 @@ -14,15 +14,11 @@ c) Highlighting of `comment` environments as comment blocks. -The highlighting of todo-notes and footnotes has to be specifically configured: -see below. - -### Regarding `todonotes` and `footnote` support +## Customising `todonotes` and `footnote` colours -Unfortunately, VSCode does not appear to let extensions contribute token colours -for syntax highlighting. Therefore, to enable syntax highlighting for `\todo` and -`\footnote`, add the following (with possibly customised colours) to your user -`settings.json` (Cmd+Shift+P, “Open Settings (JSON)”): +To customise syntax highlighting for `\todo` and `\footnote`, add the following +(with possibly customised colours) to your user `settings.json` +(Cmd+Shift+P, “Open Settings (JSON)”): ```json "editor.tokenColorCustomizations": { @@ -43,6 +39,8 @@ } ``` +## Initial-prefixed todo-notes + 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 diff -r 2f22cc1afaad -r 1dc4f331d3d5 package.json --- a/package.json Thu May 14 17:45:50 2020 -0500 +++ b/package.json Wed May 13 15:17:53 2020 -0500 @@ -83,6 +83,42 @@ "meta.embedded.block.latex": "latex" } } - ] + ], + "configurationDefaults": { + "[latexplus]": { + "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" + } + } + ] + } + } + } } } \ No newline at end of file