<patterns>
 <class pattern="\.(tex|sty|cls|def|bib)$" icon="text-x-tex.png" name="latex" >

<!--Options-->
  <Option>
   <Name>wrap</Name>
   <Value>1</Value>
   <flags>2</flags>
  </Option>
  <Option>
   <Name>emulate_tabs</Name>
   <Value>1</Value>
   <flags>2</flags>
  </Option>
  <Option>
   <Name>default</Name>
   <Value>0</Value>
   <flags>2</flags>
  </Option>
  <Option>
   <Name>base_indentation</Name>
   <Value>0</Value>
   <flags>2</flags>
  </Option>

<!--Highlight styles-->
  <style format="0" name="Attribute" color="#0000aa" />
  <style format="0" name="Braces" color="#0000ff" />
  <style format="2" name="Comment" color="#ff8c00" />
  <style format="0" name="Keyword" color="#ff0000" />
  <style format="0" name="Math" color="#0000ff" />

<!--Highlight patterns-->
  <range_pattern options="comments" style="Comment" parent="" name="Comment" >
   <comments></comments>
   <begin>%</begin>
   <end>$</end>
  </range_pattern>
  <range_pattern options="span " style="Attribute" parent="" name="Attribute" >
   <comments></comments>
   <begin>\\((\w+)|[^\s\d])(\[(\s|\d|\w)*\])?\{</begin>
   <end>[^\\]\}</end>
  </range_pattern>
  <range_pattern options="span " style="Math" parent="" name="Math" >
   <comments></comments>
   <begin>\$</begin>
   <end>\$</end>
  </range_pattern>
  <keyword_pattern style="Braces" parent="" name="Braces" >
   <comments></comments>
   <keyword>((\{|\[|\]|\})*(\{|\[|\]|\})(\{|\[|\]|\})*)</keyword>
  </keyword_pattern>
  <keyword_pattern style="Keyword" parent="" name="Keyword" >
   <comments></comments>
   <keyword>\\((\w+\b)|[^\s\d])</keyword>
  </keyword_pattern>
  <keyword_pattern style="Keyword" parent="Attribute" name="Keyword2" >
   <comments></comments>
   <keyword>\\((\w+\b)|[^\s\d])</keyword>
  </keyword_pattern>

<!--Indentation patterns-->

<!--Parenthesis-->
  <parenthesis begin="(" end=")" regexp="\(|\)" />
  <parenthesis begin="[" end="]" regexp="\[|\]" />
  <parenthesis begin="{" end="}" regexp="\{|\}" />
  <parenthesis begin="\begin" end="\end" regexp="(\\begin)|(\\end)" />

<!--Block delimiters-->
  <block_delimiter begin="{" end="}" regexp="\{|\}" />
  <block_delimiter begin="\begin" end="\end" regexp="(\\begin)|(\\end)" />

<!--Text macros-->
  <macro accelerator="Alt+T" name="Add one tab indentation" >
   <rule>
    <regexp>^</regexp>
    <replacement>XML_TAB</replacement>
   </rule>
  </macro>
  <macro accelerator="Shift+Alt+T" name="Remove one tab indentation" >
   <rule>
    <regexp>^\t</regexp>
    <replacement></replacement>
   </rule>
  </macro>
  <macro name="Remove all tab indentations" >
   <rule>
    <regexp>^\t+</regexp>
    <replacement></replacement>
   </rule>
  </macro>
  <macro name="Clean end of line" >
   <rule>
    <regexp>\s+$</regexp>
    <replacement></replacement>
   </rule>
  </macro>
  <macro options="separator" name="generic" />
  <macro accelerator="Alt+C" name="Add comments" >
   <rule>
    <regexp>^</regexp>
    <replacement>% </replacement>
   </rule>
  </macro>
  <macro accelerator="Shift+Alt+C" name="Remove comments" >
   <rule>
    <regexp>^% </regexp>
    <replacement></replacement>
   </rule>
  </macro>
 </class>
</patterns>
