Class: Object

Inherits:
BasicObject
Defined in:
lib/to_latex.rb

Instance Method Summary collapse

Instance Method Details

#to_latexObject

Convert an object to latex with escaping



80
81
82
# File 'lib/to_latex.rb', line 80

def to_latex
  to_s.to_latex
end

#to_latex_math(open = "\\ensuremath{", close = nil) ⇒ Object

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



85
86
87
88
# 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