Class: Docgenerator::Tables::Longtable

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

Overview

Use longtable-package: ctan.org/pkg/longtable

Requires doc.head << element(:usepackage,{},‘longtable’)

or

doc.head << Docgenerator::Tables::TEX_PACKAGE_LONGTABLE

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 Tabular

#<<, #htmltag, #inspect, #to_creole, #to_text, #to_wiki

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



128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
# File 'lib/docgenerator/tabular.rb', line 128

def to_latex(options={})
  o = set_option_defaults(options)
  o[:log].debug("enter to_latex for longtable") if o[:log].debug?
  cmd	=	''
  cmd	<<	"\n" if @crbefore
  cmd	<<	"\\begin{longtable}"
  cmd	<<	"[%s]" % @attr[:texalignment].content.first if @attr[:texalignment]
  cmd	<<	"{"
  cmd	<<	@attr[:columndescription].content.to_doc(:latex, o)
  cmd	<<	"}"
  cmd	<<	"\n" if @crmid
  cmd	<< @content.to_latex(o)
  cmd	<<	"\\end{longtable}"
  cmd	<<	"\n" if @crafter
  return cmd
end