lib/plurimath/math/function/font_style/sans-serif.rb in plurimath-0.2.1 vs lib/plurimath/math/function/font_style/sans-serif.rb in plurimath-0.2.2
- old
+ new
@@ -9,9 +9,28 @@
class SansSerif < FontStyle
def initialize(parameter_one,
parameter_two = "sans-serif")
super
end
+
+ def to_asciimath
+ "mathsf(#{parameter_one.to_asciimath})"
+ end
+
+ def to_latex
+ first_value = parameter_one.to_latex if parameter_one
+ "\\mathsf{#{first_value}}"
+ end
+
+ def to_mathml_without_math_tag
+ Utility.update_nodes(
+ Utility.ox_element(
+ "mstyle",
+ attributes: { mathvariant: "sans-serif" },
+ ),
+ [parameter_one.to_mathml_without_math_tag],
+ )
+ end
end
end
end
end
end