Class: String

Inherits:
Object
  • Object
show all
Defined in:
lib/to_latex.rb

Direct Known Subclasses

ToLatex::LatexString

Instance Method Summary collapse

Instance Method Details

#latex!Object

Convert a string to latex without escaping. Despite the bang, this is NOT destructive, it returns a new object.



66
67
68
# File 'lib/to_latex.rb', line 66

def latex!
  ToLatex::LatexString.new self
end

#latex?Boolean

Tells if this is a string converted to latex

Returns:

  • (Boolean)


71
72
73
# File 'lib/to_latex.rb', line 71

def latex?
  false
end

#to_latexObject

Convert a string to latex with escaping special characters.



60
61
62
# File 'lib/to_latex.rb', line 60

def to_latex
  ToLatex::LatexString.new ToLatex.escape(self)
end