Sha256: e485a9c839d3ed405e326ff1c03513be2dff7ebf66d71098c187640c6dfcc0b1

Contents?: true

Size: 567 Bytes

Versions: 5

Compression:

Stored size: 567 Bytes

Contents

module MaRuKu::Out::HTML
	def convert_to_mathml_ritex(kind, tex)
		begin
			if not $ritex_parser
				require 'ritex'
			 	$ritex_parser = Ritex::Parser.new
			end
			
			mathml =  $ritex_parser.parse(tex.strip)
			doc = Document.new(mathml, {:respect_whitespace =>:all}).root
			return doc
		rescue LoadError => e
			maruku_error "Could not load package 'ritex'.\n"+
			"Please install it using:\n"+
			"   $ gem install ritex\n\n"+e.inspect
		rescue Racc::ParseError => e
			maruku_error "Could not parse TeX: \n#{tex}"+
				"\n\n #{e.inspect}"
		end
		nil
	end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
maruku-0.7.3 lib/maruku/ext/math/mathml_engines/ritex.rb
maruku-0.7.2 lib/maruku/ext/math/mathml_engines/ritex.rb
maruku-0.7.1 lib/maruku/ext/math/mathml_engines/ritex.rb
maruku-0.7.0 lib/maruku/ext/math/mathml_engines/ritex.rb
maruku-0.7.0.beta1 lib/maruku/ext/math/mathml_engines/ritex.rb