Module: MathML::String

Included in:
String
Defined in:
lib/math_ml/string.rb

Constant Summary collapse

@@mathml_latex_parser =
nil

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.mathml_latex_parserObject



14
15
16
17
# File 'lib/math_ml/string.rb', line 14

def self.mathml_latex_parser
	@@mathml_latex_parser = MathML::LaTeX::Parser.new unless @@mathml_latex_parser
	@@mathml_latex_parser
end

.mathml_latex_parser=(mlp) ⇒ Object

Raises:

  • (TypeError)


19
20
21
22
# File 'lib/math_ml/string.rb', line 19

def self.mathml_latex_parser=(mlp)
	raise TypeError unless mlp.is_a?(MathML::LaTeX::Parser) || mlp==nil
	@@mathml_latex_parser = mlp
end

Instance Method Details

#to_mathml(displaystyle = false) ⇒ Object



24
25
26
# File 'lib/math_ml/string.rb', line 24

def to_mathml(displaystyle=false)
	MathML::String.mathml_latex_parser.parse(self, displaystyle)
end