plurimath 0.3.9 → 0.4.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (105) hide show
  1. checksums.yaml +4 -4
  2. data/lib/plurimath/latex/constants.rb +1 -0
  3. data/lib/plurimath/latex/parse.rb +11 -3
  4. data/lib/plurimath/latex/transform.rb +93 -7
  5. data/lib/plurimath/math/core.rb +16 -4
  6. data/lib/plurimath/math/formula.rb +24 -20
  7. data/lib/plurimath/math/function/abs.rb +2 -2
  8. data/lib/plurimath/math/function/bar.rb +48 -10
  9. data/lib/plurimath/math/function/base.rb +3 -3
  10. data/lib/plurimath/math/function/binary_function.rb +20 -10
  11. data/lib/plurimath/math/function/cancel.rb +2 -2
  12. data/lib/plurimath/math/function/ceil.rb +7 -2
  13. data/lib/plurimath/math/function/color.rb +2 -2
  14. data/lib/plurimath/math/function/ddot.rb +17 -12
  15. data/lib/plurimath/math/function/deg.rb +2 -2
  16. data/lib/plurimath/math/function/det.rb +2 -2
  17. data/lib/plurimath/math/function/dim.rb +2 -2
  18. data/lib/plurimath/math/function/dot.rb +26 -2
  19. data/lib/plurimath/math/function/exp.rb +2 -2
  20. data/lib/plurimath/math/function/fenced.rb +6 -7
  21. data/lib/plurimath/math/function/floor.rb +2 -2
  22. data/lib/plurimath/math/function/font_style/bold-fraktur.rb +17 -0
  23. data/lib/plurimath/math/function/font_style/bold-italic.rb +17 -0
  24. data/lib/plurimath/math/function/font_style/bold-sans-serif.rb +17 -0
  25. data/lib/plurimath/math/function/font_style/bold-script.rb +17 -0
  26. data/lib/plurimath/math/function/font_style/bold.rb +4 -0
  27. data/lib/plurimath/math/function/font_style/double_struck.rb +4 -0
  28. data/lib/plurimath/math/function/font_style/fraktur.rb +4 -0
  29. data/lib/plurimath/math/function/font_style/italic.rb +4 -0
  30. data/lib/plurimath/math/function/font_style/monospace.rb +4 -0
  31. data/lib/plurimath/math/function/font_style/normal.rb +4 -0
  32. data/lib/plurimath/math/function/font_style/sans-serif-bold-italic.rb +17 -0
  33. data/lib/plurimath/math/function/font_style/sans-serif-italic.rb +17 -0
  34. data/lib/plurimath/math/function/font_style/sans-serif.rb +4 -0
  35. data/lib/plurimath/math/function/font_style/script.rb +4 -0
  36. data/lib/plurimath/math/function/font_style.rb +24 -2
  37. data/lib/plurimath/math/function/frac.rb +3 -3
  38. data/lib/plurimath/math/function/gcd.rb +2 -2
  39. data/lib/plurimath/math/function/glb.rb +2 -2
  40. data/lib/plurimath/math/function/hat.rb +42 -9
  41. data/lib/plurimath/math/function/hom.rb +2 -2
  42. data/lib/plurimath/math/function/inf.rb +2 -2
  43. data/lib/plurimath/math/function/int.rb +4 -4
  44. data/lib/plurimath/math/function/ker.rb +2 -2
  45. data/lib/plurimath/math/function/lcm.rb +2 -2
  46. data/lib/plurimath/math/function/left.rb +1 -1
  47. data/lib/plurimath/math/function/lg.rb +2 -2
  48. data/lib/plurimath/math/function/lim.rb +2 -2
  49. data/lib/plurimath/math/function/liminf.rb +2 -2
  50. data/lib/plurimath/math/function/limits.rb +4 -4
  51. data/lib/plurimath/math/function/limsup.rb +2 -2
  52. data/lib/plurimath/math/function/ln.rb +2 -2
  53. data/lib/plurimath/math/function/log.rb +5 -3
  54. data/lib/plurimath/math/function/longdiv.rb +2 -2
  55. data/lib/plurimath/math/function/lub.rb +2 -2
  56. data/lib/plurimath/math/function/max.rb +2 -2
  57. data/lib/plurimath/math/function/mbox.rb +2 -2
  58. data/lib/plurimath/math/function/menclose.rb +2 -2
  59. data/lib/plurimath/math/function/merror.rb +1 -1
  60. data/lib/plurimath/math/function/min.rb +2 -2
  61. data/lib/plurimath/math/function/mod.rb +3 -3
  62. data/lib/plurimath/math/function/msgroup.rb +2 -2
  63. data/lib/plurimath/math/function/msline.rb +2 -2
  64. data/lib/plurimath/math/function/multiscript.rb +4 -4
  65. data/lib/plurimath/math/function/norm.rb +2 -2
  66. data/lib/plurimath/math/function/obrace.rb +40 -26
  67. data/lib/plurimath/math/function/oint.rb +4 -4
  68. data/lib/plurimath/math/function/over.rb +3 -3
  69. data/lib/plurimath/math/function/overset.rb +8 -3
  70. data/lib/plurimath/math/function/power.rb +3 -3
  71. data/lib/plurimath/math/function/power_base.rb +8 -8
  72. data/lib/plurimath/math/function/prod.rb +4 -4
  73. data/lib/plurimath/math/function/right.rb +1 -1
  74. data/lib/plurimath/math/function/root.rb +3 -3
  75. data/lib/plurimath/math/function/rule.rb +1 -1
  76. data/lib/plurimath/math/function/scarries.rb +2 -2
  77. data/lib/plurimath/math/function/semantics.rb +2 -2
  78. data/lib/plurimath/math/function/sqrt.rb +2 -2
  79. data/lib/plurimath/math/function/stackrel.rb +3 -3
  80. data/lib/plurimath/math/function/substack.rb +3 -3
  81. data/lib/plurimath/math/function/sum.rb +14 -19
  82. data/lib/plurimath/math/function/sup.rb +2 -2
  83. data/lib/plurimath/math/function/table.rb +7 -7
  84. data/lib/plurimath/math/function/td.rb +2 -2
  85. data/lib/plurimath/math/function/ternary_function.rb +13 -9
  86. data/lib/plurimath/math/function/text.rb +6 -5
  87. data/lib/plurimath/math/function/tilde.rb +27 -2
  88. data/lib/plurimath/math/function/tr.rb +2 -2
  89. data/lib/plurimath/math/function/ubrace.rb +28 -21
  90. data/lib/plurimath/math/function/ul.rb +55 -18
  91. data/lib/plurimath/math/function/unary_function.rb +13 -8
  92. data/lib/plurimath/math/function/underover.rb +10 -5
  93. data/lib/plurimath/math/function/underset.rb +8 -3
  94. data/lib/plurimath/math/function/vec.rb +25 -3
  95. data/lib/plurimath/math/number.rb +6 -2
  96. data/lib/plurimath/math/symbol.rb +6 -2
  97. data/lib/plurimath/math.rb +1 -0
  98. data/lib/plurimath/mathml/constants.rb +9 -1
  99. data/lib/plurimath/mathml/parser.rb +16 -10
  100. data/lib/plurimath/mathml/transform.rb +59 -31
  101. data/lib/plurimath/omml/parser.rb +24 -1
  102. data/lib/plurimath/omml/transform.rb +56 -41
  103. data/lib/plurimath/utility.rb +154 -9
  104. data/lib/plurimath/version.rb +1 -1
  105. metadata +8 -2
