plurimath 0.5.0 → 0.7.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (110) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +4 -0
  3. data/.rspec +3 -0
  4. data/.rspec-opal +11 -0
  5. data/Gemfile +4 -0
  6. data/Rakefile +11 -0
  7. data/lib/plurimath/asciimath/parse.rb +3 -2
  8. data/lib/plurimath/asciimath/transform.rb +47 -5
  9. data/lib/plurimath/latex/constants.rb +5 -1
  10. data/lib/plurimath/latex/parse.rb +20 -11
  11. data/lib/plurimath/latex/transform.rb +32 -14
  12. data/lib/plurimath/math/core.rb +212 -10
  13. data/lib/plurimath/math/formula.rb +154 -40
  14. data/lib/plurimath/math/function/abs.rb +28 -15
  15. data/lib/plurimath/math/function/bar.rb +5 -0
  16. data/lib/plurimath/math/function/base.rb +22 -2
  17. data/lib/plurimath/math/function/binary_function.rb +38 -12
  18. data/lib/plurimath/math/function/ceil.rb +24 -9
  19. data/lib/plurimath/math/function/color.rb +14 -0
  20. data/lib/plurimath/math/function/ddot.rb +6 -1
  21. data/lib/plurimath/math/function/deg.rb +4 -1
  22. data/lib/plurimath/math/function/det.rb +4 -1
  23. data/lib/plurimath/math/function/dim.rb +4 -1
  24. data/lib/plurimath/math/function/dot.rb +5 -0
  25. data/lib/plurimath/math/function/exp.rb +4 -1
  26. data/lib/plurimath/math/function/fenced.rb +51 -15
  27. data/lib/plurimath/math/function/floor.rb +24 -14
  28. data/lib/plurimath/math/function/font_style.rb +63 -8
  29. data/lib/plurimath/math/function/frac.rb +38 -18
  30. data/lib/plurimath/math/function/gcd.rb +4 -1
  31. data/lib/plurimath/math/function/glb.rb +8 -1
  32. data/lib/plurimath/math/function/hat.rb +16 -5
  33. data/lib/plurimath/math/function/hom.rb +4 -1
  34. data/lib/plurimath/math/function/inf.rb +16 -0
  35. data/lib/plurimath/math/function/int.rb +35 -9
  36. data/lib/plurimath/math/function/ker.rb +4 -1
  37. data/lib/plurimath/math/function/lcm.rb +17 -1
  38. data/lib/plurimath/math/function/left.rb +20 -2
  39. data/lib/plurimath/math/function/lg.rb +4 -1
  40. data/lib/plurimath/math/function/lim.rb +16 -0
  41. data/lib/plurimath/math/function/liminf.rb +4 -1
  42. data/lib/plurimath/math/function/limits.rb +29 -9
  43. data/lib/plurimath/math/function/limsup.rb +4 -1
  44. data/lib/plurimath/math/function/linebreak.rb +95 -0
  45. data/lib/plurimath/math/function/ln.rb +4 -1
  46. data/lib/plurimath/math/function/log.rb +27 -12
  47. data/lib/plurimath/math/function/longdiv.rb +19 -0
  48. data/lib/plurimath/math/function/lub.rb +4 -1
  49. data/lib/plurimath/math/function/max.rb +4 -1
  50. data/lib/plurimath/math/function/mbox.rb +8 -7
  51. data/lib/plurimath/math/function/menclose.rb +6 -0
  52. data/lib/plurimath/math/function/merror.rb +12 -3
  53. data/lib/plurimath/math/function/min.rb +4 -1
  54. data/lib/plurimath/math/function/mod.rb +48 -15
  55. data/lib/plurimath/math/function/msgroup.rb +32 -0
  56. data/lib/plurimath/math/function/msline.rb +10 -0
  57. data/lib/plurimath/math/function/multiscript.rb +27 -0
  58. data/lib/plurimath/math/function/nary.rb +128 -0
  59. data/lib/plurimath/math/function/norm.rb +24 -15
  60. data/lib/plurimath/math/function/obrace.rb +5 -0
  61. data/lib/plurimath/math/function/oint.rb +48 -20
  62. data/lib/plurimath/math/function/over.rb +29 -10
  63. data/lib/plurimath/math/function/overset.rb +19 -10
  64. data/lib/plurimath/math/function/phantom.rb +24 -6
  65. data/lib/plurimath/math/function/power.rb +19 -4
  66. data/lib/plurimath/math/function/power_base.rb +34 -33
  67. data/lib/plurimath/math/function/prod.rb +43 -23
  68. data/lib/plurimath/math/function/right.rb +20 -2
  69. data/lib/plurimath/math/function/root.rb +6 -0
  70. data/lib/plurimath/math/function/rule.rb +8 -1
  71. data/lib/plurimath/math/function/scarries.rb +14 -0
  72. data/lib/plurimath/math/function/semantics.rb +15 -0
  73. data/lib/plurimath/math/function/sqrt.rb +5 -0
  74. data/lib/plurimath/math/function/stackrel.rb +14 -0
  75. data/lib/plurimath/math/function/substack.rb +18 -51
  76. data/lib/plurimath/math/function/sum.rb +36 -12
  77. data/lib/plurimath/math/function/sup.rb +11 -2
  78. data/lib/plurimath/math/function/table/array.rb +1 -1
  79. data/lib/plurimath/math/function/table/matrix.rb +4 -0
  80. data/lib/plurimath/math/function/table.rb +62 -26
  81. data/lib/plurimath/math/function/td.rb +42 -4
  82. data/lib/plurimath/math/function/ternary_function.rb +48 -10
  83. data/lib/plurimath/math/function/text.rb +25 -3
  84. data/lib/plurimath/math/function/tilde.rb +5 -0
  85. data/lib/plurimath/math/function/tr.rb +29 -1
  86. data/lib/plurimath/math/function/ubrace.rb +5 -0
  87. data/lib/plurimath/math/function/unary_function.rb +115 -29
  88. data/lib/plurimath/math/function/underover.rb +27 -58
  89. data/lib/plurimath/math/function/underset.rb +25 -9
  90. data/lib/plurimath/math/function/vec.rb +45 -0
  91. data/lib/plurimath/math/function.rb +7 -5
  92. data/lib/plurimath/math/number.rb +12 -8
  93. data/lib/plurimath/math/symbol.rb +25 -13
  94. data/lib/plurimath/math.rb +1 -3
  95. data/lib/plurimath/mathml/parser.rb +6 -4
  96. data/lib/plurimath/mathml/transform.rb +26 -19
  97. data/lib/plurimath/omml/parser.rb +3 -3
  98. data/lib/plurimath/omml/transform.rb +34 -21
  99. data/lib/plurimath/setup/oga.rb +5 -0
  100. data/lib/plurimath/setup/opal.rb.erb +8 -0
  101. data/lib/plurimath/setup/ox.rb +5 -0
  102. data/lib/plurimath/unitsml.rb +2 -1
  103. data/lib/plurimath/utility.rb +77 -41
  104. data/lib/plurimath/version.rb +1 -1
  105. data/lib/plurimath/xml_engine/oga.rb +246 -0
  106. data/lib/plurimath/xml_engine/ox.rb +29 -0
  107. data/lib/plurimath/xml_engine.rb +6 -0
  108. data/lib/plurimath.rb +12 -2
  109. metadata +12 -3
  110. data/lib/plurimath/math/function/scarry.rb +0 -12
