Method: MaRuKu::Out::Latex.init_entity_table
- Defined in:
- lib/maruku/output/to_latex_entities.rb
.init_entity_table ⇒ Object
create hash @@entity_to_latex
69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 |
# File 'lib/maruku/output/to_latex_entities.rb', line 69 def Latex.init_entity_table # $stderr.write "Creating entity table.." # $stderr.flush doc = Document.new XML_TABLE doc.elements.each("//char") do |c| num = c.attributes['num'].to_i name = c.attributes['name'] package = c.attributes['package'] convert = c.attributes['convertTo'] convert.gsub!(/@DOUBLEQUOT/,'"') convert.gsub!(/@QUOT/,"'") convert.gsub!(/@GT/,">") convert.gsub!(/@LT/,"<") convert.gsub!(/@AMP/,"&") convert.freeze e = LatexEntity.new e.html_num = num e.html_entity = name e.latex_string = convert e.latex_packages = package ? package.split : [] ENTITY_TABLE[num] = e ENTITY_TABLE[name] = e end # $stderr.puts "..done." end |