[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kwrite-devel
Subject:    Improving latex.xml syntax file
From:       Patrick =?iso-8859-1?q?H=E4cker?= <pat_h () web ! de>
Date:       2012-06-08 8:59:40
Message-ID: 201206081059.45004.pat_h () web ! de
[Download RAW message or body]

[Attachment #2 (multipart/signed)]

[Attachment #4 (multipart/mixed)]


I just edited the LaTeX syntax highlighting file to add support for the math 
display block environments of the amsmath and mathtools packages. Some 
trailing spaces have (automatically) been removed, too. The patch is 
attached.

Cheers
Patrick

["math-block.patch" (text/x-patch)]

--- part/syntax/data/latex.xml.old	2012-06-08 10:45:41.326508457 +0200
+++ part/syntax/data/latex.xml	2012-06-08 10:45:44.402508440 +0200
@@ -68,7 +68,7 @@
       <context name="SectioningMathContrSeq" attribute="Structure Keyword Mathmode" \
lineEndContext="#pop">  <DetectChar char="&#xd7;" attribute="Bullet" \
                context="#stay"/>
         <RegExpr String="[a-zA-Z]+\*?" attribute="Structure Keyword Mathmode" \
                context="#pop"/>
-        <RegExpr String="[^a-zA-Z]" attribute="Structure Keyword Mathmode" \
context="#pop" />  +        <RegExpr String="[^a-zA-Z]" attribute="Structure Keyword \
Mathmode" context="#pop" />  </context>
 
       <!-- LaTeX Footnote commands -->
@@ -214,7 +214,7 @@
         <RegExpr String="(verbatim|boxedverbatim)" attribute="Environment" \
                context="VerbatimEnv"/>
         <RegExpr String="comment" attribute="Environment" context="CommentEnv"/>
         <RegExpr String="(alignat|xalignat|xxalignat)" attribute="Environment" \
                context="MathEnvParam"/>
-        <RegExpr String="(equation|displaymath|eqnarray|subeqnarray|math|multline|gat \
her|align|flalign|IEEEeqnarray|IEEEeqnarraybox|smallmatrix|pmatrix|bmatrix|Bmatrix|vmatrix|Vmatrix)" \
attribute="Environment" context="MathEnv"/> +        <RegExpr \
String="(equation|displaymath|eqnarray|subeqnarray|math|multline|multlined|gather|gath \
ered|align|aligned|flalign|IEEEeqnarray|IEEEeqnarraybox|smallmatrix|pmatrix|bmatrix|Bmatrix|vmatrix|Vmatrix)" \
                attribute="Environment" context="MathEnv"/>
         <RegExpr String="(tabularx|tabular|supertabular|mpsupertabular|xtabular|mpxtabular|longtable)" \
attribute="Environment" context="TabEnv"/>  <DetectChar char="&#xd7;" \
                attribute="Bullet" context="#stay"/>
         <RegExpr String="[a-zA-Z]" attribute="Environment" context="LatexEnv"/>
@@ -321,7 +321,7 @@
       <!-- end of math environment -->
       <context name="MathFindEnd" attribute="Normal Text" lineEndContext="#pop" \
fallthrough="true" fallthroughContext="#pop">  <RegExpr String="\s*\{" \
                attribute="Normal Text" context="#stay"/>
-        <RegExpr String="(equation|displaymath|eqnarray|subeqnarray|math|multline|gat \
her|align|flalign|alignat|xalignat|xxalignat|IEEEeqnarray|IEEEeqnarraybox|smallmatrix|pmatrix|bmatrix|Bmatrix|vmatrix|Vmatrix)\*?" \
attribute="Environment" context="#stay"/> +        <RegExpr \
String="(equation|displaymath|eqnarray|subeqnarray|math|multline|multlined|gather|gath \
ered|align|aligned|flalign|alignat|xalignat|xxalignat|IEEEeqnarray|IEEEeqnarraybox|smallmatrix|pmatrix|bmatrix|Bmatrix|vmatrix|Vmatrix)\*?" \
                attribute="Environment" context="#stay"/>
         <DetectChar char="}" attribute="Normal Text" context="#pop#pop#pop#pop#pop"  \
endRegion="block"/>  </context>
 
@@ -339,11 +339,11 @@
         <RegExpr String="\\end(?=\s*\{(tabularx|tabular|supertabular|mpsupertabular|xtabular|mpxtabular|longtable)\*?\})" \
attribute="Structure"  context="TabFindEnd"/>  <IncludeRules context="Normal Text" />
       </context>
-      
+
       <context name="Column Separator" attribute="Column Separator" \
                lineEndContext="#stay">
 	      <DetectChar char="{" attribute="Column Separator" context="Column \
Separator"/>  <DetectChar char="}" attribute="Column Separator" context="#pop"/>
-	      <RegExpr String="." attribute="Column Separator"  context="#stay"/> 
+	      <RegExpr String="." attribute="Column Separator"  context="#stay"/>
 <!-- 	 the last regexp is very stupid. Suggestions are welcome! Fallthrough did not \
help-->  </context>
 
@@ -405,7 +405,7 @@
       <context name="MathContrSeq" attribute="Keyword Mathmode" \
lineEndContext="#pop">  <DetectChar char="&#xd7;" attribute="Bullet" \
                context="#stay"/>
         <RegExpr String="[a-zA-Z]+\*?" attribute="Keyword Mathmode" context="#pop"/>
-        <RegExpr String="[^a-zA-Z]" attribute="Keyword Mathmode" context="#pop" /> 
+        <RegExpr String="[^a-zA-Z]" attribute="Keyword Mathmode" context="#pop" />
       </context>
 
       <!-- text in mathmode -->
@@ -414,7 +414,7 @@
       </context>
 
       <context name="MathModeTextParameterStart" attribute="Normal Text" \
                lineEndContext="#stay" >
-        <RegExpr String="\\." attribute="Normal Text" context="#stay"/> 
+        <RegExpr String="\\." attribute="Normal Text" context="#stay"/>
         <DetectChar char="&#xd7;" attribute="Bullet" context="#stay"/>
 	<RegExpr String="\$.*\$" minimal="true" attribute="Math" context="#stay"/>
         <DetectChar char="{" attribute="Normal Text" \
context="MathModeTextParameter"/> @@ -423,7 +423,7 @@
       </context>
 
       <context name="MathModeTextParameter" attribute="Normal Text" \
                lineEndContext="#stay" >
-        <RegExpr String="\\." attribute="Normal Text" context="#stay"/> 
+        <RegExpr String="\\." attribute="Normal Text" context="#stay"/>
         <DetectChar char="{" attribute="Normal Text" \
context="MathModeTextParameter"/>  <DetectChar char="}" attribute="Normal Text" \
context="#pop"/>  <DetectChar char="&#xd7;" attribute="Bullet" context="#stay"/>


["signature.asc" (application/pgp-signature)]

_______________________________________________
KWrite-Devel mailing list
KWrite-Devel@kde.org
https://mail.kde.org/mailman/listinfo/kwrite-devel


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic