mathtype_to_mathml 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +14 -0
- data/.rspec +2 -0
- data/.ruby-version +1 -0
- data/.travis.yml +3 -0
- data/Gemfile +6 -0
- data/LICENSE.txt +22 -0
- data/README.md +45 -0
- data/Rakefile +7 -0
- data/lib/mathtype_to_mathml.rb +28 -0
- data/lib/mathtype_to_mathml/char_replacer.rb +311 -0
- data/lib/mathtype_to_mathml/mover.rb +151 -0
- data/lib/mathtype_to_mathml/version.rb +3 -0
- data/lib/transform.xsl +104 -0
- data/lib/xsl/arrow.xsl +319 -0
- data/lib/xsl/brace.xsl +55 -0
- data/lib/xsl/char.xsl +35 -0
- data/lib/xsl/embellishment.xsl +389 -0
- data/lib/xsl/matrix.xsl +116 -0
- data/lib/xsl/pile.xsl +54 -0
- data/lib/xsl/subsup.xsl +55 -0
- data/lib/xsl/sum.xsl +57 -0
- data/lib/xsl/union_intersection.xsl +104 -0
- data/mathtype_to_mathml.gemspec +28 -0
- data/spec/fixtures/expected/arrows.xml +389 -0
- data/spec/fixtures/expected/embellishments.xml +178 -0
- data/spec/fixtures/expected/equation1.xml +52 -0
- data/spec/fixtures/expected/equation10.xml +19 -0
- data/spec/fixtures/expected/equation11.xml +17 -0
- data/spec/fixtures/expected/equation12.xml +34 -0
- data/spec/fixtures/expected/equation13.xml +113 -0
- data/spec/fixtures/expected/equation2.xml +33 -0
- data/spec/fixtures/expected/equation3.xml +324 -0
- data/spec/fixtures/expected/equation4.xml +14 -0
- data/spec/fixtures/expected/equation5.xml +23 -0
- data/spec/fixtures/expected/equation6.xml +13 -0
- data/spec/fixtures/expected/equation7.xml +19 -0
- data/spec/fixtures/expected/equation8.xml +17 -0
- data/spec/fixtures/expected/equation9.xml +15 -0
- data/spec/fixtures/input/arrows.bin +0 -0
- data/spec/fixtures/input/embellishments.bin +0 -0
- data/spec/fixtures/input/equation1.bin +0 -0
- data/spec/fixtures/input/equation10.bin +0 -0
- data/spec/fixtures/input/equation11.bin +0 -0
- data/spec/fixtures/input/equation12.bin +0 -0
- data/spec/fixtures/input/equation13.bin +0 -0
- data/spec/fixtures/input/equation2.bin +0 -0
- data/spec/fixtures/input/equation3.bin +0 -0
- data/spec/fixtures/input/equation4.bin +0 -0
- data/spec/fixtures/input/equation5.bin +0 -0
- data/spec/fixtures/input/equation6.bin +0 -0
- data/spec/fixtures/input/equation7.bin +0 -0
- data/spec/fixtures/input/equation8.bin +0 -0
- data/spec/fixtures/input/equation9.bin +0 -0
- data/spec/html_output.rb +28 -0
- data/spec/mathtype_to_mathml_spec.rb +19 -0
- data/spec/spec_helper.rb +2 -0
- metadata +220 -0
@@ -0,0 +1,178 @@
|
|
1
|
+
<?xml version="1.0"?>
|
2
|
+
<math display="block">
|
3
|
+
<mrow>
|
4
|
+
<msup>
|
5
|
+
<mi>a</mi>
|
6
|
+
<mo>′</mo>
|
7
|
+
</msup>
|
8
|
+
<msup>
|
9
|
+
<mi>b</mi>
|
10
|
+
<mo>″</mo>
|
11
|
+
</msup>
|
12
|
+
<msup>
|
13
|
+
<mi>c</mi>
|
14
|
+
<mo>‴</mo>
|
15
|
+
</msup>
|
16
|
+
<mmultiscripts>
|
17
|
+
<mi>d</mi>
|
18
|
+
<mprescripts/>
|
19
|
+
<none/>
|
20
|
+
<mo>‵</mo>
|
21
|
+
</mmultiscripts>
|
22
|
+
<menclose notation="updiagonalstrike">
|
23
|
+
<mi>e</mi>
|
24
|
+
</menclose>
|
25
|
+
<menclose notation="horizontalstrike">
|
26
|
+
<mi>f</mi>
|
27
|
+
</menclose>
|
28
|
+
<menclose notation="updiagonalstrike downdiagonalstrike">
|
29
|
+
<mi>g</mi>
|
30
|
+
</menclose>
|
31
|
+
<menclose notation="updiagonalstrike">
|
32
|
+
<mi>h</mi>
|
33
|
+
</menclose>
|
34
|
+
<menclose notation="downdiagonalstrike">
|
35
|
+
<mi>i</mi>
|
36
|
+
</menclose>
|
37
|
+
<mo>−</mo>
|
38
|
+
<mover accent="true">
|
39
|
+
<mi>j</mi>
|
40
|
+
<mo>˙</mo>
|
41
|
+
</mover>
|
42
|
+
<mo>−</mo>
|
43
|
+
<mover accent="true">
|
44
|
+
<mi>k</mi>
|
45
|
+
<mo>¨</mo>
|
46
|
+
</mover>
|
47
|
+
<mo>−</mo>
|
48
|
+
<mover accent="true">
|
49
|
+
<mi>l</mi>
|
50
|
+
<mo>⃛</mo>
|
51
|
+
</mover>
|
52
|
+
<mo>−</mo>
|
53
|
+
<mover accent="true">
|
54
|
+
<mi>m</mi>
|
55
|
+
<mo>⃜</mo>
|
56
|
+
</mover>
|
57
|
+
<mo>−</mo>
|
58
|
+
<munder>
|
59
|
+
<mi>n</mi>
|
60
|
+
<mo>˙</mo>
|
61
|
+
</munder>
|
62
|
+
<mo>−</mo>
|
63
|
+
<munder>
|
64
|
+
<mi>o</mi>
|
65
|
+
<mo>¨</mo>
|
66
|
+
</munder>
|
67
|
+
<mo>−</mo>
|
68
|
+
<munder>
|
69
|
+
<mi>p</mi>
|
70
|
+
<mo>⃛</mo>
|
71
|
+
</munder>
|
72
|
+
<mo>−</mo>
|
73
|
+
<mover accent="true">
|
74
|
+
<mi>q</mi>
|
75
|
+
<mo>⌢</mo>
|
76
|
+
</mover>
|
77
|
+
<mo>−</mo>
|
78
|
+
<munder>
|
79
|
+
<mi>r</mi>
|
80
|
+
<mo>⃜</mo>
|
81
|
+
</munder>
|
82
|
+
<mo>−</mo>
|
83
|
+
<mover accent="true">
|
84
|
+
<mi>s</mi>
|
85
|
+
<mo>¯</mo>
|
86
|
+
</mover>
|
87
|
+
<mo>−</mo>
|
88
|
+
<mover accent="true">
|
89
|
+
<mi>t</mi>
|
90
|
+
<mo>˜</mo>
|
91
|
+
</mover>
|
92
|
+
<mo>−</mo>
|
93
|
+
<mover accent="true">
|
94
|
+
<mi>u</mi>
|
95
|
+
<mo>⌣</mo>
|
96
|
+
</mover>
|
97
|
+
<mo>−</mo>
|
98
|
+
<mover accent="true">
|
99
|
+
<mi>v</mi>
|
100
|
+
<mo>^</mo>
|
101
|
+
</mover>
|
102
|
+
<mo>−</mo>
|
103
|
+
<munder accentunder="true">
|
104
|
+
<mi>x</mi>
|
105
|
+
<mo>_</mo>
|
106
|
+
</munder>
|
107
|
+
<mo>−</mo>
|
108
|
+
<munder accentunder="true">
|
109
|
+
<mi>y</mi>
|
110
|
+
<mo>˜</mo>
|
111
|
+
</munder>
|
112
|
+
<mo>−</mo>
|
113
|
+
<munder accentunder="true">
|
114
|
+
<mi>z</mi>
|
115
|
+
<mo>⌢</mo>
|
116
|
+
</munder>
|
117
|
+
<mo>−</mo>
|
118
|
+
<munder accentunder="true">
|
119
|
+
<mi>a</mi>
|
120
|
+
<mo>⌣</mo>
|
121
|
+
</munder>
|
122
|
+
<mo>−</mo>
|
123
|
+
<mover accent="true">
|
124
|
+
<mi>b</mi>
|
125
|
+
<mo>→</mo>
|
126
|
+
</mover>
|
127
|
+
<mo>−</mo>
|
128
|
+
<mover accent="true">
|
129
|
+
<mi>c</mi>
|
130
|
+
<mo>←</mo>
|
131
|
+
</mover>
|
132
|
+
<mo>−</mo>
|
133
|
+
<mover accent="true">
|
134
|
+
<mi>d</mi>
|
135
|
+
<mo>↔</mo>
|
136
|
+
</mover>
|
137
|
+
<mo>−</mo>
|
138
|
+
<mover accent="true">
|
139
|
+
<mi>e</mi>
|
140
|
+
<mo>⇀</mo>
|
141
|
+
</mover>
|
142
|
+
<mo>−</mo>
|
143
|
+
<mover accent="true">
|
144
|
+
<mi>f</mi>
|
145
|
+
<mo>↼</mo>
|
146
|
+
</mover>
|
147
|
+
<mo>−</mo>
|
148
|
+
<munder>
|
149
|
+
<mi>g</mi>
|
150
|
+
<mo>→</mo>
|
151
|
+
</munder>
|
152
|
+
<mo>−</mo>
|
153
|
+
<munder>
|
154
|
+
<mi>h</mi>
|
155
|
+
<mo>←</mo>
|
156
|
+
</munder>
|
157
|
+
<mo>−</mo>
|
158
|
+
<munder>
|
159
|
+
<mi>i</mi>
|
160
|
+
<mo>↔</mo>
|
161
|
+
</munder>
|
162
|
+
<mo>−</mo>
|
163
|
+
<munder>
|
164
|
+
<mi>j</mi>
|
165
|
+
<mo>⇁</mo>
|
166
|
+
</munder>
|
167
|
+
<mo>−</mo>
|
168
|
+
<munder>
|
169
|
+
<mi>k</mi>
|
170
|
+
<mo>↽</mo>
|
171
|
+
</munder>
|
172
|
+
<mo>+</mo>
|
173
|
+
<mover accent="true">
|
174
|
+
<mo>∐</mo>
|
175
|
+
<mo>⌢</mo>
|
176
|
+
</mover>
|
177
|
+
</mrow>
|
178
|
+
</math>
|
@@ -0,0 +1,52 @@
|
|
1
|
+
<?xml version="1.0"?>
|
2
|
+
<math display="block">
|
3
|
+
<mrow>
|
4
|
+
<msub>
|
5
|
+
<mrow>
|
6
|
+
<mi>p</mi>
|
7
|
+
</mrow>
|
8
|
+
<mrow>
|
9
|
+
<mi>r</mi>
|
10
|
+
</mrow>
|
11
|
+
</msub>
|
12
|
+
<mo>=</mo>
|
13
|
+
<mfrac>
|
14
|
+
<mrow>
|
15
|
+
<mi>m</mi>
|
16
|
+
</mrow>
|
17
|
+
<mrow>
|
18
|
+
<mi>r</mi>
|
19
|
+
</mrow>
|
20
|
+
</mfrac>
|
21
|
+
<mstyle displaystyle="true">
|
22
|
+
<munderover>
|
23
|
+
<mo>∑</mo>
|
24
|
+
<mrow>
|
25
|
+
<mi>i</mi>
|
26
|
+
<mo>=</mo>
|
27
|
+
<mn>0</mn>
|
28
|
+
</mrow>
|
29
|
+
<mrow>
|
30
|
+
<mi>r</mi>
|
31
|
+
<mo>−</mo>
|
32
|
+
<mn>1</mn>
|
33
|
+
</mrow>
|
34
|
+
</munderover>
|
35
|
+
<mrow>
|
36
|
+
<mfrac>
|
37
|
+
<mrow>
|
38
|
+
<mi>p</mi>
|
39
|
+
<mi>i</mi>
|
40
|
+
</mrow>
|
41
|
+
<mrow>
|
42
|
+
<mi>r</mi>
|
43
|
+
<mo>−</mo>
|
44
|
+
<mi>i</mi>
|
45
|
+
<mo>+</mo>
|
46
|
+
<mn>1</mn>
|
47
|
+
</mrow>
|
48
|
+
</mfrac>
|
49
|
+
</mrow>
|
50
|
+
</mstyle>
|
51
|
+
</mrow>
|
52
|
+
</math>
|
@@ -0,0 +1,19 @@
|
|
1
|
+
<?xml version="1.0"?>
|
2
|
+
<math display="block">
|
3
|
+
<mrow>
|
4
|
+
<mstyle displaystyle="true">
|
5
|
+
<munderover>
|
6
|
+
<mo>∪</mo>
|
7
|
+
<mrow>
|
8
|
+
<mi>b</mi>
|
9
|
+
</mrow>
|
10
|
+
<mrow>
|
11
|
+
<mi>a</mi>
|
12
|
+
</mrow>
|
13
|
+
</munderover>
|
14
|
+
<mrow>
|
15
|
+
<mi>c</mi>
|
16
|
+
</mrow>
|
17
|
+
</mstyle>
|
18
|
+
</mrow>
|
19
|
+
</math>
|
@@ -0,0 +1,34 @@
|
|
1
|
+
<?xml version="1.0"?>
|
2
|
+
<math display="block">
|
3
|
+
<mrow>
|
4
|
+
<msup>
|
5
|
+
<mrow>
|
6
|
+
<mn>(</mn>
|
7
|
+
<mi>a</mi>
|
8
|
+
<mo>−</mo>
|
9
|
+
<mi>b</mi>
|
10
|
+
<mn>)</mn>
|
11
|
+
</mrow>
|
12
|
+
<mrow>
|
13
|
+
<mi>c</mi>
|
14
|
+
</mrow>
|
15
|
+
</msup>
|
16
|
+
<mo>+</mo>
|
17
|
+
<msup>
|
18
|
+
<mrow>
|
19
|
+
<mrow>
|
20
|
+
<mo>(</mo>
|
21
|
+
<mrow>
|
22
|
+
<mi>b</mi>
|
23
|
+
<mo>+</mo>
|
24
|
+
<mi>c</mi>
|
25
|
+
</mrow>
|
26
|
+
<mo>)</mo>
|
27
|
+
</mrow>
|
28
|
+
</mrow>
|
29
|
+
<mrow>
|
30
|
+
<mn>2</mn>
|
31
|
+
</mrow>
|
32
|
+
</msup>
|
33
|
+
</mrow>
|
34
|
+
</math>
|
@@ -0,0 +1,113 @@
|
|
1
|
+
<?xml version="1.0"?>
|
2
|
+
<math display="block">
|
3
|
+
<mrow>
|
4
|
+
<msup>
|
5
|
+
<mrow>
|
6
|
+
<mn>(</mn>
|
7
|
+
<mi>a</mi>
|
8
|
+
<mo>+</mo>
|
9
|
+
<mi>b</mi>
|
10
|
+
<mn>)</mn>
|
11
|
+
</mrow>
|
12
|
+
<mrow>
|
13
|
+
<mi>c</mi>
|
14
|
+
</mrow>
|
15
|
+
</msup>
|
16
|
+
<mo>+</mo>
|
17
|
+
<msup>
|
18
|
+
<mrow>
|
19
|
+
<mn>[</mn>
|
20
|
+
<mi>d</mi>
|
21
|
+
<mo>+</mo>
|
22
|
+
<mi>f</mi>
|
23
|
+
<mn>]</mn>
|
24
|
+
</mrow>
|
25
|
+
<mrow>
|
26
|
+
<mn>4</mn>
|
27
|
+
</mrow>
|
28
|
+
</msup>
|
29
|
+
<mo>+</mo>
|
30
|
+
<mmultiscripts>
|
31
|
+
<mrow>
|
32
|
+
<mi>c</mi>
|
33
|
+
</mrow>
|
34
|
+
<mprescripts/>
|
35
|
+
<mrow>
|
36
|
+
<mi>b</mi>
|
37
|
+
</mrow>
|
38
|
+
<mrow>
|
39
|
+
<mi>a</mi>
|
40
|
+
</mrow>
|
41
|
+
</mmultiscripts>
|
42
|
+
<mo>+</mo>
|
43
|
+
<mmultiscripts>
|
44
|
+
<mrow>
|
45
|
+
<mi>f</mi>
|
46
|
+
</mrow>
|
47
|
+
<mprescripts/>
|
48
|
+
<mrow>
|
49
|
+
<mi>e</mi>
|
50
|
+
</mrow>
|
51
|
+
<mrow>
|
52
|
+
<mi>d</mi>
|
53
|
+
</mrow>
|
54
|
+
</mmultiscripts>
|
55
|
+
<mo>+</mo>
|
56
|
+
<msup>
|
57
|
+
<mrow>
|
58
|
+
<mrow>
|
59
|
+
<mo>(</mo>
|
60
|
+
<mrow>
|
61
|
+
<mi>g</mi>
|
62
|
+
<mo>−</mo>
|
63
|
+
<mi>h</mi>
|
64
|
+
</mrow>
|
65
|
+
<mo>)</mo>
|
66
|
+
</mrow>
|
67
|
+
</mrow>
|
68
|
+
<mrow>
|
69
|
+
<mi>i</mi>
|
70
|
+
</mrow>
|
71
|
+
</msup>
|
72
|
+
<mo>+</mo>
|
73
|
+
<msub>
|
74
|
+
<mrow>
|
75
|
+
<mi>j</mi>
|
76
|
+
</mrow>
|
77
|
+
<mrow>
|
78
|
+
<mi>k</mi>
|
79
|
+
</mrow>
|
80
|
+
</msub>
|
81
|
+
<mo>+</mo>
|
82
|
+
<mmultiscripts>
|
83
|
+
<mrow>
|
84
|
+
<mi>m</mi>
|
85
|
+
</mrow>
|
86
|
+
<mprescripts/>
|
87
|
+
<mrow>
|
88
|
+
<mi>l</mi>
|
89
|
+
</mrow>
|
90
|
+
<none/>
|
91
|
+
</mmultiscripts>
|
92
|
+
<mo>+</mo>
|
93
|
+
<mmultiscripts>
|
94
|
+
<mrow>
|
95
|
+
<mi>o</mi>
|
96
|
+
</mrow>
|
97
|
+
<mprescripts/>
|
98
|
+
<none/>
|
99
|
+
<mrow>
|
100
|
+
<mi>n</mi>
|
101
|
+
</mrow>
|
102
|
+
</mmultiscripts>
|
103
|
+
<mo>+</mo>
|
104
|
+
<msup>
|
105
|
+
<mrow>
|
106
|
+
<mi>p</mi>
|
107
|
+
</mrow>
|
108
|
+
<mrow>
|
109
|
+
<mi>r</mi>
|
110
|
+
</mrow>
|
111
|
+
</msup>
|
112
|
+
</mrow>
|
113
|
+
</math>
|
@@ -0,0 +1,33 @@
|
|
1
|
+
<?xml version="1.0"?>
|
2
|
+
<math display="block">
|
3
|
+
<mrow>
|
4
|
+
<mfrac>
|
5
|
+
<mrow>
|
6
|
+
<mo>−</mo>
|
7
|
+
<mi>b</mi>
|
8
|
+
<mo>±</mo>
|
9
|
+
<msqrt>
|
10
|
+
<mrow>
|
11
|
+
<msup>
|
12
|
+
<mrow>
|
13
|
+
<mi>b</mi>
|
14
|
+
</mrow>
|
15
|
+
<mrow>
|
16
|
+
<mn>2</mn>
|
17
|
+
</mrow>
|
18
|
+
</msup>
|
19
|
+
<mo>−</mo>
|
20
|
+
<mn>4</mn>
|
21
|
+
<mi>a</mi>
|
22
|
+
<mi>c</mi>
|
23
|
+
</mrow>
|
24
|
+
<mrow/>
|
25
|
+
</msqrt>
|
26
|
+
</mrow>
|
27
|
+
<mrow>
|
28
|
+
<mn>2</mn>
|
29
|
+
<mi>a</mi>
|
30
|
+
</mrow>
|
31
|
+
</mfrac>
|
32
|
+
</mrow>
|
33
|
+
</math>
|