summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/context/third
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2011-12-18 23:06:57 +0000
committerKarl Berry <karl@freefriends.org>2011-12-18 23:06:57 +0000
commit4c841569d636a6dcddf66ab0ab135249a569f64e (patch)
treef98d072caf234e4ac29697f0852c899d5eac4ff7 /Master/texmf-dist/doc/context/third
parent2c36c65036ba988c02539d1238ea2c25fa457608 (diff)
context-vim (18dec11)
git-svn-id: svn://tug.org/texlive/trunk@24867 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/doc/context/third')
-rw-r--r--Master/texmf-dist/doc/context/third/vim/vim.txt31
1 files changed, 31 insertions, 0 deletions
diff --git a/Master/texmf-dist/doc/context/third/vim/vim.txt b/Master/texmf-dist/doc/context/third/vim/vim.txt
index b758e998473..9a879a501d2 100644
--- a/Master/texmf-dist/doc/context/third/vim/vim.txt
+++ b/Master/texmf-dist/doc/context/third/vim/vim.txt
@@ -390,6 +390,37 @@ highlighted line will be numbered thrice (with the numbers overprinted on one
another). This is because, internally, highlighting is implemented using text
backgrounds and they do not work with line numbering.
+Using TeX code in Comments
+--------------------------
+
+Sometimes one wants to use TeX code in comments, especially for math. To
+enable this use
+
+ \definevimtyping
+ [...]
+ [...
+ escape=on,
+ ]
+
+When `escape=on`, the `2context.vim` script passes the `Comment` syntax
+region (as identified by `vim`) verbatim to TeX. So, we may use TeX
+commands inside the comment region and they will be interpretted by TeX.
+For example
+
+ \definevimtyping[C][syntax=c, escape=on]
+
+ \startC
+ /* The following function computers the roots of \m{ax^2+bx+c=0}
+ * using the determinant \m{\Delta=\frac{-b\pm\sqrt{b^2-2ac}}{2a}}
+ */
+ double root (double a, double b, double c) {....}
+ \stopC
+
+**Note** that only `\ { }` have their usual meaning inside the `Comment`
+region when `escape=on` is set. Thus, to enter a math expression, use
+`\m{...}` instead of `$...$`. Moreover, spaces are active inside the
+math mode, so, as in the above example, avoid spaces in the math expressions.
+
Tuning color schemes
--------------------