mathtype_to_mathml 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (58) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +14 -0
  3. data/.rspec +2 -0
  4. data/.ruby-version +1 -0
  5. data/.travis.yml +3 -0
  6. data/Gemfile +6 -0
  7. data/LICENSE.txt +22 -0
  8. data/README.md +45 -0
  9. data/Rakefile +7 -0
  10. data/lib/mathtype_to_mathml.rb +28 -0
  11. data/lib/mathtype_to_mathml/char_replacer.rb +311 -0
  12. data/lib/mathtype_to_mathml/mover.rb +151 -0
  13. data/lib/mathtype_to_mathml/version.rb +3 -0
  14. data/lib/transform.xsl +104 -0
  15. data/lib/xsl/arrow.xsl +319 -0
  16. data/lib/xsl/brace.xsl +55 -0
  17. data/lib/xsl/char.xsl +35 -0
  18. data/lib/xsl/embellishment.xsl +389 -0
  19. data/lib/xsl/matrix.xsl +116 -0
  20. data/lib/xsl/pile.xsl +54 -0
  21. data/lib/xsl/subsup.xsl +55 -0
  22. data/lib/xsl/sum.xsl +57 -0
  23. data/lib/xsl/union_intersection.xsl +104 -0
  24. data/mathtype_to_mathml.gemspec +28 -0
  25. data/spec/fixtures/expected/arrows.xml +389 -0
  26. data/spec/fixtures/expected/embellishments.xml +178 -0
  27. data/spec/fixtures/expected/equation1.xml +52 -0
  28. data/spec/fixtures/expected/equation10.xml +19 -0
  29. data/spec/fixtures/expected/equation11.xml +17 -0
  30. data/spec/fixtures/expected/equation12.xml +34 -0
  31. data/spec/fixtures/expected/equation13.xml +113 -0
  32. data/spec/fixtures/expected/equation2.xml +33 -0
  33. data/spec/fixtures/expected/equation3.xml +324 -0
  34. data/spec/fixtures/expected/equation4.xml +14 -0
  35. data/spec/fixtures/expected/equation5.xml +23 -0
  36. data/spec/fixtures/expected/equation6.xml +13 -0
  37. data/spec/fixtures/expected/equation7.xml +19 -0
  38. data/spec/fixtures/expected/equation8.xml +17 -0
  39. data/spec/fixtures/expected/equation9.xml +15 -0
  40. data/spec/fixtures/input/arrows.bin +0 -0
  41. data/spec/fixtures/input/embellishments.bin +0 -0
  42. data/spec/fixtures/input/equation1.bin +0 -0
  43. data/spec/fixtures/input/equation10.bin +0 -0
  44. data/spec/fixtures/input/equation11.bin +0 -0
  45. data/spec/fixtures/input/equation12.bin +0 -0
  46. data/spec/fixtures/input/equation13.bin +0 -0
  47. data/spec/fixtures/input/equation2.bin +0 -0
  48. data/spec/fixtures/input/equation3.bin +0 -0
  49. data/spec/fixtures/input/equation4.bin +0 -0
  50. data/spec/fixtures/input/equation5.bin +0 -0
  51. data/spec/fixtures/input/equation6.bin +0 -0
  52. data/spec/fixtures/input/equation7.bin +0 -0
  53. data/spec/fixtures/input/equation8.bin +0 -0
  54. data/spec/fixtures/input/equation9.bin +0 -0
  55. data/spec/html_output.rb +28 -0
  56. data/spec/mathtype_to_mathml_spec.rb +19 -0
  57. data/spec/spec_helper.rb +2 -0
  58. metadata +220 -0
