LaTeX::Table::Types::Ctable - Create LaTeX tables with the ctable package.


LaTeX-Table documentation Contained in the LaTeX-Table distribution.

Index


Code Index:

NAME

Top

LaTeX::Table::Types::Ctable - Create LaTeX tables with the ctable package.

INTERFACE

Top

generate_latex_code

SEE ALSO

Top

LaTeX::Table, LaTeX::Table::Types::TypeI

LICENSE AND COPYRIGHT

Top


LaTeX-Table documentation Contained in the LaTeX-Table distribution.

package LaTeX::Table::Types::Ctable;
use Moose;

with 'LaTeX::Table::Types::TypeI';

use version; our $VERSION = qv('1.0.6');

my $template = <<'EOT'
{[% DEFINE_COLORS_CODE %][% IF FONTSIZE %]\[% FONTSIZE %]
[% END %][% IF FONTFAMILY %]\[% FONTFAMILY %]family
[% END %][% EXTRA_ROW_HEIGHT_CODE %][% RULES_WIDTH_GLOBAL_CODE %][% RESIZEBOX_BEGIN_CODE %]
\ctable[[% IF CAPTION %]caption = {[% CAPTION %]},
[% IF SHORTCAPTION %]cap = {[% SHORTCAPTION %]},
[% END %][% UNLESS CAPTION_TOP %]botcap,
[% END %][% END %][% IF POSITION %]pos = [% POSITION %],
[% END %][% IF LABEL %]label = {[% LABEL %]},
[% END %][% IF MAXWIDTH %]maxwidth = {[% MAXWIDTH %]},
[% END %][% IF WIDTH %]width = {[% WIDTH %]},
[% END %][% IF CENTER %]center,
[% END %][% IF LEFT %]left,
[% END %][% IF RIGHT %]right,
[% END %][% IF SIDEWAYS %]sideways,
[% END %][% IF STAR %]star,
[% END %][% IF CONTINUED %]continued = {[% CONTINUEDMSG %]},
[% END %]]{[% COLDEF %]}{[% FOOTTABLE %]}{
[% RULES_COLOR_GLOBAL_CODE %][% HEADER_CODE %][% DATA_CODE %]}
[% RESIZEBOX_END_CODE %]}
EOT
    ;

has '+_tabular_environment' => ( default => 'tabular' );
has '+_template'            => ( default => $template );

# default width environment is tabularx
after '_check_options' => sub {
    my ($self) = @_;
    if ( $self->_table_obj->get_width || $self->_table_obj->get_maxwidth ) {
        $self->_table_obj->set_width_environment('tabularx');
    }
};

1;

__END__

# vim: ft=perl sw=4 ts=4 expandtab