Sha256: 049a740deca4198011b1ad76fb9296b2cc6e911205336b593864907678ec211f
Contents?: true
Size: 1.18 KB
Versions: 25
Compression:
Stored size: 1.18 KB
Contents
# frozen_string_literal: true require_relative "../table" module Plurimath module Math module Function class Table class Array < Table def initialize(value = [], open_paren = "[", close_paren = "]", options = {}) super end def to_latex "\\begin{array}#{array_args}#{latex_content}\\end{array}" end def array_args args = [] value.first.parameter_one.each do |td| args << if Utility.symbol_value(td.parameter_one.first, "|") "|" else Utility::ALIGNMENT_LETTERS.invert[Hash(td.parameter_two)[:columnalign]]&.to_s end end "{#{args.join}}" unless args.compact.empty? end def to_mathml_without_math_tag table_tag = Utility.ox_element("mtable", attributes: table_attribute) Utility.update_nodes( table_tag, value&.map(&:to_mathml_without_math_tag), ) end end end end end end
Version data entries
25 entries across 25 versions & 1 rubygems