Sha256: 283c5e795928259d406900648d880b40be81a4ce8073fe7cb2728895fb2ddecb

Contents?: true

Size: 928 Bytes

Versions: 17

Compression:

Stored size: 928 Bytes

Contents

# frozen_string_literal: true

require_relative "binary_function"

module Plurimath
  module Math
    module Function
      class Over < BinaryFunction
        def to_asciimath
          first_value = wrapped(parameter_one)
          second_value = wrapped(parameter_two)
          "overset#{first_value}#{second_value}"
        end

        def to_mathml_without_math_tag
          mover_tag    = Utility.ox_element("mfrac")
          first_value  = parameter_one&.to_mathml_without_math_tag
          second_value = parameter_two&.to_mathml_without_math_tag
          Utility.update_nodes(
            mover_tag,
            [
              first_value,
              second_value,
            ],
          )
        end

        def to_latex
          first_value = parameter_one&.to_latex
          two_value = parameter_two&.to_latex
          "{#{first_value} \\over #{two_value}}"
        end
      end
    end
  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
plurimath-0.3.7 lib/plurimath/math/function/over.rb
plurimath-0.3.6 lib/plurimath/math/function/over.rb
plurimath-0.3.5 lib/plurimath/math/function/over.rb
plurimath-0.3.4 lib/plurimath/math/function/over.rb
plurimath-0.3.3 lib/plurimath/math/function/over.rb
plurimath-0.3.2 lib/plurimath/math/function/over.rb
plurimath-0.3.1.2 lib/plurimath/math/function/over.rb
plurimath-0.3.1 lib/plurimath/math/function/over.rb
plurimath-0.3.0 lib/plurimath/math/function/over.rb
plurimath-0.2.9 lib/plurimath/math/function/over.rb
plurimath-0.2.8 lib/plurimath/math/function/over.rb
plurimath-0.2.7 lib/plurimath/math/function/over.rb
plurimath-0.2.6 lib/plurimath/math/function/over.rb
plurimath-0.2.5 lib/plurimath/math/function/over.rb
plurimath-0.2.4 lib/plurimath/math/function/over.rb
plurimath-0.2.3 lib/plurimath/math/function/over.rb
plurimath-0.2.2 lib/plurimath/math/function/over.rb