mathtype_to_mathml 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (45) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +1 -0
  3. data/lib/mathtype_to_mathml.rb +1 -1
  4. data/lib/mathtype_to_mathml/char_replacer.rb +60 -5
  5. data/lib/mathtype_to_mathml/version.rb +1 -1
  6. data/lib/transform.xsl +20 -41
  7. data/lib/xsl/box.xsl +42 -0
  8. data/lib/xsl/char.xsl +1820 -1
  9. data/lib/xsl/fence.xsl +228 -0
  10. data/lib/xsl/frac.xsl +46 -0
  11. data/lib/xsl/int.xsl +622 -0
  12. data/lib/xsl/lim.xsl +32 -0
  13. data/lib/xsl/product_coproduct.xsl +107 -0
  14. data/lib/xsl/sum.xsl +24 -0
  15. data/mathtype_to_mathml.gemspec +1 -1
  16. data/spec/fixtures/expected/280.xml +122 -0
  17. data/spec/fixtures/expected/281.xml +61 -0
  18. data/spec/fixtures/expected/299.xml +70 -0
  19. data/spec/fixtures/expected/326.xml +173 -0
  20. data/spec/fixtures/expected/424.xml +425 -0
  21. data/spec/fixtures/expected/450.xml +174 -0
  22. data/spec/fixtures/expected/452.xml +166 -0
  23. data/spec/fixtures/expected/478.xml +303 -0
  24. data/spec/fixtures/expected/boxes.xml +22 -0
  25. data/spec/fixtures/expected/equation14.xml +54 -0
  26. data/spec/fixtures/expected/fences.xml +64 -0
  27. data/spec/fixtures/expected/integrals.xml +264 -0
  28. data/spec/fixtures/expected/sums.xml +36 -0
  29. data/spec/fixtures/expected/unions_and_intersections.xml +140 -0
  30. data/spec/fixtures/input/280.bin +0 -0
  31. data/spec/fixtures/input/281.bin +0 -0
  32. data/spec/fixtures/input/299.bin +0 -0
  33. data/spec/fixtures/input/326.bin +0 -0
  34. data/spec/fixtures/input/424.bin +0 -0
  35. data/spec/fixtures/input/450.bin +0 -0
  36. data/spec/fixtures/input/452.bin +0 -0
  37. data/spec/fixtures/input/478.bin +0 -0
  38. data/spec/fixtures/input/boxes.bin +0 -0
  39. data/spec/fixtures/input/equation14.bin +0 -0
  40. data/spec/fixtures/input/fences.bin +0 -0
  41. data/spec/fixtures/input/integrals.bin +0 -0
  42. data/spec/fixtures/input/sums.bin +0 -0
  43. data/spec/fixtures/input/unions_and_intersections.bin +0 -0
  44. metadata +66 -5
  45. data/lib/xsl/brace.xsl +0 -55