@@ -0,0 +1,324 @@
1
+ <?xml version="1.0"?>
2
+ <math display="block">
3
+ <mrow>
4
+ <mstyle displaystyle="true">
5
+ <munderover>
6
+ <mo>&#x2211;</mo>
7
+ <mrow>
8
+ <mi>b</mi>
9
+ <mo>&#x003D;</mo>
10
+ <mn>4</mn>
11
+ </mrow>
12
+ <mrow>
13
+ <mi>i</mi>
14
+ <mo>&#x003D;</mo>
15
+ <mn>3</mn>
16
+ </mrow>
17
+ </munderover>
18
+ <mrow>
19
+ <mi>t</mi>
20
+ <mstyle displaystyle="true">
21
+ <munderover>
22
+ <mo>&#x2229;</mo>
23
+ <mrow>
24
+ <mi>i</mi>
25
+ <mo>&#x003D;</mo>
26
+ <mn>1</mn>
27
+ </mrow>
28
+ <mrow>
29
+ <mi>n</mi>
30
+ </mrow>
31
+ </munderover>
32
+ <mrow>
33
+ <msub>
34
+ <mrow>
35
+ <mi>X</mi>
36
+ </mrow>
37
+ <mrow>
38
+ <mi>i</mi>
39
+ </mrow>
40
+ </msub>
41
+ </mrow>
42
+ </mstyle>
43
+ <mrow>
44
+ <mo>{</mo>
45
+ <mrow>
46
+ <mrow>
47
+ <mo>[</mo>
48
+ <mrow>
49
+ <mrow>
50
+ <mo>(</mo>
51
+ <mrow>
52
+ <mo>&#x00B1;</mo>
53
+ <mo>&#x2260;</mo>
54
+ <mo>&#x2264;</mo>
55
+ <mo>&#x2202;</mo>
56
+ <mo>&#x2192;</mo>
57
+ <mo>&#x2192;</mo>
58
+ <mi>&#x3B8;</mi>
59
+ <mi>&#x3C0;</mi>
60
+ <mrow>
61
+ <mo>&#x2329;</mo>
62
+ <mrow>
63
+ <mi>d</mi>
64
+ </mrow>
65
+ <mo>|</mo>
66
+ <mrow>
67
+ <mi>b</mi>
68
+ </mrow>
69
+ <mo>&#x232A;</mo>
70
+ </mrow>
71
+ </mrow>
72
+ <mo>)</mo>
73
+ </mrow>
74
+ </mrow>
75
+ <mo>]</mo>
76
+ </mrow>
77
+ </mrow>
78
+ <mo>}</mo>
79
+ </mrow>
80
+ </mrow>
81
+ </mstyle>
82
+ <mrow>
83
+ <mo>(</mo>
84
+ <mrow>
85
+ <mtable columnalign="left">
86
+ <mtr columnalign="left">
87
+ <mtd columnalign="left">
88
+ <msub>
89
+ <mrow>
90
+ <mi>a</mi>
91
+ </mrow>
92
+ <mrow>
93
+ <mn>1</mn>
94
+ <mn>1</mn>
95
+ </mrow>
96
+ </msub>
97
+ </mtd>
98
+ <mtd columnalign="left">
99
+ <mo>&#x2026;</mo>
100
+ </mtd>
101
+ <mtd columnalign="left">
102
+ <msub>
103
+ <mrow>
104
+ <mi>a</mi>
105
+ </mrow>
106
+ <mrow>
107
+ <mn>1</mn>
108
+ <mi>n</mi>
109
+ </mrow>
110
+ </msub>
111
+ </mtd>
112
+ </mtr>
113
+ <mtr columnalign="left">
114
+ <mtd columnalign="left">
115
+ <mo>&#x22EE;</mo>
116
+ </mtd>
117
+ <mtd columnalign="left">
118
+ <mo>&#x22F1;</mo>
119
+ </mtd>
120
+ <mtd columnalign="left">
121
+ <mo>&#x22EE;</mo>
122
+ </mtd>
123
+ </mtr>
124
+ <mtr columnalign="left">
125
+ <mtd columnalign="left">
126
+ <msub>
127
+ <mrow>
128
+ <mi>a</mi>
129
+ </mrow>
130
+ <mrow>
131
+ <mi>m</mi>
132
+ <mn>1</mn>
133
+ </mrow>
134
+ </msub>
135
+ </mtd>
136
+ <mtd columnalign="left">
137
+ <mo>&#x22EF;</mo>
138
+ </mtd>
139
+ <mtd columnalign="left">
140
+ <msub>
141
+ <mrow>
142
+ <mi>a</mi>
143
+ </mrow>
144
+ <mrow>
145
+ <mi>m</mi>
146
+ <mi>n</mi>
147
+ </mrow>
148
+ </msub>
149
+ </mtd>
150
+ </mtr>
151
+ </mtable>
152
+ </mrow>
153
+ <mo>)</mo>
154
+ </mrow>
155
+ <mrow>
156
+ <mo>(</mo>
157
+ <mrow>
158
+ <mtable columnalign="left">
159
+ <mtr columnalign="left">
160
+ <mtd columnalign="left">
161
+ <msub>
162
+ <mrow>
163
+ <mi>a</mi>
164
+ </mrow>
165
+ <mrow>
166
+ <mn>1</mn>
167
+ <mn>1</mn>
168
+ </mrow>
169
+ </msub>
170
+ </mtd>
171
+ <mtd columnalign="left">
172
+ <msub>
173
+ <mrow>
174
+ <mi>a</mi>
175
+ </mrow>
176
+ <mrow>
177
+ <mn>1</mn>
178
+ <mn>2</mn>
179
+ </mrow>
180
+ </msub>
181
+ </mtd>
182
+ <mtd columnalign="left">
183
+ <msub>
184
+ <mrow>
185
+ <mi>a</mi>
186
+ </mrow>
187
+ <mrow>
188
+ <mn>1</mn>
189
+ <mn>3</mn>
190
+ </mrow>
191
+ </msub>
192
+ </mtd>
193
+ </mtr>
194
+ <mtr columnalign="left">
195
+ <mtd columnalign="left">
196
+ <msub>
197
+ <mrow>
198
+ <mi>a</mi>
199
+ </mrow>
200
+ <mrow>
201
+ <mn>2</mn>
202
+ <mn>1</mn>
203
+ </mrow>
204
+ </msub>
205
+ </mtd>
206
+ <mtd columnalign="left">
207
+ <msub>
208
+ <mrow>
209
+ <mi>a</mi>
210
+ </mrow>
211
+ <mrow>
212
+ <mn>2</mn>
213
+ <mn>2</mn>
214
+ </mrow>
215
+ </msub>
216
+ </mtd>
217
+ <mtd columnalign="left">
218
+ <msub>
219
+ <mrow>
220
+ <mi>a</mi>
221
+ </mrow>
222
+ <mrow>
223
+ <mn>2</mn>
224
+ <mn>3</mn>
225
+ </mrow>
226
+ </msub>
227
+ </mtd>
228
+ </mtr>
229
+ <mtr columnalign="left">
230
+ <mtd columnalign="left">
231
+ <msub>
232
+ <mrow>
233
+ <mi>a</mi>
234
+ </mrow>
235
+ <mrow>
236
+ <mn>3</mn>
237
+ <mn>1</mn>
238
+ </mrow>
239
+ </msub>
240
+ </mtd>
241
+ <mtd columnalign="left">
242
+ <msub>
243
+ <mrow>
244
+ <mi>a</mi>
245
+ </mrow>
246
+ <mrow>
247
+ <mn>3</mn>
248
+ <mn>2</mn>
249
+ </mrow>
250
+ </msub>
251
+ </mtd>
252
+ <mtd columnalign="left">
253
+ <msub>
254
+ <mrow>
255
+ <mi>a</mi>
256
+ </mrow>
257
+ <mrow>
258
+ <mn>3</mn>
259
+ <mn>3</mn>
260
+ </mrow>
261
+ </msub>
262
+ </mtd>
263
+ </mtr>
264
+ </mtable>
265
+ </mrow>
266
+ <mo>)</mo>
267
+ </mrow>
268
+ <mrow>
269
+ <mo>(</mo>
270
+ <mrow>
271
+ <mtable columnalign="left">
272
+ <mtr columnalign="left">
273
+ <mtd columnalign="left">
274
+ <msub>
275
+ <mrow>
276
+ <mi>a</mi>
277
+ </mrow>
278
+ <mrow>
279
+ <mn>1</mn>
280
+ </mrow>
281
+ </msub>
282
+ </mtd>
283
+ <mtd columnalign="left">
284
+ <mn>1</mn>
285
+ </mtd>
286
+ <mtd columnalign="left">
287
+ <mn>0</mn>
288
+ </mtd>
289
+ </mtr>
290
+ <mtr columnalign="left">
291
+ <mtd columnalign="left">
292
+ <mn>4</mn>
293
+ </mtd>
294
+ <mtd columnalign="left">
295
+ <mo>&#x22F1;</mo>
296
+ </mtd>
297
+ <mtd columnalign="left">
298
+ <mn>2</mn>
299
+ </mtd>
300
+ </mtr>
301
+ <mtr columnalign="left">
302
+ <mtd columnalign="left">
303
+ <mn>0</mn>
304
+ </mtd>
305
+ <mtd columnalign="left">
306
+ <mn>3</mn>
307
+ </mtd>
308
+ <mtd columnalign="left">
309
+ <msub>
310
+ <mrow>
311
+ <mi>a</mi>
312
+ </mrow>
313
+ <mrow>
314
+ <mi>n</mi>
315
+ </mrow>
316
+ </msub>
317
+ </mtd>
318
+ </mtr>
319
+ </mtable>
320
+ </mrow>
321
+ <mo>)</mo>
322
+ </mrow>
323
+ </mrow>
324
+ </math>
@@ -0,0 +1,14 @@
1
+ <?xml version="1.0"?>
2
+ <math display="block">
3
+ <mrow>
4
+ <mroot>
5
+ <mrow>
6
+ <mn>2</mn>
7
+ <mn>7</mn>
8
+ </mrow>
9
+ <mrow>
10
+ <mn>3</mn>
11
+ </mrow>
12
+ </mroot>
13
+ </mrow>
14
+ </math>
@@ -0,0 +1,23 @@
1
+ <?xml version="1.0"?>
2
+ <math display="block">
3
+ <mrow>
4
+ <mi>a</mi>
5
+ <munderover accentunder="true">
6
+ <mstyle scriptlevel="-1">
7
+ <mo>&#x21C0;</mo>
8
+ </mstyle>
9
+ <munder>
10
+ <mstyle scriptlevel="+1">
11
+ <mo>&#x21BD;</mo>
12
+ </mstyle>
13
+ <mrow>
14
+ <mi>b</mi>
15
+ </mrow>
16
+ </munder>
17
+ <mrow>
18
+ <mi>a</mi>
19
+ </mrow>
20
+ </munderover>
21
+ <mi>c</mi>
22
+ </mrow>
23
+ </math>
@@ -0,0 +1,13 @@
1
+ <?xml version="1.0"?>
2
+ <math display="block">
3
+ <mrow>
4
+ <mi>a</mi>
5
+ <mover>
6
+ <mo>&#x2194;</mo>
7
+ <mrow>
8
+ <mi>c</mi>
9
+ </mrow>
10
+ </mover>
11
+ <mi>b</mi>
12
+ </mrow>
13
+ </math>
@@ -0,0 +1,19 @@
1
+ <?xml version="1.0"?>
2
+ <math display="block">
3
+ <mrow>
4
+ <mstyle displaystyle="true">
5
+ <msubsup>
6
+ <mo>&#x222A;</mo>
7
+ <mrow>
8
+ <mi>a</mi>
9
+ </mrow>
10
+ <mrow>
11
+ <mi>c</mi>
12
+ </mrow>
13
+ </msubsup>
14
+ <mrow>
15
+ <mi>b</mi>
16
+ </mrow>
17
+ </mstyle>
18
+ </mrow>
19
+ </math>
@@ -0,0 +1,17 @@
1
+ <?xml version="1.0"?>
2
+ <math display="block">
3
+ <mrow>
4
+ <mstyle displaystyle="true">
5
+ <munderover>
6
+ <mo>&#x222A;</mo>
7
+ <mrow>
8
+ <mi>a</mi>
9
+ </mrow>
10
+ <mrow/>
11
+ </munderover>
12
+ <mrow>
13
+ <mi>b</mi>
14
+ </mrow>
15
+ </mstyle>
16
+ </mrow>
17
+ </math>
@@ -0,0 +1,15 @@
1
+ <?xml version="1.0"?>
2
+ <math display="block">
3
+ <mrow>
4
+ <mstyle displaystyle="true">
5
+ <msubsup>
6
+ <mo>&#x222A;</mo>
7
+ <mrow/>
8
+ <mrow/>
9
+ </msubsup>
10
+ <mrow>
11
+ <mi>s</mi>
12
+ </mrow>
13
+ </mstyle>
14
+ </mrow>
15
+ </math>
Binary file
Binary file
Binary file
Binary file
Binary file