Sha256: 58b647cce6e5d07cf33b01c4e12ccce03eddb8626f611aeca7eb405c0f91111d

Contents?: true

Size: 1.04 KB

Versions: 2

Compression:

Stored size: 1.04 KB

Contents

module Plurimath
  module Math
    module Symbols
      class Dd < Symbol
        INPUT = {
          unicodemath: [["dd", "&#x2146;"], parsing_wrapper(["DifferentialD"])],
          asciimath: [["&#x2146;"], parsing_wrapper(["dd", "DifferentialD"])],
          mathml: ["&#x2146;"],
          latex: [["DifferentialD", "dd", "&#x2146;"]],
          omml: ["&#x2146;"],
          html: ["&#x2146;"],
        }.freeze

        # output methods
        def to_latex
          "\\DifferentialD"
        end

        def to_asciimath
          parsing_wrapper("dd")
        end

        def to_unicodemath
          encoded
        end

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

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

        def to_html
          "&#x2146;"
        end

        private

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

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
plurimath-0.8.12 lib/plurimath/math/symbols/dd.rb
plurimath-0.8.11 lib/plurimath/math/symbols/dd.rb