Sha256: 9cc2ebb63f24a0dabfba3e098196dafcce79b01363cd09c0c498c09f394f2611

Contents?: true

Size: 1.11 KB

Versions: 2

Compression:

Stored size: 1.11 KB

Contents

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

        # output methods
        def to_latex
          "\\ComplexJ"
        end

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

        def to_unicodemath
          Utility.html_entity_to_unicode("&#x2149;")
        end

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

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

        def to_html
          "&#x2149;"
        end

        private

        def encoded
          Utility.html_entity_to_unicode("&#x2149;")
        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/jj.rb
plurimath-0.8.13 lib/plurimath/math/symbols/jj.rb