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