@@ -6,10 +6,21 @@ module Plurimath
6
6
  module Math
7
7
  module Function
8
8
  class Dot < UnaryFunction
9
+ attr_accessor :attributes
10
+
11
+ def initialize(parameter_one = nil, attributes = {})
12
+ super(parameter_one)
13
+ @attributes = attributes
14
+ end
15
+
9
16
  def to_mathml_without_math_tag
17
+ dot_tag = (Utility.ox_element("mo") << ".")
18
+ return dot_tag unless parameter_one
19
+
10
20
  first_value = parameter_one&.to_mathml_without_math_tag
11
21
  dot_tag = (Utility.ox_element("mo") << ".")
12
22
  over_tag = Utility.ox_element("mover")
23
+ over_tag.attributes.merge!({ accent: attributes[:accent] }) if attributes && attributes[:accent]
13
24
  Utility.update_nodes(
14
25
  over_tag,
15
26
  [
@@ -19,7 +30,20 @@ module Plurimath
19
30
  )
20
31
  end
21
32
 
22
- def to_omml_without_math_tag
33
+ def to_omml_without_math_tag(display_style)
34
+ return r_element(".", rpr_tag: false) unless parameter_one
35
+
36
+ if attributes && attributes[:accent]
37
+ acc_tag(display_style)
38
+ else
39
+ symbol = Symbol.new(".")
40
+ Overset.new(parameter_one, symbol).to_omml_without_math_tag(true)
41
+ end
42
+ end
43
+
44
+ protected
45
+
46
+ def acc_tag(display_style)
23
47
  acc_tag = Utility.ox_element("acc", namespace: "m")
24
48
  acc_pr_tag = Utility.ox_element("accPr", namespace: "m")
25
49
  acc_pr_tag << Utility.ox_element(
@@ -31,7 +55,7 @@ module Plurimath
31
55
  acc_tag,
32
56
  [
33
57
  acc_pr_tag,
34
- omml_parameter(parameter_one, tag_name: "e"),
58
+ omml_parameter(parameter_one, display_style, tag_name: "e"),
35
59
  ],
36
60
  )
37
61
  [acc_tag]
@@ -10,8 +10,8 @@ module Plurimath
10
10
  false
11
11
  end
12
12
 
13
- def to_omml_without_math_tag
14
- [r_element("exp"), omml_value]
13
+ def to_omml_without_math_tag(display_style)
14
+ [r_element("exp", rpr_tag: false), omml_value(display_style)]
15
15
  end
16
16
  end
17
17
  end
@@ -30,15 +30,13 @@ module Plurimath
30
30
  end
31
31
 
32
32
  def to_latex
33
- open_paren = parameter_one ? parameter_one.value : "("
34
33
  fenced_value = parameter_two&.map(&:to_latex)&.join(" ")
35
- close_paren = parameter_three ? parameter_three.value : ")"
36
- first_value = latex_paren(open_paren)
37
- second_value = latex_paren(close_paren)
34
+ first_value = latex_paren(parameter_one&.value)
35
+ second_value = latex_paren(parameter_three&.value)
38
36
  "#{first_value} #{fenced_value} #{second_value}"
39
37
  end
40
38
 
41
- def to_omml_without_math_tag
39
+ def to_omml_without_math_tag(display_style)
42
40
  d = Utility.ox_element("d", namespace: "m")
43
41
  dpr = Utility.ox_element("dPr", namespace: "m")
44
42
  first_value(dpr)
@@ -50,6 +48,7 @@ module Plurimath
50
48
  dpr,
51
49
  omml_parameter(
52
50
  Formula.new(Array(parameter_two)),
51
+ display_style,
53
52
  tag_name: "e",
54
53
  ),
55
54
  ],
