All Downloads are FREE. Search and download functionalities are using the official Maven repository.

modes.latex.xml Maven / Gradle / Ivy

Go to download

This project aims to build a command line tool that can create HTML view with syntax highlighted source code. It uses Jedit syntax highlighting engine and support all languages that are supported in JEdit. Which are currently: ActionScript, Ada 95, ANTLR, Apache HTTPD, APDL, AppleScript, ASP, Aspect-J, Assembly, AWK, B formal method, Batch, BBj, BCEL, BibTeX, C, C++, C#, CHILL, CIL, COBOL, ColdFusion, CSS, CVS Commit, D, DOxygen, DSSSL, Eiffel, EmbPerl, Erlang, Factor, Fortran, Foxpro, FreeMarker, Fortran, Gettext, Groovy, Haskell, HTML, Icon, IDL, Inform, INI, Inno Setup, Informix 4GL, Interlis, Io, Java, JavaScript, JCL, JHTML, JMK, JSP, Latex, Lilypond, Lisp, LOTOS, Lua, Makefile, Maple, ML, Modula-3, MoinMoin, MQSC, NetRexx, NQC, NSIS2, Objective C, ObjectRexx, Occam, Omnimark, Parrot, Pascal, Patch, Perl, PHP, Pike, PL-SQL, PL/I, Pop11, PostScript, Povray, PowerDynamo, Progress 4GL, Prolog, Properties, PSP, PV-WAVE, Pyrex, Python, REBOL, Redcode, Relax-NG, RelationalView, Rest, Rib, RPM spec, RTF, Ruby, Ruby-HTML, RView, S+, S#, SAS, Scheme, SDL/PL, SGML, Shell Script, SHTML, Smalltalk, SMI MIB, SQR, Squidconf, SVN Commit, Swig, TCL, TeX, Texinfo, TPL, Transact-SQL, UnrealScript, VBScript, Velocity, Verilog, VHDL, XML, XSL, ZPT

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

