/itexToMML

To download this project, use:
bzr branch http://golem.ph.utexas.edu/~distler/code/itexToMML/

« back to all changes in this revision

Viewing changes to itex-src/itex2MML.l

  • Committer: Jacques Distler
  • Date: 2007-10-23 02:35:06 UTC
  • Revision ID: distler@golem.ph.utexas.edu-20071023023506-3xmt7akl8egw5uri
SVG Environment
New "svg" LaTeX environment. See my blog post for details.

Show diffs side-by-side

added added

removed removed

1
 
/*             itex2MML 1.2.6
2
 
 *   itex2MML.l last modified 10/5/2007
 
1
/*             itex2MML 1.3
 
2
 *   itex2MML.l last modified 10/22/2007
3
3
 */
4
4
 
5
5
%{
6
6
%}
7
7
%option noyywrap
8
 
%x MATH ATTRIBUTELIST BBOLD FRAKTUR CALLIGRAPHIC ROMAN PLAINTEXT INT1 INT2 INT3 MATHENV
 
8
%x MATH ATTRIBUTELIST BBOLD FRAKTUR CALLIGRAPHIC ROMAN PLAINTEXT INT1 INT2 INT3 MATHENV SVGENV
9
9
%{
10
10
#include <string.h>
11
11
 
802
802
"\\operatorname" |
803
803
"\\mathop"       {BEGIN(PLAINTEXT); return MATHOP;}
804
804
 
 
805
"\\includegraphics"(\[[^\]]*\])?\{[^}]*\}       ;
 
806
 
805
807
"\\"[a-zA-Z]+    {yylval=itex2MML_copy_string(yytext+1); return MOP;}
806
808
 
807
809
"\&"[a-zA-Z_][a-zA-Z0-9_]*";" |
829
831
"\{aligned\}" {BEGIN(MATH); return ALIGNED;}
830
832
"\{gathered\}" {BEGIN(MATH); return GATHERED;}
831
833
"\{split\}" {BEGIN(MATH); return ALIGNED;}
 
834
"\{svg\}" {BEGIN(SVGENV); return SVG;}
 
835
}
 
836
 
 
837
<SVGENV>{
 
838
"\\end\{svg\}" {BEGIN(MATH); return ENDSVG;}
 
839
[^\\]* {yylval=itex2MML_copy_string(yytext); BEGIN(SVGENV); return XMLSTRING;}
832
840
}
833
841
 
834
842
<ROMAN>{