Class: Func

Inherits:
Latex show all
Defined in:
lib/annlat/LaRuby.rb

Overview

represents @name(@args)

Instance Method Summary collapse

Methods inherited from Latex

#*, #**, #+, #-, #-@, #/, #glue, #is, #my_json, #ne, #of, #to_ltx, #wrap

Constructor Details

#initialize(some_name, *some_args) ⇒ Func

Returns a new instance of Func.



59
60
61
62
# File 'lib/annlat/LaRuby.rb', line 59

def initialize(some_name, *some_args)
  @name = some_name.to_ltx
  @args = some_args.map{|a| a.to_ltx}  
end

Instance Method Details

#latexObject



64
65
66
67
68
69
# File 'lib/annlat/LaRuby.rb', line 64

def latex
  return (@name.latex + '()') if @args.length == 0
  str = @args[0].latex
  @args[1..-1].each {|a| str += (',' + a.latex)}
  @name.latex + '(' + str + ')'
end