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,178 @@
1
+ <?xml version="1.0"?>
2
+ <math display="block">
3
+ <mrow>
4
+ <msup>
5
+ <mi>a</mi>
6
+ <mo>&#x2032;</mo>
7
+ </msup>
8
+ <msup>
9
+ <mi>b</mi>
10
+ <mo>&#x2033;</mo>
11
+ </msup>
12
+ <msup>
13
+ <mi>c</mi>
14
+ <mo>&#x2034;</mo>
15
+ </msup>
16
+ <mmultiscripts>
17
+ <mi>d</mi>
18
+ <mprescripts/>
19
+ <none/>
20
+ <mo>&#x2035;</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>&#x2212;</mo>
38
+ <mover accent="true">
39
+ <mi>j</mi>
40
+ <mo>&#x2D9;</mo>
41
+ </mover>
42
+ <mo>&#x2212;</mo>
43
+ <mover accent="true">
44
+ <mi>k</mi>
45
+ <mo>&#xA8;</mo>
46
+ </mover>
47
+ <mo>&#x2212;</mo>
48
+ <mover accent="true">
49
+ <mi>l</mi>
50
+ <mo>&#x20DB;</mo>
51
+ </mover>
52
+ <mo>&#x2212;</mo>
53
+ <mover accent="true">
54
+ <mi>m</mi>
55
+ <mo>&#x20DC;</mo>
56
+ </mover>
57
+ <mo>&#x2212;</mo>
58
+ <munder>
59
+ <mi>n</mi>
60
+ <mo>&#x2D9;</mo>
61
+ </munder>
62
+ <mo>&#x2212;</mo>
63
+ <munder>
64
+ <mi>o</mi>
65
+ <mo>&#xA8;</mo>
66
+ </munder>
67
+ <mo>&#x2212;</mo>
68
+ <munder>
69
+ <mi>p</mi>
70
+ <mo>&#x20DB;</mo>
71
+ </munder>
72
+ <mo>&#x2212;</mo>
73
+ <mover accent="true">
74
+ <mi>q</mi>
75
+ <mo>&#x2322;</mo>
76
+ </mover>
77
+ <mo>&#x2212;</mo>
78
+ <munder>
79
+ <mi>r</mi>
80
+ <mo>&#x20DC;</mo>
81
+ </munder>
82
+ <mo>&#x2212;</mo>
83
+ <mover accent="true">
84
+ <mi>s</mi>
85
+ <mo>&#xAF;</mo>
86
+ </mover>
87
+ <mo>&#x2212;</mo>
88
+ <mover accent="true">
89
+ <mi>t</mi>
90
+ <mo>&#x2DC;</mo>
91
+ </mover>
92
+ <mo>&#x2212;</mo>
93
+ <mover accent="true">
94
+ <mi>u</mi>
95
+ <mo>&#x2323;</mo>
96
+ </mover>
97
+ <mo>&#x2212;</mo>
98
+ <mover accent="true">
99
+ <mi>v</mi>
100
+ <mo>^</mo>
101
+ </mover>
102
+ <mo>&#x2212;</mo>
103
+ <munder accentunder="true">
104
+ <mi>x</mi>
105
+ <mo>_</mo>
106
+ </munder>
107
+ <mo>&#x2212;</mo>
108
+ <munder accentunder="true">
109
+ <mi>y</mi>
110
+ <mo>&#x2DC;</mo>
111
+ </munder>
112
+ <mo>&#x2212;</mo>
113
+ <munder accentunder="true">
114
+ <mi>z</mi>
115
+ <mo>&#x2322;</mo>
116
+ </munder>
117
+ <mo>&#x2212;</mo>
118
+ <munder accentunder="true">
119
+ <mi>a</mi>
120
+ <mo>&#x2323;</mo>
121
+ </munder>
122
+ <mo>&#x2212;</mo>
123
+ <mover accent="true">
124
+ <mi>b</mi>
125
+ <mo>&#x2192;</mo>
126
+ </mover>
127
+ <mo>&#x2212;</mo>
128
+ <mover accent="true">
129
+ <mi>c</mi>
130
+ <mo>&#x2190;</mo>
131
+ </mover>
132
+ <mo>&#x2212;</mo>
133
+ <mover accent="true">
134
+ <mi>d</mi>
135
+ <mo>&#x2194;</mo>
136
+ </mover>
137
+ <mo>&#x2212;</mo>
138
+ <mover accent="true">
139
+ <mi>e</mi>
140
+ <mo>&#x21C0;</mo>
141
+ </mover>
142
+ <mo>&#x2212;</mo>
143
+ <mover accent="true">
144
+ <mi>f</mi>
145
+ <mo>&#x21BC;</mo>
146
+ </mover>
147
+ <mo>&#x2212;</mo>
148
+ <munder>
149
+ <mi>g</mi>
150
+ <mo>&#x2192;</mo>
151
+ </munder>
152
+ <mo>&#x2212;</mo>
153
+ <munder>
154
+ <mi>h</mi>
155
+ <mo>&#x2190;</mo>
156
+ </munder>
157
+ <mo>&#x2212;</mo>
158
+ <munder>
159
+ <mi>i</mi>
160
+ <mo>&#x2194;</mo>
161
+ </munder>
162
+ <mo>&#x2212;</mo>
163
+ <munder>
164
+ <mi>j</mi>
165
+ <mo>&#x21C1;</mo>
166
+ </munder>
167
+ <mo>&#x2212;</mo>
168
+ <munder>
169
+ <mi>k</mi>
170
+ <mo>&#x21BD;</mo>
171
+ </munder>
172
+ <mo>&#x002B;</mo>
173
+ <mover accent="true">
174
+ <mo>&#x2210;</mo>
175
+ <mo>&#x2322;</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>&#x003D;</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>&#x2211;</mo>
24
+ <mrow>
25
+ <mi>i</mi>
26
+ <mo>&#x003D;</mo>
27
+ <mn>0</mn>
28
+ </mrow>
29
+ <mrow>
30
+ <mi>r</mi>
31
+ <mo>&#x2212;</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>&#x2212;</mo>
44
+ <mi>i</mi>
45
+ <mo>&#x002B;</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>&#x222A;</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,17 @@
1
+ <?xml version="1.0"?>
2
+ <math display="block">
3
+ <mrow>
4
+ <msup>
5
+ <mrow>
6
+ <mn>&#x0028;</mn>
7
+ <mi>a</mi>
8
+ <mo>&#x2212;</mo>
9
+ <mi>b</mi>
10
+ <mn>&#x0029;</mn>
11
+ </mrow>
12
+ <mrow>
13
+ <mi>c</mi>
14
+ </mrow>
15
+ </msup>
16
+ </mrow>
17
+ </math>
@@ -0,0 +1,34 @@
1
+ <?xml version="1.0"?>
2
+ <math display="block">
3
+ <mrow>
4
+ <msup>
5
+ <mrow>
6
+ <mn>&#x0028;</mn>
7
+ <mi>a</mi>
8
+ <mo>&#x2212;</mo>
9
+ <mi>b</mi>
10
+ <mn>&#x0029;</mn>
11
+ </mrow>
12
+ <mrow>
13
+ <mi>c</mi>
14
+ </mrow>
15
+ </msup>
16
+ <mo>&#x002B;</mo>
17
+ <msup>
18
+ <mrow>
19
+ <mrow>
20
+ <mo>(</mo>
21
+ <mrow>
22
+ <mi>b</mi>
23
+ <mo>&#x002B;</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>&#x0028;</mn>
7
+ <mi>a</mi>
8
+ <mo>&#x002B;</mo>
9
+ <mi>b</mi>
10
+ <mn>&#x0029;</mn>
11
+ </mrow>
12
+ <mrow>
13
+ <mi>c</mi>
14
+ </mrow>
15
+ </msup>
16
+ <mo>&#x002B;</mo>
17
+ <msup>
18
+ <mrow>
19
+ <mn>&#x005B;</mn>
20
+ <mi>d</mi>
21
+ <mo>&#x002B;</mo>
22
+ <mi>f</mi>
23
+ <mn>&#x005D;</mn>
24
+ </mrow>
25
+ <mrow>
26
+ <mn>4</mn>
27
+ </mrow>
28
+ </msup>
29
+ <mo>&#x002B;</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>&#x002B;</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>&#x002B;</mo>
56
+ <msup>
57
+ <mrow>
58
+ <mrow>
59
+ <mo>(</mo>
60
+ <mrow>
61
+ <mi>g</mi>
62
+ <mo>&#x2212;</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>&#x002B;</mo>
73
+ <msub>
74
+ <mrow>
75
+ <mi>j</mi>
76
+ </mrow>
77
+ <mrow>
78
+ <mi>k</mi>
79
+ </mrow>
80
+ </msub>
81
+ <mo>&#x002B;</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>&#x002B;</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>&#x002B;</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>&#x2212;</mo>
7
+ <mi>b</mi>
8
+ <mo>&#x00B1;</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>&#x2212;</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>