Wed, 13 May 2020 14:55:08 -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 | |
|
6
0ac9389339bf
Support `\footnotemark` and `\footnotetext`.
Tuomo Valkonen <tuomov@iki.fi>
parents:
5
diff
changeset
|
13 | b) Footnote highlighting (`\foonote`, `\footnotemark`, and `\footnotemark`). |
| 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 | ### How to enable |
| 21 | ||
| 22 | This package does not override the standard “LaTeX” grammar. It provides the | |
| 23 | “LaTeX+” grammar. Please select that as the default grammar for `.tex` files. | |
| 24 | ||
| 25 | ### Regarding `todonotes` and `footnote` support | |
| 26 | ||
| 27 | To enable syntax highlighting for `\todo` and `\footnote`, add the following | |
| 1 | 28 | (with possibly customised colours) to your user `settings.json` |
| 29 | (Cmd+Shift+P, “Open Settings (JSON)”): | |
| 0 | 30 | |
| 31 | ```json | |
| 1 | 32 | "editor.tokenColorCustomizations": { |
| 33 | "textMateRules": [ | |
| 34 | { | |
| 35 | "scope": "entity.name.todo.latex", | |
| 36 | "settings": { | |
| 37 | "foreground": "#d17000", | |
| 38 | "fontStyle": "italic", | |
| 39 | } | |
| 40 | }, | |
| 41 | { | |
| 42 | "scope": "support.function.todo.latex", | |
| 43 | "settings": { | |
| 44 | "foreground": "#d17000", | |
| 45 | "fontStyle": "italic", | |
| 0 | 46 | } |
| 1 | 47 | }, |
| 48 | { | |
| 49 | "scope": "entity.name.footnote.latex", | |
| 50 | "settings": { | |
| 51 | "foreground": "#e28000", | |
| 52 | "fontStyle": "italic", | |
| 53 | } | |
| 54 | }, | |
| 55 | { | |
| 56 | "scope": "support.function.footnote.latex", | |
| 57 | "settings": { | |
| 58 | "foreground": "#e28000", | |
| 59 | "fontStyle": "italic", | |
| 60 | } | |
| 61 | } | |
| 62 | ], | |
| 63 | }, | |
| 0 | 64 | ``` |
| 65 | ||
|
5
993903fd4434
Support initial-prefixed \XYtodo.
Tuomo Valkonen <tuomov@iki.fi>
parents:
4
diff
changeset
|
66 | Initial-prefixed `\XYtodo` custom todonotes commands are also supported. |
|
993903fd4434
Support initial-prefixed \XYtodo.
Tuomo Valkonen <tuomov@iki.fi>
parents:
4
diff
changeset
|
67 | 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
|
68 | the above colour customisations and in your LaTeX source define |
|
993903fd4434
Support initial-prefixed \XYtodo.
Tuomo Valkonen <tuomov@iki.fi>
parents:
4
diff
changeset
|
69 | ```tex |
| 7 | 70 | \newcommand{\lstodo}[2][]{\todo[color=DarkRed!40,#1]{#2}} |
|
5
993903fd4434
Support initial-prefixed \XYtodo.
Tuomo Valkonen <tuomov@iki.fi>
parents:
4
diff
changeset
|
71 | ``` |
|
993903fd4434
Support initial-prefixed \XYtodo.
Tuomo Valkonen <tuomov@iki.fi>
parents:
4
diff
changeset
|
72 | (The colour setting here only affects LaTeX output, not VSCode.) |
|
993903fd4434
Support initial-prefixed \XYtodo.
Tuomo Valkonen <tuomov@iki.fi>
parents:
4
diff
changeset
|
73 | |
| 0 | 74 | [texlab]: https://marketplace.visualstudio.com/items?itemName=efoerster.texlab |