@@ -6,12 +6,20 @@ module Plurimath
6
6
  module Math
7
7
  module Function
8
8
  class Limits < TernaryFunction
9
+ FUNCTION = {
10
+ name: "function apply",
11
+ first_value: "base",
12
+ second_value: "subscript",
13
+ third_value: "supscript",
14
+ }.freeze
15
+
9
16
  def to_mathml_without_math_tag
10
17
  underover = Utility.ox_element("munderover")
11
- value_array = []
12
- value_array << parameter_one&.to_mathml_without_math_tag
13
- value_array << parameter_two&.to_mathml_without_math_tag
14
- value_array << parameter_three&.to_mathml_without_math_tag
18
+ value_array = [
19
+ validate_mathml_fields(parameter_one),
20
+ validate_mathml_fields(parameter_two),
21
+ validate_mathml_fields(parameter_three),
22
+ ]
15
23
  Utility.update_nodes(underover, value_array)
16
24
  end
17
25
 
@@ -23,11 +31,23 @@ module Plurimath
23
31
  end
24
32
 
25
33
  def to_omml_without_math_tag(display_style)
26
- value_array = []
27
- value_array << parameter_one.insert_t_tag(display_style) if parameter_one
28
- value_array << parameter_two.insert_t_tag(display_style) if parameter_two
29
- value_array << parameter_three.insert_t_tag(display_style) if parameter_three
30
- value_array
34
+ underover(display_style)
35
+ end
36
+
37
+ def line_breaking(obj)
38
+ parameter_one&.line_breaking(obj)
39
+ if obj.value_exist?
40
+ obj.update(self.class.new(Utility.filter_values(obj.value), parameter_two, parameter_three))
41
+ self.parameter_two = nil
42
+ self.parameter_three = nil
43
+ return
44
+ end
45
+
46
+ parameter_two&.line_breaking(obj)
47
+ if obj.value_exist?
48
+ obj.update(self.class.new(nil, Utility.filter_values(obj.value), parameter_three))
49
+ self.parameter_three = nil
50
+ end
31
51
  end
