dotfiles

My personal dotfiles 💠️

block_stem.html.haml (396B)

      1 - require 'asciimath'
      2 - require 'mathematical'
      3 - require 'escape_utils'
      4 - case @style.to_sym
      5 - when :asciimath
      6   - amath = EscapeUtils.unescape_html(content)
      7   - tex = "$$#{AsciiMath.parse(amath).to_latex}$$"
      8 - when :latexmath
      9   - tex = "$$#{EscapeUtils.unescape_html(content)}$$"
     10 
     11 - svg = Mathematical.new.render(tex)
     12 - if svg[:data] and not svg[:exception]
     13   %figure.equation
     14     =(svg[:data])