Sha256: 887a6c39c307404b9305a4cd1d828307cc4db4fb1f099e493c55294faa1089f0

Contents?: true

Size: 1.08 KB

Versions: 2

Compression:

Stored size: 1.08 KB

Contents

module Plurimath
  module Math
    module Symbols
      class Ii < Symbol
        INPUT = {
          unicodemath: [["ii", "&#x2148;"], parsing_wrapper(["ComplexI"], lang: :unicode)],
          asciimath: [["&#x2148;"], parsing_wrapper(["ii", "ComplexI"], lang: :asciimath)],
          mathml: ["&#x2148;"],
          latex: [["ComplexI", "ii", "&#x2148;"]],
          omml: ["&#x2148;"],
          html: ["&#x2148;"],
        }.freeze

        # output methods
        def to_latex
          "\\ComplexI"
        end

        def to_asciimath
          parsing_wrapper("ii", lang: :asciimath)
        end

        def to_unicodemath
          encoded
        end

        def to_mathml_without_math_tag(intent)
          attributes = { intent: encoded } if intent
          ox_element("mi", attributes: attributes) << "&#x2148;"
        end

        def to_omml_without_math_tag(_)
          "&#x2148;"
        end

        def to_html
          "&#x2148;"
        end

        private

        def encoded
          Utility.html_entity_to_unicode("&#x2148;")
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
plurimath-0.8.14 lib/plurimath/math/symbols/ii.rb
plurimath-0.8.13 lib/plurimath/math/symbols/ii.rb