Class: ConTeXtSetup::TeX

Inherits:
Param show all
Defined in:
lib/tex/context/contextsetup.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Param

#opt, #optional?, #sanitize_html, #show

Methods inherited from SetupXML

parse_xml, tag_method

Constructor Details

#initialize(interface) ⇒ TeX

Returns a new instance of TeX.



448
449
450
451
452
# File 'lib/tex/context/contextsetup.rb', line 448

def initialize(interface)
  @interface=interface
  @separator=nil
  @command=nil
end

Instance Attribute Details

#commandObject

The command that all this is about (without any backslashes)



441
442
443
# File 'lib/tex/context/contextsetup.rb', line 441

def command
  @command
end

#separatorObject

If set, usually set to \ (backslash)



439
440
441
# File 'lib/tex/context/contextsetup.rb', line 439

def separator
  @separator
end

Instance Method Details

#==(other) ⇒ Object



460
461
462
# File 'lib/tex/context/contextsetup.rb', line 460

def ==(other)
  ConTeXtSetup::TeX===other && @separator==other.separator && @command == other.command
end

#parse_xml(elt) ⇒ Object



442
443
444
445
446
447
# File 'lib/tex/context/contextsetup.rb', line 442

def parse_xml(elt)
  if elt.attributes["separator"]
    @separator = "\\\\"
  end
  @command   = elt.attributes["command"]
end

#to_html(detail = true, cls = 'first') ⇒ Object



453
454
455
456
457
458
459
# File 'lib/tex/context/contextsetup.rb', line 453

def to_html(detail=true,cls='first')
  if detail
    ""
  else
    "#{@separator}\\#{@command}"
  end
end