Class: Octopress::Printable::MathConverter

Inherits:
Converter
  • Object
show all
Defined in:
lib/octopress-printable/math.rb

Instance Attribute Summary

Attributes inherited from Converter

#match

Instance Method Summary collapse

Methods inherited from Converter

#before_xelatex, #envs, get_includes, #header, #initialize, #last_xelatex, #pandoc_args, timestamp, #xelatex_args

Constructor Details

This class inherits a constructor from Octopress::Printable::Converter

Instance Method Details

#convert(line) ⇒ Object



5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/octopress-printable/math.rb', line 5

def convert(line)
  str = line.gsub(/\$\$\s*\\begin{equation}/, '\\begin{equation}')
  str.gsub!(/\\end{equation}\s*\$\$/, '\\end{equation}')

  str.gsub!(/\\\*/, '*')
  str.gsub!(/\\\|/, '|')
  str.gsub!(/\\_/, '_')

  if !@match
    if str != line
      @match = true
    end
  end

  str
end