Class: Docgenerator::Tables::Caption

Inherits:
Element show all
Defined in:
lib/docgenerator/tabular.rb

Overview

Define a caption.

If the option longtable is set, then a \ is added (needed if a \caption is set inside a longtable-environment)

Constant Summary

Constants inherited from Element

Element::SUPPORTED_TARGETS

Constants included from Docgenerator

ATTR_LANG, CSS_BORDER, CSS_COLORS, CSS_WIDTH, DOCGENERATOR_DEFAULT_LOGGER, DOCGENERATOR_LOGGER, ENDTAG, HTML_ATTR_ALIGN, HTML_ATTR_ALL, HTML_ATTR_CORE, HTML_ATTR_EVENTS, HTML_ATTR_I18N, HTML_ATTR_VALIGN, VERSION

Instance Attribute Summary

Attributes inherited from Element

#attr, #content, #log

Instance Method Summary collapse

Methods inherited from Element

#<<, #CR, #Cr, #[], add, add_attribute, add_attributes, add_context_output, add_creole_output, add_html_output, add_html_tag, add_id, add_latex_output, add_output, add_text_output, add_wiki_output, attributes, #cR, #content?, #cr, create, create_convert_to_code, #delete, element_ids, #element_ids, #empty?, get, get_attribute_list, has_no_content, #htmltag, #ids, inherited, #initialize, #insert, #insertafter, #insertbefore, #inspect, #inspect_creation_caller, #linebreak, overview, #prepare_tracing_info, #restrict_to, #texkeyval, #texoptional, #to_context, #to_creole, #to_doc, #to_html, #to_s, #to_text, #to_wiki, trace=

Methods included from Docgenerator

#set_option_defaults, set_option_defaults, trace_off, trace_on, trace_on?

Constructor Details

This class inherits a constructor from Docgenerator::Element

Instance Method Details

#to_latex(options = {}) ⇒ Object



640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
# File 'lib/docgenerator/tabular.rb', line 640

def to_latex(options= {})
  cmd	=	''
  cmd	<<	"\n" if @crbefore
  cmd	<<	"\\caption"
  if @attr[:optional].content != []
    cmd	<<	"["
    cmd	<<	@attr[:optional].content.to_s
    cmd	<<	"]"
    cmd	<<	"\n\t" if @crmid
  end
  cmd	<<	"{"
  cmd	<< @content.to_latex(options)
  cmd	<<	"}"
  cmd << '\\\\' if @attr[:longtable].content != []
  cmd	<<	"\n" if @crafter
  return cmd
end