32
52
  end
33
53
  end
@@ -7,7 +7,10 @@ module Plurimath
7
7
  module Function
8
8
  class Limsup < UnaryFunction
9
9
  def to_omml_without_math_tag(display_style)
10
- [r_element("limsup", rpr_tag: false), omml_value(display_style)]
10
+ array = []
11
+ array << r_element("limsup", rpr_tag: false) unless hide_function_name
12
+ array += Array(omml_value(display_style))
13
+ array
11
14
  end
12
15
  end
13
16
  end
@@ -0,0 +1,95 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "unary_function"
4
+
5
+ module Plurimath
6
+ module Math
7
+ module Function
8
+ class Linebreak < UnaryFunction
9
+ attr_accessor :attributes
10
+
11
+ def initialize(parameter_one = nil, attributes = {})
12
+ @parameter_one = parameter_one
13
+ @attributes = attributes
14
+ Utility.validate_left_right([parameter_one])
15
+ end
16
+
17
+ def ==(object)
18
+ object.class == self.class &&
19
+ object.parameter_one == parameter_one &&
20
+ object.linebreak == linebreak
21
+ end
22
+
23
+ def to_asciimath
24
+ linebreak_character = "\\\n "
25
+ return linebreak_character unless parameter_one
26
+
27
+ case attributes[:linebreakstyle]
28
+ when "after"
29
+ "#{asciimath_value}#{linebreak_character}"
30
+ else
31
+ "#{linebreak_character}#{asciimath_value}"
32
+ end
33
+ end
34
+
35
+ def to_latex
36
+ linebreak_character = "\\\\ "
37
+ return linebreak_character unless parameter_one
38
+
39
+ case attributes[:linebreakstyle]
40
+ when "after"
41
+ "#{latex_value}#{linebreak_character}"
42
+ else
43
+ "#{linebreak_character}#{latex_value}"
44
+ end
45
+ end
46
+
47
+ def to_mathml_without_math_tag
48
+ return Utility.ox_element("mo", attributes: { linebreak: "newline" }) unless parameter_one
49
+
50
+ mo_node = parameter_one.to_mathml_without_math_tag
51
+ mo_node.name = "mo" unless mo_node.name == "mo"
52
+ mo_node.attributes.merge!(attributes) unless attributes.empty?
53
+ mo_node
54
+ end
55
+
56
+ def to_html
57
+ br_tag = "<br/>"
58
+ return br_tag unless parameter_one
59
+
60
+ case attributes[:linebreakstyle]
61
+ when "after"
62
+ "#{parameter_one.to_html}#{br_tag}"
63
+ else
64
+ "#{br_tag}#{parameter_one.to_html}"
65
+ end
66
+ end
67
+
68
+ def to_omml_without_math_tag(display_style)
69
+ parameter_one&.insert_t_tag(display_style)
70
+ end
71
+
72
+ def omml_line_break(result)
73
+ result.first.pop
74
+ return result unless exist?
75
+
76
+ case attributes[:linebreakstyle]
77
+ when "after"
78
+ result[0] << parameter_one
79
+ else
80
+ result[1].insert(0, parameter_one)
81
+ end
82
+ result
83
+ end
84
+
85
+ def separate_table
86
+ true
87
+ end
88
+
89
+ def linebreak
90
+ true
91
+ end
92
+ end
93
+ end
94
+ end
95
+ end
@@ -11,7 +11,10 @@ module Plurimath
11
11
  end
