Wed, 13 May 2020 16:16:39 -0500
Bump version
0 | 1 | # latex-syntax |
2 | ||
4 | 3 | This package provides rich LaTeX _syntax highlighting_ for VSCode. It provides |
4 | _only_ syntax highlighting: no annoying snippets etc. that only serve to mess | |
5 | up your work. It is recommended to be combined with [texlab][]. The latter | |
7 | 6 | provides language intelligence/auto-completion and a build system interface. |
4 | 7 | The present package complements texlab with richer syntax highlighting. The |
8 | grammar is derived from LaTeX-Workshop, but has improvements including | |
0 | 9 | |
5
993903fd4434
Support initial-prefixed \XYtodo.
Tuomo Valkonen <tuomov@iki.fi>
parents:
4
diff
changeset
|
10 | a) Highlighting for the `todonotes` package: `\todo` as well as custom-defined |
993903fd4434
Support initial-prefixed \XYtodo.
Tuomo Valkonen <tuomov@iki.fi>
parents:
4
diff
changeset
|
11 | `\XYtodo` for author initials `X` and `Y`. |
0 | 12 | |
9 | 13 | b) Footnote highlighting (`\footnote`, `\footnotemark`, and `\footnotetext`). |
0 | 14 | |
15 | c) Highlighting of `comment` environments as comment blocks. | |
16 | ||
5
993903fd4434
Support initial-prefixed \XYtodo.
Tuomo Valkonen <tuomov@iki.fi>
parents:
4
diff
changeset
|
17 | The highlighting of todo-notes and footnotes has to be specifically configured: |
993903fd4434
Support initial-prefixed \XYtodo.
Tuomo Valkonen <tuomov@iki.fi>
parents:
4
diff
changeset
|
18 | see below. |
993903fd4434
Support initial-prefixed \XYtodo.
Tuomo Valkonen <tuomov@iki.fi>
parents:
4
diff
changeset
|
19 | |
0 | 20 | ### Regarding `todonotes` and `footnote` support |
21 | ||
11
3633d38b64bd
Explain that extensions cannot seem to be able to contribute token colours.
Tuomo Valkonen <tuomov@iki.fi>
parents:
9
diff
changeset
|
22 | Unfortunately, VSCode does not appear to let extensions contribute token colours |
3633d38b64bd
Explain that extensions cannot seem to be able to contribute token colours.
Tuomo Valkonen <tuomov@iki.fi>
parents:
9
diff
changeset
|
23 | for syntax highlighting. Therefore, to enable syntax highlighting for `\todo` and |
3633d38b64bd
Explain that extensions cannot seem to be able to contribute token colours.
Tuomo Valkonen <tuomov@iki.fi>
parents:
9
diff
changeset
|
24 | `\footnote`, add the following (with possibly customised colours) to your user |
3633d38b64bd
Explain that extensions cannot seem to be able to contribute token colours.
Tuomo Valkonen <tuomov@iki.fi>
parents:
9
diff
changeset
|
25 | `settings.json` (Cmd+Shift+P, “Open Settings (JSON)”): |
0 | 26 | |
27 | ```json | |
1 | 28 | "editor.tokenColorCustomizations": { |
29 | "textMateRules": [ | |
30 | { | |
31 | "scope": "entity.name.todo.latex", | |
32 | "settings": { | |
33 | "foreground": "#d17000", | |
34 | "fontStyle": "italic", | |
35 | } | |
36 | }, | |
37 | { | |
38 | "scope": "support.function.todo.latex", | |
39 | "settings": { | |
40 | "foreground": "#d17000", | |
41 | "fontStyle": "italic", | |
0 | 42 | } |
1 | 43 | }, |
44 | { | |
45 | "scope": "entity.name.footnote.latex", | |
46 | "settings": { | |
47 | "foreground": "#e28000", | |
48 | "fontStyle": "italic", | |
49 | } | |
50 | }, | |
51 | { | |
52 | "scope": "support.function.footnote.latex", | |
53 | "settings": { | |
54 | "foreground": "#e28000", | |
55 | "fontStyle": "italic", | |
56 | } | |
57 | } | |
58 | ], | |
59 | }, | |
0 | 60 | ``` |
61 | ||
5
993903fd4434
Support initial-prefixed \XYtodo.
Tuomo Valkonen <tuomov@iki.fi>
parents:
4
diff
changeset
|
62 | Initial-prefixed `\XYtodo` custom todonotes commands are also supported. |
993903fd4434
Support initial-prefixed \XYtodo.
Tuomo Valkonen <tuomov@iki.fi>
parents:
4
diff
changeset
|
63 | For example, `\lstodo{a latex-syntax todo}` will be highlighted if you do |
993903fd4434
Support initial-prefixed \XYtodo.
Tuomo Valkonen <tuomov@iki.fi>
parents:
4
diff
changeset
|
64 | the above colour customisations and in your LaTeX source define |
993903fd4434
Support initial-prefixed \XYtodo.
Tuomo Valkonen <tuomov@iki.fi>
parents:
4
diff
changeset
|
65 | ```tex |
7 | 66 | \newcommand{\lstodo}[2][]{\todo[color=DarkRed!40,#1]{#2}} |
5
993903fd4434
Support initial-prefixed \XYtodo.
Tuomo Valkonen <tuomov@iki.fi>
parents:
4
diff
changeset
|
67 | ``` |
993903fd4434
Support initial-prefixed \XYtodo.
Tuomo Valkonen <tuomov@iki.fi>
parents:
4
diff
changeset
|
68 | (The colour setting here only affects LaTeX output, not VSCode.) |
993903fd4434
Support initial-prefixed \XYtodo.
Tuomo Valkonen <tuomov@iki.fi>
parents:
4
diff
changeset
|
69 | |
0 | 70 | [texlab]: https://marketplace.visualstudio.com/items?itemName=efoerster.texlab |