mathtype_to_mathml_plus 0.0.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (99) 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/char_replacer.rb +366 -0
  11. data/lib/mathtype_to_mathml/mover.rb +151 -0
  12. data/lib/mathtype_to_mathml/version.rb +3 -0
  13. data/lib/mathtype_to_mathml.rb +45 -0
  14. data/lib/transform.xsl +53 -0
  15. data/lib/xsl/arrow.xsl +319 -0
  16. data/lib/xsl/box.xsl +42 -0
  17. data/lib/xsl/char.xsl +1854 -0
  18. data/lib/xsl/embellishment.xsl +389 -0
  19. data/lib/xsl/fence.xsl +228 -0
  20. data/lib/xsl/frac.xsl +46 -0
  21. data/lib/xsl/int.xsl +622 -0
  22. data/lib/xsl/lim.xsl +32 -0
  23. data/lib/xsl/long_division.xsl +32 -0
  24. data/lib/xsl/long_embellishment.xsl +150 -0
  25. data/lib/xsl/matrix.xsl +115 -0
  26. data/lib/xsl/pile.xsl +54 -0
  27. data/lib/xsl/product_coproduct.xsl +107 -0
  28. data/lib/xsl/subsup.xsl +55 -0
  29. data/lib/xsl/sum.xsl +81 -0
  30. data/lib/xsl/union_intersection.xsl +104 -0
  31. data/mathtype_to_mathml.gemspec +29 -0
  32. data/spec/fixtures/expected/280.xml +122 -0
  33. data/spec/fixtures/expected/281.xml +60 -0
  34. data/spec/fixtures/expected/299.xml +70 -0
  35. data/spec/fixtures/expected/326.xml +173 -0
  36. data/spec/fixtures/expected/424.xml +425 -0
  37. data/spec/fixtures/expected/450.xml +174 -0
  38. data/spec/fixtures/expected/452.xml +166 -0
  39. data/spec/fixtures/expected/478.xml +303 -0
  40. data/spec/fixtures/expected/629.xml +98 -0
  41. data/spec/fixtures/expected/arrows.xml +389 -0
  42. data/spec/fixtures/expected/boxes.xml +22 -0
  43. data/spec/fixtures/expected/embellishments.xml +178 -0
  44. data/spec/fixtures/expected/embellishments_roots_long_divisions.xml +162 -0
  45. data/spec/fixtures/expected/equation1.xml +52 -0
  46. data/spec/fixtures/expected/equation10.xml +19 -0
  47. data/spec/fixtures/expected/equation11.xml +17 -0
  48. data/spec/fixtures/expected/equation12.xml +34 -0
  49. data/spec/fixtures/expected/equation13.xml +113 -0
  50. data/spec/fixtures/expected/equation14.xml +54 -0
  51. data/spec/fixtures/expected/equation2.xml +33 -0
  52. data/spec/fixtures/expected/equation3.xml +324 -0
  53. data/spec/fixtures/expected/equation4.xml +14 -0
  54. data/spec/fixtures/expected/equation5.xml +23 -0
  55. data/spec/fixtures/expected/equation6.xml +13 -0
  56. data/spec/fixtures/expected/equation7.xml +19 -0
  57. data/spec/fixtures/expected/equation8.xml +17 -0
  58. data/spec/fixtures/expected/equation9.xml +15 -0
  59. data/spec/fixtures/expected/fences.xml +64 -0
  60. data/spec/fixtures/expected/integrals.xml +264 -0
  61. data/spec/fixtures/expected/matrices.xml +253 -0
  62. data/spec/fixtures/expected/sums.xml +36 -0
  63. data/spec/fixtures/expected/unions_and_intersections.xml +140 -0
  64. data/spec/fixtures/input/280.bin +0 -0
  65. data/spec/fixtures/input/281.bin +0 -0
  66. data/spec/fixtures/input/299.bin +0 -0
  67. data/spec/fixtures/input/326.bin +0 -0
  68. data/spec/fixtures/input/424.bin +0 -0
  69. data/spec/fixtures/input/450.bin +0 -0
  70. data/spec/fixtures/input/452.bin +0 -0
  71. data/spec/fixtures/input/478.bin +0 -0
  72. data/spec/fixtures/input/629.bin +0 -0
  73. data/spec/fixtures/input/arrows.bin +0 -0
  74. data/spec/fixtures/input/boxes.bin +0 -0
  75. data/spec/fixtures/input/embellishments.bin +0 -0
  76. data/spec/fixtures/input/embellishments_roots_long_divisions.bin +0 -0
  77. data/spec/fixtures/input/equation1.bin +0 -0
  78. data/spec/fixtures/input/equation10.bin +0 -0
  79. data/spec/fixtures/input/equation11.bin +0 -0
  80. data/spec/fixtures/input/equation12.bin +0 -0
  81. data/spec/fixtures/input/equation13.bin +0 -0
  82. data/spec/fixtures/input/equation14.bin +0 -0
  83. data/spec/fixtures/input/equation2.bin +0 -0
  84. data/spec/fixtures/input/equation3.bin +0 -0
  85. data/spec/fixtures/input/equation4.bin +0 -0
  86. data/spec/fixtures/input/equation5.bin +0 -0
  87. data/spec/fixtures/input/equation6.bin +0 -0
  88. data/spec/fixtures/input/equation7.bin +0 -0
  89. data/spec/fixtures/input/equation8.bin +0 -0
  90. data/spec/fixtures/input/equation9.bin +0 -0
  91. data/spec/fixtures/input/fences.bin +0 -0
  92. data/spec/fixtures/input/integrals.bin +0 -0
  93. data/spec/fixtures/input/matrices.bin +0 -0
  94. data/spec/fixtures/input/sums.bin +0 -0
  95. data/spec/fixtures/input/unions_and_intersections.bin +0 -0
  96. data/spec/html_output.rb +28 -0
  97. data/spec/mathtype_to_mathml_spec.rb +16 -0
  98. data/spec/spec_helper.rb +4 -0
  99. metadata +305 -0
