lib/plurimath/math/function/left.rb in plurimath-0.2.1 vs lib/plurimath/math/function/left.rb in plurimath-0.2.2
- old
+ new
@@ -8,12 +8,36 @@
class Left < UnaryFunction
def to_asciimath
"left#{parameter_one}"
end
+ def to_mathml_without_math_tag
+ mo = Utility.ox_element("mo")
+ mo << left_paren if parameter_one
+ mo
+ end
+
+ def to_omml_without_math_tag
+ mt = Utility.ox_element("m:t")
+ mt << parameter_one if parameter_one
+ mt
+ end
+
+ def to_html
+ "<i>#{parameter_one}</i>"
+ end
+
def to_latex
prefix = "\\" if parameter_one == "{"
- "\\left#{prefix}#{parameter_one}"
+ "\\left #{prefix}#{parameter_one}"
+ end
+
+ protected
+
+ def left_paren
+ return "{" if parameter_one == "\\{"
+
+ parameter_one
end
end
end
end
end