File Coverage

blib/lib/LaTeX/Table/Types/Ctable.pm
Criterion Covered Total %
statement 1 3 33.3
branch n/a
condition n/a
subroutine 1 1 100.0
pod n/a
total 2 4 50.0


line stmt bran cond sub pod time code
1             package LaTeX::Table::Types::Ctable;
2 1     1   1716 use Moose;
  0            
  0            
3              
4             with 'LaTeX::Table::Types::TypeI';
5              
6             use version; our $VERSION = qv('1.0.6');
7              
8             my $template = <<'EOT'
9             {[% DEFINE_COLORS_CODE %][% IF FONTSIZE %]\[% FONTSIZE %]
10             [% END %][% IF FONTFAMILY %]\[% FONTFAMILY %]family
11             [% END %][% EXTRA_ROW_HEIGHT_CODE %][% RULES_WIDTH_GLOBAL_CODE %][% RESIZEBOX_BEGIN_CODE %]
12             \ctable[[% IF CAPTION %]caption = {[% CAPTION %]},
13             [% IF SHORTCAPTION %]cap = {[% SHORTCAPTION %]},
14             [% END %][% UNLESS CAPTION_TOP %]botcap,
15             [% END %][% END %][% IF POSITION %]pos = [% POSITION %],
16             [% END %][% IF LABEL %]label = {[% LABEL %]},
17             [% END %][% IF MAXWIDTH %]maxwidth = {[% MAXWIDTH %]},
18             [% END %][% IF WIDTH %]width = {[% WIDTH %]},
19             [% END %][% IF CENTER %]center,
20             [% END %][% IF LEFT %]left,
21             [% END %][% IF RIGHT %]right,
22             [% END %][% IF SIDEWAYS %]sideways,
23             [% END %][% IF STAR %]star,
24             [% END %][% IF CONTINUED %]continued = {[% CONTINUEDMSG %]},
25             [% END %]]{[% COLDEF %]}{[% FOOTTABLE %]}{
26             [% RULES_COLOR_GLOBAL_CODE %][% HEADER_CODE %][% DATA_CODE %]}
27             [% RESIZEBOX_END_CODE %]}
28             EOT
29             ;
30              
31             has '+_tabular_environment' => ( default => 'tabular' );
32             has '+_template' => ( default => $template );
33              
34             # default width environment is tabularx
35             after '_check_options' => sub {
36             my ($self) = @_;
37             if ( $self->_table_obj->get_width || $self->_table_obj->get_maxwidth ) {
38             $self->_table_obj->set_width_environment('tabularx');
39             }
40             };
41              
42             1;
43              
44             __END__
45              
46             =head1 NAME
47              
48             LaTeX::Table::Types::Ctable - Create LaTeX tables with the ctable package.
49              
50             =head1 INTERFACE
51              
52             =over
53              
54             =item C<generate_latex_code>
55              
56             =back
57              
58             =head1 SEE ALSO
59              
60             L<LaTeX::Table>, L<LaTeX::Table::Types::TypeI>
61              
62             =head1 LICENSE AND COPYRIGHT
63              
64             Copyright (c) 2006-2010 C<< <limaone@cpan.org> >>
65              
66             This module is free software; you can redistribute it and/or
67             modify it under the same terms as Perl itself. See L<perlartistic>.
68              
69             =cut
70              
71             # vim: ft=perl sw=4 ts=4 expandtab