plurimath 0.3.7 → 0.3.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/plurimath/asciimath/constants.rb +1 -1
- data/lib/plurimath/asciimath/transform.rb +17 -0
- data/lib/plurimath/latex/constants.rb +3 -5
- data/lib/plurimath/math/core.rb +14 -0
- data/lib/plurimath/math/formula.rb +19 -6
- data/lib/plurimath/math/function/binary_function.rb +14 -4
- data/lib/plurimath/math/function/cancel.rb +4 -0
- data/lib/plurimath/math/function/ceil.rb +7 -0
- data/lib/plurimath/math/function/color.rb +4 -0
- data/lib/plurimath/math/function/ddot.rb +4 -3
- data/lib/plurimath/math/function/deg.rb +4 -0
- data/lib/plurimath/math/function/det.rb +4 -0
- data/lib/plurimath/math/function/dim.rb +4 -0
- data/lib/plurimath/math/function/dot.rb +18 -0
- data/lib/plurimath/math/function/exp.rb +4 -0
- data/lib/plurimath/math/function/floor.rb +8 -0
- data/lib/plurimath/math/function/font_style.rb +1 -3
- data/lib/plurimath/math/function/gcd.rb +4 -0
- data/lib/plurimath/math/function/glb.rb +4 -0
- data/lib/plurimath/math/function/hat.rb +13 -0
- data/lib/plurimath/math/function/hom.rb +3 -0
- data/lib/plurimath/math/function/inf.rb +18 -17
- data/lib/plurimath/math/function/int.rb +8 -8
- data/lib/plurimath/math/function/ker.rb +3 -0
- data/lib/plurimath/math/function/lcm.rb +3 -0
- data/lib/plurimath/math/function/lg.rb +4 -0
- data/lib/plurimath/math/function/lim.rb +1 -5
- data/lib/plurimath/math/function/liminf.rb +3 -0
- data/lib/plurimath/math/function/limsup.rb +3 -0
- data/lib/plurimath/math/function/ln.rb +4 -0
- data/lib/plurimath/math/function/longdiv.rb +3 -0
- data/lib/plurimath/math/function/lub.rb +4 -0
- data/lib/plurimath/math/function/max.rb +4 -0
- data/lib/plurimath/math/function/menclose.rb +1 -3
- data/lib/plurimath/math/function/merror.rb +1 -0
- data/lib/plurimath/math/function/min.rb +4 -0
- data/lib/plurimath/math/function/mod.rb +8 -0
- data/lib/plurimath/math/function/msline.rb +3 -0
- data/lib/plurimath/math/function/norm.rb +8 -0
- data/lib/plurimath/math/function/obrace.rb +29 -4
- data/lib/plurimath/math/function/oint.rb +55 -3
- data/lib/plurimath/math/function/over.rb +15 -1
- data/lib/plurimath/math/function/phantom.rb +7 -4
- data/lib/plurimath/math/function/power_base.rb +3 -1
- data/lib/plurimath/math/function/prod.rb +4 -0
- data/lib/plurimath/math/function/root.rb +2 -6
- data/lib/plurimath/math/function/scarries.rb +3 -0
- data/lib/plurimath/math/function/semantics.rb +4 -0
- data/lib/plurimath/math/function/sqrt.rb +1 -3
- data/lib/plurimath/math/function/stackrel.rb +15 -0
- data/lib/plurimath/math/function/substack.rb +45 -0
- data/lib/plurimath/math/function/sum.rb +8 -0
- data/lib/plurimath/math/function/sup.rb +4 -0
- data/lib/plurimath/math/function/table.rb +0 -4
- data/lib/plurimath/math/function/ternary_function.rb +13 -4
- data/lib/plurimath/math/function/tilde.rb +14 -0
- data/lib/plurimath/math/function/ubrace.rb +20 -0
- data/lib/plurimath/math/function/ul.rb +2 -0
- data/lib/plurimath/math/function/unary_function.rb +0 -4
- data/lib/plurimath/math/function/underover.rb +2 -5
- data/lib/plurimath/math/function/vec.rb +14 -0
- data/lib/plurimath/math/symbol.rb +8 -0
- data/lib/plurimath/math.rb +3 -1
- data/lib/plurimath/mathml/parser.rb +2 -2
- data/lib/plurimath/version.rb +1 -1
- metadata +2 -3
- data/lib/plurimath/math/function/underline.rb +0 -12
@@ -38,6 +38,14 @@ module Plurimath
|
|
38
38
|
second_value = "<i>#{parameter_two.to_html}</i>" if parameter_two
|
39
39
|
"#{first_value}<i>mod</i>#{second_value}"
|
40
40
|
end
|
41
|
+
|
42
|
+
def to_omml_without_math_tag
|
43
|
+
values = []
|
44
|
+
values << parameter_one.insert_t_tag if parameter_one
|
45
|
+
values << r_element("mod")
|
46
|
+
values << parameter_two.insert_t_tag if parameter_two
|
47
|
+
values
|
48
|
+
end
|
41
49
|
end
|
42
50
|
end
|
43
51
|
end
|
@@ -22,13 +22,38 @@ module Plurimath
|
|
22
22
|
end
|
23
23
|
end
|
24
24
|
|
25
|
-
def tag_name
|
26
|
-
"underover"
|
27
|
-
end
|
28
|
-
|
29
25
|
def validate_function_formula
|
30
26
|
false
|
31
27
|
end
|
28
|
+
|
29
|
+
def to_omml_without_math_tag
|
30
|
+
groupchr = Utility.ox_element("groupChr", namespace: "m")
|
31
|
+
Utility.update_nodes(
|
32
|
+
groupchr,
|
33
|
+
[
|
34
|
+
group_chr_pr,
|
35
|
+
omml_parameter(parameter_one, tag_name: "e"),
|
36
|
+
],
|
37
|
+
)
|
38
|
+
[groupchr]
|
39
|
+
end
|
40
|
+
|
41
|
+
protected
|
42
|
+
|
43
|
+
def group_chr_pr
|
44
|
+
groupchrpr = Utility.ox_element("groupChrPr", namespace: "m")
|
45
|
+
vert_jc = Utility.ox_element("vertJc", namespace: "m", attributes: { "m:val": "bot" })
|
46
|
+
chr = Utility.ox_element("chr", namespace: "m", attributes: { "m:val": "⏞" })
|
47
|
+
pos = Utility.ox_element("pos", namespace: "m", attributes: { "m:val": "top" })
|
48
|
+
Utility.update_nodes(
|
49
|
+
groupchrpr,
|
50
|
+
[
|
51
|
+
chr,
|
52
|
+
pos,
|
53
|
+
vert_jc,
|
54
|
+
],
|
55
|
+
)
|
56
|
+
end
|
32
57
|
end
|
33
58
|
|
34
59
|
Overbrace = Obrace
|
@@ -1,15 +1,67 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require_relative "
|
3
|
+
require_relative "ternary_function"
|
4
4
|
|
5
5
|
module Plurimath
|
6
6
|
module Math
|
7
7
|
module Function
|
8
|
-
class Oint <
|
8
|
+
class Oint < TernaryFunction
|
9
9
|
def to_asciimath
|
10
10
|
first_value = "_#{wrapped(parameter_one)}" if parameter_one
|
11
11
|
second_value = "^#{wrapped(parameter_two)}" if parameter_two
|
12
|
-
"oint#{first_value}#{second_value}"
|
12
|
+
"oint#{first_value}#{second_value} #{parameter_three&.to_asciimath}".strip
|
13
|
+
end
|
14
|
+
|
15
|
+
def to_latex
|
16
|
+
first_value = "_#{latex_wrapped(parameter_one)}" if parameter_one
|
17
|
+
second_value = "^#{latex_wrapped(parameter_two)}" if parameter_two
|
18
|
+
"\\#{class_name}#{first_value}#{second_value} #{parameter_three&.to_latex}".strip
|
19
|
+
end
|
20
|
+
|
21
|
+
def to_mathml_without_math_tag
|
22
|
+
mo_tag = Utility.ox_element("mo") << invert_unicode_symbols.to_s
|
23
|
+
return mo_tag unless all_values_exist?
|
24
|
+
|
25
|
+
value_array = [mo_tag]
|
26
|
+
value_array << parameter_one&.to_mathml_without_math_tag
|
27
|
+
value_array << parameter_two&.to_mathml_without_math_tag
|
28
|
+
tag_name = if parameter_one && parameter_two
|
29
|
+
"subsup"
|
30
|
+
else
|
31
|
+
parameter_one ? "sub" : "sup"
|
32
|
+
end
|
33
|
+
msubsup_tag = Utility.ox_element("m#{tag_name}")
|
34
|
+
Utility.update_nodes(msubsup_tag, value_array)
|
35
|
+
return msubsup_tag if parameter_three.nil?
|
36
|
+
|
37
|
+
Utility.update_nodes(
|
38
|
+
Utility.ox_element("mrow"),
|
39
|
+
[
|
40
|
+
msubsup_tag,
|
41
|
+
parameter_three&.to_mathml_without_math_tag,
|
42
|
+
].compact,
|
43
|
+
)
|
44
|
+
end
|
45
|
+
|
46
|
+
def to_omml_without_math_tag
|
47
|
+
if all_values_exist?
|
48
|
+
nary = Utility.ox_element("nary", namespace: "m")
|
49
|
+
Utility.update_nodes(
|
50
|
+
nary,
|
51
|
+
[
|
52
|
+
narypr("∮", function_type: "subSup"),
|
53
|
+
omml_parameter(parameter_one, tag_name: "sub"),
|
54
|
+
omml_parameter(parameter_two, tag_name: "sup"),
|
55
|
+
omml_parameter(parameter_three, tag_name: "e"),
|
56
|
+
],
|
57
|
+
)
|
58
|
+
[nary]
|
59
|
+
else
|
60
|
+
r_tag = Utility.ox_element("r", namespace: "m")
|
61
|
+
t_tag = Utility.ox_element("t", namespace: "m")
|
62
|
+
r_tag << (t_tag << "∮")
|
63
|
+
[r_tag]
|
64
|
+
end
|
13
65
|
end
|
14
66
|
end
|
15
67
|
end
|
@@ -9,7 +9,7 @@ module Plurimath
|
|
9
9
|
def to_asciimath
|
10
10
|
first_value = wrapped(parameter_one)
|
11
11
|
second_value = wrapped(parameter_two)
|
12
|
-
"
|
12
|
+
"frac#{first_value}#{second_value}"
|
13
13
|
end
|
14
14
|
|
15
15
|
def to_mathml_without_math_tag
|
@@ -30,6 +30,20 @@ module Plurimath
|
|
30
30
|
two_value = parameter_two&.to_latex
|
31
31
|
"{#{first_value} \\over #{two_value}}"
|
32
32
|
end
|
33
|
+
|
34
|
+
def to_omml_without_math_tag
|
35
|
+
f_element = Utility.ox_element("f", namespace: "m")
|
36
|
+
fpr_element = Utility.ox_element("fPr", namespace: "m")
|
37
|
+
Utility.update_nodes(
|
38
|
+
f_element,
|
39
|
+
[
|
40
|
+
fpr_element << Utility.pr_element("ctrl", true, namespace: "m"),
|
41
|
+
omml_parameter(parameter_one, tag_name: "num"),
|
42
|
+
omml_parameter(parameter_two, tag_name: "den"),
|
43
|
+
],
|
44
|
+
)
|
45
|
+
[f_element]
|
46
|
+
end
|
33
47
|
end
|
34
48
|
end
|
35
49
|
end
|
@@ -7,7 +7,7 @@ module Plurimath
|
|
7
7
|
module Function
|
8
8
|
class Phantom < UnaryFunction
|
9
9
|
def to_asciimath
|
10
|
-
"
|
10
|
+
"#{Array.new(parameter_one&.length, '\ ').join}"
|
11
11
|
end
|
12
12
|
|
13
13
|
def to_html
|
@@ -15,12 +15,15 @@ module Plurimath
|
|
15
15
|
end
|
16
16
|
|
17
17
|
def to_latex
|
18
|
-
|
18
|
+
Array.new(parameter_one&.length, '\\ ').join
|
19
19
|
end
|
20
20
|
|
21
21
|
def to_mathml_without_math_tag
|
22
|
-
|
23
|
-
Utility.
|
22
|
+
phantom = Utility.ox_element("mphantom")
|
23
|
+
Utility.update_nodes(
|
24
|
+
phantom,
|
25
|
+
parameter_one&.map(&:to_mathml_without_math_tag),
|
26
|
+
)
|
24
27
|
end
|
25
28
|
end
|
26
29
|
end
|
@@ -35,7 +35,7 @@ module Plurimath
|
|
35
35
|
narypr << Utility.ox_element(
|
36
36
|
"limLoc",
|
37
37
|
namespace: "m",
|
38
|
-
attributes: { "m:val":
|
38
|
+
attributes: { "m:val": parameter_one.omml_tag_name },
|
39
39
|
)
|
40
40
|
hide_tags(narypr)
|
41
41
|
narypr << Utility.pr_element("ctrl", true, namespace: "m")
|
@@ -47,6 +47,8 @@ module Plurimath
|
|
47
47
|
end
|
48
48
|
|
49
49
|
def to_omml_without_math_tag
|
50
|
+
return underover if parameter_one.omml_tag_name == "undOvr"
|
51
|
+
|
50
52
|
ssubsup = Utility.ox_element("sSubSup", namespace: "m")
|
51
53
|
ssubsuppr = Utility.ox_element("sSubSupPr", namespace: "m")
|
52
54
|
ssubsuppr << hide_tags(
|
@@ -27,16 +27,12 @@ module Plurimath
|
|
27
27
|
def to_omml_without_math_tag
|
28
28
|
rad_element = Utility.ox_element("rad", namespace: "m")
|
29
29
|
pr_element = Utility.ox_element("radPr", namespace: "m")
|
30
|
-
deg_element = Utility.ox_element("deg", namespace: "m")
|
31
|
-
e_element = Utility.ox_element("e", namespace: "m")
|
32
|
-
Utility.update_nodes(e_element, parameter_one.to_omml_without_math_tag)
|
33
|
-
Utility.update_nodes(deg_element, parameter_two.to_omml_without_math_tag)
|
34
30
|
Utility.update_nodes(
|
35
31
|
rad_element,
|
36
32
|
[
|
37
33
|
(pr_element << Utility.pr_element("ctrl", true, namespace: "m")),
|
38
|
-
|
39
|
-
|
34
|
+
omml_parameter(parameter_two, tag_name: "deg"),
|
35
|
+
omml_parameter(parameter_one, tag_name: "e"),
|
40
36
|
],
|
41
37
|
)
|
42
38
|
[rad_element]
|
@@ -21,14 +21,12 @@ module Plurimath
|
|
21
21
|
namespace: "m",
|
22
22
|
attributes: { "m:val": "1" },
|
23
23
|
)
|
24
|
-
e_element = Utility.ox_element("e", namespace: "m")
|
25
|
-
Utility.update_nodes(e_element, omml_value)
|
26
24
|
Utility.update_nodes(
|
27
25
|
rad_element,
|
28
26
|
[
|
29
27
|
(pr_element << Utility.pr_element("ctrl", true, namespace: "m")),
|
30
28
|
Utility.ox_element("deg", namespace: "m"),
|
31
|
-
|
29
|
+
omml_parameter(parameter_one, tag_name: "e"),
|
32
30
|
],
|
33
31
|
)
|
34
32
|
[rad_element]
|
@@ -27,6 +27,21 @@ module Plurimath
|
|
27
27
|
"#{first_value}#{second_value}"
|
28
28
|
end
|
29
29
|
|
30
|
+
def to_omml_without_math_tag
|
31
|
+
limupp = Utility.ox_element("limUpp", namespace: "m")
|
32
|
+
limupppr = Utility.ox_element("limUppPr", namespace: "m")
|
33
|
+
limupppr << Utility.pr_element("ctrl", true, namespace: "m")
|
34
|
+
Utility.update_nodes(
|
35
|
+
limupp,
|
36
|
+
[
|
37
|
+
limupppr,
|
38
|
+
omml_parameter(parameter_two, tag_name: "e"),
|
39
|
+
omml_parameter(parameter_one, tag_name: "lim"),
|
40
|
+
],
|
41
|
+
)
|
42
|
+
[limupp]
|
43
|
+
end
|
44
|
+
|
30
45
|
protected
|
31
46
|
|
32
47
|
def wrapped(field)
|
@@ -18,6 +18,51 @@ module Plurimath
|
|
18
18
|
value_array << parameter_two.to_mathml_without_math_tag if parameter_two
|
19
19
|
Utility.update_nodes(Utility.ox_element("mtable"), value_array)
|
20
20
|
end
|
21
|
+
|
22
|
+
def to_omml_without_math_tag
|
23
|
+
Array(
|
24
|
+
Utility.update_nodes(
|
25
|
+
mm_element,
|
26
|
+
[
|
27
|
+
omml_parameter(parameter_one, tag_name: "mr"),
|
28
|
+
omml_parameter(parameter_two, tag_name: "mr"),
|
29
|
+
],
|
30
|
+
),
|
31
|
+
)
|
32
|
+
end
|
33
|
+
|
34
|
+
protected
|
35
|
+
|
36
|
+
def mm_element
|
37
|
+
mcjc = Utility.ox_element(
|
38
|
+
"mcJc",
|
39
|
+
namespace: "m",
|
40
|
+
attributes: { "m:val": "center" },
|
41
|
+
)
|
42
|
+
mcount = Utility.ox_element(
|
43
|
+
"count",
|
44
|
+
namespace: "m",
|
45
|
+
attributes: { "m:val": "1" },
|
46
|
+
)
|
47
|
+
mbasejc = Utility.ox_element(
|
48
|
+
"baseJc",
|
49
|
+
namespace: "m",
|
50
|
+
attributes: { "m:val": "center", },
|
51
|
+
)
|
52
|
+
mplchide = Utility.ox_element(
|
53
|
+
"plcHide",
|
54
|
+
namespace: "m",
|
55
|
+
attributes: { "m:val": "1" },
|
56
|
+
)
|
57
|
+
mm = Utility.ox_element("m", namespace: "m")
|
58
|
+
mc = Utility.ox_element("mc", namespace: "m")
|
59
|
+
mpr = Utility.ox_element("mpr", namespace: "m")
|
60
|
+
mcs = Utility.ox_element("mcs", namespace: "m")
|
61
|
+
mcpr = Utility.ox_element("mcPr", namespace: "m")
|
62
|
+
mc << Utility.update_nodes(mcpr, [mcjc, mcount])
|
63
|
+
mcs << mc
|
64
|
+
Utility.update_nodes(mm, [mpr])
|
65
|
+
end
|
21
66
|
end
|
22
67
|
end
|
23
68
|
end
|
@@ -51,10 +51,6 @@ module Plurimath
|
|
51
51
|
"#{first_value}#{second_value}#{third_value}"
|
52
52
|
end
|
53
53
|
|
54
|
-
def class_name
|
55
|
-
self.class.name.split("::").last.downcase
|
56
|
-
end
|
57
|
-
|
58
54
|
protected
|
59
55
|
|
60
56
|
def latex_wrapped(field)
|
@@ -129,6 +125,19 @@ module Plurimath
|
|
129
125
|
def all_values_exist?
|
130
126
|
!(parameter_one.nil? && parameter_two.nil? && parameter_three.nil?)
|
131
127
|
end
|
128
|
+
|
129
|
+
def validate_mathml_tag(parameter)
|
130
|
+
return Array(Utility.ox_element("mrow")) unless parameter
|
131
|
+
|
132
|
+
Array(parameter.to_mathml_without_math_tag)
|
133
|
+
end
|
134
|
+
|
135
|
+
def underover
|
136
|
+
overset = Overset.new(parameter_one, parameter_three)
|
137
|
+
return overset unless parameter_two
|
138
|
+
|
139
|
+
Underset.new(overset, parameter_two)&.to_omml_without_math_tag
|
140
|
+
end
|
132
141
|
end
|
133
142
|
end
|
134
143
|
end
|
@@ -12,6 +12,20 @@ module Plurimath
|
|
12
12
|
second_value = parameter_one.to_mathml_without_math_tag if parameter_one
|
13
13
|
Utility.update_nodes(mover, [second_value, first_value])
|
14
14
|
end
|
15
|
+
|
16
|
+
def to_omml_without_math_tag
|
17
|
+
acc_tag = Utility.ox_element("acc", namespace: "m")
|
18
|
+
acc_pr_tag = Utility.ox_element("accPr", namespace: "m")
|
19
|
+
acc_pr_tag << (Utility.ox_element("chr", namespace: "m", attributes: { "m:val": "˜" }))
|
20
|
+
Utility.update_nodes(
|
21
|
+
acc_tag,
|
22
|
+
[
|
23
|
+
acc_pr_tag,
|
24
|
+
omml_parameter(parameter_one, tag_name: "e"),
|
25
|
+
],
|
26
|
+
)
|
27
|
+
[acc_tag]
|
28
|
+
end
|
15
29
|
end
|
16
30
|
end
|
17
31
|
end
|
@@ -26,9 +26,29 @@ module Plurimath
|
|
26
26
|
"underover"
|
27
27
|
end
|
28
28
|
|
29
|
+
def omml_tag_name
|
30
|
+
"undOvr"
|
31
|
+
end
|
32
|
+
|
29
33
|
def validate_function_formula
|
30
34
|
false
|
31
35
|
end
|
36
|
+
|
37
|
+
def to_omml_without_math_tag
|
38
|
+
limlow = Utility.ox_element("limLow", namespace: "m")
|
39
|
+
limlowpr = Utility.ox_element("limLowPr", namespace: "m")
|
40
|
+
limlowpr << Utility.pr_element("ctrl", true, namespace: "m")
|
41
|
+
lim = Utility.ox_element("lim", namespace: "m")
|
42
|
+
Utility.update_nodes(
|
43
|
+
limlow,
|
44
|
+
[
|
45
|
+
limlowpr,
|
46
|
+
omml_parameter(parameter_one, tag_name: "e"),
|
47
|
+
Utility.update_nodes(lim, r_element("⏟")),
|
48
|
+
],
|
49
|
+
)
|
50
|
+
[limlow]
|
51
|
+
end
|
32
52
|
end
|
33
53
|
|
34
54
|
Underbrace = Ubrace
|
@@ -36,10 +36,7 @@ module Plurimath
|
|
36
36
|
end
|
37
37
|
|
38
38
|
def to_omml_without_math_tag
|
39
|
-
|
40
|
-
return overset unless parameter_two
|
41
|
-
|
42
|
-
Underset.new(overset, parameter_two)&.to_omml_without_math_tag
|
39
|
+
underover
|
43
40
|
end
|
44
41
|
|
45
42
|
def omml_nary_tag
|
@@ -86,7 +83,7 @@ module Plurimath
|
|
86
83
|
end
|
87
84
|
|
88
85
|
def first_value(pr_element)
|
89
|
-
first_value = parameter_one.
|
86
|
+
first_value = parameter_one.nary_attr_value
|
90
87
|
first_value = Utility.html_entity_to_unicode(first_value)
|
91
88
|
unless first_value == "∫"
|
92
89
|
pr_element << Utility.ox_element(
|
@@ -16,6 +16,20 @@ module Plurimath
|
|
16
16
|
],
|
17
17
|
)
|
18
18
|
end
|
19
|
+
|
20
|
+
def to_omml_without_math_tag
|
21
|
+
acc_tag = Utility.ox_element("acc", namespace: "m")
|
22
|
+
acc_pr_tag = Utility.ox_element("accPr", namespace: "m")
|
23
|
+
acc_pr_tag << (Utility.ox_element("chr", namespace: "m", attributes: { "m:val": "→" }))
|
24
|
+
Utility.update_nodes(
|
25
|
+
acc_tag,
|
26
|
+
[
|
27
|
+
acc_pr_tag,
|
28
|
+
omml_parameter(parameter_one, tag_name: "e"),
|
29
|
+
],
|
30
|
+
)
|
31
|
+
[acc_tag]
|
32
|
+
end
|
19
33
|
end
|
20
34
|
end
|
21
35
|
end
|
@@ -72,6 +72,14 @@ module Plurimath
|
|
72
72
|
["⋀", "⋁", "⋂", "⋃"].include?(value) ? "underover" : "subsup"
|
73
73
|
end
|
74
74
|
|
75
|
+
def omml_tag_name
|
76
|
+
if ["⋀", "⋁", "⋂", "⋃", "⋃", "∑", "∏"].include?(value)
|
77
|
+
return "undOvr"
|
78
|
+
end
|
79
|
+
|
80
|
+
"subSup"
|
81
|
+
end
|
82
|
+
|
75
83
|
def nary_attr_value
|
76
84
|
value
|
77
85
|
end
|
data/lib/plurimath/math.rb
CHANGED
@@ -22,11 +22,11 @@ module Plurimath
|
|
22
22
|
|
23
23
|
def parse
|
24
24
|
ox_nodes = Ox.load(text, strip_namespace: true)
|
25
|
-
display_style = ox_nodes&.locate("*/mstyle/@displaystyle")&.first
|
25
|
+
display_style = ox_nodes&.locate("*/mstyle/@displaystyle")&.first || true
|
26
26
|
nodes = parse_nodes(ox_nodes.nodes)
|
27
27
|
Math::Formula.new(
|
28
28
|
Transform.new.apply(nodes).flatten.compact,
|
29
|
-
displaystyle: display_style
|
29
|
+
displaystyle: display_style,
|
30
30
|
)
|
31
31
|
end
|
32
32
|
|
data/lib/plurimath/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: plurimath
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ribose Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-08-
|
11
|
+
date: 2023-08-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: parslet
|
@@ -183,7 +183,6 @@ files:
|
|
183
183
|
- lib/plurimath/math/function/ubrace.rb
|
184
184
|
- lib/plurimath/math/function/ul.rb
|
185
185
|
- lib/plurimath/math/function/unary_function.rb
|
186
|
-
- lib/plurimath/math/function/underline.rb
|
187
186
|
- lib/plurimath/math/function/underover.rb
|
188
187
|
- lib/plurimath/math/function/underset.rb
|
189
188
|
- lib/plurimath/math/function/vec.rb
|