data/lib/xsl/fence.xsl ADDED
@@ -0,0 +1,228 @@
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
+ <!-- Fences -->
8
+ <xsl:template match="tmpl[selector='tmPAREN']">
9
+ <mrow>
10
+ <mo>(</mo>
11
+ <xsl:apply-templates select="slot[1]"/>
12
+ <mo>)</mo>
13
+ </mrow>
14
+ </xsl:template>
15
+
16
+ <xsl:template match="tmpl[selector='tmPAREN' and variation='tvFENCE_L' and not(variation='tvFENCE_R')]">
17
+ <mrow><mo>(</mo> <xsl:apply-templates select="slot[1]"/></mrow>
18
+ </xsl:template>
19
+
20
+ <xsl:template match="tmpl[selector='tmPAREN' and variation='tvFENCE_R' and not(variation='tvFENCE_L')]">
21
+ <mrow> <xsl:apply-templates select="slot[1]"/> <mo>)</mo></mrow>
22
+ </xsl:template>
23
+
24
+ <xsl:template match="tmpl[selector='tmBRACK']">
25
+ <mrow>
26
+ <mo>[</mo>
27
+ <xsl:apply-templates select="slot[1]"/>
28
+ <mo>]</mo>
29
+ </mrow>
30
+ </xsl:template>
31
+
32
+ <xsl:template match="tmpl[selector='tmBRACE']">
33
+ <mrow>
34
+ <mo>{</mo>
35
+ <xsl:apply-templates select="slot[1]"/>
36
+ <mo>}</mo>
37
+ </mrow>
38
+ </xsl:template>
39
+
40
+ <xsl:template match="tmpl[selector='tmANGLE']">
41
+ <mrow><mo>&#x2329;</mo> <xsl:apply-templates select="slot[1]"/> <mo>&#x232A;</mo></mrow>
42
+ </xsl:template>
43
+
44
+ <xsl:template match="tmpl[selector='tmANGLE' and variation='tvFENCE_L' and not(variation='tvFENCE_R')]">
45
+ <mrow>
46
+ <mo>&#x2329;</mo>
47
+ <xsl:apply-templates select="slot[1]"/>
48
+ </mrow>
49
+ </xsl:template>
50
+
51
+ <xsl:template match="tmpl[selector='tmANGLE' and variation='tvFENCE_R' and not(variation='tvFENCE_L')]">
52
+ <mrow>
53
+ <xsl:apply-templates select="slot[1]"/>
54
+ <mo>&#x232A;</mo>
55
+ </mrow>
56
+ </xsl:template>
57
+
58
+ <xsl:template match="tmpl[selector='tmBAR']">
59
+ <mrow><mo>|</mo> <xsl:apply-templates select="slot[1]"/> <mo>|</mo></mrow>
60
+ </xsl:template>
61
+
62
+ <xsl:template match="tmpl[selector='tmBAR' and variation='tvFENCE_L' and not(variation='tvFENCE_R')]">
63
+ <mrow>
64
+ <mo>|</mo>
65
+ <xsl:apply-templates select="slot[1]"/>
66
+ </mrow>
67
+ </xsl:template>
68
+
69
+ <xsl:template match="tmpl[selector='tmBAR' and variation='tvFENCE_R' and not(variation='tvFENCE_L')]">
70
+ <mrow>
71
+ <xsl:apply-templates select="slot[1]"/>
72
+ <mo>|</mo>
73
+ </mrow>
74
+ </xsl:template>
75
+
76
+ <xsl:template match="tmpl[selector='tmFLOOR']">
77
+ <mrow><mo>&#x230A;</mo> <xsl:apply-templates select="slot[1]"/> <mo>&#x230B;</mo></mrow>
78
+ </xsl:template>
79
+
80
+ <xsl:template match="tmpl[selector='tmCEILING']">
81
+ <mrow><mo>&#x2308;</mo> <xsl:apply-templates select="slot[1]"/> <mo>&#x2309;</mo></mrow>
82
+ </xsl:template>
83
+
84
+ <xsl:template match="tmpl[selector='tmINTERVAL' and variation='tvINTV_LBLB']">
85
+ <mrow> <mo>[</mo> <xsl:apply-templates select="slot[1]"/> <mo>[</mo> </mrow>
86
+ </xsl:template>
87
+
88
+ <xsl:template match="tmpl[selector='tmINTERVAL' and variation='tvINTV_RBRB']">
89
+ <mrow><mo>]</mo> <xsl:apply-templates select="slot[1]"/> <mo>]</mo></mrow>
90
+ </xsl:template>
91
+
92
+ <xsl:template match="tmpl[selector='tmINTERVAL' and variation='tvINTV_RBLB']">
93
+ <mrow><mo>]</mo> <xsl:apply-templates select="slot[1]"/> <mo>[</mo></mrow>
94
+ </xsl:template>
95
+
96
+ <xsl:template match="tmpl[selector='tmINTERVAL' and variation='tvINTV_LBRP']">
97
+ <mrow><mo>[</mo> <xsl:apply-templates select="slot[1]"/> <mo>)</mo></mrow>
98
+ </xsl:template>
99
+
100
+ <xsl:template match="tmpl[selector='tmINTERVAL' and variation='tvINTV_LPRB']">
101
+ <mrow><mo>(</mo> <xsl:apply-templates select="slot[1]"/> <mo>]</mo></mrow>
102
+ </xsl:template>
103
+
104
+ <xsl:template match="tmpl[selector='tmBRACK' and variation='tvFENCE_L' and not(variation='tvFENCE_R')]">
105
+ <mrow> <mo>[</mo> <xsl:apply-templates select="slot[1]"/> </mrow>
106
+ </xsl:template>
107
+
108
+ <xsl:template match="tmpl[selector='tmBRACK' and variation='tvFENCE_R' and not(variation='tvFENCE_L')]">
109
+ <mrow><xsl:apply-templates select="slot[1]"/> <mo>]</mo></mrow>
110
+ </xsl:template>
111
+
112
+ <xsl:template match="tmpl[selector='tmBRACE' and variation='tvFENCE_L' and not(variation='tvFENCE_R')]">
113
+ <mrow><mo>{</mo> <xsl:apply-templates select="slot[1]"/> </mrow>
114
+ </xsl:template>
115
+
116
+ <xsl:template match="tmpl[selector='tmBRACE' and variation='tvFENCE_R' and not(variation='tvFENCE_L')]">
117
+ <mrow><xsl:apply-templates select="slot[1]"/> <mo>}</mo></mrow>
118
+ </xsl:template>
119
+
120
+ <xsl:template match="tmpl[selector='tmDIRAC']">
121
+ <mrow>
122
+ <mo>&#x2329;</mo>
123
+ <xsl:apply-templates select="slot[1]"/>
124
+ <mo>|</mo>
125
+ <xsl:apply-templates select="slot[2]"/>
126
+ <mo>&#x232A;</mo>
127
+ </mrow>
128
+ </xsl:template>
129
+
130
+ <xsl:template match="tmpl[selector='tmDIRAC' and variation='tvDI_RIGHT' and not(variation='tvDI_LEFT')]">
131
+ <mrow>
132
+ <mo>|</mo>
133
+ <xsl:apply-templates select="slot[2]"/>
134
+ <mo>&#x232A;</mo>
135
+ </mrow>
136
+ </xsl:template>
137
+
138
+ <xsl:template match="tmpl[selector='tmDIRAC' and variation='tvDI_LEFT' and not(variation='tvDI_RIGHT')]">
139
+ <mrow>
140
+ <mo>&#x2329;</mo>
141
+ <xsl:apply-templates select="slot[1]"/>
142
+ <mo>|</mo>
143
+ </mrow>
144
+ </xsl:template>
145
+
146
+ <xsl:template match="tmpl[selector='tmDBAR']">
147
+ <mrow><mo>&#x2016;</mo> <xsl:apply-templates select="slot[1]"/> <mo>&#x2016;</mo></mrow>
148
+ </xsl:template>
149
+
150
+ <xsl:template match="tmpl[selector='tmDBAR' and variation='tvFENCE_L' and not(variation='tvFENCE_R')]">
151
+ <mrow>
152
+ <mo>&#x2016;</mo>
153
+ <xsl:apply-templates select="slot[1]"/>
154
+ </mrow>
155
+ </xsl:template>
156
+
157
+ <xsl:template match="tmpl[selector='tmDBAR' and variation='tvFENCE_R' and not(variation='tvFENCE_L')]">
158
+ <mrow>
159
+ <xsl:apply-templates select="slot[1]"/>
160
+ <mo>&#x2016;</mo>
161
+ </mrow>
162
+ </xsl:template>
163
+
164
+ <xsl:template match="tmpl[selector='tmOBRACK']">
165
+ <mrow>
166
+ <mo>&#x301A;</mo>
167
+ <xsl:apply-templates select="slot[1]"/>
168
+ <mo>&#x301B;</mo>
169
+ </mrow>
170
+ </xsl:template>
171
+
172
+ <xsl:template match="tmpl[selector='tmOBRACK' and variation='tvFENCE_L' and not(variation='tvFENCE_R')]">
173
+ <mrow>
174
+ <mo>&#x301A;</mo>
175
+ <xsl:apply-templates select="slot[1]"/>
176
+ </mrow>
177
+ </xsl:template>
178
+
179
+ <xsl:template match="tmpl[selector='tmOBRACK' and variation='tvFENCE_R' and not(variation='tvFENCE_L')]">
180
+ <mrow>
181
+ <xsl:apply-templates select="slot[1]"/>
182
+ <mo>&#x301B;</mo>
183
+ </mrow>
184
+ </xsl:template>
185
+
186
+ <xsl:template match="tmpl[selector='tmHBRACE']">
187
+ <munder>
188
+ <munder>
189
+ <xsl:apply-templates select="slot[1]"/>
190
+ <mo stretchy="true">&#xFE38;</mo>
191
+ </munder>
192
+ <xsl:apply-templates select="slot[2]"/>
193
+ </munder>
194
+ </xsl:template>
195
+
196
+ <xsl:template match="tmpl[selector='tmHBRACE' and variation='tvHB_TOP']">
197
+ <mover>
198
+ <mover>
199
+ <xsl:apply-templates select="slot[1]"/>
200
+ <mo stretchy="true">&#xFE37;</mo>
201
+ </mover>
202
+ <xsl:apply-templates select="slot[2]"/>
203
+ </mover>
204
+ </xsl:template>
205
+
206
+ <xsl:template match="tmpl[selector='tmHBRACK']">
207
+ <munder>
208
+ <munder>
209
+ <xsl:apply-templates select="slot[1]"/>
210
+ <mo stretchy="true">&#x23B5;</mo>
211
+ </munder>
212
+ <xsl:apply-templates select="slot[2]"/>
213
+ </munder>
214
+ </xsl:template>
215
+
216
+ <xsl:template match="tmpl[selector='tmHBRACK' and variation='tvHB_TOP']">
217
+ <mover>
218
+ <mover>
219
+ <xsl:apply-templates select="slot[1]"/>
220
+ <mo stretchy="true">&#x23B4;</mo>
221
+ </mover>
222
+ <xsl:apply-templates select="slot[2]"/>
223
+ </mover>
224
+ </xsl:template>
225
+
226
+
227
+
228
+ </xsl:stylesheet>
data/lib/xsl/frac.xsl ADDED
@@ -0,0 +1,46 @@
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
+ <!-- Fractions -->
8
+
9
+ <xsl:template match="tmpl[selector='tmFRACT']">
10
+ <mfrac>
11
+ <xsl:apply-templates select="slot[1]"/>
12
+ <xsl:apply-templates select="slot[2]"/>
13
+ </mfrac>
14
+ </xsl:template>
15
+
16
+ <xsl:template match="tmpl[selector='tmFRACT' and variation='tvFR_SLASH']">
17
+ <mfrac bevelled="true">
18
+ <xsl:apply-templates select="slot[1]"/>
19
+ <xsl:apply-templates select="slot[2]"/>
20
+ </mfrac>
21
+ </xsl:template>
22
+
23
+ <xsl:template match="tmpl[selector='tmFRACT' and variation='tvFR_SMALL']">
24
+ <mstyle scriptlevel="+1">
25
+ <mfrac>
26
+ <xsl:apply-templates select="slot[1]"/>
27
+ <xsl:apply-templates select="slot[2]"/>
28
+ </mfrac>
29
+ </mstyle>
30
+ </xsl:template>
31
+
32
+
33
+ <xsl:template match="tmpl[selector='tmFRACT' and variation='tvFR_SLASH' and variation='tvFR_BASE']">
34
+ <mrow><xsl:apply-templates select="slot[1]"/><mo>/</mo><xsl:apply-templates select="slot[2]"/></mrow>
35
+ </xsl:template>
36
+
37
+ <xsl:template match="tmpl[selector='tmFRACT' and variation='tvFR_SLASH' and variation='tvFR_SMALL']">
38
+ <mstyle scriptlevel="+1">
39
+ <mfrac bevelled="true">
40
+ <xsl:apply-templates select="slot[1]"/>
41
+ <xsl:apply-templates select="slot[2]"/>
42
+ </mfrac>
43
+ </mstyle>
44
+ </xsl:template>
45
+
46
+ </xsl:stylesheet>
data/lib/xsl/int.xsl ADDED
@@ -0,0 +1,622 @@
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
+ <!-- Integral operators -->
8
+ <!-- The order is important because it would be very messy to address all
9
+ conditions for each template, and so we rely on the fact that the
10
+ last matching rule has precedence -->
11
+
12
+ <xsl:template match="tmpl[selector='tmINTOP']">
13
+ <msubsup>
14
+ <mstyle mathsize="140%" displaystyle="true"><xsl:apply-templates select="slot[4]"/></mstyle>
15
+ <xsl:apply-templates select="slot[2]"/>
16
+ <xsl:apply-templates select="slot[3]"/>
17
+ </msubsup>
18
+ </xsl:template>
19
+
20
+ <xsl:template match="tmpl[selector='tmINTOP' and variation='tvBO_UPPER']">
21
+ <msup>
22
+ <mstyle mathsize="140%" displaystyle="true"><xsl:apply-templates select="slot[4]"/></mstyle>
23
+ <xsl:apply-templates select="slot[3]"/>
24
+ </msup>
25
+ </xsl:template>
26
+
27
+ <xsl:template match="tmpl[selector='tmINTOP' and variation='tvBO_LOWER' and not(variation='tvBO_UPPER')]">
28
+ <msub>
29
+ <mstyle mathsize="140%" displaystyle="true"><xsl:apply-templates select="slot[4]"/></mstyle>
30
+ <xsl:apply-templates select="slot[2]"/>
31
+ </msub>
32
+ </xsl:template>
33
+
34
+ <!-- Integrals -->
35
+
36
+ <xsl:template match="tmpl[selector='tmINTEG']">
37
+ <mstyle displaystyle="true">
38
+ <mrow>
39
+ <msubsup>
40
+ <mo>&#x222B;</mo>
41
+ <xsl:apply-templates select="slot[2]"/>
42
+ <xsl:apply-templates select="slot[3]"/>
43
+ </msubsup>
44
+ <xsl:apply-templates select="slot[1]"/>
45
+ </mrow>
46
+ </mstyle>
47
+ </xsl:template>
48
+
49
+ <xsl:template match="tmpl[selector='tmINTEG' and (not(variation='tvBO_UPPER') and not(variation='tvBO_LOWER'))]">
50
+ <mstyle displaystyle="true">
51
+ <mrow><mo>&#x222B;</mo>
52
+ <xsl:apply-templates select="slot[1]"/>
53
+ </mrow>
54
+ </mstyle>
55
+ </xsl:template>
56
+
57
+ <xsl:template match="tmpl[selector='tmINTEG' and variation='tvBO_SUM']">
58
+ <mstyle displaystyle="true">
59
+ <mrow>
60
+ <munderover>
61
+ <mo>&#x222B;</mo>
62
+ <xsl:apply-templates select="slot[2]"/>
63
+ <xsl:apply-templates select="slot[3]"/>
64
+ </munderover>
65
+ <xsl:apply-templates select="slot[1]"/>
66
+ </mrow>
67
+ </mstyle>
68
+ </xsl:template>
69
+
70
+ <xsl:template match="tmpl[selector='tmINTEG' and variation='tvINT_EXPAND']">
71
+ <mstyle displaystyle="true">
72
+ <mrow>
73
+ <msubsup>
74
+ <mo stretchy="true">&#x222B;</mo>
75
+ <xsl:apply-templates select="slot[2]"/>
76
+ <xsl:apply-templates select="slot[3]"/>
77
+ </msubsup>
78
+ <xsl:apply-templates select="slot[1]"/>
79
+ </mrow>
80
+ </mstyle>
81
+ </xsl:template>
82
+
83
+ <xsl:template match="tmpl[selector='tmINTEG' and variation='tvINT_1' and variation='tvBO_LOWER' and not(variation='tvBO_UPPER')]">
84
+ <mstyle displaystyle="true">
85
+ <mrow>
86
+ <msub>
87
+ <mo>&#x222B;</mo>
88
+ <xsl:apply-templates select="slot[2]"/>
89
+ </msub>
90
+ <xsl:apply-templates select="slot[1]"/>
91
+ </mrow>
92
+ </mstyle>
93
+ </xsl:template>
94
+
95
+ <xsl:template match="tmpl[selector='tmINTEG' and variation='tvINT_2']">
96
+ <mstyle displaystyle="true">
97
+ <mrow>
98
+ <msub>
99
+ <mo>&#x222C;</mo>
100
+ <xsl:apply-templates select="slot[2]"/>
101
+ </msub>
102
+ <xsl:apply-templates select="slot[1]"/>
103
+ </mrow>
104
+ </mstyle>
105
+ </xsl:template>
106
+
107
+ <xsl:template match="tmpl[selector='tmINTEG' and variation='tvINT_2' and (not(variation='tvBO_UPPER') and not(variation='tvBO_LOWER'))]">
108
+ <mstyle displaystyle="true">
109
+ <mrow>
110
+ <mo>&#x222C;</mo>
111
+ <xsl:apply-templates select="slot[1]"/>
112
+ </mrow>
113
+ </mstyle>
114
+ </xsl:template>
115
+
116
+ <xsl:template match="tmpl[selector='tmINTEG' and variation='tvINT_3']">
117
+ <mstyle displaystyle="true">
118
+ <mrow>
119
+ <msub>
120
+ <mo>&#x222D;</mo>
121
+ <xsl:apply-templates select="slot[2]"/>
122
+ </msub>
123
+ <xsl:apply-templates select="slot[1]"/>
124
+ </mrow>
125
+ </mstyle>
126
+ </xsl:template>
127
+
128
+ <xsl:template match="tmpl[selector='tmINTEG' and variation='tvINT_LOOP']">
129
+ <mstyle displaystyle="true">
130
+ <mrow>
131
+ <msub>
132
+ <mo>&#x222E;</mo>
133
+ <xsl:apply-templates select="slot[2]"/>
134
+ </msub>
135
+ <xsl:apply-templates select="slot[1]"/>
136
+ </mrow>
137
+ </mstyle>
138
+ </xsl:template>
139
+
140
+ <xsl:template match="tmpl[selector='tmINTEG' and variation='tvINT_CW_LOOP']">
141
+ <mstyle displaystyle="true">
142
+ <mrow>
143
+ <msub>
144
+ <mo>&#x2232;</mo>
145
+ <xsl:apply-templates select="slot[2]"/>
146
+ </msub>
147
+ <xsl:apply-templates select="slot[1]"/>
148
+ </mrow>
149
+ </mstyle>
150
+ </xsl:template>
151
+
152
+ <xsl:template match="tmpl[selector='tmINTEG' and variation='tvINT_CCW_LOOP']">
153
+ <mstyle displaystyle="true">
154
+ <mrow>
155
+ <msub>
156
+ <mo>&#x2233;</mo>
157
+ <xsl:apply-templates select="slot[2]"/>
158
+ </msub>
159
+ <xsl:apply-templates select="slot[1]"/>
160
+ </mrow>
161
+ </mstyle>
162
+ </xsl:template>
163
+
164
+ <xsl:template match="tmpl[selector='tmINTEG' and variation='tvINT_LOOP' and (not(variation='tvBO_UPPER') and not(variation='tvBO_LOWER'))]">
165
+ <mstyle displaystyle="true">
166
+ <mrow>
167
+ <mo>&#x222E;</mo>
168
+ <xsl:apply-templates select="slot[1]"/>
169
+ </mrow>
170
+ </mstyle>
171
+ </xsl:template>
172
+
173
+ <xsl:template match="tmpl[selector='tmINTEG' and variation='tvBO_SUM' and variation='tvBO_LOWER' and not(variation='tvBO_UPPER')]">
174
+ <mstyle displaystyle="true">
175
+ <mrow>
176
+ <munder>
177
+ <mo>&#x222B;</mo>
178
+ <xsl:apply-templates select="slot[2]"/>
179
+ </munder>
180
+ <xsl:apply-templates select="slot[1]"/>
181
+ </mrow>
182
+ </mstyle>
183
+ </xsl:template>
184
+
185
+ <xsl:template match="tmpl[selector='tmINTEG' and variation='tvINT_EXPAND' and variation='tvBO_SUM']">
186
+ <mstyle displaystyle="true">
187
+ <mrow>
188
+ <munderover>
189
+ <mo stretchy="true">&#x222B;</mo>
190
+ <xsl:apply-templates select="slot[2]"/>
191
+ <xsl:apply-templates select="slot[3]"/>
192
+ </munderover>
193
+ <xsl:apply-templates select="slot[1]"/>
194
+ </mrow>
195
+ </mstyle>
196
+ </xsl:template>
197
+
198
+ <xsl:template match="tmpl[selector='tmINTEG' and variation='tvINT_2' and variation='tvBO_SUM']">
199
+ <mstyle displaystyle="true">
200
+ <mrow>
201
+ <munder>
202
+ <mo>&#x222C;</mo>
203
+ <xsl:apply-templates select="slot[2]"/>
204
+ </munder>
205
+ <xsl:apply-templates select="slot[1]"/>
206
+ </mrow>
207
+ </mstyle>
208
+ </xsl:template>
209
+
210
+ <xsl:template match="tmpl[selector='tmINTEG' and variation='tvINT_2' and variation='tvINT_LOOP']">
211
+ <mstyle displaystyle="true">
212
+ <mrow>
213
+ <msub>
214
+ <mo>&#x222F;</mo>
215
+ <xsl:apply-templates select="slot[2]"/>
216
+ </msub>
217
+ <xsl:apply-templates select="slot[1]"/>
218
+ </mrow>
219
+ </mstyle>
220
+ </xsl:template>
221
+
222
+ <xsl:template match="tmpl[selector='tmINTEG' and variation='tvINT_2' and variation='tvINT_EXPAND']">
223
+ <mstyle displaystyle="true">
224
+ <mrow>
225
+ <msub>
226
+ <mo stretchy="true">&#x222C;</mo>
227
+ <xsl:apply-templates select="slot[2]"/>
228
+ </msub>
229
+ <xsl:apply-templates select="slot[1]"/>
230
+ <xsl:apply-templates select="slot[1]"/>
231
+ </mrow>
232
+
233
+ </mstyle>
234
+ </xsl:template>
235
+
236
+ <xsl:template match="tmpl[selector='tmINTEG' and variation='tvINT_2' and variation='tvINT_EXPAND' and variation='tvBO_SUM']">
237
+ <mstyle displaystyle="true">
238
+ <mrow>
239
+ <munder>
240
+ <mo stretchy="true">&#x222C;</mo>
241
+ <xsl:apply-templates select="slot[2]"/>
242
+ </munder>
243
+ <xsl:apply-templates select="slot[1]"/>
244
+ </mrow>
245
+ </mstyle>
246
+ </xsl:template>
247
+
248
+
249
+ <xsl:template match="tmpl[selector='tmINTEG' and variation='tvINT_LOOP' and variation='tvBO_SUM']">
250
+ <mstyle displaystyle="true">
251
+ <mrow>
252
+ <munder>
253
+ <mo>&#x222E;</mo>
254
+ <xsl:apply-templates select="slot[2]"/>
255
+ </munder>
256
+ <xsl:apply-templates select="slot[1]"/>
257
+ </mrow>
258
+ </mstyle>
259
+ </xsl:template>
260
+
261
+ <xsl:template match="tmpl[selector='tmINTEG' and variation='tvINT_CW_LOOP' and variation='tvBO_SUM']">
262
+ <mstyle displaystyle="true">
263
+ <mrow>
264
+ <munder>
265
+ <mo>&#x2232;</mo>
266
+ <xsl:apply-templates select="slot[2]"/>
267
+ </munder>
268
+ <xsl:apply-templates select="slot[1]"/>
269
+ </mrow>
270
+ </mstyle>
271
+ </xsl:template>
272
+
273
+ <xsl:template match="tmpl[selector='tmINTEG' and variation='tvINT_CCW_LOOP' and variation='tvBO_SUM']">
274
+ <mstyle displaystyle="true">
275
+ <mrow>
276
+ <munder>
277
+ <mo>&#x2233;</mo>
278
+ <xsl:apply-templates select="slot[2]"/>
279
+ </munder>
280
+ <xsl:apply-templates select="slot[1]"/>
281
+ </mrow>
282
+ </mstyle>
283
+ </xsl:template>
284
+
285
+ <xsl:template match="tmpl[selector='tmINTEG' and variation='tvINT_3' and variation='tvBO_SUM']">
286
+ <mstyle displaystyle="true">
287
+ <mrow>
288
+ <munder>
289
+ <mo>&#x222D;</mo>
290
+ <xsl:apply-templates select="slot[2]"/>
291
+ </munder>
292
+ <xsl:apply-templates select="slot[1]"/>
293
+ </mrow>
294
+ </mstyle>
295
+ </xsl:template>
296
+
297
+ <xsl:template match="tmpl[selector='tmINTEG' and variation='tvINT_3' and variation='tvINT_LOOP']">
298
+ <mstyle displaystyle="true">
299
+ <mrow>
300
+ <msub>
301
+ <mo>&#x2230;</mo>
302
+ <xsl:apply-templates select="slot[2]"/>
303
+ </msub>
304
+ <xsl:apply-templates select="slot[1]"/>
305
+ </mrow>
306
+ </mstyle>
307
+ </xsl:template>
308
+
309
+ <xsl:template match="tmpl[selector='tmINTEG' and variation='tvINT_3' and variation='tvINT_EXPAND']">
310
+ <mstyle displaystyle="true">
311
+ <mrow>
312
+ <msub>
313
+ <mo stretchy="true">&#x222D;</mo>
314
+ <xsl:apply-templates select="slot[2]"/>
315
+ </msub>
316
+ <xsl:apply-templates select="slot[1]"/>
317
+ </mrow>
318
+ </mstyle>
319
+ </xsl:template>
320
+
321
+ <xsl:template match="tmpl[selector='tmINTEG' and variation='tvINT_EXPAND' and variation='tvINT_CW_LOOP']">
322
+ <mstyle displaystyle="true">
323
+ <mrow>
324
+ <msub>
325
+ <mo stretchy="true">&#x2232;</mo>
326
+ <xsl:apply-templates select="slot[2]"/>
327
+ </msub>
328
+ <xsl:apply-templates select="slot[1]"/>
329
+ </mrow>
330
+ </mstyle>
331
+ </xsl:template>
332
+
333
+ <xsl:template match="tmpl[selector='tmINTEG' and variation='tvINT_EXPAND' and variation='tvINT_CCW_LOOP']">
334
+ <mstyle displaystyle="true">
335
+ <mrow>
336
+ <msub>
337
+ <mo stretchy="true">&#x2233;</mo>
338
+ <xsl:apply-templates select="slot[2]"/>
339
+ </msub>
340
+ <xsl:apply-templates select="slot[1]"/>
341
+ </mrow>
342
+ </mstyle>
343
+ </xsl:template>
344
+
345
+
346
+ <xsl:template match="tmpl[selector='tmINTEG' and variation='tvINT_EXPAND' and variation='tvINT_LOOP']">
347
+ <mstyle displaystyle="true">
348
+ <mrow>
349
+ <msub>
350
+ <mo stretchy="true">&#x222E;</mo>
351
+ <xsl:apply-templates select="slot[2]"/>
352
+ </msub>
353
+ <xsl:apply-templates select="slot[1]"/>
354
+ </mrow>
355
+ </mstyle>
356
+ </xsl:template>
357
+
358
+ <xsl:template match="tmpl[selector='tmINTEG' and variation='tvINT_2' and variation='tvINT_LOOP' and variation='tvBO_SUM']">
359
+ <mstyle displaystyle="true">
360
+ <mrow>
361
+ <munder>
362
+ <mo>&#x222F;</mo>
363
+ <xsl:apply-templates select="slot[2]"/>
364
+ </munder>
365
+ <xsl:apply-templates select="slot[1]"/>
366
+ </mrow>
367
+ </mstyle>
368
+ </xsl:template>
369
+
370
+ <xsl:template match="tmpl[selector='tmINTEG' and variation='tvINT_2' and variation='tvINT_EXPAND' and variation='tvINT_LOOP']">
371
+ <mstyle displaystyle="true">
372
+ <mrow>
373
+ <msub>
374
+ <mo stretchy="true">&#x222F;</mo>
375
+ <xsl:apply-templates select="slot[2]"/>
376
+ </msub>
377
+ <xsl:apply-templates select="slot[1]"/>
378
+ </mrow>
379
+ </mstyle>
380
+ </xsl:template>
381
+
382
+ <xsl:template match="tmpl[selector='tmINTEG' and variation='tvINT_2' and variation='tvINT_LOOP' and (not(variation='tvBO_UPPER') and not(variation='tvBO_LOWER'))]">
383
+ <mstyle displaystyle="true">
384
+ <mrow>
385
+ <mo>&#x222F;</mo>
386
+ <xsl:apply-templates select="slot[1]"/>
387
+ </mrow>
388
+ </mstyle>
389
+ </xsl:template>
390
+
391
+ <xsl:template match="tmpl[selector='tmINTEG' and variation='tvINT_3' and (not(variation='tvBO_UPPER') and not(variation='tvBO_LOWER'))]">
392
+ <mstyle displaystyle="true">
393
+ <mrow>
394
+ <mo>&#x222D;</mo>
395
+ <xsl:apply-templates select="slot[1]"/>
396
+ </mrow>
397
+ </mstyle>
398
+ </xsl:template>
399
+
400
+ <xsl:template match="tmpl[selector='tmINTEG' and variation='tvINT_3' and variation='tvINT_EXPAND' and variation='tvBO_SUM']">
401
+ <mstyle displaystyle="true">
402
+ <mrow>
403
+ <munder>
404
+ <mo stretchy="true">&#x222D;</mo>
405
+ <xsl:apply-templates select="slot[2]"/>
406
+ </munder>
407
+ <xsl:apply-templates select="slot[1]"/>
408
+ </mrow>
409
+ </mstyle>
410
+ </xsl:template>
411
+
412
+ <xsl:template match="tmpl[selector='tmINTEG' and variation='tvINT_3' and variation='tvINT_LOOP' and variation='tvBO_SUM']">
413
+ <mstyle displaystyle="true">
414
+ <mrow>
415
+ <munder>
416
+ <mo>&#x2230;</mo>
417
+ <xsl:apply-templates select="slot[2]"/>
418
+ </munder>
419
+ <xsl:apply-templates select="slot[1]"/>
420
+ </mrow>
421
+ </mstyle>
422
+ </xsl:template>
423
+
424
+ <xsl:template match="tmpl[selector='tmINTEG' and variation='tvINT_3' and variation='tvINT_EXPAND' and variation='tvINT_LOOP']">
425
+ <mstyle displaystyle="true">
426
+ <mrow>
427
+ <msub>
428
+ <mo stretchy="true">&#x2230;</mo>
429
+ <xsl:apply-templates select="slot[2]"/>
430
+ </msub>
431
+ <xsl:apply-templates select="slot[1]"/>
432
+ </mrow>
433
+ </mstyle>
434
+ </xsl:template>
435
+
436
+
437
+ <xsl:template match="tmpl[selector='tmINTEG' and variation='tvINT_CW_LOOP' and (not(variation='tvBO_UPPER') and not(variation='tvBO_LOWER'))]">
438
+ <mstyle displaystyle="true">
439
+ <mrow>
440
+ <mo>&#x2232;</mo>
441
+ <xsl:apply-templates select="slot[1]"/>
442
+ </mrow>
443
+ </mstyle>
444
+ </xsl:template>
445
+
446
+ <xsl:template match="tmpl[selector='tmINTEG' and variation='tvINT_CCW_LOOP' and (not(variation='tvBO_UPPER') and not(variation='tvBO_LOWER'))]">
447
+ <mstyle displaystyle="true">
448
+ <mrow>
449
+ <mo>&#x2233;</mo>
450
+ <xsl:apply-templates select="slot[1]"/>
451
+ </mrow>
452
+ </mstyle>
453
+ </xsl:template>
454
+
455
+ <xsl:template match="tmpl[selector='tmINTEG' and variation='tvINT_EXPAND' and variation='tvBO_LOWER' and not(variation='tvBO_UPPER')]">
456
+ <mstyle displaystyle="true">
457
+ <mrow>
458
+ <msub>
459
+ <mo stretchy="true">&#x222B;</mo>
460
+ <xsl:apply-templates select="slot[2]"/>
461
+ </msub>
462
+ <xsl:apply-templates select="slot[1]"/>
463
+ </mrow>
464
+ </mstyle>
465
+ </xsl:template>
466
+
467
+ <xsl:template match="tmpl[selector='tmINTEG' and variation='tvINT_EXPAND' and variation='tvINT_LOOP' and variation='tvBO_SUM']">
468
+ <mstyle displaystyle="true">
469
+ <mrow>
470
+ <munder>
471
+ <mo stretchy="true">&#x222E;</mo>
472
+ <xsl:apply-templates select="slot[2]"/>
473
+ </munder>
474
+ <xsl:apply-templates select="slot[1]"/>
475
+ </mrow>
476
+ </mstyle>
477
+ </xsl:template>
478
+
479
+ <xsl:template match="tmpl[selector='tmINTEG' and variation='tvINT_EXPAND' and variation='tvINT_CCW_LOOP' and variation='tvBO_SUM']">
480
+ <mstyle displaystyle="true">
481
+ <mrow>
482
+ <munder>
483
+ <mo stretchy="true">&#x2233;</mo>
484
+ <xsl:apply-templates select="slot[2]"/>
485
+ </munder>
486
+ <xsl:apply-templates select="slot[1]"/>
487
+ </mrow>
488
+ </mstyle>
489
+ </xsl:template>
490
+
491
+ <xsl:template match="tmpl[selector='tmINTEG' and variation='tvINT_EXPAND' and variation='tvINT_CW_LOOP' and variation='tvBO_SUM']">
492
+ <mstyle displaystyle="true">
493
+ <mrow>
494
+ <munder>
495
+ <mo stretchy="true">&#x2232;</mo>
496
+ <xsl:apply-templates select="slot[2]"/>
497
+ </munder>
498
+ <xsl:apply-templates select="slot[1]"/>
499
+ </mrow>
500
+ </mstyle>
501
+ </xsl:template>
502
+
503
+ <xsl:template match="tmpl[selector='tmINTEG' and variation='tvINT_EXPAND' and (not(variation='tvBO_UPPER') and not(variation='tvBO_LOWER'))]">
504
+ <mstyle displaystyle="true">
505
+ <mrow>
506
+ <mo stretchy="true">&#x222B;</mo>
507
+ <xsl:apply-templates select="slot[1]"/>
508
+ </mrow>
509
+ </mstyle>
510
+ </xsl:template>
511
+
512
+ <xsl:template match="tmpl[selector='tmINTEG' and variation='tvINT_2' and variation='tvINT_EXPAND' and (not(variation='tvBO_UPPER') and not(variation='tvBO_LOWER'))]">
513
+ <mstyle displaystyle="true">
514
+ <mrow>
515
+ <mo stretchy="true">&#x222C;</mo>
516
+ <xsl:apply-templates select="slot[1]"/>
517
+ </mrow>
518
+ </mstyle>
519
+ </xsl:template>
520
+
521
+ <xsl:template match="tmpl[selector='tmINTEG' and variation='tvINT_3' and variation='tvINT_EXPAND' and (not(variation='tvBO_UPPER') and not(variation='tvBO_LOWER'))]">
522
+ <mstyle displaystyle="true">
523
+ <mrow>
524
+ <mo stretchy="true">&#x222D;</mo>
525
+ <xsl:apply-templates select="slot[1]"/>
526
+ </mrow>
527
+ </mstyle>
528
+ </xsl:template>
529
+
530
+ <xsl:template match="tmpl[selector='tmINTEG' and variation='tvINT_EXPAND' and variation='tvBO_SUM' and variation='tvBO_LOWER' and not(variation='tvBO_UPPER')]">
531
+ <mstyle displaystyle="true">
532
+ <mrow>
533
+ <munder>
534
+ <mo stretchy="true">&#x222B;</mo>
535
+ <xsl:apply-templates select="slot[2]"/>
536
+ </munder>
537
+ <xsl:apply-templates select="slot[1]"/>
538
+ </mrow>
539
+ </mstyle>
540
+ </xsl:template>
541
+
542
+ <xsl:template match="tmpl[selector='tmINTEG' and variation='tvINT_3' and variation='tvINT_LOOP' and (not(variation='tvBO_UPPER') and not(variation='tvBO_LOWER'))]">
543
+ <mstyle displaystyle="true">
544
+ <mrow>
545
+ <mo>&#x2230;</mo>
546
+ <xsl:apply-templates select="slot[1]"/>
547
+ </mrow>
548
+ </mstyle>
549
+ </xsl:template>
550
+
551
+ <xsl:template match="tmpl[selector='tmINTEG' and variation='tvINT_3' and variation='tvINT_EXPAND' and variation='tvINT_LOOP' and variation='tvBO_SUM']">
552
+ <mstyle displaystyle="true">
553
+ <mrow>
554
+ <munder>
555
+ <mo stretchy="true">&#x2230;</mo>
556
+ <xsl:apply-templates select="slot[2]"/>
557
+ </munder>
558
+ <xsl:apply-templates select="slot[1]"/>
559
+ </mrow>
560
+ </mstyle>
561
+ </xsl:template>
562
+
563
+ <xsl:template match="tmpl[selector='tmINTEG' and variation='tvINT_EXPAND' and variation='tvINT_CCW_LOOP' and (not(variation='tvBO_UPPER') and not(variation='tvBO_LOWER'))]">
564
+ <mstyle displaystyle="true">
565
+ <mrow>
566
+ <mo stretchy="true">&#x2233;</mo>
567
+ <xsl:apply-templates select="slot[1]"/>
568
+ </mrow>
569
+ </mstyle>
570
+ </xsl:template>
571
+
572
+
573
+ <xsl:template match="tmpl[selector='tmINTEG' and variation='tvINT_EXPAND' and variation='tvINT_LOOP' and (not(variation='tvBO_UPPER') and not(variation='tvBO_LOWER'))]">
574
+ <mstyle displaystyle="true">
575
+ <mrow>
576
+ <mo stretchy="true">&#x222E;</mo>
577
+ <xsl:apply-templates select="slot[1]"/>
578
+ </mrow>
579
+ </mstyle>
580
+ </xsl:template>
581
+
582
+
583
+ <xsl:template match="tmpl[selector='tmINTEG' and variation='tvINT_2' and variation='tvINT_EXPAND' and variation='tvINT_LOOP' and variation='tvBO_SUM']">
584
+ <mstyle displaystyle="true">
585
+ <mrow>
586
+ <munder>
587
+ <mo stretchy="true">&#x222F;</mo>
588
+ <xsl:apply-templates select="slot[2]"/>
589
+ </munder>
590
+ <xsl:apply-templates select="slot[1]"/>
591
+ </mrow>
592
+ </mstyle>
593
+ </xsl:template>
594
+
595
+ <xsl:template match="tmpl[selector='tmINTEG' and variation='tvINT_EXPAND' and variation='tvINT_CW_LOOP' and (not(variation='tvBO_UPPER') and not(variation='tvBO_LOWER'))]">
596
+ <mstyle displaystyle="true">
597
+ <mrow>
598
+ <mo stretchy="true">&#x2232;</mo>
599
+ <xsl:apply-templates select="slot[1]"/>
600
+ </mrow>
601
+ </mstyle>
602
+ </xsl:template>
603
+
604
+
605
+ <xsl:template match="tmpl[selector='tmINTEG' and variation='tvINT_2' and variation='tvINT_EXPAND' and variation='tvINT_LOOP' and (not(variation='tvBO_UPPER') and not(variation='tvBO_LOWER'))]">
606
+ <mstyle displaystyle="true">
607
+ <mrow>
608
+ <mo stretchy="true">&#x222F;</mo>
609
+ <xsl:apply-templates select="slot[1]"/>
610
+ </mrow>
611
+ </mstyle>
612
+ </xsl:template>
613
+
614
+ <xsl:template match="tmpl[selector='tmINTEG' and variation='tvINT_3' and variation='tvINT_EXPAND' and variation='tvINT_LOOP' and (not(variation='tvBO_UPPER') and not(variation='tvBO_LOWER'))]">
615
+ <mstyle displaystyle="true">
616
+ <mrow>
617
+ <mo stretchy="true">&#x2230;</mo>
618
+ <xsl:apply-templates select="slot[1]"/>
619
+ </mrow>
620
+ </mstyle>
621
+ </xsl:template>
622
+ </xsl:stylesheet>