Sha256: 11bf88d654ea7ff55c07fb125ad8256947dd8b84550a6b52ec254e13b4343d0d

Contents?: true

Size: 656 Bytes

Versions: 12

Compression:

Stored size: 656 Bytes

Contents

module MaRuKu; class MDElement
	
	def md_inline_math(math)
		self.md_el(:inline_math, [], meta={:math=>math})
	end

	def md_equation(math, label, numerate)
		reglabel= /\\label\{(\w+)\}/
		if math =~ reglabel
			label = $1
			math.gsub!(reglabel,'')
		end
#		puts "Found label = #{label} math #{math.inspect} "
		num = nil
		if (label || numerate) && @doc #take number
			@doc.eqid2eq ||= {}	
			num = @doc.eqid2eq.size + 1
			label = "eq#{num}" if not label      # FIXME do id for document
		end
		e = self.md_el(:equation, [], meta={:math=>math, :label=>label,:num=>num})
		if label && @doc #take number
			@doc.eqid2eq[label] = e
		end
		e
	end

end end

Version data entries

12 entries across 12 versions & 5 rubygems

Version Path
bai-maruku-0.5.9 lib/maruku/ext/math/elements.rb
remi-maruku-0.5.9 lib/maruku/ext/math/elements.rb
maruku-0.6.1 lib/maruku/ext/math/elements.rb
maiku-0.6.1.maiku lib/maruku/ext/math/elements.rb
vanity-1.7.1 vendor/ruby/1.9.1/gems/maruku-0.6.0/lib/maruku/ext/math/elements.rb
maruku-0.5.4 lib/maruku/ext/math/elements.rb
maruku-0.5.6 lib/maruku/ext/math/elements.rb
maruku-0.5.5 lib/maruku/ext/math/elements.rb
maruku-0.6.0 lib/maruku/ext/math/elements.rb
maruku-0.5.7 lib/maruku/ext/math/elements.rb
maruku-0.5.9 lib/maruku/ext/math/elements.rb
maruku-0.5.8 lib/maruku/ext/math/elements.rb