@@ -87,8 +86,8 @@ module Plurimath
87
86
  return "" if paren.nil? || paren.empty?
88
87
 
89
88
  paren = %w[{ }].include?(paren) ? "\\#{paren}" : paren
90
- paren = "\\#{Latex::Constants::UNICODE_SYMBOLS.invert[paren]}" if paren.to_s.match?(/&#x.{0,4};/)
91
- paren.to_s
89
+ paren = "\\#{Latex::Constants::UNICODE_SYMBOLS.invert[paren]}" if paren&.to_s&.match?(/&#x.{0,4};/)
90
+ paren&.to_s
92
91
  end
93
92
 
94
93
  def mathml_paren(field)
@@ -22,10 +22,10 @@ module Plurimath
22
22
  )
23
23
  end
24
24
 
25
- def to_omml_without_math_tag
25
+ def to_omml_without_math_tag(display_style)
26
26
  [
27
27
  r_element("⌊"),
28
- omml_value,
28
+ omml_value(display_style),
29
29
  r_element("⌋"),
30
30
  ]
31
31
  end
@@ -0,0 +1,17 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "../font_style"
4
+
5
+ module Plurimath
6
+ module Math
7
+ module Function
8
+ class FontStyle
9
+ class BoldFraktur < FontStyle
10
+ def to_omml_without_math_tag(display_style)
11
+ font_styles(display_style, sty: "b", scr: "fraktur")
12
+ end
13
+ end
14
+ end
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,17 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "../font_style"
4
+
5
+ module Plurimath
6
+ module Math
7
+ module Function
8
+ class FontStyle
9
+ class BoldItalic < FontStyle
10
+ def to_omml_without_math_tag(display_style)
11
+ font_styles(display_style, sty: "bi")
12
+ end
13
+ end
14
+ end
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,17 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "../font_style"
4
+
5
+ module Plurimath
6
+ module Math
7
+ module Function
8
+ class FontStyle
9
+ class BoldSansSerif < FontStyle
10
+ def to_omml_without_math_tag(display_style)
11
+ font_styles(display_style, sty: "b", scr: "sans-serif")
12
+ end
13
+ end
14
+ end
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,17 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "../font_style"
4
+
5
+ module Plurimath
6
+ module Math
7
+ module Function
8
+ class FontStyle
9
+ class BoldScript < FontStyle
10
+ def to_omml_without_math_tag(display_style)
11
+ font_styles(display_style, sty: "b", scr: "script")
12
+ end
13
+ end
14
+ end
15
+ end
16
+ end
17
+ end
@@ -29,6 +29,10 @@ module Plurimath
29
29
  [parameter_one&.to_mathml_without_math_tag],
30
30
  )