<!-- jEdit LaTeX mode
  written by: Michael Schlotter, [email protected]
  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="\@_-:*&lt;&gt;" />
  </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}&amp;&amp;[^*]])</BEGIN>
      <END>$1</END>
    </SPAN_REGEXP>
    
    <!-- verbatim environments -->
    <SPAN TYPE="KEYWORD1" DELEGATE="VerbatimRules">
      <BEGIN>\begin{verbatim*}</BEGIN><END>\end{verbatim*}</END>
    </SPAN>
    <SPAN TYPE="KEYWORD1" DELEGATE="VerbatimRules">
      <BEGIN>\begin{verbatim}</BEGIN><END>\end{verbatim}</END>
    </SPAN>
    
    <!-- mathematical environments, including AMS definitions -->
    <SPAN TYPE="KEYWORD1" DELEGATE="MathRules">
      <BEGIN>$$</BEGIN><END>$$</END>
    </SPAN>
    <SPAN TYPE="KEYWORD1" DELEGATE="MathRules">
      <BEGIN>$</BEGIN><END>$</END>
    </SPAN>
    <SPAN TYPE="KEYWORD1" DELEGATE="MathRules">
      <BEGIN>\(</BEGIN><END>\)</END>
    </SPAN>
    <SPAN TYPE="KEYWORD1" DELEGATE="MathRules">
      <BEGIN>\[</BEGIN><END>\]</END>
    </SPAN>
    <SPAN TYPE="KEYWORD1" DELEGATE="MathRules">
      <BEGIN>\begin{math}</BEGIN><END>\end{math}</END>
    </SPAN>
    <SPAN TYPE="KEYWORD1" DELEGATE="MathRules">
      <BEGIN>\begin{displaymath}</BEGIN><END>\end{displaymath}</END>
    </SPAN>
    <SPAN TYPE="KEYWORD1" DELEGATE="MathRules">
      <BEGIN>\begin{equation*}</BEGIN><END>\end{equation*}</END>
    </SPAN>
    <SPAN TYPE="KEYWORD1" DELEGATE="MathRules">
      <BEGIN>\begin{equation}</BEGIN><END>\end{equation}</END>
    </SPAN>
    <SPAN TYPE="KEYWORD1" DELEGATE="MathRules">
      <BEGIN>\begin{eqnarray*}</BEGIN><END>\end{eqnarray*}</END>
    </SPAN>
    <SPAN TYPE="KEYWORD1" DELEGATE="MathRules">
      <BEGIN>\begin{eqnarray}</BEGIN><END>\end{eqnarray}</END>
    </SPAN>
    <SPAN TYPE="KEYWORD1" DELEGATE="MathRules">
      <BEGIN>\begin{align*}</BEGIN><END>\end{align*}</END>
    </SPAN>
    <SPAN TYPE="KEYWORD1" DELEGATE="MathRules">
      <BEGIN>\begin{align}</BEGIN><END>\end{align}</END>
    </SPAN>
    <SPAN TYPE="KEYWORD1" DELEGATE="MathRules">
      <BEGIN>\begin{flalign*}</BEGIN><END>\end{flalign*}</END>
    </SPAN>
    <SPAN TYPE="KEYWORD1" DELEGATE="MathRules">
      <BEGIN>\begin{flalign}</BEGIN><END>\end{flalign}</END>
    </SPAN>
    <SPAN TYPE="KEYWORD1" DELEGATE="MathRules">
      <BEGIN>\begin{gather*}</BEGIN><END>\end{gather*}</END>
    </SPAN>
    <SPAN TYPE="KEYWORD1" DELEGATE="MathRules">
      <BEGIN>\begin{gather}</BEGIN><END>\end{gather}</END>
    </SPAN>
    <SPAN TYPE="KEYWORD1" DELEGATE="MathRules">
      <BEGIN>\begin{multline*}</BEGIN><END>\end{multline*}</END>
    </SPAN>
    <SPAN TYPE="KEYWORD1" DELEGATE="MathRules">
      <BEGIN>\begin{multline}</BEGIN><END>\end{multline}</END>
    </SPAN>
    
    <!-- labels - includes all commands ending with `ref' and `ref*' -->
    <SPAN TYPE="KEYWORD4" DELEGATE="LabelRules" NO_LINE_BREAK="TRUE">
      <BEGIN>\label{</BEGIN><END>}</END>
    </SPAN>
    <SPAN TYPE="KEYWORD4" DELEGATE="LabelRules" NO_LINE_BREAK="TRUE">
      <BEGIN>\cite{</BEGIN><END>}</END>
    </SPAN>
    <SPAN TYPE="KEYWORD4" DELEGATE="LabelRules" NO_LINE_BREAK="TRUE">
      <BEGIN>\hyperlink{</BEGIN><END>}</END>
    </SPAN>
    <SPAN TYPE="KEYWORD4" DELEGATE="LabelRules" NO_LINE_BREAK="TRUE">
      <BEGIN>\hypertarget{</BEGIN><END>}</END>
    </SPAN>
    <SPAN TYPE="KEYWORD4" DELEGATE="LabelRules" NO_LINE_BREAK="TRUE">
      <BEGIN>\url{</BEGIN><END>}</END>
    </SPAN>
    <SPAN_REGEXP
      TYPE="KEYWORD4" DELEGATE="LabelRules"
      HASH_CHAR="\"  NO_LINE_BREAK="TRUE">
      <BEGIN>.[\p{Alnum}]*ref[\*]?\{</BEGIN>
      <END>}</END>
    </SPAN_REGEXP>
    
    <!-- escaped characters which are treated as normal text -->
    <SEQ TYPE="NULL">\&amp;</SEQ>
    <SEQ TYPE="NULL">\$</SEQ>
    <SEQ TYPE="NULL">\%</SEQ>
    <SEQ TYPE="NULL">\#</SEQ>
    <SEQ TYPE="NULL">\_</SEQ>
    <SEQ TYPE="NULL">\{</SEQ>
    <SEQ TYPE="NULL">\}</SEQ>
    
    <!-- tabbing tokens (or accents, depending on environment) -->
    <SEQ TYPE="KEYWORD2">\=</SEQ>
    <SEQ TYPE="KEYWORD2">\&gt;</SEQ>
    <SEQ TYPE="KEYWORD2">\&lt;</SEQ>
    <SEQ TYPE="KEYWORD2">\+</SEQ>
    <SEQ TYPE="KEYWORD2">\-</SEQ>
    <SEQ TYPE="KEYWORD2">\'</SEQ>
    <SEQ TYPE="KEYWORD2">\`</SEQ>
    
    <!-- more accents incl. those specific to tabbing environment -->
    <SEQ TYPE="KEYWORD2">\^</SEQ>
    <SEQ TYPE="KEYWORD2">\"</SEQ>
    <SEQ TYPE="KEYWORD2">\~</SEQ>
    <SEQ TYPE="KEYWORD2">\.</SEQ>
    <SEQ TYPE="KEYWORD2">\a'</SEQ>
    <SEQ TYPE="KEYWORD2">\a`</SEQ>
    <SEQ TYPE="KEYWORD2">\a=</SEQ>
    
    <!-- special tokens: macro parameter, linebreak, alignment tab -->
    <SEQ_REGEXP TYPE="DIGIT">#[1-9]</SEQ_REGEXP>
    <SEQ TYPE="KEYWORD3">\\</SEQ>
    <SEQ TYPE="KEYWORD3">&amp;</SEQ>
    
    <!-- comments -->
    <SPAN TYPE="COMMENT2">
      <BEGIN>\iffalse</BEGIN><END>\fi</END>
    </SPAN>
    <EOL_SPAN TYPE="COMMENT1">%</EOL_SPAN>
    
    <!-- quotes, including those defined by package `(n)german' -->
    <SPAN TYPE="LITERAL1"><BEGIN>``</BEGIN><END>''</END></SPAN>
    <SPAN TYPE="LITERAL1"><BEGIN>"`</BEGIN><END>"'</END></SPAN>
    <SPAN TYPE="LITERAL1"><BEGIN>"&lt;</BEGIN><END>"&gt;</END></SPAN>
    <SPAN TYPE="LITERAL1"><BEGIN>\glqq</BEGIN><END>\grqq</END></SPAN>
    <SPAN TYPE="LITERAL1"><BEGIN>\glq</BEGIN><END>\grq</END></SPAN>
    <SPAN TYPE="LITERAL1"><BEGIN>\flqq</BEGIN><END>\frqq</END></SPAN>
    <SPAN TYPE="LITERAL1"><BEGIN>\flq</BEGIN><END>\frq</END></SPAN>
    
    <!-- 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">\</MARK_FOLLOWING>
    
    <!-- group delimeters -->
    <SEQ TYPE="KEYWORD4">{</SEQ>
    <SEQ TYPE="KEYWORD4">}</SEQ>
    <SEQ TYPE="KEYWORD4">[</SEQ>
    <SEQ TYPE="KEYWORD4">]</SEQ>
  </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{</BEGIN><END>}</END>
    </SPAN>
    
    <!-- escaped characters which are treated as normal text -->
    <SEQ TYPE="LITERAL2">\&amp;</SEQ>
    <SEQ TYPE="LITERAL2">\$</SEQ>
    <SEQ TYPE="LITERAL2">\%</SEQ>
    
    <!-- special tokens: macro parameter, linebreak, alignment tab -->
    <SEQ_REGEXP TYPE="DIGIT">#[1-9]</SEQ_REGEXP>
    <SEQ TYPE="KEYWORD3">\\</SEQ>
    <SEQ TYPE="KEYWORD3">&amp;</SEQ>
    
    <!-- labels -->
    <MARK_FOLLOWING TYPE="LABEL" MATCH_TYPE="KEYWORD4"
      >\label{</MARK_FOLLOWING>
    
    <!-- comments -->
    <EOL_SPAN TYPE="COMMENT1">%</EOL_SPAN>
  </RULES>
  
  <!-- verbatim rules -->
  <RULES SET="VerbatimRules" DEFAULT="LITERAL3" />
  
  <!-- label rules -->
  <RULES SET="LabelRules" DEFAULT="LABEL" />

</MODE>





© 2015 - 2024 Weber Informatics LLC | Privacy Policy