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