12
12
 
13
13
  def to_omml_without_math_tag(display_style)
14
- [r_element("ln", rpr_tag: false), omml_value(display_style)]
14
+ array = []
15
+ array = r_element("ln", rpr_tag: false) unless hide_function_name
16
+ array += Array(omml_value(display_style))
17
+ array
15
18
  end
16
19
  end
17
20
  end
@@ -6,6 +6,12 @@ module Plurimath
6
6
  module Math
7
7
  module Function
8
8
  class Log < BinaryFunction
9
+ FUNCTION = {
10
+ name: "function apply",
11
+ first_value: "subscript",
12
+ second_value: "supscript",
13
+ }
14
+
9
15
  def to_asciimath
10
16
  first_value = "_#{wrapped(parameter_one)}" if parameter_one
11
17
  second_value = "^#{wrapped(parameter_two)}" if parameter_two
@@ -29,9 +35,7 @@ module Plurimath
29
35
 
30
36
  ssubsup = Utility.ox_element("sSubSup", namespace: "m")
31
37
  ssubsuppr = Utility.ox_element("sSubSupPr", namespace: "m")
32
- ssubsuppr << hide_tags(
33
- Utility.pr_element("ctrl", true, namespace: "m"),
34
- )
38
+ ssubsuppr << hide_tags(Utility.pr_element("ctrl", true, namespace: "m"))
35
39
  Utility.update_nodes(
36
40
  ssubsup,
37
41
  [
@@ -45,25 +49,36 @@ module Plurimath
45
49
  end
46
50
 
47
51
  def to_mathml_without_math_tag
48
- subsup_tag = Utility.ox_element("msubsup")
49
- first_value = (Utility.ox_element("mi") << "log")
52
+ first_value = ox_element("mi")
53
+ first_value << "log" unless hide_function_name
50
54
  if parameter_one || parameter_two
51
- new_arr = [first_value]
52
- new_arr << parameter_one&.to_mathml_without_math_tag
53
- new_arr << parameter_two&.to_mathml_without_math_tag
54
- Utility.update_nodes(
55
- subsup_tag,
56
- new_arr,
57
- )
55
+ new_arr = [
56
+ first_value,
57
+ validate_mathml_fields(parameter_one),
58
+ validate_mathml_fields(parameter_two),
59
+ ]
60
+ Utility.update_nodes(ox_element("msubsup"), new_arr)
58
61
  else
59
62
  first_value
60
63
  end
61
64
  end
62
65
 
66
+ def line_breaking(obj)
67
+ parameter_one&.line_breaking(obj)
68
+ if obj.value_exist?
69
+ log = self.class.new(Utility.filter_values(obj.value), parameter_two)
70
+ self.parameter_two = nil
71
+ log.hide_function_name = true
72
+ obj.update(log)
73
+ end
74
+ end
75
+
63
76
  protected
64
77
 
65
78
  def e_parameter
66
79
  e_tag = Utility.ox_element("e", namespace: "m")
80
+ return e_tag if hide_function_name
81
+
67
82
  e_tag << rpr_tag
68
83
  end
69
84
 
@@ -6,9 +6,28 @@ module Plurimath
6
6
  module Math
7
7
  module Function
8
8
  class Longdiv < UnaryFunction
9
+ def to_asciimath
10
+ asciimath_value
11
+ end
12
+
13
+ def to_latex
14
+ latex_value
15
+ end
16
+
17
+ def to_mathml_without_math_tag
18
+ Utility.update_nodes(
19
+ ox_element("m#{class_name}"),
20
+ mathml_value,
21
+ )
22
+ end
23
+
9
24
  def to_omml_without_math_tag(display_style)
10
25
  omml_value(display_style)
11
26
  end
27
+
28
+ def line_breaking(obj)
29
+ custom_array_line_breaking(obj)
30
+ end
12
31
  end
13
32
  end
14
33
  end
@@ -11,7 +11,10 @@ module Plurimath
11
11
  end
12
12
 
13
13
  def to_omml_without_math_tag(display_style)
14
- [r_element("lub", rpr_tag: false), omml_value(display_style)]
14
+ array = []
15
+ array << r_element("lub", rpr_tag: false) unless hide_function_name
16
+ array += Array(omml_value(display_style))
17
+ array
15
18
  end
16
19
  end
17
20
  end
@@ -11,7 +11,10 @@ module Plurimath
11
11
  end
12
12
 
13
13
  def to_omml_without_math_tag(display_style)
14
- [r_element("max", rpr_tag: false), omml_value(display_style)]
14
+ array = []
15
+ array << r_element("max", rpr_tag: false) unless hide_function_name
16
+ array += Array(omml_value(display_style))
17
+ array
15
18
  end
16
19
  end
17
20
  end
@@ -5,23 +5,24 @@ module Plurimath
5
5
  module Math
6
6
  module Function
7
7
  class Mbox < UnaryFunction
8
+ def to_asciimath
9
+ Text.new(parameter_one).to_asciimath
10
+ end
11
+
8
12
  def to_mathml_without_math_tag
9
- text = Utility.ox_element("mtext")
10
- text << (parameter_one.to_mathml_without_math_tag) if parameter_one
11
- text
13
+ Text.new(parameter_one).to_mathml_without_math_tag
12
14
  end
13
15
 
14
16
  def to_latex
15
- first_value = parameter_one&.to_latex
16
- "\\mbox{#{first_value}}"
17
+ "\\mbox{#{parameter_one}}"
17
18
  end
18
19
 
19
20
  def to_html
20
- parameter_one&.to_html
21
+ parameter_one
21
22
  end
22
23
 
23
24
  def to_omml_without_math_tag(display_style)
24
- omml_value(display_style)
25
+ Text.new(parameter_one).to_omml_without_math_tag(display_style)
25
26
  end
26
27
  end
27
28
  end
@@ -6,6 +6,12 @@ module Plurimath
6
6
  module Math
7
7
  module Function
8
8
  class Menclose < BinaryFunction
9
+ FUNCTION = {
10
+ name: "enclosure",
11
+ first_value: "enclosure type",
12
+ second_value: "expression",
13
+ }.freeze
14
+
9
15
  def to_asciimath
10
16
  parameter_two&.to_asciimath
11
17
  end
@@ -1,12 +1,21 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require_relative "binary_function"
3
+ require_relative "unary_function"
4
4
 
5
5
  module Plurimath
6
6
  module Math
7
7
  module Function
8
- class Merror < BinaryFunction
9
- def to_omml_without_math_tag(display_style); end
8
+ class Merror < UnaryFunction
9
+ def to_asciimath;end
10
+
11
+ def to_latex;end
12
+
13
+ def to_mathml_without_math_tag
14
+ merror = Utility.ox_element("merror")
15
+ Utility.update_nodes(merror, mathml_value)
16
+ end
17
+
18
+ def to_omml_without_math_tag(_); end
10
19
  end
11
20
  end
12
21
  end
@@ -11,7 +11,10 @@ module Plurimath
11
11
  end
12
12
 
13
13
  def to_omml_without_math_tag(display_style)
14
- [r_element("min", rpr_tag: false), omml_value(display_style)]
14
+ array = []
15
+ array << r_element("min", rpr_tag: false) unless hide_function_name
16
+ array += Array(omml_value(display_style))
17
+ array
15
18
  end
16
19
  end
17
20
  end
@@ -6,6 +6,12 @@ module Plurimath
6
6
  module Math
7
7
  module Function
8
8
  class Mod < BinaryFunction
9
+ FUNCTION = {
10
+ name: "mod",
11
+ first_value: "base",
12
+ second_value: "argument",
13
+ }
14
+
9
15
  def to_asciimath
10
16
  first_value = parameter_one&.to_asciimath
11
17
  second_value = parameter_two&.to_asciimath
@@ -13,18 +19,12 @@ module Plurimath
13
19
  end
14
20
 
15
21
  def to_mathml_without_math_tag
16
- mrow_tag = Utility.ox_element("mrow")
17
- mo_tag = Utility.ox_element("mi") << "mod"
18
- first_value = parameter_one&.to_mathml_without_math_tag if parameter_one
19
- second_value = parameter_two&.to_mathml_without_math_tag if parameter_two
20
- Utility.update_nodes(
21
- mrow_tag,
22
- [
23
- first_value,
24
- mo_tag,
25
- second_value,
26
- ],
27
- )
22
+ mi_tag = ox_element("mi")
23
+ mi_tag << "mod" unless hide_function_name
24
+ value_array = [mi_tag]
25
+ value_array.insert(0, parameter_one&.to_mathml_without_math_tag) if parameter_one
26
+ value_array << parameter_two&.to_mathml_without_math_tag if parameter_two
27
+ Utility.update_nodes(ox_element("mrow"), value_array)
28
28
  end
29
29
 
30
30
  def to_latex
@@ -41,11 +41,44 @@ module Plurimath
41
41
 
42
42
  def to_omml_without_math_tag(display_style)
43
43
  values = []
44
- values << parameter_one.insert_t_tag(display_style) if parameter_one
45
- values << r_element("mod")
46
- values << parameter_two.insert_t_tag(display_style) if parameter_two
44
+ first_value(display_style, values)
45
+ values << r_element("mod") unless hide_function_name
46
+ second_value(display_style, values)
47
47
  values
48
48
  end
49
+
50
+ def line_breaking(obj)
51
+ parameter_one&.line_breaking(obj)
52
+ if obj.value_exist?
53
+ mod = self.class.new(Utility.filter_values(obj.value), parameter_two)
54
+ mod.hide_function_name = false
55
+ self.hide_function_name = true
56
+ obj.update(mod)
57
+ self.parameter_two = nil
58
+ return
59
+ end
60
+
61
+ parameter_two&.line_breaking(obj)
62
+ if obj.value_exist?
63
+ mod = self.class.new(nil, Utility.filter_values(obj.value))
64
+ mod.hide_function_name = true
65
+ obj.update(mod)
66
+ end
67
+ end
68
+
69
+ protected
70
+
71
+ def first_value(display_style, values)
72
+ return unless parameter_one
73
+
74
+ values << parameter_one.insert_t_tag(display_style)
75
+ end
76
+
77
+ def second_value(display_style, values)
78
+ return unless parameter_two
79
+
80
+ values << parameter_two.insert_t_tag(display_style)
81
+ end
49
82
  end
50
83
  end
51
84
  end
@@ -28,6 +28,38 @@ module Plurimath
28
28
  def to_html
29
29
  "<i>#{parameter_one.map(&:to_html).join}</i>"
30
30
  end
31
+
32
+ def to_asciimath_math_zone(spacing, last = false, _indent = true)
33
+ [
34
+ "#{spacing}\"msgroup\" function apply\n",
35
+ Formula.new(parameter_one).to_asciimath_math_zone(gsub_spacing(spacing, last)),
36
+ ]
37
+ end
38
+
39
+ def to_latex_math_zone(spacing, last = false, indent = true)
40
+ [
41
+ "#{spacing}\"msgroup\" function apply\n",
42
+ Formula.new(parameter_one).to_latex_math_zone(gsub_spacing(spacing, last), last, indent),
43
+ ]
44
+ end
45
+
46
+ def to_mathml_math_zone(spacing, last = false, indent = true)
47
+ [
48
+ "#{spacing}\"msgroup\" function apply\n",
49
+ Formula.new(parameter_one).to_mathml_math_zone(gsub_spacing(spacing, last), last, indent),
50
+ ]
51
+ end
52
+
53
+ def to_omml_math_zone(spacing, last = false, indent = true, display_style:)
54
+ [
55
+ "#{spacing}\"msgroup\" function apply\n",
56
+ Formula.new(parameter_one).to_omml_math_zone(gsub_spacing(spacing, last), last, indent, display_style: display_style),
57
+ ]
58
+ end
59
+
60
+ def line_breaking(obj)
61
+ custom_array_line_breaking(obj)
62
+ end
31
63
  end
32
64
  end
33
65
  end
@@ -6,9 +6,19 @@ module Plurimath
6
6
  module Math
7
7
  module Function
8
8
  class Msline < UnaryFunction
9
+ def to_asciimath;end
10
+
11
+ def to_latex;end
12
+
13
+ def to_mathml_without_math_tag
14
+ ox_element("msline")
15
+ end
16
+
9
17
  def to_omml_without_math_tag(display_style)
10
18
  omml_value(display_style)
11
19
  end
20
+
21
+ def to_omml_without_math_tag(display_style);end
12
22
  end
13
23
  end
14
24
  end
@@ -5,6 +5,13 @@ module Plurimath
5
5
  module Math
6
6
  module Function
7
7
  class Multiscript < TernaryFunction
8
+ FUNCTION = {
9
+ name: "multiscript",
10
+ first_value: "base",
11
+ second_value: "subscript",
12
+ third_value: "supscript",
13
+ }.freeze
14
+
8
15
  def to_omml_without_math_tag(display_style)
9
16
  pre_element = Utility.ox_element("sPre", namespace: "m")
10
17
  pr_element = Utility.ox_element("sPrePr", namespace: "m")
@@ -19,6 +26,26 @@ module Plurimath
19
26
  )
20
27
  [pre_element]
21
28
  end
29
+
30
+ def line_breaking(obj)
31
+ parameter_one&.line_breaking(obj)
32
+ if obj.value_exist?
33
+ obj.update(
34
+ self.class.new(Utility.filter_values(obj.value), parameter_two, parameter_three)
35
+ )
36
+ self.parameter_two = nil
37
+ self.parameter_three = nil
38
+ return
39
+ end
40
+
41
+ parameter_two.line_breaking(obj)
42
+ if obj.value_exist?
43
+ obj.update(
44
+ self.class.new(nil, Utility.filter_values(obj.value), parameter_three)
45
+ )
46
+ self.parameter_three = nil
47
+ end
48
+ end
22
49
  end
23
50
  end
24
51
  end