[gtksourceview] latex.lang: add support for embedded R code (Sweave package)



commit 5395983eed5343fd562bfc8d4509aa52c180391d
Author: Mathias Moser <matmoser wu ac at>
Date:   Fri Feb 7 21:59:17 2014 +0100

    latex.lang: add support for embedded R code (Sweave package)

 data/language-specs/latex.lang |   15 +++++++++++++++
 1 files changed, 15 insertions(+), 0 deletions(-)
---
diff --git a/data/language-specs/latex.lang b/data/language-specs/latex.lang
index 46b4758..e3187cd 100644
--- a/data/language-specs/latex.lang
+++ b/data/language-specs/latex.lang
@@ -88,6 +88,20 @@
       </include>
     </context>
 
+    <!-- Embedded R Code (Sweave package) -->
+
+    <context id="R-block" class="no-spell-check">
+      <start>(\\begin)\{(Scode|Sinput|Soutput)\}</start>
+      <end>(\\end)\{(\%{2 start})\}</end>
+      <include>
+        <context sub-pattern="1" where="start" style-ref="common-commands"/>
+        <context sub-pattern="2" where="start" style-ref="name"/>
+        <context sub-pattern="1" where="end" style-ref="common-commands"/>
+        <context sub-pattern="2" where="end" style-ref="name"/>
+        <context ref="r:r"/>
+      </include>
+    </context>
+
     <!--using brackets is an experimental feature from the listings package. The
         following must support these cases:
 
@@ -564,6 +578,7 @@
       <include>
         <context ref="comment"/>
         <context ref="verbatim"/>
+        <context ref="R-block"/>
         <context ref="headings"/>
         <context ref="math"/>
         <context ref="specific-commands"/>


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