README.md

Wed, 13 May 2020 15:40:47 -0500

author
Tuomo Valkonen <tuomov@iki.fi>
date
Wed, 13 May 2020 15:40:47 -0500
changeset 11
3633d38b64bd
parent 9
caaf16def702
child 13
15b8d7242ad9
child 15
a65b8c098aa6
permissions
-rw-r--r--

Explain that extensions cannot seem to be able to contribute token colours.

0
aa9fc390ce91 Initial version.
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
1 # latex-syntax
aa9fc390ce91 Initial version.
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
2
4
acf39baa1c7d More README improvements
Tuomo Valkonen <tuomov@iki.fi>
parents: 3
diff changeset
3 This package provides rich LaTeX _syntax highlighting_ for VSCode. It provides
acf39baa1c7d More README improvements
Tuomo Valkonen <tuomov@iki.fi>
parents: 3
diff changeset
4 _only_ syntax highlighting: no annoying snippets etc. that only serve to mess
acf39baa1c7d More README improvements
Tuomo Valkonen <tuomov@iki.fi>
parents: 3
diff changeset
5 up your work. It is recommended to be combined with [texlab][]. The latter
7
fedc1fbea767 typofixes
Tuomo Valkonen <tuomov@iki.fi>
parents: 6
diff changeset
6 provides language intelligence/auto-completion and a build system interface.
4
acf39baa1c7d More README improvements
Tuomo Valkonen <tuomov@iki.fi>
parents: 3
diff changeset
7 The present package complements texlab with richer syntax highlighting. The
acf39baa1c7d More README improvements
Tuomo Valkonen <tuomov@iki.fi>
parents: 3
diff changeset
8 grammar is derived from LaTeX-Workshop, but has improvements including
0
aa9fc390ce91 Initial version.
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
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
aa9fc390ce91 Initial version.
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
12
9
caaf16def702 README typofixes
Tuomo Valkonen <tuomov@iki.fi>
parents: 7
diff changeset
13 b) Footnote highlighting (`\footnote`, `\footnotemark`, and `\footnotetext`).
0
aa9fc390ce91 Initial version.
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
14
aa9fc390ce91 Initial version.
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
15 c) Highlighting of `comment` environments as comment blocks.
aa9fc390ce91 Initial version.
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
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
aa9fc390ce91 Initial version.
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
20 ### How to enable
aa9fc390ce91 Initial version.
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
21
aa9fc390ce91 Initial version.
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
22 This package does not override the standard “LaTeX” grammar. It provides the
aa9fc390ce91 Initial version.
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
23 “LaTeX+” grammar. Please select that as the default grammar for `.tex` files.
aa9fc390ce91 Initial version.
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
24
aa9fc390ce91 Initial version.
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
25 ### Regarding `todonotes` and `footnote` support
aa9fc390ce91 Initial version.
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
26
11
3633d38b64bd Explain that extensions cannot seem to be able to contribute token colours.
Tuomo Valkonen <tuomov@iki.fi>
parents: 9
diff changeset
27 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
28 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
29 `\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
30 `settings.json` (Cmd+Shift+P, “Open Settings (JSON)”):
0
aa9fc390ce91 Initial version.
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
31
aa9fc390ce91 Initial version.
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
32 ```json
1
6c4986d204ac README improvements
Tuomo Valkonen <tuomov@iki.fi>
parents: 0
diff changeset
33 "editor.tokenColorCustomizations": {
6c4986d204ac README improvements
Tuomo Valkonen <tuomov@iki.fi>
parents: 0
diff changeset
34 "textMateRules": [
6c4986d204ac README improvements
Tuomo Valkonen <tuomov@iki.fi>
parents: 0
diff changeset
35 {
6c4986d204ac README improvements
Tuomo Valkonen <tuomov@iki.fi>
parents: 0
diff changeset
36 "scope": "entity.name.todo.latex",
6c4986d204ac README improvements
Tuomo Valkonen <tuomov@iki.fi>
parents: 0
diff changeset
37 "settings": {
6c4986d204ac README improvements
Tuomo Valkonen <tuomov@iki.fi>
parents: 0
diff changeset
38 "foreground": "#d17000",
6c4986d204ac README improvements
Tuomo Valkonen <tuomov@iki.fi>
parents: 0
diff changeset
39 "fontStyle": "italic",
6c4986d204ac README improvements
Tuomo Valkonen <tuomov@iki.fi>
parents: 0
diff changeset
40 }
6c4986d204ac README improvements
Tuomo Valkonen <tuomov@iki.fi>
parents: 0
diff changeset
41 },
6c4986d204ac README improvements
Tuomo Valkonen <tuomov@iki.fi>
parents: 0
diff changeset
42 {
6c4986d204ac README improvements
Tuomo Valkonen <tuomov@iki.fi>
parents: 0
diff changeset
43 "scope": "support.function.todo.latex",
6c4986d204ac README improvements
Tuomo Valkonen <tuomov@iki.fi>
parents: 0
diff changeset
44 "settings": {
6c4986d204ac README improvements
Tuomo Valkonen <tuomov@iki.fi>
parents: 0
diff changeset
45 "foreground": "#d17000",
6c4986d204ac README improvements
Tuomo Valkonen <tuomov@iki.fi>
parents: 0
diff changeset
46 "fontStyle": "italic",
0
aa9fc390ce91 Initial version.
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
47 }
1
6c4986d204ac README improvements
Tuomo Valkonen <tuomov@iki.fi>
parents: 0
diff changeset
48 },
6c4986d204ac README improvements
Tuomo Valkonen <tuomov@iki.fi>
parents: 0
diff changeset
49 {
6c4986d204ac README improvements
Tuomo Valkonen <tuomov@iki.fi>
parents: 0
diff changeset
50 "scope": "entity.name.footnote.latex",
6c4986d204ac README improvements
Tuomo Valkonen <tuomov@iki.fi>
parents: 0
diff changeset
51 "settings": {
6c4986d204ac README improvements
Tuomo Valkonen <tuomov@iki.fi>
parents: 0
diff changeset
52 "foreground": "#e28000",
6c4986d204ac README improvements
Tuomo Valkonen <tuomov@iki.fi>
parents: 0
diff changeset
53 "fontStyle": "italic",
6c4986d204ac README improvements
Tuomo Valkonen <tuomov@iki.fi>
parents: 0
diff changeset
54 }
6c4986d204ac README improvements
Tuomo Valkonen <tuomov@iki.fi>
parents: 0
diff changeset
55 },
6c4986d204ac README improvements
Tuomo Valkonen <tuomov@iki.fi>
parents: 0
diff changeset
56 {
6c4986d204ac README improvements
Tuomo Valkonen <tuomov@iki.fi>
parents: 0
diff changeset
57 "scope": "support.function.footnote.latex",
6c4986d204ac README improvements
Tuomo Valkonen <tuomov@iki.fi>
parents: 0
diff changeset
58 "settings": {
6c4986d204ac README improvements
Tuomo Valkonen <tuomov@iki.fi>
parents: 0
diff changeset
59 "foreground": "#e28000",
6c4986d204ac README improvements
Tuomo Valkonen <tuomov@iki.fi>
parents: 0
diff changeset
60 "fontStyle": "italic",
6c4986d204ac README improvements
Tuomo Valkonen <tuomov@iki.fi>
parents: 0
diff changeset
61 }
6c4986d204ac README improvements
Tuomo Valkonen <tuomov@iki.fi>
parents: 0
diff changeset
62 }
6c4986d204ac README improvements
Tuomo Valkonen <tuomov@iki.fi>
parents: 0
diff changeset
63 ],
6c4986d204ac README improvements
Tuomo Valkonen <tuomov@iki.fi>
parents: 0
diff changeset
64 },
0
aa9fc390ce91 Initial version.
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
65 ```
aa9fc390ce91 Initial version.
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
66
5
993903fd4434 Support initial-prefixed \XYtodo.
Tuomo Valkonen <tuomov@iki.fi>
parents: 4
diff changeset
67 Initial-prefixed `\XYtodo` custom todonotes commands are also supported.
993903fd4434 Support initial-prefixed \XYtodo.
Tuomo Valkonen <tuomov@iki.fi>
parents: 4
diff changeset
68 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
69 the above colour customisations and in your LaTeX source define
993903fd4434 Support initial-prefixed \XYtodo.
Tuomo Valkonen <tuomov@iki.fi>
parents: 4
diff changeset
70 ```tex
7
fedc1fbea767 typofixes
Tuomo Valkonen <tuomov@iki.fi>
parents: 6
diff changeset
71 \newcommand{\lstodo}[2][]{\todo[color=DarkRed!40,#1]{#2}}
5
993903fd4434 Support initial-prefixed \XYtodo.
Tuomo Valkonen <tuomov@iki.fi>
parents: 4
diff changeset
72 ```
993903fd4434 Support initial-prefixed \XYtodo.
Tuomo Valkonen <tuomov@iki.fi>
parents: 4
diff changeset
73 (The colour setting here only affects LaTeX output, not VSCode.)
993903fd4434 Support initial-prefixed \XYtodo.
Tuomo Valkonen <tuomov@iki.fi>
parents: 4
diff changeset
74
0
aa9fc390ce91 Initial version.
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
75 [texlab]: https://marketplace.visualstudio.com/items?itemName=efoerster.texlab

mercurial