31
31
  end
32
+
33
+ def to_omml_without_math_tag(display_style)
34
+ font_styles(display_style, sty: "b")
35
+ end
32
36
  end
33
37
  end
34
38
  end
@@ -29,6 +29,10 @@ module Plurimath
29
29
  [parameter_one&.to_mathml_without_math_tag],
30
30
  )
31
31
  end
32
+
33
+ def to_omml_without_math_tag(display_style)
34
+ font_styles(display_style, sty: nil, scr: "double-struck")
35
+ end
32
36
  end
33
37
  end
34
38
  end
@@ -29,6 +29,10 @@ module Plurimath
29
29
  [parameter_one&.to_mathml_without_math_tag],
30
30
  )
31
31
  end
32
+
33
+ def to_omml_without_math_tag(display_style)
34
+ font_styles(display_style, scr: "fraktur")
35
+ end
32
36
  end
33
37
  end
34
38
  end
@@ -29,6 +29,10 @@ module Plurimath
29
29
  [parameter_one&.to_mathml_without_math_tag],
30
30
  )
31
31
  end
32
+
33
+ def to_omml_without_math_tag(display_style)
34
+ font_styles(display_style, sty: "i")
35
+ end
32
36
  end
33
37
  end
34
38
  end
@@ -29,6 +29,10 @@ module Plurimath
29
29
  [parameter_one&.to_mathml_without_math_tag],
30
30
  )
31
31
  end
32
+
33
+ def to_omml_without_math_tag(display_style)
34
+ font_styles(display_style, sty: nil, scr: "monospace")
35
+ end
32
36
  end
33
37
  end
34
38
  end
@@ -29,6 +29,10 @@ module Plurimath
29
29
  [parameter_one&.to_mathml_without_math_tag],
30
30
  )
31
31
  end
32
+
33
+ def to_omml_without_math_tag(display_style)
34
+ font_styles(display_style, sty: "p")
35
+ end
32
36
  end
33
37
  end
34
38
  end
@@ -0,0 +1,17 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "../font_style"
4
+
5
+ module Plurimath
6
+ module Math
7
+ module Function
8
+ class FontStyle
9
+ class SansSerifBoldItalic < FontStyle
10
+ def to_omml_without_math_tag(display_style)
11
+ font_styles(display_style, sty: "bi", scr: "sans-serif")
12
+ end
13
+ end
14
+ end
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,17 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "../font_style"
4
+
5
+ module Plurimath
6
+ module Math
7
+ module Function
8
+ class FontStyle
9
+ class SansSerifItalic < FontStyle
10
+ def to_omml_without_math_tag(display_style)
11
+ font_styles(display_style, sty: "i", scr: "sans-serif")
12
+ end
13
+ end
14
+ end
15
+ end
16
+ end
17
+ end
@@ -29,6 +29,10 @@ module Plurimath
29
29
  [parameter_one&.to_mathml_without_math_tag],
30
30
  )
31
31
  end
32
+
33
+ def to_omml_without_math_tag(display_style)
34
+ font_styles(display_style, sty: "p", scr: "sans-serif")
35
+ end
32
36
  end
33
37
  end
34
38
  end
