Sha256: a928505291c5cbf07385cf52c327c81548adbb5e39bbe5f6ac699562d37e9009

Contents?: true

Size: 724 Bytes

Versions: 3

Compression:

Stored size: 724 Bytes

Contents

# frozen_string_literal: true

require_relative "../table"

module Plurimath
  module Math
    module Function
      class Table
        class Vmatrix < Table
          def initialize(value,
                         open_paren = "|",
                         close_paren = "|",
                         options = {})
            super
          end

          def to_latex
            "\\begin#{opening}#{latex_content}\\end#{matrix_class}"
          end

          def to_unicodemath
            "#{matrix_symbol}(#{value.map(&:to_unicodemath).join("@")})"
          end

          private

          def matrix_symbol
            open_paren == "norm[" ? "⒩" : "⒱"
          end
        end
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
plurimath-0.8.2 lib/plurimath/math/function/table/vmatrix.rb
plurimath-0.8.1 lib/plurimath/math/function/table/vmatrix.rb
plurimath-0.8.0 lib/plurimath/math/function/table/vmatrix.rb