8 grammar is derived from LaTeX-Workshop, but has improvements including |
8 grammar is derived from LaTeX-Workshop, but has improvements including |
9 |
9 |
10 a) Highlighting for the `todonotes` package: `\todo` as well as custom-defined |
10 a) Highlighting for the `todonotes` package: `\todo` as well as custom-defined |
11 `\XYtodo` for author initials `X` and `Y`. |
11 `\XYtodo` for author initials `X` and `Y`. |
12 |
12 |
13 b) Footnote highlighting (`\footnote`, `\footnotemark`, and `\footnotetext`). |
13 b) Likewise (custom-defined) `\reply` and `\XYreply` macros are highlighted to |
|
14 allow discussion of document review. |
14 |
15 |
15 c) Highlighting of `comment` environments as comment blocks. |
16 c) Footnote highlighting (`\footnote`, `\footnotemark`, and `\footnotetext`). |
|
17 |
|
18 d) Highlighting of `comment` environments as comment blocks. |
16 |
19 |
17 The highlighting of todo-notes and footnotes has to be specifically configured: |
20 The highlighting of todo-notes and footnotes has to be specifically configured: |
18 see below. |
21 see below. |
19 |
22 |
20 ### Regarding `todonotes` and `footnote` support |
23 ### Regarding `todonotes` and `footnote` support |
21 |
24 |
22 Unfortunately, VSCode does not appear to let extensions contribute token colours |
25 Unfortunately, VSCode does not appear to let extensions contribute token colours |
23 for syntax highlighting. Therefore, to enable syntax highlighting for `\todo` and |
26 for syntax highlighting. Therefore, to enable syntax highlighting for `\todo`, `\reply`, and |
24 `\footnote`, add the following (with possibly customised colours) to your user |
27 `\footnote`, add the following (with possibly customised colours) to your user |
25 `settings.json` (Cmd+Shift+P, “Open Settings (JSON)”): |
28 `settings.json` (Cmd+Shift+P, “Open Settings (JSON)”): |
26 |
29 |
27 ```json |
30 ```json |
28 "editor.tokenColorCustomizations": { |
31 "editor.tokenColorCustomizations": { |
49 ```tex |
62 ```tex |
50 \newcommand{\lstodo}[2][]{\todo[color=DarkRed!40,#1]{#2}} |
63 \newcommand{\lstodo}[2][]{\todo[color=DarkRed!40,#1]{#2}} |
51 ``` |
64 ``` |
52 (The colour setting here only affects LaTeX output, not VSCode.) |
65 (The colour setting here only affects LaTeX output, not VSCode.) |
53 |
66 |
|
67 To define `\reply` for discussion inside todonotes, a simple one is |
|
68 ```tex |
|
69 \newcommand{\reply}[1]{\textbf{#1}} |
|
70 ``` |
|
71 |
|
72 |
54 [texlab]: https://marketplace.visualstudio.com/items?itemName=efoerster.texlab |
73 [texlab]: https://marketplace.visualstudio.com/items?itemName=efoerster.texlab |