@@ -29,6 +29,10 @@ module Plurimath
29
29
  [parameter_one&.to_mathml_without_math_tag],
30
30
  )
31
31
  end
32
+
33
+ def to_omml_without_math_tag(display_style)
34
+ font_styles(display_style, scr: "script")
35
+ end
32
36
  end
33
37
  end
34
38
  end
@@ -21,8 +21,8 @@ module Plurimath
21
21
  )
22
22
  end
23
23
 
24
- def to_omml_without_math_tag
25
- Array(parameter_one&.insert_t_tag)
24
+ def to_omml_without_math_tag(display_style)
25
+ font_styles(display_style)
26
26
  end
27
27
 
28
28
  def to_html
@@ -36,6 +36,28 @@ module Plurimath
36
36
  def validate_function_formula
37
37
  true
38
38
  end
39
+
40
+ def extract_class_from_text
41
+ parameter_one.parameter_one if parameter_one.is_a?(Text)
42
+ parameter_one.class_name
43
+ end
44
+
45
+ def extractable?
46
+ parameter_one.is_a?(Text)
47
+ end
48
+
49
+ def font_styles(display_style, sty: "p", scr: nil)
50
+ r_tag = Utility.ox_element("r", namespace: "m")
51
+ rpr_tag = Utility.ox_element("rPr", namespace: "m")
52
+ fonts = []
53
+ fonts << Utility.ox_element("scr", namespace: "m", attributes: { "m:val": scr }) if scr
54
+ fonts << Utility.ox_element("sty", namespace: "m", attributes: { "m:val": sty }) if sty
55
+ r_tag << Utility.update_nodes(rpr_tag, fonts)
56
+ Utility.update_nodes(
57
+ r_tag,
58
+ Array(parameter_one.font_style_t_tag(display_style)),
59
+ )
60
+ end
39
61
  end
40
62
  end
41
63
  end
@@ -31,7 +31,7 @@ module Plurimath
31
31
  "\\frac{#{first_value}}{#{two_value}}"
32
32
  end
33
33
 
34
- def to_omml_without_math_tag
34
+ def to_omml_without_math_tag(display_style)
35
35
  f_element = Utility.ox_element("f", namespace: "m")
36
36
  fpr_element = Utility.ox_element("fPr", namespace: "m")
37
37
  fpr_element << Utility.pr_element("ctrl", true, namespace: "m")
@@ -39,8 +39,8 @@ module Plurimath
39
39
  f_element,
40
40
  [
41
41
  fpr_element,
42
- omml_parameter(parameter_one, tag_name: "num"),
43
- omml_parameter(parameter_two, tag_name: "den"),
42
+ omml_parameter(parameter_one, display_style, tag_name: "num"),
43
+ omml_parameter(parameter_two, display_style, tag_name: "den"),
44
44
  ],
45
45
  )
46
46
  [f_element]
@@ -10,8 +10,8 @@ module Plurimath
10
10
  false
11
11
  end
12
12
 
13
- def to_omml_without_math_tag
14
- [r_element("gcd"), omml_value]
13
+ def to_omml_without_math_tag(display_style)
14
+ [r_element("gcd", rpr_tag: false), omml_value(display_style)]
15
15
  end
16
16
  end
17
17
  end
@@ -10,8 +10,8 @@ module Plurimath
10
10
  false
11
11
  end
12
12
 
13
- def to_omml_without_math_tag
14
- [r_element("glb"), omml_value]
13
+ def to_omml_without_math_tag(display_style)
14
+ [r_element("glb", rpr_tag: false), omml_value(display_style)]
15
15
  end
16
16
  end
17
17
  end
@@ -6,15 +6,34 @@ module Plurimath
6
6
  module Math
7
7
  module Function
8
8
  class Hat < UnaryFunction
9
+ attr_accessor :attributes
10
+
11
+ def initialize(parameter_one = nil, attributes = {})
12
+ super(parameter_one)
13
+ @attributes = attributes
14
+ end
15
+
16
+ def to_asciimath
17
+ first_value = "(#{parameter_one.to_asciimath})" if parameter_one
18
+ "hat#{first_value}"
19
+ end
20
+
21
+ def to_latex
22
+ first_value = "{#{parameter_one.to_latex}}" if parameter_one
23
+ "\\hat#{first_value}"
24
+ end
25
+
9
26
  def to_mathml_without_math_tag
