module ToLatex::Convertible

Public Instance Methods

to_latex() click to toggle source

Convert an object to latex with escaping

# File lib/to_latex.rb, line 80
def to_latex
  to_s.to_latex
end
to_latex_math(open = "\\ensuremath{", close = nil) click to toggle source

Convert an object to latex with escaping and adding ensuremath{}, $$ or other delimiter around

# File lib/to_latex.rb, line 85
def to_latex_math open = "\\ensuremath{", close = nil
  close ||= ToLatex::DELIMITER_PAIRS[open] || open
  ToLatex::LatexString.new "#{open}#{to_latex}#{close}"
end