Class: Latexmath::Converter

Inherits:
Object
  • Object
show all
Defined in:
lib/latexmath/converter.rb

Instance Method Summary collapse

Constructor Details

#initialize(aggregate) ⇒ Converter

Returns a new instance of Converter.



3
4
5
# File 'lib/latexmath/converter.rb', line 3

def initialize(aggregate)
  @aggregate = aggregate
end

Instance Method Details

#convert(xmlns = 'http://www.w3.org/1998/Math/MathML', display = 'block') ⇒ Object



7
8
9
10
11
12
13
14
15
16
# File 'lib/latexmath/converter.rb', line 7

def convert(xmlns = 'http://www.w3.org/1998/Math/MathML', display = 'block')
  @doc = Ox::Document.new
  math = Ox::Element.new('math')
  math = Latexmath::XML::Element.new(@doc, 'math', { xmlns: xmlns, display: display })
  mrow = Latexmath::XML::Element.new(math, 'mrow')

  classify_subgroup(@aggregate, mrow)

  Ox.dump(@doc, indent: -1)
end