10
- mover_tag = Utility.ox_element("mover")
11
- first_value = parameter_one&.to_mathml_without_math_tag
12
- second_value = (Utility.ox_element("mo") << "^")
27
+ mo_tag = (Utility.ox_element("mo") << "^")
28
+ return mo_tag unless parameter_one
29
+
30
+ mover_tag = Utility.ox_element("mover")
31
+ mover_tag.attributes.merge!(attributes) if attributes && !attributes.empty?
13
32
  Utility.update_nodes(
14
33
  mover_tag,
15
34
  [
16
- first_value,
17
- second_value,
35
+ parameter_one&.to_mathml_without_math_tag,
36
+ mo_tag,
18
37
  ],
19
38
  )
20
39
  end
@@ -23,15 +42,29 @@ module Plurimath
23
42
  false
24
43
  end
25
44
 
26
- def to_omml_without_math_tag
45
+ def to_omml_without_math_tag(display_style)
46
+ return r_element("^", rpr_tag: false) unless parameter_one
47
+
48
+ if attributes && attributes[:accent]
49
+ accent_tag(display_style)
50
+ else
51
+ symbol = Symbol.new("&#x302;")
52
+ Overset.new(parameter_one, symbol).to_omml_without_math_tag(true)
53
+ end
54
+ end
55
+
56
+ protected
57
+
58
+ def accent_tag(display_style)
27
59
  acc_tag = Utility.ox_element("acc", namespace: "m")
28
60
  acc_pr_tag = Utility.ox_element("accPr", namespace: "m")
29
61
  acc_pr_tag << (Utility.ox_element("chr", namespace: "m", attributes: { "m:val": "̂" }))
30
- me = Utility.ox_element("e", namespace: "m")
31
- Utility.update_nodes(me, omml_value)
32
62
  Utility.update_nodes(
33
63
  acc_tag,
34
- [acc_pr_tag, me],
64
+ [
65
+ acc_pr_tag,
66
+ omml_parameter(parameter_one, display_style, tag_name: "e", namespace: "m"),
67
+ ],
35
68
  )
36
69
  [acc_tag]
37
70
  end
@@ -6,8 +6,8 @@ module Plurimath
6
6
  module Math
7
7
  module Function
8
8
  class Hom < UnaryFunction
9
- def to_omml_without_math_tag
10
- [r_element("hom"), omml_value]
9
+ def to_omml_without_math_tag(display_style)
10
+ [r_element("hom", rpr_tag: false), omml_value(display_style)]
11
11
  end
12
12
  end
13
13
  end
@@ -30,8 +30,8 @@ module Plurimath
30
30
  )
31
31
  end
32
32
 
33
- def to_omml_without_math_tag
34
- underover
33
+ def to_omml_without_math_tag(display_style)
34
+ underover(display_style)
35
35
  end
36
36
  end
37
37
  end
@@ -42,16 +42,16 @@ module Plurimath
42
42
  )
43
43
  end
44
44
 
45
- def to_omml_without_math_tag
45
+ def to_omml_without_math_tag(display_style)
46
46
  if all_values_exist?
47
47
  nary = Utility.ox_element("nary", namespace: "m")
48
48
  Utility.update_nodes(
49
49
  nary,
50
50
  [
51
51
  narypr("∫", function_type: "subSup"),
52
- omml_parameter(parameter_one, tag_name: "sub"),
53
- omml_parameter(parameter_two, tag_name: "sup"),
54
- omml_parameter(parameter_three, tag_name: "e"),
52
+ omml_parameter(parameter_one, display_style, tag_name: "sub"),
53
+ omml_parameter(parameter_two, display_style, tag_name: "sup"),
54
+ omml_parameter(parameter_three, display_style, tag_name: "e"),
55
55
  ],
56
56
  )
57
57
  [nary]
@@ -6,8 +6,8 @@ module Plurimath
6
6
  module Math
7
7
  module Function
8
8
  class Ker < UnaryFunction
9
- def to_omml_without_math_tag
10
- [r_element("ker"), omml_value]
9
+ def to_omml_without_math_tag(display_style)
10
+ [r_element("ker", rpr_tag: false), omml_value(display_style)]
11
11
  end
12
12
  end
13
13
  end
@@ -6,8 +6,8 @@ module Plurimath
6
6
  module Math
