/itexToMML

To download this project, use:
bzr branch http://golem.ph.utexas.edu/~distler/code/itexToMML/
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
INTRODUCTION:

This package contains the distribution for itex2MML. Binaries for MacOSX and
Linux are provided in the itex-binaries directory. The source code is in the
itex-src directory. It should compile on most platforms by simply typing

     make
     sudo make install

Also included are Ruby bindings. They require GNU make and SWIG 1.3, and can be
built with

     make ruby
     make test_ruby
     sudo make install_ruby

The Ruby module provides four public methods

       itex.html_filter(a_string)
               converts all itex equations in a_string to MathML, passing the
               rest of a_string unmodified. Returns the converted string. 

       itex.filter(a_string)
               converts all itex equations in a_string to MathML. Returns just
               the MathML equation(s), as a string.

       itex.inline_filter(a_string)
               treats a_string as an inline equation (automatically supplies
               the surrounding $...$, so you don't have to) and converts it
               MathML. Returns the MathML inline equation, as a string.

       itex.block_filter(a_string)
               treats a_string as a block equation (automatically supplies
               the surrounding $$...$$, so you don't have to) and converts it
               MathML. Returns the MathML block equation, as a string.

Finally, there is a MovableType (2.6 or greater) plugin which provides two
Text Filtering options:
1) itex to MathML
2) itex to MathML with parbreaks

The plugin relies on the itex2MML commandline utility to do the actual
conversion. The first filter is a straight itex2MML translation. The latter
uses the "TeX" (and blogger's) convention that two linebreaks in succession
signify a new paragraph. (The bloggers also like to convert single linebreaks
to <br />, but that would mess with TeX formula entry, so we don't support it.)

Another plugin, which adds itex support to the Textile and Markdown text
filters is available separately from 

    http://golem.ph.utexas.edu/~distler/blog/archives/000374.html

To use it, you need both this plugin and the Textile and/or Markdown plugins
installed.

See
      http://golem.ph.utexas.edu/~distler/blog/itex2MMLcommands.html
and the itex2MML homepage 
      http://pear.math.pitt.edu/mathzilla/itex2mml.html
for more details on composing in itex and using the itex2MML program.
The version of itex2MML included here is a greatly-enhanced version, with
many bugfixes and support for a larger subset of LaTeX/AMSLaTeX syntax.

Below I've put some simple notes specific to the use of this plugin.

USAGE NOTES:

1) Tex equations are delimited by $...$ (inline) or \[...\] (display).
Alternatively, $$...$$ can also be used to delimit display equations. So,
just as in a TeX document, be sure you don't have any free-floating $'s
in your text. If you want to enter something that renders as a $, use
the unicode entity &#36;.

2) If you are using the "itex to MathML with parbreaks" filter, paragraph
breaks are inserted automatically. So

              Some text is here.

              Some more text
              \[    display equation    \]
              Yet more text.

              And still more.

gets turned into three paragraphs.  If you are using the plain
"itex to MathML" filter, you need to put in the paragraph breaks
yourself, so the above would look like

              <p>Some text is here. </p>
              <p>Some more text
              \[    display equation    \]
              Yet more text.</p>         
              <p>And still more.</p>

3) Mozilla only renders MathML when you serve the document as XML (ie
using the MIME type application/xhtml+xml rather than text/html). You had better
be producing 100% valid XHTML if you want to see *anything* when Mozilla
is operating in that mode.

4)The best way to serve up XML to Mozilla, while still catering to
other browsers is to use mod_rewrite rules in the .htaccess file of your
blog. See
    http://golem.ph.utexas.edu/~distler/blog/archives/000167.html
for how to do that.

INSTALLATION INSTRUCTIONS:

1) Put itex2MML.pl in your MovableType plugins directory.

2) If you are running MacOSX or Linux, I've provided a precompiled binary,
so you can skip to step 3).
If these don't do the trick for you, or if you prefer to compile your own,
cd into the itex-src directory and type "make". The result should be an itex2MML
binary for your architecture.

3) Copy itex2MML into /usr/local/bin/, and make sure it's executable
(mode 755). If you decide to put it in another location, you merely have
to edit itex2MML.pl to reflect its new location.

As with Paul Gartside's original version,

  http://pear.math.pitt.edu/mathzilla/itex2mmlBugs.html

itex2MML is Open Source software, released under a dual license: GPL and MPL.