Sha256: cc3780a1c6737e37d58dc32f4cae4e7b44eac3d81e645bef7e75c55d466ee422

Contents?: true

Size: 699 Bytes

Versions: 8

Compression:

Stored size: 699 Bytes

Contents

# frozen_string_literal: true

require_relative "unary_function"

module Plurimath
  module Math
    module Function
      class Phantom < UnaryFunction
        def to_asciimath
          "#{Array.new(parameter_one&.length, '\ ').join}"
        end

        def to_html
          "<i>#{Array.new(parameter_one&.length, '&nbsp;').join}</i>"
        end

        def to_latex
          Array.new(parameter_one&.length, '\\ ').join
        end

        def to_mathml_without_math_tag
          phantom = Utility.ox_element("mphantom")
          Utility.update_nodes(
            phantom,
            parameter_one&.map(&:to_mathml_without_math_tag),
          )
        end
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
plurimath-0.6.0 lib/plurimath/math/function/phantom.rb
plurimath-0.5.0 lib/plurimath/math/function/phantom.rb
plurimath-0.4.4 lib/plurimath/math/function/phantom.rb
plurimath-0.4.3 lib/plurimath/math/function/phantom.rb
plurimath-0.4.2 lib/plurimath/math/function/phantom.rb
plurimath-0.4.1 lib/plurimath/math/function/phantom.rb
plurimath-0.3.9 lib/plurimath/math/function/phantom.rb
plurimath-0.3.8 lib/plurimath/math/function/phantom.rb