7
7
  module Function
8
8
  class Lcm < UnaryFunction
9
- def to_omml_without_math_tag
10
- [r_element("lcm"), omml_value]
9
+ def to_omml_without_math_tag(display_style)
10
+ [r_element("lcm", rpr_tag: false), omml_value(display_style)]
11
11
  end
12
12
  end
13
13
  end
@@ -16,7 +16,7 @@ module Plurimath
16
16
  mo
17
17
  end
18
18
 
19
- def to_omml_without_math_tag
19
+ def to_omml_without_math_tag(display_style)
20
20
  mr = Utility.ox_element("m:r")
21
21
  if parameter_one
22
22
  mt = Utility.ox_element("m:t")
@@ -10,8 +10,8 @@ module Plurimath
10
10
  false
11
11
  end
12
12
 
13
- def to_omml_without_math_tag
14
- [r_element("lg"), omml_value]
13
+ def to_omml_without_math_tag(display_style)
14
+ [r_element("lg", rpr_tag: false), omml_value(display_style)]
15
15
  end
16
16
  end
17
17
  end
@@ -39,8 +39,8 @@ module Plurimath
39
39
  end
40
40
  end
41
41
 
42
- def to_omml_without_math_tag
43
- underover
42
+ def to_omml_without_math_tag(display_style)
43
+ underover(display_style)
44
44
  end
45
45
  end
46
46
  end
@@ -6,8 +6,8 @@ module Plurimath
6
6
  module Math
7
7
  module Function
8
8
  class Liminf < UnaryFunction
9
- def to_omml_without_math_tag
10
- [r_element("liminf"), omml_value]
9
+ def to_omml_without_math_tag(display_style)
10
+ [r_element("liminf", rpr_tag: false), omml_value(display_style)]
11
11
  end
12
12
  end
13
13
  end
@@ -22,11 +22,11 @@ module Plurimath
22
22
  "#{first_value}\\#{class_name}_#{second_value}^#{third_value}"
23
23
  end
24
24
 
25
- def to_omml_without_math_tag
25
+ def to_omml_without_math_tag(display_style)
26
26
  value_array = []
27
- value_array << parameter_one.insert_t_tag if parameter_one
28
- value_array << parameter_two.insert_t_tag if parameter_two
29
- value_array << parameter_three.insert_t_tag if parameter_three
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
30
  value_array
31
31
  end
32
32
  end
@@ -6,8 +6,8 @@ module Plurimath
6
6
  module Math
7
7
  module Function
8
8
  class Limsup < UnaryFunction
9
- def to_omml_without_math_tag
10
- [r_element("limsup"), omml_value]
9
+ def to_omml_without_math_tag(display_style)
10
+ [r_element("limsup", rpr_tag: false), omml_value(display_style)]
11
11
  end
12
12
  end
13
13
  end
@@ -10,8 +10,8 @@ module Plurimath
10
10
  false
11
11
  end
12
12
 
13
- def to_omml_without_math_tag
14
- [r_element("ln"), omml_value]
13
+ def to_omml_without_math_tag(display_style)
14
+ [r_element("ln", rpr_tag: false), omml_value(display_style)]
15
15
  end
16
16
  end
17
17
  end
@@ -24,7 +24,9 @@ module Plurimath
24
24
  "<i>log</i>#{first_value}#{second_value}"
25
25
  end
26
26
 
27
- def to_omml_without_math_tag
27
+ def to_omml_without_math_tag(display_style)
28
+ return r_element("log", rpr_tag: false) unless all_values_exist?
29
+
28
30
  ssubsup = Utility.ox_element("sSubSup", namespace: "m")
29
31
  ssubsuppr = Utility.ox_element("sSubSupPr", namespace: "m")
30
32
  ssubsuppr << hide_tags(
@@ -35,8 +37,8 @@ module Plurimath
35
37
  [
36
38
  ssubsuppr,
37
39
  e_parameter,
38
- omml_parameter(parameter_one, tag_name: "sub"),
39
- omml_parameter(parameter_two, tag_name: "sup"),
40
+ omml_parameter(parameter_one, display_style, tag_name: "sub"),
41
+ omml_parameter(parameter_two, display_style, tag_name: "sup"),
40
42
  ],
41
43
  )
42
44
  [ssubsup]