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,116 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!--
3
+ // =====================================================
4
+ // Matrices
5
+ // =====================================================
6
+
7
+ // matrix translation (left, center, right)
8
+ matrix/l = "<(ns)mtable columnalign='left'>$+$n#$-$n</(ns)mtable>";
9
+ matrix = "<(ns)mtable>$+$n#$-$n</(ns)mtable>";
10
+ matrix/r = "<(ns)mtable columnalign='right'>$+$n#$-$n</(ns)mtable>";
11
+
12
+ // matrix line translation (left, center, right)
13
+ matrow/l = "<(ns)mtr columnalign='left'>$+$n#$-$n</(ns)mtr>$n";
14
+ matrow = "<(ns)mtr>$+$n#$-$n</(ns)mtr>$n";
15
+ matrow/r = "<(ns)mtr columnalign='right'>$+$n#$-$n</(ns)mtr>$n";
16
+
17
+ // matrix element translation (except for last element) (left, center, right)
18
+ matelem/l = "<(ns)mtd columnalign='left'>$+$n#$-$n</(ns)mtd>$n";
19
+ matelem = "<(ns)mtd>$+$n#$-$n</(ns)mtd>$n";
20
+ matelem/r = "<(ns)mtd columnalign='right'>$+$n#$-$n</(ns)mtd>$n";
21
+
22
+ // matrix element translation (last element only) (left, center, right)
23
+ matelem/last/l = "<(ns)mtd columnalign='left'>$+$n#$-$n</(ns)mtd>";
24
+ matelem/last = "<(ns)mtd>$+$n#$-$n</(ns)mtd>";
25
+ matelem/last/r = "<(ns)mtd columnalign='right'>$+$n#$-$n</(ns)mtd>";
26
+ -->
27
+
28
+
29
+ <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
30
+ xmlns:xs="http://www.w3.org/2001/XMLSchema"
31
+ exclude-result-prefixes="xs"
32
+ version="1.0">
33
+
34
+ <!-- Matrices TODO -->
35
+ <xsl:template match="matrix">
36
+ <mtable columnalign="left">
37
+ <xsl:variable name="rows" select="number(rows)"/>
38
+
39
+ <xsl:apply-templates select="slot[position() mod $rows = 1]" mode="rows" />
40
+ </mtable>
41
+ </xsl:template>
42
+
43
+ <!--
44
+
45
+ <xsl:template match="matrix">
46
+ <mtable>
47
+ <xsl:apply-templates select="slot[1]"/>
48
+ </mtable>
49
+ </xsl:template>
50
+
51
+ <xsl:template match="matrix">
52
+ <mtable columnalign="right">
53
+ <xsl:apply-templates select="slot[1]"/>
54
+ </mtable>
55
+ </xsl:template>
56
+
57
+ -->
58
+
59
+ <xsl:template name="matrow" match="slot" mode="rows">
60
+ <xsl:variable name="rows" select="number(parent::*/rows)"/>
61
+ <mtr columnalign="left">
62
+ <xsl:apply-templates select="." mode="columns" />
63
+ <xsl:apply-templates select="following-sibling::slot[position() &lt; $rows]" mode="columns" />
64
+ </mtr>
65
+ </xsl:template>
66
+
67
+ <!--
68
+ <xsl:template match="matrow">
69
+ <mtr>
70
+ <xsl:apply-templates select="slot[1]"/>
71
+ </mtr>
72
+ </xsl:template>
73
+
74
+ <xsl:template match="matrow">
75
+ <mtr columnalign="right">
76
+ <xsl:apply-templates select="slot[1]"/>
77
+ </mtr>
78
+ </xsl:template>
79
+ -->
80
+
81
+ <xsl:template name="matelem" match="slot" mode="columns">
82
+ <mtd columnalign="left">
83
+ <xsl:apply-templates />
84
+ </mtd>
85
+ </xsl:template>
86
+
87
+ <!-- <xsl:template match="matelem">
88
+ <mtd>
89
+ <xsl:apply-templates select="slot[1]"/>
90
+ </mtd>
91
+ </xsl:template>
92
+
93
+ <xsl:template match="matelem">
94
+ <mtd columnalign="right">
95
+ <xsl:apply-templates select="slot[1]"/>
96
+ </mtd>
97
+ </xsl:template>
98
+
99
+ <xsl:template match="matelem">
100
+ <mtd columnalign="left">
101
+ <xsl:apply-templates select="slot[1]"/>
102
+ </mtd>
103
+ </xsl:template>
104
+
105
+ <xsl:template match="matelem">
106
+ <mtd>
107
+ <xsl:apply-templates select="slot[1]"/>
108
+ </mtd>
109
+ </xsl:template>
110
+
111
+ <xsl:template match="matelem">
112
+ <mtd columnalign="right">
113
+ <xsl:apply-templates select="slot[1]"/>
114
+ </mtd>
115
+ </xsl:template> -->
116
+ </xsl:stylesheet>
data/lib/xsl/pile.xsl ADDED
@@ -0,0 +1,54 @@
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
+ <!-- The translation of a pile using this form of translation string is performed with the following steps:
8
+
9
+ The <start> part of the translation string is output;
10
+ The first line is translated;
11
+ The <repeat> part of the translation string is output;
12
+ The next line is translated;
13
+ If there are any more lines, go back to Step 3. Otherwise, continue with the next step;
14
+ The <end> part of the translation string is output.
15
+ -->
16
+ <xsl:template match="pile">
17
+ <mtable>
18
+ <xsl:apply-templates select="slot" mode="wrap"/>
19
+ </mtable>
20
+ </xsl:template>
21
+
22
+ <xsl:template match="pile[halign='left']">
23
+ <mtable columnalign="left">
24
+ <xsl:apply-templates select="slot" mode="wrap"/>
25
+ </mtable>
26
+ </xsl:template>
27
+
28
+ <xsl:template match="pile/slot" mode="wrap">
29
+ <mtr>
30
+ <mtd>
31
+ <xsl:apply-templates select="."/>
32
+ </mtd>
33
+ </mtr>
34
+ </xsl:template>
35
+
36
+ <xsl:template match="pile[halign='right']">
37
+ <mtable columnalign="right">
38
+ <xsl:apply-templates select="slot" mode="wrap"/>
39
+ </mtable>
40
+ </xsl:template>
41
+
42
+ <xsl:template match="pile[halign='dec']">
43
+ <mtable groupalign="decimalpoint">
44
+ <xsl:apply-templates select="slot" mode="wrap"/>
45
+ </mtable>
46
+ </xsl:template>
47
+
48
+ <xsl:template match="pile[halign='al']">
49
+ <mtable>
50
+ <xsl:apply-templates select="slot" mode="wrap"/>
51
+ </mtable>
52
+ </xsl:template>
53
+
54
+ </xsl:stylesheet>
@@ -0,0 +1,55 @@
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
+ <xsl:template match="tmpl[selector='tmSUP' and not(variation='tvSU_PRECEDES')]">
8
+ <msup>
9
+ <xsl:apply-templates select="slot[1]"/>
10
+ <xsl:apply-templates select="slot[3]"/>
11
+ </msup>
12
+ </xsl:template>
13
+
14
+ <xsl:template match="tmpl[selector='tmSUB' and not(variation='tvSU_PRECEDES')]">
15
+ <msub>
16
+ <xsl:apply-templates select="slot[1]"/>
17
+ <xsl:apply-templates select="slot[2]"/>
18
+ </msub>
19
+ </xsl:template>
20
+
21
+ <xsl:template match="tmpl[selector='tmSUBSUP' and not(variation='tvSU_PRECEDES')]">
22
+ <msubsup>
23
+ <xsl:apply-templates select="slot[1]"/>
24
+ <xsl:apply-templates select="slot[2]"/>
25
+ <xsl:apply-templates select="slot[3]"/>
26
+ </msubsup>
27
+ </xsl:template>
28
+
29
+ <xsl:template match="tmpl[selector='tmSUP' and variation='tvSU_PRECEDES']">
30
+ <mmultiscripts>
31
+ <xsl:apply-templates select="slot[1]"/>
32
+ <mprescripts/>
33
+ <none/>
34
+ <xsl:apply-templates select="slot[3]"/>
35
+ </mmultiscripts>
36
+ </xsl:template>
37
+
38
+ <xsl:template match="tmpl[selector='tmSUB' and variation='tvSU_PRECEDES']">
39
+ <mmultiscripts>
40
+ <xsl:apply-templates select="slot[1]"/>
41
+ <mprescripts/>
42
+ <xsl:apply-templates select="slot[2]"/>
43
+ <none/>
44
+ </mmultiscripts>
45
+ </xsl:template>
46
+
47
+ <xsl:template match="tmpl[selector='tmSUBSUP' and variation='tvSU_PRECEDES']">
48
+ <mmultiscripts>
49
+ <xsl:apply-templates select="slot[1]"/>
50
+ <mprescripts/>
51
+ <xsl:apply-templates select="slot[2]"/>
52
+ <xsl:apply-templates select="slot[3]"/>
53
+ </mmultiscripts>
54
+ </xsl:template>
55
+ </xsl:stylesheet>
data/lib/xsl/sum.xsl ADDED
@@ -0,0 +1,57 @@
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
+ <!-- Summations -->
8
+
9
+ <xsl:template match="tmpl[selector='tmSUM' and (not(variation='tvBO_UPPER') and not(variation='tvBO_UPPER'))]">
10
+ <mstyle displaystyle="true">
11
+ <mo>&#x2211;</mo>
12
+ <xsl:apply-templates select="slot[1]"/>
13
+ </mstyle>
14
+ </xsl:template>
15
+
16
+ <xsl:template match="tmpl[selector='tmSUM' and variation='tvBO_LOWER']">
17
+ <mstyle displaystyle="true">
18
+ <munder>
19
+ <mo>&#x2211;</mo>
20
+ <xsl:apply-templates select="slot[2]"/>
21
+ </munder>
22
+ <xsl:apply-templates select="slot[1]"/>
23
+ </mstyle>
24
+ </xsl:template>
25
+
26
+ <xsl:template match="tmpl[selector='tmSUM']">
27
+ <mstyle displaystyle="true">
28
+ <munderover>
29
+ <mo>&#x2211;</mo>
30
+ <xsl:apply-templates select="slot[2]"/>
31
+ <xsl:apply-templates select="slot[3]"/>
32
+ </munderover>
33
+ <xsl:apply-templates select="slot[1]"/>
34
+ </mstyle>
35
+ </xsl:template>
36
+
37
+ <xsl:template match="tmpl[selector='tmSUM' and not(variation='tvBO_SUM') and variation='tvBO_LOWER']">
38
+ <mstyle displaystyle="true">
39
+ <msub>
40
+ <mo>&#x2211;</mo>
41
+ <xsl:apply-templates select="slot[2]"/>
42
+ </msub>
43
+ <xsl:apply-templates select="slot[1]"/>
44
+ </mstyle>
45
+ </xsl:template>
46
+
47
+ <xsl:template match="tmpl[selector='tmSUM' and not(variation='tvBO_SUM')]">
48
+ <mstyle displaystyle="true">
49
+ <msubsup>
50
+ <mo>&#x2211;</mo>
51
+ <xsl:apply-templates select="slot[2]"/>
52
+ <xsl:apply-templates select="slot[3]"/>
53
+ </msubsup>
54
+ <xsl:apply-templates select="slot[1]"/>
55
+ </mstyle>
56
+ </xsl:template>
57
+ </xsl:stylesheet>
@@ -0,0 +1,104 @@
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
+ <!-- Unions and intersections -->
8
+
9
+ <xsl:template match="tmpl[selector='tmINTER' and (not(variation='tvBO_UPPER') and not(variation='tvBO_UPPER'))]">
10
+ <mstyle displaystyle="true">
11
+ <mo>&#x2229;</mo> <xsl:apply-templates select="slot[1]"/>
12
+ </mstyle>
13
+ </xsl:template>
14
+
15
+ <xsl:template match="tmpl[selector='tmINTER' and variation='tvBO_LOWER']">
16
+ <mstyle displaystyle="true">
17
+ <munder>
18
+ <mo>&#x2229;</mo>
19
+ <xsl:apply-templates select="slot[2]"/>
20
+ </munder>
21
+ <xsl:apply-templates select="slot[1]"/>
22
+ </mstyle>
23
+ </xsl:template>
24
+
25
+ <xsl:template match="tmpl[selector='tmINTER']">
26
+ <mstyle displaystyle="true">
27
+ <munderover>
28
+ <mo>&#x2229;</mo>
29
+ <xsl:apply-templates select="slot[2]"/>
30
+ <xsl:apply-templates select="slot[3]"/>
31
+ </munderover>
32
+ <xsl:apply-templates select="slot[1]"/>
33
+ </mstyle>
34
+ </xsl:template>
35
+
36
+ <xsl:template match="tmpl[selector='tmINTER' and not(variation='tvBO_SUM') and variation='tvBO_LOWER']">
37
+ <mstyle displaystyle="true">
38
+ <msub>
39
+ <mo>&#x2229;</mo>
40
+ <xsl:apply-templates select="slot[2]"/>
41
+ </msub>
42
+ <xsl:apply-templates select="slot[1]"/>
43
+ </mstyle>
44
+ </xsl:template>
45
+
46
+ <xsl:template match="tmpl[selector='tmINTER' and not(variation='tvBO_SUM')]">
47
+ <mstyle displaystyle="true">
48
+ <msubsup>
49
+ <mo>&#x2229;</mo>
50
+ <xsl:apply-templates select="slot[2]"/>
51
+ <xsl:apply-templates select="slot[3]"/>
52
+ </msubsup>
53
+ <xsl:apply-templates select="slot[1]"/>
54
+ </mstyle>
55
+ </xsl:template>
56
+
57
+ <xsl:template match="tmpl[selector='tmUNION' and (not(variation='tvBO_UPPER') and not(variation='tvBO_UPPER'))]">
58
+ <mstyle displaystyle="true">
59
+ <mo>&#x222A;</mo> <xsl:apply-templates select="slot[1]"/>
60
+ </mstyle>
61
+ </xsl:template>
62
+
63
+ <xsl:template match="tmpl[selector='tmUNION' and variation='tvBO_LOWER']">
64
+ <mstyle displaystyle="true">
65
+ <munder>
66
+ <mo>&#x222A;</mo>
67
+ <xsl:apply-templates select="slot[2]"/>
68
+ </munder>
69
+ <xsl:apply-templates select="slot[1]"/>
70
+ </mstyle>
71
+ </xsl:template>
72
+
73
+ <xsl:template match="tmpl[selector='tmUNION']">
74
+ <mstyle displaystyle="true">
75
+ <munderover>
76
+ <mo>&#x222A;</mo>
77
+ <xsl:apply-templates select="slot[2]"/>
78
+ <xsl:apply-templates select="slot[3]"/>
79
+ </munderover>
80
+ <xsl:apply-templates select="slot[1]"/>
81
+ </mstyle>
82
+ </xsl:template>
83
+
84
+ <xsl:template match="tmpl[selector='tmUNION' and not(variation='tvBO_SUM') and variation='tvBO_LOWER']">
85
+ <mstyle displaystyle="true">
86
+ <msub>
87
+ <mo>&#x222A;</mo>
88
+ <xsl:apply-templates select="slot[2]"/>
89
+ </msub>
90
+ <xsl:apply-templates select="slot[1]"/>
91
+ </mstyle>
92
+ </xsl:template>
93
+
94
+ <xsl:template match="tmpl[selector='tmUNION' and not(variation='tvBO_SUM') ]">
95
+ <mstyle displaystyle="true">
96
+ <msubsup>
97
+ <mo>&#x222A;</mo>
98
+ <xsl:apply-templates select="slot[2]"/>
99
+ <xsl:apply-templates select="slot[3]"/>
100
+ </msubsup>
101
+ <xsl:apply-templates select="slot[1]"/>
102
+ </mstyle>
103
+ </xsl:template>
104
+ </xsl:stylesheet>
@@ -0,0 +1,28 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'mathtype_to_mathml/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "mathtype_to_mathml"
8
+ spec.version = MathTypeToMathML::VERSION
9
+ spec.authors = ["PLOS"]
10
+ spec.email = ["plos@plos.org"]
11
+ spec.summary = %q{Converts from a binary MathType format (MTEF) to MathML.}
12
+ spec.description = %q{This gem can be used to convert MathType equations from a binary format (e.g. embedded in Word documents) to an open MathML representation. It achieves that in several stages, first using the "mathtype" gem to convert from a binary to an XML form of MTEF, and second, using XSLTs to convert XML to MathML.}
13
+ spec.homepage = ""
14
+ spec.license = "MIT"
15
+
16
+ spec.files = `git ls-files -z`.split("\x0")
17
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
18
+ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
+ spec.require_paths = ["lib"]
20
+
21
+ spec.add_development_dependency "bundler", "~> 1.7"
22
+ spec.add_development_dependency "rake", "~> 10.0"
23
+ spec.add_development_dependency "rspec", "~> 3.3"
24
+ spec.add_development_dependency "pry", "~> 0.10"
25
+
26
+ spec.add_dependency "nokogiri", "~> 1.6"
27
+ spec.add_dependency "mathtype", "~> 0.0.5"
28
+ end
@@ -0,0 +1,389 @@
1
+ <?xml version="1.0"?>
2
+ <math display="block">
3
+ <mtable columnalign="left">
4
+ <mtr>
5
+ <mtd>
6
+ <mrow>
7
+ <mi>a</mi>
8
+ <mover>
9
+ <mo>&#x2192;</mo>
10
+ <mrow>
11
+ <mi>b</mi>
12
+ </mrow>
13
+ </mover>
14
+ <mi>c</mi>
15
+ <mo>&#x002B;</mo>
16
+ <mi>a</mi>
17
+ <munder>
18
+ <mo>&#x2192;</mo>
19
+ <mrow>
20
+ <mi>b</mi>
21
+ </mrow>
22
+ </munder>
23
+ <mi>c</mi>
24
+ <mo>&#x002B;</mo>
25
+ <mi>a</mi>
26
+ <munderover>
27
+ <mo>&#x2192;</mo>
28
+ <mrow>
29
+ <mi>c</mi>
30
+ </mrow>
31
+ <mrow>
32
+ <mi>b</mi>
33
+ </mrow>
34
+ </munderover>
35
+ <mi>d</mi>
36
+ <mo>&#x002B;</mo>
37
+ <mi>a</mi>
38
+ <mover>
39
+ <mo>&#x2190;</mo>
40
+ <mrow>
41
+ <mi>b</mi>
42
+ </mrow>
43
+ </mover>
44
+ <mi>c</mi>
45
+ <mo>&#x002B;</mo>
46
+ <mi>a</mi>
47
+ <munder>
48
+ <mo>&#x2190;</mo>
49
+ <mrow>
50
+ <mi>b</mi>
51
+ </mrow>
52
+ </munder>
53
+ <mi>c</mi>
54
+ </mrow>
55
+ </mtd>
56
+ </mtr>
57
+ <mtr>
58
+ <mtd>
59
+ <mrow>
60
+ <mi>a</mi>
61
+ <munderover>
62
+ <mo>&#x2190;</mo>
63
+ <mrow>
64
+ <mi>c</mi>
65
+ </mrow>
66
+ <mrow>
67
+ <mi>b</mi>
68
+ </mrow>
69
+ </munderover>
70
+ <mi>d</mi>
71
+ <mo>&#x002B;</mo>
72
+ <mi>a</mi>
73
+ <mover>
74
+ <mo>&#x2194;</mo>
75
+ <mrow>
76
+ <mi>b</mi>
77
+ </mrow>
78
+ </mover>
79
+ <mi>c</mi>
80
+ <mo>&#x002B;</mo>
81
+ <mi>a</mi>
82
+ <munder>
83
+ <mo>&#x2194;</mo>
84
+ <mrow>
85
+ <mi>b</mi>
86
+ </mrow>
87
+ </munder>
88
+ <mi>c</mi>
89
+ <mo>&#x002B;</mo>
90
+ <mi>a</mi>
91
+ <munderover>
92
+ <mo>&#x2194;</mo>
93
+ <mrow>
94
+ <mi>c</mi>
95
+ </mrow>
96
+ <mrow>
97
+ <mi>b</mi>
98
+ </mrow>
99
+ </munderover>
100
+ <mi>d</mi>
101
+ <mo>&#x002B;</mo>
102
+ <mi>a</mi>
103
+ <mover>
104
+ <mo>&#x21C4;</mo>
105
+ <mrow>
106
+ <mi>b</mi>
107
+ </mrow>
108
+ </mover>
109
+ <mi>c</mi>
110
+ </mrow>
111
+ </mtd>
112
+ </mtr>
113
+ <mtr>
114
+ <mtd>
115
+ <mrow>
116
+ <mi>a</mi>
117
+ <munder>
118
+ <mo>&#x21C4;</mo>
119
+ <mrow>
120
+ <mi>b</mi>
121
+ </mrow>
122
+ </munder>
123
+ <mi>c</mi>
124
+ <mo>&#x002B;</mo>
125
+ <mi>a</mi>
126
+ <munderover>
127
+ <mo>&#x21C4;</mo>
128
+ <mrow>
129
+ <mi>c</mi>
130
+ </mrow>
131
+ <mrow>
132
+ <mi>b</mi>
133
+ </mrow>
134
+ </munderover>
135
+ <mi>d</mi>
136
+ <mo>&#x002B;</mo>
137
+ <mi>a</mi>
138
+ <mover>
139
+ <munder accentunder="true">
140
+ <mstyle scriptlevel="-1">
141
+ <mo>&#x2192;</mo>
142
+ </mstyle>
143
+ <mstyle scriptlevel="+1">
144
+ <mo>&#x2190;</mo>
145
+ </mstyle>
146
+ </munder>
147
+ <mrow>
148
+ <mi>b</mi>
149
+ </mrow>
150
+ </mover>
151
+ <mi>c</mi>
152
+ <mo>&#x002B;</mo>
153
+ <mi>a</mi>
154
+ <munder>
155
+ <munder accentunder="true">
156
+ <mstyle scriptlevel="-1">
157
+ <mo>&#x2192;</mo>
158
+ </mstyle>
159
+ <mstyle scriptlevel="+1">
160
+ <mo>&#x2190;</mo>
161
+ </mstyle>
162
+ </munder>
163
+ <mrow>
164
+ <mi>b</mi>
165
+ </mrow>
166
+ </munder>
167
+ <mi>c</mi>
168
+ <mo>&#x002B;</mo>
169
+ <mi>a</mi>
170
+ <munderover accentunder="true">
171
+ <mstyle scriptlevel="-1">
172
+ <mo>&#x2192;</mo>
173
+ </mstyle>
174
+ <munder>
175
+ <mstyle scriptlevel="+1">
176
+ <mo>&#x2190;</mo>
177
+ </mstyle>
178
+ <mrow>
179
+ <mi>c</mi>
180
+ </mrow>
181
+ </munder>
182
+ <mrow>
183
+ <mi>b</mi>
184
+ </mrow>
185
+ </munderover>
186
+ <mi>d</mi>
187
+ </mrow>
188
+ </mtd>
189
+ </mtr>
190
+ <mtr>
191
+ <mtd>
192
+ <mrow>
193
+ <mi>a</mi>
194
+ <mover>
195
+ <munder accentunder="true">
196
+ <mstyle scriptlevel="+1">
197
+ <mo>&#x2192;</mo>
198
+ </mstyle>
199
+ <mstyle scriptlevel="-1">
200
+ <mo>&#x2190;</mo>
201
+ </mstyle>
202
+ </munder>
203
+ <mrow>
204
+ <mi>b</mi>
205
+ </mrow>
206
+ </mover>
207
+ <mi>c</mi>
208
+ <mo>&#x002B;</mo>
209
+ <mi>a</mi>
210
+ <munder>
211
+ <munder accentunder="true">
212
+ <mstyle scriptlevel="+1">
213
+ <mo>&#x2192;</mo>
214
+ </mstyle>
215
+ <mstyle scriptlevel="-1">
216
+ <mo>&#x2190;</mo>
217
+ </mstyle>
218
+ </munder>
219
+ <mrow>
220
+ <mi>b</mi>
221
+ </mrow>
222
+ </munder>
223
+ <mi>c</mi>
224
+ <mo>&#x002B;</mo>
225
+ <mi>a</mi>
226
+ <munderover accentunder="true">
227
+ <mstyle scriptlevel="+1">
228
+ <mo>&#x2192;</mo>
229
+ </mstyle>
230
+ <munder>
231
+ <mstyle scriptlevel="-1">
232
+ <mo>&#x2190;</mo>
233
+ </mstyle>
234
+ <mrow>
235
+ <mi>c</mi>
236
+ </mrow>
237
+ </munder>
238
+ <mrow>
239
+ <mi>b</mi>
240
+ </mrow>
241
+ </munderover>
242
+ <mi>d</mi>
243
+ <mo>&#x002B;</mo>
244
+ <mi>a</mi>
245
+ <mover>
246
+ <mo>&#x21CC;</mo>
247
+ <mrow>
248
+ <mi>b</mi>
249
+ </mrow>
250
+ </mover>
251
+ <mi>c</mi>
252
+ <mo>&#x002B;</mo>
253
+ <mi>a</mi>
254
+ <munder>
255
+ <mo>&#x21CC;</mo>
256
+ <mrow>
257
+ <mi>b</mi>
258
+ </mrow>
259
+ </munder>
260
+ <mi>c</mi>
261
+ </mrow>
262
+ </mtd>
263
+ </mtr>
264
+ <mtr>
265
+ <mtd>
266
+ <mrow>
267
+ <mi>a</mi>
268
+ <munderover>
269
+ <mo>&#x21CC;</mo>
270
+ <mrow>
271
+ <mi>c</mi>
272
+ </mrow>
273
+ <mrow>
274
+ <mi>b</mi>
275
+ </mrow>
276
+ </munderover>
277
+ <mi>d</mi>
278
+ <mo>&#x002B;</mo>
279
+ <mi>a</mi>
280
+ <mover>
281
+ <munder accentunder="true">
282
+ <mstyle scriptlevel="-1">
283
+ <mo>&#x21C0;</mo>
284
+ </mstyle>
285
+ <mstyle scriptlevel="+1">
286
+ <mo>&#x21BD;</mo>
287
+ </mstyle>
288
+ </munder>
289
+ <mrow>
290
+ <mi>b</mi>
291
+ </mrow>
292
+ </mover>
293
+ <mi>c</mi>
294
+ <mo>&#x002B;</mo>
295
+ <mi>a</mi>
296
+ <munder>
297
+ <munder accentunder="true">
298
+ <mstyle scriptlevel="-1">
299
+ <mo>&#x21C0;</mo>
300
+ </mstyle>
301
+ <mstyle scriptlevel="+1">
302
+ <mo>&#x21BD;</mo>
303
+ </mstyle>
304
+ </munder>
305
+ <mrow>
306
+ <mi>b</mi>
307
+ </mrow>
308
+ </munder>
309
+ <mi>c</mi>
310
+ <mo>&#x002B;</mo>
311
+ <mi>a</mi>
312
+ <munderover accentunder="true">
313
+ <mstyle scriptlevel="-1">
314
+ <mo>&#x21C0;</mo>
315
+ </mstyle>
316
+ <munder>
317
+ <mstyle scriptlevel="+1">
318
+ <mo>&#x21BD;</mo>
319
+ </mstyle>
320
+ <mrow>
321
+ <mi>c</mi>
322
+ </mrow>
323
+ </munder>
324
+ <mrow>
325
+ <mi>b</mi>
326
+ </mrow>
327
+ </munderover>
328
+ <mi>d</mi>
329
+ <mo>&#x002B;</mo>
330
+ <mi>a</mi>
331
+ <mover>
332
+ <munder accentunder="true">
333
+ <mstyle scriptlevel="+1">
334
+ <mo>&#x21C0;</mo>
335
+ </mstyle>
336
+ <mstyle scriptlevel="-1">
337
+ <mo>&#x21BD;</mo>
338
+ </mstyle>
339
+ </munder>
340
+ <mrow>
341
+ <mi>b</mi>
342
+ </mrow>
343
+ </mover>
344
+ <mi>c</mi>
345
+ </mrow>
346
+ </mtd>
347
+ </mtr>
348
+ <mtr>
349
+ <mtd>
350
+ <mrow>
351
+ <mi>a</mi>
352
+ <munder>
353
+ <munder accentunder="true">
354
+ <mstyle scriptlevel="+1">
355
+ <mo>&#x21C0;</mo>
356
+ </mstyle>
357
+ <mstyle scriptlevel="-1">
358
+ <mo>&#x21BD;</mo>
359
+ </mstyle>
360
+ </munder>
361
+ <mrow>
362
+ <mi>b</mi>
363
+ </mrow>
364
+ </munder>
365
+ <mi>c</mi>
366
+ <mo>&#x002B;</mo>
367
+ <mi>a</mi>
368
+ <munderover accentunder="true">
369
+ <mstyle scriptlevel="+1">
370
+ <mo>&#x21C0;</mo>
371
+ </mstyle>
372
+ <munder>
373
+ <mstyle scriptlevel="-1">
374
+ <mo>&#x21BD;</mo>
375
+ </mstyle>
376
+ <mrow>
377
+ <mi>c</mi>
378
+ </mrow>
379
+ </munder>
380
+ <mrow>
381
+ <mi>b</mi>
382
+ </mrow>
383
+ </munderover>
384
+ <mi>d</mi>
385
+ </mrow>
386
+ </mtd>
387
+ </mtr>
388
+ </mtable>
389
+ </math>