Sha256: a0ff95a104a6a8f593cf9ebbf499106f24f54c2f6294acf2d3a76a41a8fb8f8c
Contents?: true
Size: 1.31 KB
Versions: 15
Compression:
Stored size: 1.31 KB
Contents
# frozen_string_literal: true require_relative "unary_function" module Plurimath module Math module Function class Bar < UnaryFunction def to_latex first_value = "{#{parameter_one.to_latex}}" if parameter_one "\\overline#{first_value}" end def to_mathml_without_math_tag first_value = parameter_one&.to_mathml_without_math_tag Utility.update_nodes( Utility.ox_element("mover"), [ first_value, Utility.ox_element("mo") << "¯", ], ) end def to_omml_without_math_tag bar = Utility.ox_element("bar", namespace: "m") me = Utility.ox_element("e", namespace: "m") me << parameter_one.to_omml_without_math_tag if parameter_one Utility.update_nodes( bar, [ bar_pr, me, ], ) end protected def bar_pr attrs = { "m:val": "top" } barpr = Utility.ox_element("barPr", namespace: "m") pos = Utility.ox_element("pos", namespace: "m", attributes: attrs) ctrlp = Utility.pr_element("ctrl", true, namespace: "m") Utility.update_nodes(barpr, [pos, ctrlp]) end end end end end
Version data entries
15 entries across 15 versions & 1 rubygems