Sha256: bfe1e7d5557acad14f580f45a5aab765c3900434435b827a935c1b2e84f5296d

Contents?: true

Size: 1.16 KB

Versions: 10

Compression:

Stored size: 1.16 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

        def intent_names
          { name: encoded }
        end

        private

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

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
plurimath-0.8.26 lib/plurimath/math/symbols/ii.rb
plurimath-0.8.25 lib/plurimath/math/symbols/ii.rb
plurimath-0.8.24 lib/plurimath/math/symbols/ii.rb
plurimath-0.8.23 lib/plurimath/math/symbols/ii.rb
plurimath-0.8.22 lib/plurimath/math/symbols/ii.rb
plurimath-0.8.21 lib/plurimath/math/symbols/ii.rb
plurimath-0.8.20 lib/plurimath/math/symbols/ii.rb
plurimath-0.8.19 lib/plurimath/math/symbols/ii.rb
plurimath-0.8.18 lib/plurimath/math/symbols/ii.rb
plurimath-0.8.17 lib/plurimath/math/symbols/ii.rb