data/lib/transform.xsl ADDED
@@ -0,0 +1,53 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
3
+ xmlns:xs="http://www.w3.org/2001/XMLSchema"
4
+ exclude-result-prefixes="xs"
5
+ version="1.0">
6
+ <xsl:template match="/">
7
+ <xsl:apply-templates select=".//mtef" />
8
+ </xsl:template>
9
+
10
+ <xsl:template match="mtef[equation_options = 'inline']">
11
+ <math>
12
+ <xsl:apply-templates select="pile | slot"/>
13
+ </math>
14
+ </xsl:template>
15
+
16
+ <xsl:template match="mtef[equation_options = 'block']">
17
+ <math display="block">
18
+ <xsl:apply-templates select="pile | slot"/>
19
+ </math>
20
+ </xsl:template>
21
+
22
+ <xsl:template match="slot">
23
+ <mrow>
24
+ <xsl:apply-templates/>
25
+ </mrow>
26
+ </xsl:template>
27
+
28
+ <!-- Non-empty text nodes -->
29
+ <xsl:template match="text()[normalize-space()]">
30
+ <xsl:value-of select="."/>
31
+ </xsl:template>
32
+
33
+ <xsl:template match="*" />
34
+
35
+ <xsl:include href="xsl/int.xsl" />
36
+ <xsl:include href="xsl/lim.xsl" />
37
+ <xsl:include href="xsl/frac.xsl" />
38
+ <xsl:include href="xsl/pile.xsl" />
39
+ <xsl:include href="xsl/char.xsl" />
40
+ <xsl:include href="xsl/embellishment.xsl" />
41
+ <xsl:include href="xsl/subsup.xsl"/>
42
+ <xsl:include href="xsl/sum.xsl"/>
43
+ <xsl:include href="xsl/product_coproduct.xsl"/>
44
+ <xsl:include href="xsl/union_intersection.xsl"/>
45
+ <xsl:include href="xsl/box.xsl" />
46
+ <xsl:include href="xsl/fence.xsl" />
47
+ <xsl:include href="xsl/arrow.xsl"/>
48
+ <xsl:include href="xsl/matrix.xsl"/>
49
+ <xsl:include href="xsl/long_embellishment.xsl"/>
50
+ <xsl:include href="xsl/long_division.xsl"/>
51
+ <xsl:include href="xsl/root.xsl" />
52
+ <xsl:include href="xsl/map-fonts.xsl" />
53
+ </xsl:stylesheet>
data/lib/xsl/arrow.xsl ADDED
@@ -0,0 +1,319 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
3
+ xmlns:xs="http://www.w3.org/2001/XMLSchema"
4
+ exclude-result-prefixes="xs"
5
+ version="1.0">
6
+
7
+ <!-- Arrows -->
8
+ <xsl:template match="tmpl[selector='tmARROW']">
9
+ <mover>
10
+ <mo>&#x2192;</mo>
11
+ <xsl:apply-templates select="slot[1] | pile[1]"/>
12
+ </mover>
13
+ </xsl:template>
14
+
15
+ <xsl:template match="tmpl[selector='tmARROW' and variation='tvAR_LEFT']">
16
+ <mover>
17
+ <mo>&#x2190;</mo>
18
+ <xsl:apply-templates select="slot[1] | pile[1]"/>
19
+ </mover>
20
+ </xsl:template>
21
+
22
+ <xsl:template match="tmpl[selector='tmARROW' and variation='tvAR_BOTTOM']">
23
+ <munder>
24
+ <mo>&#x2192;</mo>
25
+ <xsl:apply-templates select="slot[2] | pile[2]"/>
26
+ </munder>
27
+ </xsl:template>
28
+
29
+ <xsl:template match="tmpl[selector='tmARROW' and variation='tvAR_TOPBOTTOM']">
30
+ <munderover>
31
+ <mo>&#x2192;</mo>
32
+ <xsl:apply-templates select="slot[2] | pile[2]"/>
33
+ <xsl:apply-templates select="slot[1] | pile[1]"/>
34
+ </munderover>
35
+ </xsl:template>
36
+
37
+ <xsl:template match="tmpl[selector='tmARROW' and variation='tvAR_DOUBLE']">
38
+ <mover>
39
+ <mo>&#x21C4;</mo>
40
+ <xsl:apply-templates select="slot[1] | pile[1]"/>
41
+ </mover>
42
+ </xsl:template>
43
+
44
+ <xsl:template match="tmpl[selector='tmARROW' and (variation='tvAR_LEFT' and variation='tvAR_RIGHT' )]">
45
+ <mover>
46
+ <mo>&#x2194;</mo>
47
+ <xsl:apply-templates select="slot[1] | pile[1]"/>
48
+ </mover>
49
+ </xsl:template>
50
+
51
+ <xsl:template match="tmpl[selector='tmARROW' and variation='tvAR_LEFT' and variation='tvAR_TOPBOTTOM']">
52
+ <munderover>
53
+ <mo>&#x2190;</mo>
54
+ <xsl:apply-templates select="slot[2] | pile[2]"/>
55
+ <xsl:apply-templates select="slot[1] | pile[1]"/>
56
+ </munderover>
57
+ </xsl:template>
58
+
59
+
60
+ <xsl:template match="tmpl[selector='tmARROW' and variation='tvAR_DOUBLE' and variation='tvAR_TOPBOTTOM']">
61
+ <munderover>
62
+ <mo>&#x21C4;</mo>
63
+ <xsl:apply-templates select="slot[2] | pile[2]"/>
64
+ <xsl:apply-templates select="slot[1] | pile[1]"/>
65
+ </munderover>
66
+ </xsl:template>
67
+
68
+ <xsl:template match="tmpl[selector='tmARROW' and variation='tvAR_DOUBLE' and variation='tvAR_LOS']">
69
+ <mover>
70
+ <munder accentunder="true">
71
+ <mstyle scriptlevel="-1"><mo>&#x2192;</mo></mstyle>
72
+ <mstyle scriptlevel="+1"><mo>&#x2190;</mo></mstyle>
73
+ </munder>
74
+ <xsl:apply-templates select="slot[1] | pile[1]"/>
75
+ </mover>
76
+ </xsl:template>
77
+
78
+ <xsl:template match="tmpl[selector='tmARROW' and variation='tvAR_DOUBLE' and variation='tvAR_SOL']">
79
+ <mover>
80
+ <munder accentunder="true">
81
+ <mstyle scriptlevel="+1"><mo>&#x2192;</mo></mstyle>
82
+ <mstyle scriptlevel="-1"><mo>&#x2190;</mo></mstyle>
83
+ </munder>
84
+ <xsl:apply-templates select="slot[1] | pile[1]"/>
85
+ </mover>
86
+ </xsl:template>
87
+
88
+ <xsl:template match="tmpl[selector='tmARROW' and (variation='tvAR_DOUBLE' or variation='tvAR_HARPOON') and variation='tvAR_HARPOON']">
89
+ <mover>
90
+ <mo>&#x21CC;</mo>
91
+ <xsl:apply-templates select="slot[1] | pile[1]"/>
92
+ </mover>
93
+ </xsl:template>
94
+
95
+ <xsl:template match="tmpl[selector='tmARROW' and (variation='tvAR_LEFT' and variation='tvAR_RIGHT' ) and variation='tvAR_TOPBOTTOM']">
96
+ <munderover>
97
+ <mo>&#x2194;</mo>
98
+ <xsl:apply-templates select="slot[2] | pile[2]"/>
99
+ <xsl:apply-templates select="slot[1] | pile[1]"/>
100
+ </munderover>
101
+ </xsl:template>
102
+
103
+
104
+ <xsl:template match="tmpl[selector='tmARROW' and (variation='tvAR_DOUBLE' or variation='tvAR_HARPOON') and variation='tvAR_HARPOON']">
105
+ <mover>
106
+ <mo>&#x21CC;</mo>
107
+ <xsl:apply-templates select="slot[1] | pile[1]"/>
108
+ </mover>
109
+ </xsl:template>
110
+
111
+ <xsl:template match="tmpl[selector='tmARROW' and variation='tvAR_DOUBLE' and variation='tvAR_LOS' and variation='tvAR_TOPBOTTOM']">
112
+ <munderover accentunder="true">
113
+ <mstyle scriptlevel="-1"><mo>&#x2192;</mo></mstyle>
114
+ <munder>
115
+ <mstyle scriptlevel="+1"><mo>&#x2190;</mo></mstyle>
116
+ <xsl:apply-templates select="slot[2] | pile[2]"/>
117
+ </munder>
118
+ <xsl:apply-templates select="slot[1] | pile[1]"/>
119
+ </munderover>
120
+ </xsl:template>
121
+
122
+ <xsl:template match="tmpl[selector='tmARROW' and variation='tvAR_DOUBLE' and variation='tvAR_SOL' and variation='tvAR_TOPBOTTOM']">
123
+ <munderover accentunder="true">
124
+ <mstyle scriptlevel="+1"><mo>&#x2192;</mo></mstyle>
125
+ <munder>
126
+ <mstyle scriptlevel="-1"><mo>&#x2190;</mo></mstyle>
127
+ <xsl:apply-templates select="slot[2] | pile[2]"/>
128
+ </munder>
129
+ <xsl:apply-templates select="slot[1] | pile[1]"/>
130
+ </munderover>
131
+ </xsl:template>
132
+
133
+ <xsl:template match="tmpl[selector='tmARROW' and (variation='tvAR_DOUBLE' or variation='tvAR_HARPOON') and variation='tvAR_HARPOON' and variation='tvAR_SOL']">
134
+ <mover>
135
+ <munder accentunder="true">
136
+ <mstyle scriptlevel="+1"><mo>&#x21C0;</mo></mstyle>
137
+ <mstyle scriptlevel="-1"><mo>&#x21BD;</mo></mstyle>
138
+ </munder>
139
+ <xsl:apply-templates select="slot[1] | pile[1]"/>
140
+ </mover>
141
+ </xsl:template>
142
+
143
+ <xsl:template match="tmpl[selector='tmARROW' and (variation='tvAR_DOUBLE' or variation='tvAR_HARPOON') and variation='tvAR_HARPOON' and variation='tvAR_LOS']">
144
+ <mover>
145
+ <munder accentunder="true">
146
+ <mstyle scriptlevel="-1"><mo>&#x21C0;</mo></mstyle>
147
+ <mstyle scriptlevel="+1"><mo>&#x21BD;</mo></mstyle>
148
+ </munder>
149
+ <xsl:apply-templates select="slot[1] | pile[1]"/>
150
+ </mover>
151
+ </xsl:template>
152
+
153
+ <xsl:template match="tmpl[selector='tmARROW' and (variation='tvAR_DOUBLE' or variation='tvAR_HARPOON') and variation='tvAR_HARPOON' and variation='tvAR_TOPBOTTOM']">
154
+ <munderover>
155
+ <mo>&#x21CC;</mo>
156
+ <xsl:apply-templates select="slot[2] | pile[2]"/>
157
+ <xsl:apply-templates select="slot[1] | pile[1]"/>
158
+ </munderover>
159
+ </xsl:template>
160
+
161
+ <xsl:template match="tmpl[selector='tmARROW' and (variation='tvAR_DOUBLE' or variation='tvAR_HARPOON') and variation='tvAR_HARPOON' and variation='tvAR_LOS' and variation='tvAR_TOPBOTTOM']">
162
+ <munderover accentunder="true">
163
+ <mstyle scriptlevel="-1"><mo>&#x21C0;</mo></mstyle>
164
+ <munder>
165
+ <mstyle scriptlevel="+1"><mo>&#x21BD;</mo></mstyle>
166
+ <xsl:apply-templates select="slot[2] | pile[2]"/>
167
+ </munder>
168
+ <xsl:apply-templates select="slot[1] | pile[1]"/>
169
+ </munderover>
170
+ </xsl:template>
171
+
172
+ <xsl:template match="tmpl[selector='tmARROW' and (variation='tvAR_DOUBLE' or variation='tvAR_HARPOON') and variation='tvAR_HARPOON' and variation='tvAR_SOL' and variation='tvAR_TOPBOTTOM']">
173
+ <munderover accentunder="true">
174
+ <mstyle scriptlevel="+1"><mo>&#x21C0;</mo></mstyle>
175
+ <munder>
176
+ <mstyle scriptlevel="-1"><mo>&#x21BD;</mo></mstyle>
177
+ <xsl:apply-templates select="slot[2] | pile[2]"/>
178
+ </munder>
179
+ <xsl:apply-templates select="slot[1] | pile[1]"/>
180
+ </munderover>
181
+ </xsl:template>
182
+
183
+ <xsl:template match="tmpl[selector='tmARROW' and variation='tvAR_LEFT' and variation='tvAR_BOTTOM']">
184
+ <munder>
185
+ <mo>&#x2190;</mo>
186
+ <xsl:apply-templates select="slot[2] | pile[2]"/>
187
+ </munder>
188
+ </xsl:template>
189
+
190
+ <xsl:template match="tmpl[selector='tmARROW' and (variation='tvAR_LEFT' and variation='tvAR_RIGHT' ) and variation='tvAR_BOTTOM']">
191
+ <munder>
192
+ <mo>&#x2194;</mo>
193
+ <xsl:apply-templates select="slot[2] | pile[2]"/>
194
+ </munder>
195
+ </xsl:template>
196
+
197
+ <xsl:template match="tmpl[selector='tmARROW' and variation='tvAR_DOUBLE' and variation='tvAR_BOTTOM']">
198
+ <munder>
199
+ <mo>&#x21C4;</mo>
200
+ <xsl:apply-templates select="slot[2] | pile[2]"/>
201
+ </munder>
202
+ </xsl:template>
203
+
204
+ <xsl:template match="tmpl[selector='tmARROW' and variation='tvAR_DOUBLE' and variation='tvAR_LOS' and variation='tvAR_BOTTOM']">
205
+ <munder>
206
+ <munder accentunder="true">
207
+ <mstyle scriptlevel="-1"><mo>&#x2192;</mo></mstyle>
208
+ <mstyle scriptlevel="+1"><mo>&#x2190;</mo></mstyle>
209
+ </munder>
210
+ <xsl:apply-templates select="slot[2] | pile[2]"/>
211
+ </munder>
212
+ </xsl:template>
213
+
214
+ <xsl:template match="tmpl[selector='tmARROW' and variation='tvAR_DOUBLE' and variation='tvAR_SOL' and variation='tvAR_BOTTOM']">
215
+ <munder>
216
+ <munder accentunder="true">
217
+ <mstyle scriptlevel="+1"><mo>&#x2192;</mo></mstyle>
218
+ <mstyle scriptlevel="-1"><mo>&#x2190;</mo></mstyle>
219
+ </munder>
220
+ <xsl:apply-templates select="slot[2] | pile[2]"/>
221
+ </munder>
222
+ </xsl:template>
223
+
224
+ <xsl:template match="tmpl[selector='tmARROW' and (variation='tvAR_DOUBLE' or variation='tvAR_HARPOON') and variation='tvAR_HARPOON' and variation='tvAR_BOTTOM']">
225
+ <munder>
226
+ <mo>&#x21CC;</mo>
227
+ <xsl:apply-templates select="slot[2] | pile[2]"/>
228
+ </munder>
229
+ </xsl:template>
230
+
231
+ <xsl:template match="tmpl[selector='tmARROW' and (variation='tvAR_DOUBLE' or variation='tvAR_HARPOON') and variation='tvAR_HARPOON' and variation='tvAR_LOS' and variation='tvAR_BOTTOM']">
232
+ <munder>
233
+ <munder accentunder="true">
234
+ <mstyle scriptlevel="-1"><mo>&#x21C0;</mo></mstyle>
235
+ <mstyle scriptlevel="+1"><mo>&#x21BD;</mo></mstyle>
236
+ </munder>
237
+ <xsl:apply-templates select="slot[2] | pile[2]"/>
238
+ </munder>
239
+ </xsl:template>
240
+
241
+ <xsl:template match="tmpl[selector='tmARROW' and (variation='tvAR_DOUBLE' or variation='tvAR_HARPOON') and variation='tvAR_HARPOON' and variation='tvAR_SOL' and variation='tvAR_BOTTOM']">
242
+ <munder>
243
+ <munder accentunder="true">
244
+ <mstyle scriptlevel="+1"><mo>&#x21C0;</mo></mstyle>
245
+ <mstyle scriptlevel="-1"><mo>&#x21BD;</mo></mstyle>
246
+ </munder>
247
+ <xsl:apply-templates select="slot[2] | pile[2]"/>
248
+ </munder>
249
+ </xsl:template>
250
+
251
+ <xsl:template match="tmpl[selector='tmARROW' and variation='tvAR_LEFT' and variation='tvAR_BOTTOM']">
252
+ <munder>
253
+ <mo>&#x2190;</mo>
254
+ <xsl:apply-templates select="slot[2] | pile[2]"/>
255
+ </munder>
256
+ </xsl:template>
257
+
258
+ <xsl:template match="tmpl[selector='tmARROW' and (variation='tvAR_LEFT' and variation='tvAR_RIGHT' ) and variation='tvAR_BOTTOM']">
259
+ <munder>
260
+ <mo>&#x2194;</mo>
261
+ <xsl:apply-templates select="slot[2] | pile[2]"/>
262
+ </munder>
263
+ </xsl:template>
264
+
265
+ <xsl:template match="tmpl[selector='tmARROW' and variation='tvAR_DOUBLE' and variation='tvAR_BOTTOM']">
266
+ <munder>
267
+ <mo>&#x21C4;</mo>
268
+ <xsl:apply-templates select="slot[2] | pile[2]"/>
269
+ </munder>
270
+ </xsl:template>
271
+
272
+ <xsl:template match="tmpl[selector='tmARROW' and variation='tvAR_DOUBLE' and variation='tvAR_LOS' and variation='tvAR_BOTTOM']">
273
+ <munder>
274
+ <munder accentunder="true">
275
+ <mstyle scriptlevel="-1"><mo>&#x2192;</mo></mstyle>
276
+ <mstyle scriptlevel="+1"><mo>&#x2190;</mo></mstyle>
277
+ </munder>
278
+ <xsl:apply-templates select="slot[2] | pile[2]"/>
279
+ </munder>
280
+ </xsl:template>
281
+
282
+ <xsl:template match="tmpl[selector='tmARROW' and variation='tvAR_DOUBLE' and variation='tvAR_SOL' and variation='tvAR_BOTTOM']">
283
+ <munder>
284
+ <munder accentunder="true">
285
+ <mstyle scriptlevel="+1"><mo>&#x2192;</mo></mstyle>
286
+ <mstyle scriptlevel="-1"><mo>&#x2190;</mo></mstyle>
287
+ </munder>
288
+ <xsl:apply-templates select="slot[2] | pile[2]"/>
289
+ </munder>
290
+ </xsl:template>
291
+
292
+ <xsl:template match="tmpl[selector='tmARROW' and (variation='tvAR_DOUBLE' or variation='tvAR_HARPOON') and variation='tvAR_HARPOON' and variation='tvAR_BOTTOM']">
293
+ <munder>
294
+ <mo>&#x21CC;</mo>
295
+ <xsl:apply-templates select="slot[2] | pile[2]"/>
296
+ </munder>
297
+ </xsl:template>
298
+
299
+ <xsl:template match="tmpl[selector='tmARROW' and (variation='tvAR_DOUBLE' or variation='tvAR_HARPOON') and variation='tvAR_HARPOON' and variation='tvAR_LOS' and variation='tvAR_BOTTOM']">
300
+ <munder>
301
+ <munder accentunder="true">
302
+ <mstyle scriptlevel="-1"><mo>&#x21C0;</mo></mstyle>
303
+ <mstyle scriptlevel="+1"><mo>&#x21BD;</mo></mstyle>
304
+ </munder>
305
+ <xsl:apply-templates select="slot[2] | pile[2]"/>
306
+ </munder>
307
+ </xsl:template>
308
+
309
+ <xsl:template match="tmpl[selector='tmARROW' and (variation='tvAR_DOUBLE' or variation='tvAR_HARPOON') and variation='tvAR_HARPOON' and variation='tvAR_SOL' and variation='tvAR_BOTTOM']">
310
+ <munder>
311
+ <munder accentunder="true">
312
+ <mstyle scriptlevel="+1"><mo>&#x21C0;</mo></mstyle>
313
+ <mstyle scriptlevel="-1"><mo>&#x21BD;</mo></mstyle>
314
+ </munder>
315
+ <xsl:apply-templates select="slot[2] | pile[2]"/>
316
+ </munder>
317
+ </xsl:template>
318
+
319
+ </xsl:stylesheet>
data/lib/xsl/box.xsl ADDED
@@ -0,0 +1,42 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
3
+ xmlns:xs="http://www.w3.org/2001/XMLSchema"
4
+ exclude-result-prefixes="xs"
5
+ version="1.0">
6
+
7
+ <!-- Boxes -->
8
+
9
+ <xsl:template match="tmpl[selector='tmBOX' and (variation='tvBX_TOP' and variation='tvBX_LEFT')]">
10
+ <menclose notation="top left">
11
+ <xsl:apply-templates select="slot[1] | pile[1]"/>
12
+ </menclose>
13
+ </xsl:template>
14
+
15
+
16
+ <xsl:template match="tmpl[selector='tmBOX' and (variation='tvBX_TOP' and variation='tvBX_RIGHT')]">
17
+ <menclose notation="actuarial">
18
+ <xsl:apply-templates select="slot[1] | pile[1]"/>
19
+ </menclose>
20
+ </xsl:template>
21
+
22
+
23
+ <xsl:template match="tmpl[selector='tmBOX' and (variation='tvBX_BOTTOM' and variation='tvBX_LEFT')]">
24
+ <menclose notation="bottom left">
25
+ <xsl:apply-templates select="slot[1] | pile[1]"/>
26
+ </menclose>
27
+ </xsl:template>
28
+
29
+
30
+ <xsl:template match="tmpl[selector='tmBOX' and (variation='tvBX_BOTTOM' and variation='tvBX_RIGHT')]">
31
+ <menclose notation="bottom right">
32
+ <xsl:apply-templates select="slot[1] | pile[1]"/>
33
+ </menclose>
34
+ </xsl:template>
35
+
36
+ <xsl:template match="tmpl[selector='tmBOX' and variation='tvBX_TOP' and variation='tvBX_BOTTOM' and variation='tvBX_LEFT' and variation='tvBX_RIGHT']">
37
+ <menclose notation="box">
38
+ <xsl:apply-templates select="slot[1] | pile[1]"/>
39
+ </menclose>
40
+ </xsl:template>
41
+
42
+ </xsl:stylesheet>