Sha256: fe6ae3e01b19715a754606440b17d4624a7ce92f30e5f9e8c378f06c386eb015
Contents?: true
Size: 1.17 KB
Versions: 7
Compression:
Stored size: 1.17 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 to_mathml_without_math_tag Utility.update_nodes( ox_element("mtable", attributes: table_attribute), value&.map(&:to_mathml_without_math_tag), ) end private 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 end end end end end
Version data entries
7 entries across 7 versions & 1 rubygems