[gtksourceview/wip/latex] latex.lang: improve math highlighting



commit fe2fc62e83731e848fdad393d96fabede9fe17fa
Author: Sébastien Wilmet <swilmet gnome org>
Date:   Thu Dec 5 21:34:06 2013 +0100

    latex.lang: improve math highlighting

 data/language-specs/latex.lang |   27 ++++++++++++++++++++++++++-
 1 files changed, 26 insertions(+), 1 deletions(-)
---
diff --git a/data/language-specs/latex.lang b/data/language-specs/latex.lang
index 3b8111a..0b52f05 100644
--- a/data/language-specs/latex.lang
+++ b/data/language-specs/latex.lang
@@ -382,11 +382,36 @@
       </match>
     </context>
 
+    <context id="math-spacing" style-ref="special-char">
+      <match>\\[;:!]</match>
+    </context>
+
+    <context id="math-brackets" style-ref="common-commands">
+      <match extended="true">
+        \\(left | right | [bB]igg?[lr])  (      # bracket size specifier
+          \(|\) | \[|\] | \\\{|\\\}   |         # normal brackets (curly escaped)
+          \|  |  \\\|  |  /  |  \\backslash |   # pipe and slashes
+          \\(                                   #-symbol commands
+            [lr]floor | [lr]ceil | [lr]angle |  ##
+            ([uU]p(down)?|[dD]own)arrow         ##
+          )                                     ##
+        )
+      </match>
+    </context>
+
+    <context id="math-super-sub-script" style-ref="common-commands">
+      <match>\^|_</match>
+    </context>
+
     <context id="in-math" class="no-spell-check">
       <include>
+        <context ref="comment"/>
         <context ref="math-command"/>
+        <context ref="math-spacing"/>
+        <context ref="math-brackets"/>
+        <context ref="special-char"/>
+        <context ref="math-super-sub-script"/>
         <context ref="generic-command"/>
-        <!-- more to come -->
       </include>
     </context>
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]