alvinalexander.com | career | drupal | java | mac | mysql | perl | scala | uml | unix  

jEdit example source code file (latex.xml)

This example jEdit source code file (latex.xml) is included in the DevDaily.com "Java Source Code Warehouse" project. The intent of this project is to help you "Learn Java by Example" TM.

Java - jEdit tags/keywords

begin, begin, delegate, end, keyword1, keyword2, keyword4, mathrules, seq, seq, span, span, type, type

The jEdit latex.xml source code

<?xml version="1.0"?>
<!DOCTYPE MODE SYSTEM "xmode.dtd">

<!-- jEdit LaTeX mode
  written by: Michael Schlotter, m.schlotter@bath.ac.uk
  latex.xml, v.1.2, 29 Mar 2008
  
  Suggested catalog entry:
  <MODE NAME="latex" FILE="latex.xml"
    FILE_NAME_GLOB="*.{tex,ltx,latex,sty,cls}" />
-->

<MODE>
  <PROPS>
    <PROPERTY NAME="lineComment" VALUE="%" />
    <PROPERTY NAME="deepIndent" VALUE="FALSE" />
    <PROPERTY NAME="wordBreakChars" VALUE="" />
    <PROPERTY NAME="noWordSep" VALUE="\@_-:*<>" />
  </PROPS>
  
  <!-- default rules -->
  <RULES
    IGNORE_CASE="FALSE"
    NO_WORD_SEP="@_-:*"
    HIGHLIGHT_DIGITS="FALSE">
    
    <!-- \verb|sometext|; any delimeter except * can be used -->
    <SPAN_REGEXP
      TYPE="KEYWORD2" DELEGATE="VerbatimRules"
      HASH_CHAR="\" NO_LINE_BREAK="TRUE">
      <BEGIN>.verb[\*]?([\p{Punct}&&[^*]])
      <END>$1
    </SPAN_REGEXP>
    
    <!-- verbatim environments -->
    <SPAN TYPE="KEYWORD1" DELEGATE="VerbatimRules">
      <BEGIN>\begin{verbatim*}\end{verbatim*}
    </SPAN>
    <SPAN TYPE="KEYWORD1" DELEGATE="VerbatimRules">
      <BEGIN>\begin{verbatim}\end{verbatim}
    </SPAN>
    
    <!-- mathematical environments, including AMS definitions -->
    <SPAN TYPE="KEYWORD1" DELEGATE="MathRules">
      <BEGIN>$$$$
    </SPAN>
    <SPAN TYPE="KEYWORD1" DELEGATE="MathRules">
      <BEGIN>$$
    </SPAN>
    <SPAN TYPE="KEYWORD1" DELEGATE="MathRules">
      <BEGIN>\(\)
    </SPAN>
    <SPAN TYPE="KEYWORD1" DELEGATE="MathRules">
      <BEGIN>\[\]
    </SPAN>
    <SPAN TYPE="KEYWORD1" DELEGATE="MathRules">
      <BEGIN>\begin{math}\end{math}
    </SPAN>
    <SPAN TYPE="KEYWORD1" DELEGATE="MathRules">
      <BEGIN>\begin{displaymath}\end{displaymath}
    </SPAN>
    <SPAN TYPE="KEYWORD1" DELEGATE="MathRules">
      <BEGIN>\begin{equation*}\end{equation*}
    </SPAN>
    <SPAN TYPE="KEYWORD1" DELEGATE="MathRules">
      <BEGIN>\begin{equation}\end{equation}
    </SPAN>
    <SPAN TYPE="KEYWORD1" DELEGATE="MathRules">
      <BEGIN>\begin{eqnarray*}\end{eqnarray*}
    </SPAN>
    <SPAN TYPE="KEYWORD1" DELEGATE="MathRules">
      <BEGIN>\begin{eqnarray}\end{eqnarray}
    </SPAN>
    <SPAN TYPE="KEYWORD1" DELEGATE="MathRules">
      <BEGIN>\begin{align*}\end{align*}
    </SPAN>
    <SPAN TYPE="KEYWORD1" DELEGATE="MathRules">
      <BEGIN>\begin{align}\end{align}
    </SPAN>
    <SPAN TYPE="KEYWORD1" DELEGATE="MathRules">
      <BEGIN>\begin{flalign*}\end{flalign*}
    </SPAN>
    <SPAN TYPE="KEYWORD1" DELEGATE="MathRules">
      <BEGIN>\begin{flalign}\end{flalign}
    </SPAN>
    <SPAN TYPE="KEYWORD1" DELEGATE="MathRules">
      <BEGIN>\begin{gather*}\end{gather*}
    </SPAN>
    <SPAN TYPE="KEYWORD1" DELEGATE="MathRules">
      <BEGIN>\begin{gather}\end{gather}
    </SPAN>
    <SPAN TYPE="KEYWORD1" DELEGATE="MathRules">
      <BEGIN>\begin{multline*}\end{multline*}
    </SPAN>
    <SPAN TYPE="KEYWORD1" DELEGATE="MathRules">
      <BEGIN>\begin{multline}\end{multline}
    </SPAN>
    
    <!-- labels - includes all commands ending with `ref' and `ref*' -->
    <SPAN TYPE="KEYWORD4" DELEGATE="LabelRules" NO_LINE_BREAK="TRUE">
      <BEGIN>\label{}
    </SPAN>
    <SPAN TYPE="KEYWORD4" DELEGATE="LabelRules" NO_LINE_BREAK="TRUE">
      <BEGIN>\cite{}
    </SPAN>
    <SPAN TYPE="KEYWORD4" DELEGATE="LabelRules" NO_LINE_BREAK="TRUE">
      <BEGIN>\hyperlink{}
    </SPAN>
    <SPAN TYPE="KEYWORD4" DELEGATE="LabelRules" NO_LINE_BREAK="TRUE">
      <BEGIN>\hypertarget{}
    </SPAN>
    <SPAN TYPE="KEYWORD4" DELEGATE="LabelRules" NO_LINE_BREAK="TRUE">
      <BEGIN>\url{}
    </SPAN>
    <SPAN_REGEXP
      TYPE="KEYWORD4" DELEGATE="LabelRules"
      HASH_CHAR="\"  NO_LINE_BREAK="TRUE">
      <BEGIN>.[\p{Alnum}]*ref[\*]?\{
      <END>}
    </SPAN_REGEXP>
    
    <!-- escaped characters which are treated as normal text -->
    <SEQ TYPE="NULL">\&
    <SEQ TYPE="NULL">\$
    <SEQ TYPE="NULL">\%
    <SEQ TYPE="NULL">\#
    <SEQ TYPE="NULL">\_
    <SEQ TYPE="NULL">\{
    <SEQ TYPE="NULL">\}
    
    <!-- tabbing tokens (or accents, depending on environment) -->
    <SEQ TYPE="KEYWORD2">\=
    <SEQ TYPE="KEYWORD2">\>
    <SEQ TYPE="KEYWORD2">\<
    <SEQ TYPE="KEYWORD2">\+
    <SEQ TYPE="KEYWORD2">\-
    <SEQ TYPE="KEYWORD2">\'
    <SEQ TYPE="KEYWORD2">\`
    
    <!-- more accents incl. those specific to tabbing environment -->
    <SEQ TYPE="KEYWORD2">\^
    <SEQ TYPE="KEYWORD2">\"
    <SEQ TYPE="KEYWORD2">\~
    <SEQ TYPE="KEYWORD2">\.
    <SEQ TYPE="KEYWORD2">\a'
    <SEQ TYPE="KEYWORD2">\a`
    <SEQ TYPE="KEYWORD2">\a=
    
    <!-- special tokens: macro parameter, linebreak, alignment tab -->
    <SEQ_REGEXP TYPE="DIGIT">#[1-9]
    <SEQ TYPE="KEYWORD3">\\
    <SEQ TYPE="KEYWORD3">&
    
    <!-- comments -->
    <SPAN TYPE="COMMENT2">
      <BEGIN>\iffalse\fi
    </SPAN>
    <EOL_SPAN TYPE="COMMENT1">%
    
    <!-- quotes, including those defined by package `(n)german' -->
    <SPAN TYPE="LITERAL1">``''
    <SPAN TYPE="LITERAL1">"`"'
    <SPAN TYPE="LITERAL1">"<">
    <SPAN TYPE="LITERAL1">\glqq\grqq
    <SPAN TYPE="LITERAL1">\glq\grq
    <SPAN TYPE="LITERAL1">\flqq\frqq
    <SPAN TYPE="LITERAL1">\flq\frq
    
    <!-- environment delimeters: \begin{...} ... \end{...} -->
    <SEQ_REGEXP HASH_CHAR="\" TYPE="KEYWORD1"
      >(.begin\{([\p{Alnum}|@|\*]*)\})</SEQ_REGEXP>
    <SEQ_REGEXP HASH_CHAR="\" TYPE="KEYWORD1"
      >(.end\{([\p{Alnum}|@|\*]*)\})</SEQ_REGEXP>
    
    <!-- \... commands -->
    <MARK_FOLLOWING TYPE="KEYWORD2">\
    
    <!-- group delimeters -->
    <SEQ TYPE="KEYWORD4">{
    <SEQ TYPE="KEYWORD4">}
    <SEQ TYPE="KEYWORD4">[
    <SEQ TYPE="KEYWORD4">]
  </RULES>
  
  <!-- math rules -->
  <RULES
    SET="MathRules"
    DEFAULT="LITERAL2"
    IGNORE_CASE="FALSE"
    NO_WORD_SEP="@:"
    HIGHLIGHT_DIGITS="FALSE">
    
    <!-- labels -->
    <SPAN TYPE="KEYWORD4" DELEGATE="LabelRules" NO_LINE_BREAK="TRUE">
      <BEGIN>\label{}
    </SPAN>
    
    <!-- escaped characters which are treated as normal text -->
    <SEQ TYPE="LITERAL2">\&
    <SEQ TYPE="LITERAL2">\$
    <SEQ TYPE="LITERAL2">\%
    
    <!-- special tokens: macro parameter, linebreak, alignment tab -->
    <SEQ_REGEXP TYPE="DIGIT">#[1-9]
    <SEQ TYPE="KEYWORD3">\\
    <SEQ TYPE="KEYWORD3">&
    
    <!-- labels -->
    <MARK_FOLLOWING TYPE="LABEL" MATCH_TYPE="KEYWORD4"
      >\label{</MARK_FOLLOWING>
    
    <!-- comments -->
    <EOL_SPAN TYPE="COMMENT1">%
  </RULES>
  
  <!-- verbatim rules -->
  <RULES SET="VerbatimRules" DEFAULT="LITERAL3" />
  
  <!-- label rules -->
  <RULES SET="LabelRules" DEFAULT="LABEL" />

</MODE>

Other jEdit examples (source code examples)

Here is a short list of links related to this jEdit latex.xml source code file:

... this post is sponsored by my books ...

#1 New Release!

FP Best Seller

 

new blog posts

 

Copyright 1998-2021 Alvin Alexander, alvinalexander.com
All Rights Reserved.

A percentage of advertising revenue from
pages under the /java/jwarehouse URI on this website is
paid back to open source projects.