Sha256: 3a13e07482bac3dd7a1e2536ad8a649fd9740f14d2b83b491193fbc2bcd91fbd

Contents?: true

Size: 962 Bytes

Versions: 10

Compression:

Stored size: 962 Bytes

Contents

# frozen_string_literal: true

require_relative "unary_function"

module Plurimath
  module Math
    module Function
      class Substack < UnaryFunction
        FUNCTION = {
          name: "substack",
          first_value: "above",
          second_value: "below",
        }.freeze

        def to_asciimath
          "{:#{parameter_one.compact.map(&:to_asciimath).join(",")}:}"
        end

        def to_latex
          "\\#{class_name}{#{parameter_one&.compact&.map(&:to_latex)&.join(" \\\\ ")}}"
        end

        def to_mathml_without_math_tag
          Utility.update_nodes(
            Utility.ox_element("mtable"),
            mathml_value,
          )
        end

        def to_omml_without_math_tag(display_style)
          Table.new(parameter_one).to_omml_without_math_tag(display_style)
        end

        def to_unicodemath
          "■(#{parameter_one.compact.map(&:to_unicodemath).join("@")})"
        end
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
plurimath-0.8.10 lib/plurimath/math/function/substack.rb
plurimath-0.8.9 lib/plurimath/math/function/substack.rb
plurimath-0.8.8 lib/plurimath/math/function/substack.rb
plurimath-0.8.7 lib/plurimath/math/function/substack.rb
plurimath-0.8.6 lib/plurimath/math/function/substack.rb
plurimath-0.8.5 lib/plurimath/math/function/substack.rb
plurimath-0.8.4 lib/plurimath/math/function/substack.rb
plurimath-0.8.2 lib/plurimath/math/function/substack.rb
plurimath-0.8.1 lib/plurimath/math/function/substack.rb
plurimath-0.8.0 lib/plurimath/math/function/substack.rb