/itexToMML

To download this project, use:
bzr branch http://golem.ph.utexas.edu/~distler/code/itexToMML/
1 by Jacques Distler
Initial commit.
1
INTRODUCTION:
2
3
This package contains the distribution for itex2MML. Binaries for MacOSX and
4
Linux are provided in the itex-binaries directory. The source code is in the
2 by Jacques Distler
Updated README (duh!).
5
itex-src directory. It should compile on most platforms by simply typing
6
7
     make
8
     sudo make install
9
4 by Jacques Distler
Update MovableType plugin to support equation numbering and cross-referencing.
10
The resulting itex2MML binary is a stream filter. It takes text with embedded
11
itex equations on STDIN, converts the itex equations to MathML, and outputs
12
the resulting text on STDOUT.
13
2 by Jacques Distler
Updated README (duh!).
14
Also included are Ruby bindings. They require GNU make and SWIG 1.3, and can be
15
built with
16
17
     make ruby
18
     make test_ruby
19
     sudo make install_ruby
1 by Jacques Distler
Initial commit.
20
3 by Jacques Distler
Added two new methods to the Ruby bindings.
21
The Ruby module provides four public methods
22
23
       itex.html_filter(a_string)
24
               converts all itex equations in a_string to MathML, passing the
25
               rest of a_string unmodified. Returns the converted string. 
26
27
       itex.filter(a_string)
28
               converts all itex equations in a_string to MathML. Returns just
29
               the MathML equation(s), as a string.
30
31
       itex.inline_filter(a_string)
32
               treats a_string as an inline equation (automatically supplies
33
               the surrounding $...$, so you don't have to) and converts it
34
               MathML. Returns the MathML inline equation, as a string.
35
36
       itex.block_filter(a_string)
37
               treats a_string as a block equation (automatically supplies
38
               the surrounding $$...$$, so you don't have to) and converts it
39
               MathML. Returns the MathML block equation, as a string.
40
41
Finally, there is a MovableType (2.6 or greater) plugin which provides two
1 by Jacques Distler
Initial commit.
42
Text Filtering options:
4 by Jacques Distler
Update MovableType plugin to support equation numbering and cross-referencing.
43
1 by Jacques Distler
Initial commit.
44
1) itex to MathML
45
2) itex to MathML with parbreaks
46
47
The plugin relies on the itex2MML commandline utility to do the actual
48
conversion. The first filter is a straight itex2MML translation. The latter
49
uses the "TeX" (and blogger's) convention that two linebreaks in succession
50
signify a new paragraph. (The bloggers also like to convert single linebreaks
51
to <br />, but that would mess with TeX formula entry, so we don't support it.)
52
4 by Jacques Distler
Update MovableType plugin to support equation numbering and cross-referencing.
53
A second plugin (also included) provides additionalText Filtering options:
54
55
1) Textile with itex to MathML
56
2) Markdown with itex to MathML
57
58
Details describing this plugin are available at: 
1 by Jacques Distler
Initial commit.
59
60
    http://golem.ph.utexas.edu/~distler/blog/archives/000374.html
61
4 by Jacques Distler
Update MovableType plugin to support equation numbering and cross-referencing.
62
It requires both the itex2MML plugin and the Textile and/or Markdown plugins.
1 by Jacques Distler
Initial commit.
63
64
See
65
      http://golem.ph.utexas.edu/~distler/blog/itex2MMLcommands.html
4 by Jacques Distler
Update MovableType plugin to support equation numbering and cross-referencing.
66
67
and Paul Gartside's page
68
 
1 by Jacques Distler
Initial commit.
69
      http://pear.math.pitt.edu/mathzilla/itex2mml.html
4 by Jacques Distler
Update MovableType plugin to support equation numbering and cross-referencing.
70
1 by Jacques Distler
Initial commit.
71
for more details on composing in itex and using the itex2MML program.
4 by Jacques Distler
Update MovableType plugin to support equation numbering and cross-referencing.
72
The version of itex2MML included here is greatly-enhanced, with
1 by Jacques Distler
Initial commit.
73
many bugfixes and support for a larger subset of LaTeX/AMSLaTeX syntax.
74
75
Below I've put some simple notes specific to the use of this plugin.
76
77
USAGE NOTES:
78
79
1) Tex equations are delimited by $...$ (inline) or \[...\] (display).
80
Alternatively, $$...$$ can also be used to delimit display equations. So,
81
just as in a TeX document, be sure you don't have any free-floating $'s
82
in your text. If you want to enter something that renders as a $, use
83
the unicode entity &#36;.
84
4 by Jacques Distler
Update MovableType plugin to support equation numbering and cross-referencing.
85
2) The itex2MML stream filter does not distinguish between $$...$$ and \[...\].
86
Both result in display equations. However, the MovableType plugin and Maruku
87
88
    http://maruku.rubyforge.org/
89
90
the Ruby Markdown implementation, do distinguish between them. Both have
91
automatic equation-numbering: \[...\] results in a numbered equation. You
92
can add an optional label
93
94
    \[...\label{foo}...\]
95
96
and then you can refer to the equation with either (eq:foo) or \eqref{foo}.
97
These are automatically turned into hyperlinks.
98
1 by Jacques Distler
Initial commit.
99
2) If you are using the "itex to MathML with parbreaks" filter, paragraph
4 by Jacques Distler
Update MovableType plugin to support equation numbering and cross-referencing.
100
breaks are inserted automatically, whenever you insert a blank line in your
101
text.  If you are using the plain "itex to MathML" filter, you need to put
102
in the paragraph (and any other) XHTML tags yourself.
1 by Jacques Distler
Initial commit.
103
104
3) Mozilla only renders MathML when you serve the document as XML (ie
4 by Jacques Distler
Update MovableType plugin to support equation numbering and cross-referencing.
105
using the MIME type application/xhtml+xml rather than text/html). You had
106
better be producing 100% valid XHTML if you want to see *anything* when Mozilla
1 by Jacques Distler
Initial commit.
107
is operating in that mode.
108
109
4)The best way to serve up XML to Mozilla, while still catering to
110
other browsers is to use mod_rewrite rules in the .htaccess file of your
111
blog. See
112
    http://golem.ph.utexas.edu/~distler/blog/archives/000167.html
113
for how to do that.
114
4 by Jacques Distler
Update MovableType plugin to support equation numbering and cross-referencing.
115
PLUGIN INSTALLATION INSTRUCTIONS:
1 by Jacques Distler
Initial commit.
116
4 by Jacques Distler
Update MovableType plugin to support equation numbering and cross-referencing.
117
1) Put the contents of the plugins directory into your MovableType plugins
118
directory.
1 by Jacques Distler
Initial commit.
119
120
2) If you are running MacOSX or Linux, I've provided a precompiled binary,
121
so you can skip to step 3).
122
If these don't do the trick for you, or if you prefer to compile your own,
123
cd into the itex-src directory and type "make". The result should be an itex2MML
124
binary for your architecture.
125
126
3) Copy itex2MML into /usr/local/bin/, and make sure it's executable
4 by Jacques Distler
Update MovableType plugin to support equation numbering and cross-referencing.
127
(mode 755). If you're building from source, you can achieve this by typing
128
"make install". If you decide to put it in another location, edit
129
itex2MML.pl to reflect its new location.
1 by Jacques Distler
Initial commit.
130
131
As with Paul Gartside's original version,
132
133
  http://pear.math.pitt.edu/mathzilla/itex2mmlBugs.html
134
135
itex2MML is Open Source software, released under a dual license: GPL and MPL.