| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
package LaTeX::Table::Types::TypeI; |
|
2
|
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
1522
|
use strict; |
|
|
1
|
|
|
|
|
2
|
|
|
|
1
|
|
|
|
|
32
|
|
|
4
|
1
|
|
|
1
|
|
5
|
use warnings; |
|
|
1
|
|
|
|
|
2
|
|
|
|
1
|
|
|
|
|
21
|
|
|
5
|
|
|
|
|
|
|
|
|
6
|
1
|
|
|
1
|
|
349
|
use Moose::Role; |
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
use Template; |
|
8
|
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
use version; our $VERSION = qv('1.0.6'); |
|
10
|
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
use Carp; |
|
12
|
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
has '_table_obj' => ( is => 'rw', isa => 'LaTeX::Table', required => 1 ); |
|
14
|
|
|
|
|
|
|
has '_tabular_environment' => ( is => 'ro', required => 1 ); |
|
15
|
|
|
|
|
|
|
has '_template' => ( is => 'ro', required => 1 ); |
|
16
|
|
|
|
|
|
|
has '_is_floating' => ( is => 'ro', default => 1, required => 1 ); |
|
17
|
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
sub generate_latex_code { |
|
19
|
|
|
|
|
|
|
my ($self) = @_; |
|
20
|
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
$self->_check_options(); |
|
22
|
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
my $tbl = $self->_table_obj; |
|
24
|
|
|
|
|
|
|
my $theme = $tbl->get_theme_settings; |
|
25
|
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
if ( !$tbl->get_tabletail() ) { |
|
27
|
|
|
|
|
|
|
$tbl->set_tabletail( $self->_get_default_tabletail_code() ); |
|
28
|
|
|
|
|
|
|
} |
|
29
|
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
my $template_vars = { |
|
31
|
|
|
|
|
|
|
'CENTER' => $tbl->_get_default_align ? 1 : $tbl->get_center, |
|
32
|
|
|
|
|
|
|
'LEFT' => $tbl->get_left(), |
|
33
|
|
|
|
|
|
|
'RIGHT' => $tbl->get_right(), |
|
34
|
|
|
|
|
|
|
'ENVIRONMENT' => $tbl->get_environment, |
|
35
|
|
|
|
|
|
|
'FONTFAMILY' => $tbl->get_fontfamily(), |
|
36
|
|
|
|
|
|
|
'FONTSIZE' => $tbl->get_fontsize(), |
|
37
|
|
|
|
|
|
|
'FOOTTABLE' => $tbl->get_foottable(), |
|
38
|
|
|
|
|
|
|
'POSITION' => $tbl->get_position(), |
|
39
|
|
|
|
|
|
|
'CAPTION_TOP' => $tbl->get_caption_top(), |
|
40
|
|
|
|
|
|
|
'CAPTION' => $self->_get_caption(), |
|
41
|
|
|
|
|
|
|
'CAPTION_CMD' => $self->_get_caption_command(), |
|
42
|
|
|
|
|
|
|
'CONTINUED' => $tbl->get_continued(), |
|
43
|
|
|
|
|
|
|
'CONTINUEDMSG' => $tbl->get_continuedmsg(), |
|
44
|
|
|
|
|
|
|
'SHORTCAPTION' => ( |
|
45
|
|
|
|
|
|
|
$tbl->get_maincaption ? $tbl->get_maincaption |
|
46
|
|
|
|
|
|
|
: $tbl->get_shortcaption ? $tbl->get_shortcaption |
|
47
|
|
|
|
|
|
|
: 0 |
|
48
|
|
|
|
|
|
|
), |
|
49
|
|
|
|
|
|
|
'SIDEWAYS' => $tbl->get_sideways(), |
|
50
|
|
|
|
|
|
|
'STAR' => $tbl->get_star(), |
|
51
|
|
|
|
|
|
|
'WIDTH' => $tbl->get_width(), |
|
52
|
|
|
|
|
|
|
'MAXWIDTH' => $tbl->get_maxwidth(), |
|
53
|
|
|
|
|
|
|
'COLDEF' => $tbl->get_coldef ? $tbl->get_coldef |
|
54
|
|
|
|
|
|
|
: $tbl->_get_coldef_code( $tbl->get_data ), |
|
55
|
|
|
|
|
|
|
'LABEL' => $tbl->get_label(), |
|
56
|
|
|
|
|
|
|
'TABLEHEADMSG' => $tbl->get_tableheadmsg(), |
|
57
|
|
|
|
|
|
|
'TABLETAIL' => $tbl->get_tabletail(), |
|
58
|
|
|
|
|
|
|
'TABLELASTTAIL' => $tbl->get_tablelasttail(), |
|
59
|
|
|
|
|
|
|
'XENTRYSTRETCH' => $tbl->get_xentrystretch(), |
|
60
|
|
|
|
|
|
|
'HEADER_CODE' => $tbl->_get_matrix_latex_code( $tbl->get_header, 1 ), |
|
61
|
|
|
|
|
|
|
'DATA_CODE' => $tbl->_get_matrix_latex_code( $tbl->get_data, 0 ), |
|
62
|
|
|
|
|
|
|
'TABULAR_ENVIRONMENT' => $self->_get_tabular_environment(), |
|
63
|
|
|
|
|
|
|
'EXTRA_ROW_HEIGHT_CODE' => ( |
|
64
|
|
|
|
|
|
|
defined $theme->{EXTRA_ROW_HEIGHT} |
|
65
|
|
|
|
|
|
|
? '\setlength{\extrarowheight}{' |
|
66
|
|
|
|
|
|
|
. $theme->{EXTRA_ROW_HEIGHT} . "}\n" |
|
67
|
|
|
|
|
|
|
: q{} |
|
68
|
|
|
|
|
|
|
), |
|
69
|
|
|
|
|
|
|
'RULES_COLOR_GLOBAL_CODE' => ( |
|
70
|
|
|
|
|
|
|
defined $theme->{RULES_COLOR_GLOBAL} |
|
71
|
|
|
|
|
|
|
? $theme->{RULES_COLOR_GLOBAL} . "\n" |
|
72
|
|
|
|
|
|
|
: q{} |
|
73
|
|
|
|
|
|
|
), |
|
74
|
|
|
|
|
|
|
'RULES_WIDTH_GLOBAL_CODE' => ( |
|
75
|
|
|
|
|
|
|
defined $theme->{RULES_WIDTH_GLOBAL} |
|
76
|
|
|
|
|
|
|
? $theme->{RULES_WIDTH_GLOBAL} . "\n" |
|
77
|
|
|
|
|
|
|
: q{} |
|
78
|
|
|
|
|
|
|
), |
|
79
|
|
|
|
|
|
|
'RESIZEBOX_BEGIN_CODE' => $self->_get_begin_resizebox_code(), |
|
80
|
|
|
|
|
|
|
'RESIZEBOX_END_CODE' => ( |
|
81
|
|
|
|
|
|
|
$self->_table_obj->get_resizebox ? "}\n" |
|
82
|
|
|
|
|
|
|
: q{} |
|
83
|
|
|
|
|
|
|
), |
|
84
|
|
|
|
|
|
|
'DEFINE_COLORS_CODE' => ( |
|
85
|
|
|
|
|
|
|
defined $tbl->get_theme_settings->{DEFINE_COLORS} |
|
86
|
|
|
|
|
|
|
? $tbl->get_theme_settings->{DEFINE_COLORS} . "\n" |
|
87
|
|
|
|
|
|
|
: q{} |
|
88
|
|
|
|
|
|
|
), |
|
89
|
|
|
|
|
|
|
'LT_NUM_COLUMNS' => scalar( @{ $tbl->_get_data_summary() } ), |
|
90
|
|
|
|
|
|
|
'LT_BOTTOM_RULE_CODE' => |
|
91
|
|
|
|
|
|
|
$tbl->_get_hline_code( $tbl->_get_RULE_BOTTOM_ID ), |
|
92
|
|
|
|
|
|
|
}; |
|
93
|
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
my $template_obj = Template->new(); |
|
95
|
|
|
|
|
|
|
my $template |
|
96
|
|
|
|
|
|
|
= $tbl->get_custom_template |
|
97
|
|
|
|
|
|
|
? $tbl->get_custom_template |
|
98
|
|
|
|
|
|
|
: $self->_template; |
|
99
|
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
my $template_output; |
|
101
|
|
|
|
|
|
|
|
|
102
|
|
|
|
|
|
|
$template_obj->process( \$template, $template_vars, \$template_output ) |
|
103
|
|
|
|
|
|
|
or croak $template_obj->error(); |
|
104
|
|
|
|
|
|
|
return $template_output; |
|
105
|
|
|
|
|
|
|
} |
|
106
|
|
|
|
|
|
|
|
|
107
|
|
|
|
|
|
|
sub _check_options { |
|
108
|
|
|
|
|
|
|
my ($self) = @_; |
|
109
|
|
|
|
|
|
|
my $tbl = $self->_table_obj; |
|
110
|
|
|
|
|
|
|
|
|
111
|
|
|
|
|
|
|
# default floating enviromnent is table |
|
112
|
|
|
|
|
|
|
if ( $tbl->get_environment eq '1' ) { |
|
113
|
|
|
|
|
|
|
$tbl->set_environment('table'); |
|
114
|
|
|
|
|
|
|
} |
|
115
|
|
|
|
|
|
|
|
|
116
|
|
|
|
|
|
|
if ( !$self->_is_floating ) { |
|
117
|
|
|
|
|
|
|
if ( !$tbl->get_environment ) { |
|
118
|
|
|
|
|
|
|
$tbl->_invalid_option_usage( 'environment', |
|
119
|
|
|
|
|
|
|
$tbl->get_type |
|
120
|
|
|
|
|
|
|
. ' is non-floating and requires an environment' ); |
|
121
|
|
|
|
|
|
|
} |
|
122
|
|
|
|
|
|
|
if ( $tbl->get_position ) { |
|
123
|
|
|
|
|
|
|
$tbl->_invalid_option_usage( 'position', |
|
124
|
|
|
|
|
|
|
$tbl->get_type |
|
125
|
|
|
|
|
|
|
. ' is non-floating and thus does not support position' ); |
|
126
|
|
|
|
|
|
|
} |
|
127
|
|
|
|
|
|
|
} |
|
128
|
|
|
|
|
|
|
|
|
129
|
|
|
|
|
|
|
# check center, right, left options |
|
130
|
|
|
|
|
|
|
my $cnt_true_alignments = 0; |
|
131
|
|
|
|
|
|
|
for my $align ( $tbl->get_center, $tbl->get_right, $tbl->get_left ) { |
|
132
|
|
|
|
|
|
|
if ($align) { |
|
133
|
|
|
|
|
|
|
$cnt_true_alignments++; |
|
134
|
|
|
|
|
|
|
} |
|
135
|
|
|
|
|
|
|
} |
|
136
|
|
|
|
|
|
|
if ( $cnt_true_alignments > 1 ) { |
|
137
|
|
|
|
|
|
|
$tbl->_invalid_option_usage( 'center, left, right', |
|
138
|
|
|
|
|
|
|
'only one allowed.' ); |
|
139
|
|
|
|
|
|
|
} |
|
140
|
|
|
|
|
|
|
if ( $tbl->has_center || $tbl->has_right || $tbl->has_left ) { |
|
141
|
|
|
|
|
|
|
$tbl->_set_default_align(0); |
|
142
|
|
|
|
|
|
|
} |
|
143
|
|
|
|
|
|
|
else { |
|
144
|
|
|
|
|
|
|
$tbl->_set_default_align(1); |
|
145
|
|
|
|
|
|
|
} |
|
146
|
|
|
|
|
|
|
|
|
147
|
|
|
|
|
|
|
if ( $tbl->get_maincaption && $tbl->get_shortcaption ) { |
|
148
|
|
|
|
|
|
|
$tbl->_invalid_option_usage( 'maincaption, shortcaption', |
|
149
|
|
|
|
|
|
|
'only one allowed.' ); |
|
150
|
|
|
|
|
|
|
} |
|
151
|
|
|
|
|
|
|
|
|
152
|
|
|
|
|
|
|
# handle default values by ourselves |
|
153
|
|
|
|
|
|
|
if ( $tbl->get_width_environment eq 'tabular*' ) { |
|
154
|
|
|
|
|
|
|
$tbl->set_width_environment(0); |
|
155
|
|
|
|
|
|
|
} |
|
156
|
|
|
|
|
|
|
if ( !$tbl->get_width ) { |
|
157
|
|
|
|
|
|
|
if ( $tbl->get_width_environment eq 'tabularx' ) { |
|
158
|
|
|
|
|
|
|
$tbl->_invalid_option_usage( 'width_environment', |
|
159
|
|
|
|
|
|
|
'Is tabularx and width is unset' ); |
|
160
|
|
|
|
|
|
|
} |
|
161
|
|
|
|
|
|
|
elsif ( $tbl->get_width_environment eq 'tabulary' ) { |
|
162
|
|
|
|
|
|
|
$tbl->_invalid_option_usage( 'width_environment', |
|
163
|
|
|
|
|
|
|
'Is tabulary and width is unset' ); |
|
164
|
|
|
|
|
|
|
} |
|
165
|
|
|
|
|
|
|
} |
|
166
|
|
|
|
|
|
|
return; |
|
167
|
|
|
|
|
|
|
} |
|
168
|
|
|
|
|
|
|
|
|
169
|
|
|
|
|
|
|
sub _get_caption_command { |
|
170
|
|
|
|
|
|
|
my ($self) = @_; |
|
171
|
|
|
|
|
|
|
my $tbl = $self->_table_obj; |
|
172
|
|
|
|
|
|
|
my $c_caption = 'caption'; |
|
173
|
|
|
|
|
|
|
if ( $tbl->get_caption_top && $tbl->get_caption_top ne '1' ) { |
|
174
|
|
|
|
|
|
|
$c_caption = $tbl->get_caption_top; |
|
175
|
|
|
|
|
|
|
$c_caption =~ s{ \A \\ }{}xms; |
|
176
|
|
|
|
|
|
|
} |
|
177
|
|
|
|
|
|
|
return $c_caption; |
|
178
|
|
|
|
|
|
|
} |
|
179
|
|
|
|
|
|
|
|
|
180
|
|
|
|
|
|
|
sub _get_begin_resizebox_code { |
|
181
|
|
|
|
|
|
|
my ($self) = @_; |
|
182
|
|
|
|
|
|
|
if ( $self->_table_obj->get_resizebox ) { |
|
183
|
|
|
|
|
|
|
my $rb_width = $self->_table_obj->get_resizebox->[0]; |
|
184
|
|
|
|
|
|
|
my $rb_height = q{!}; |
|
185
|
|
|
|
|
|
|
if ( defined $self->_table_obj->get_resizebox->[1] ) { |
|
186
|
|
|
|
|
|
|
$rb_height = $self->_table_obj->get_resizebox->[1]; |
|
187
|
|
|
|
|
|
|
} |
|
188
|
|
|
|
|
|
|
return "\\resizebox{$rb_width}{$rb_height}{\n"; |
|
189
|
|
|
|
|
|
|
} |
|
190
|
|
|
|
|
|
|
return q{}; |
|
191
|
|
|
|
|
|
|
} |
|
192
|
|
|
|
|
|
|
|
|
193
|
|
|
|
|
|
|
sub _get_caption { |
|
194
|
|
|
|
|
|
|
my ($self) = @_; |
|
195
|
|
|
|
|
|
|
my $caption = q{}; |
|
196
|
|
|
|
|
|
|
my $tbl = $self->_table_obj; |
|
197
|
|
|
|
|
|
|
|
|
198
|
|
|
|
|
|
|
if ( !$tbl->get_caption ) { |
|
199
|
|
|
|
|
|
|
if ( !$tbl->get_maincaption ) { |
|
200
|
|
|
|
|
|
|
return 0; |
|
201
|
|
|
|
|
|
|
} |
|
202
|
|
|
|
|
|
|
} |
|
203
|
|
|
|
|
|
|
else { |
|
204
|
|
|
|
|
|
|
$caption = $tbl->get_caption; |
|
205
|
|
|
|
|
|
|
} |
|
206
|
|
|
|
|
|
|
|
|
207
|
|
|
|
|
|
|
my $tmp = q{}; |
|
208
|
|
|
|
|
|
|
if ( $tbl->get_maincaption ) { |
|
209
|
|
|
|
|
|
|
$tmp = $tbl->get_maincaption . '. '; |
|
210
|
|
|
|
|
|
|
if ( defined $tbl->get_theme_settings->{CAPTION_FONT_STYLE} ) { |
|
211
|
|
|
|
|
|
|
$tmp = $tbl->_add_font_family( $tmp, |
|
212
|
|
|
|
|
|
|
$tbl->get_theme_settings->{CAPTION_FONT_STYLE} ); |
|
213
|
|
|
|
|
|
|
} |
|
214
|
|
|
|
|
|
|
} |
|
215
|
|
|
|
|
|
|
|
|
216
|
|
|
|
|
|
|
return $tmp . $caption; |
|
217
|
|
|
|
|
|
|
} |
|
218
|
|
|
|
|
|
|
|
|
219
|
|
|
|
|
|
|
sub _get_tabular_environment { |
|
220
|
|
|
|
|
|
|
my ($self) = @_; |
|
221
|
|
|
|
|
|
|
my $tbl = $self->_table_obj; |
|
222
|
|
|
|
|
|
|
|
|
223
|
|
|
|
|
|
|
my $res |
|
224
|
|
|
|
|
|
|
= $tbl->get_custom_tabular_environment |
|
225
|
|
|
|
|
|
|
? $tbl->get_custom_tabular_environment |
|
226
|
|
|
|
|
|
|
: $self->_tabular_environment; |
|
227
|
|
|
|
|
|
|
|
|
228
|
|
|
|
|
|
|
if ( $tbl->get_width ) { |
|
229
|
|
|
|
|
|
|
if ( !$tbl->get_width_environment ) { |
|
230
|
|
|
|
|
|
|
$res .= q{*}; |
|
231
|
|
|
|
|
|
|
} |
|
232
|
|
|
|
|
|
|
else { |
|
233
|
|
|
|
|
|
|
$res = $tbl->get_width_environment; |
|
234
|
|
|
|
|
|
|
} |
|
235
|
|
|
|
|
|
|
} |
|
236
|
|
|
|
|
|
|
return $res; |
|
237
|
|
|
|
|
|
|
} |
|
238
|
|
|
|
|
|
|
|
|
239
|
|
|
|
|
|
|
sub _get_default_tabletail_code { |
|
240
|
|
|
|
|
|
|
my ($self) = @_; |
|
241
|
|
|
|
|
|
|
|
|
242
|
|
|
|
|
|
|
my $tbl = $self->_table_obj; |
|
243
|
|
|
|
|
|
|
my $v0 = q{|} x $tbl->get_theme_settings->{'VERTICAL_RULES'}->[0]; |
|
244
|
|
|
|
|
|
|
|
|
245
|
|
|
|
|
|
|
return |
|
246
|
|
|
|
|
|
|
$tbl->_get_hline_code( $tbl->_get_RULE_MID_ID ) |
|
247
|
|
|
|
|
|
|
. '\multicolumn{' |
|
248
|
|
|
|
|
|
|
. @{ $tbl->_get_data_summary() } |
|
249
|
|
|
|
|
|
|
. "}{${v0}r$v0}{{" |
|
250
|
|
|
|
|
|
|
. $tbl->get_tabletailmsg |
|
251
|
|
|
|
|
|
|
. "}} \\\\\n"; |
|
252
|
|
|
|
|
|
|
} |
|
253
|
|
|
|
|
|
|
|
|
254
|
|
|
|
|
|
|
1; |
|
255
|
|
|
|
|
|
|
__END__ |
|
256
|
|
|
|
|
|
|
|
|
257
|
|
|
|
|
|
|
=head1 NAME |
|
258
|
|
|
|
|
|
|
|
|
259
|
|
|
|
|
|
|
LaTeX::Table::Types::TypeI - Interface for LaTeX table types. |
|
260
|
|
|
|
|
|
|
|
|
261
|
|
|
|
|
|
|
=head1 DESCRIPTION |
|
262
|
|
|
|
|
|
|
|
|
263
|
|
|
|
|
|
|
This is the type interface (or L<Moose> role), that all type objects must use. |
|
264
|
|
|
|
|
|
|
L<LaTeX::Table> delegates the LaTeX code generation to type |
|
265
|
|
|
|
|
|
|
objects. It stores all information we have in easy to use L<"TEMPLATE |
|
266
|
|
|
|
|
|
|
VARIABLES">. L<LaTeX::Table> ships with very flexible templates, but it is |
|
267
|
|
|
|
|
|
|
possible to use the template variables defined here to build custom templates. |
|
268
|
|
|
|
|
|
|
|
|
269
|
|
|
|
|
|
|
=head1 INTERFACE |
|
270
|
|
|
|
|
|
|
|
|
271
|
|
|
|
|
|
|
=over |
|
272
|
|
|
|
|
|
|
|
|
273
|
|
|
|
|
|
|
=item C<generate_latex_code> |
|
274
|
|
|
|
|
|
|
|
|
275
|
|
|
|
|
|
|
=back |
|
276
|
|
|
|
|
|
|
|
|
277
|
|
|
|
|
|
|
=head1 TEMPLATE VARIABLES |
|
278
|
|
|
|
|
|
|
|
|
279
|
|
|
|
|
|
|
Most options are accessible here: |
|
280
|
|
|
|
|
|
|
|
|
281
|
|
|
|
|
|
|
=over |
|
282
|
|
|
|
|
|
|
|
|
283
|
|
|
|
|
|
|
=item C<CENTER, LEFT, RIGHT> |
|
284
|
|
|
|
|
|
|
|
|
285
|
|
|
|
|
|
|
Example: |
|
286
|
|
|
|
|
|
|
|
|
287
|
|
|
|
|
|
|
[% IF CENTER %]\centering |
|
288
|
|
|
|
|
|
|
[% END %] |
|
289
|
|
|
|
|
|
|
|
|
290
|
|
|
|
|
|
|
=item C<ENVIRONMENT, STAR, POSITION, SIDEWAYS> |
|
291
|
|
|
|
|
|
|
|
|
292
|
|
|
|
|
|
|
These options for floating environments are typically used like: |
|
293
|
|
|
|
|
|
|
|
|
294
|
|
|
|
|
|
|
[% IF ENVIRONMENT %]\begin{[% ENVIRONMENT %][% IF STAR %]*[% END %]}[% IF POSITION %][[% POSITION %]][% END %] |
|
295
|
|
|
|
|
|
|
... |
|
296
|
|
|
|
|
|
|
[% END %] |
|
297
|
|
|
|
|
|
|
# the tabular environment here |
|
298
|
|
|
|
|
|
|
... |
|
299
|
|
|
|
|
|
|
[% IF ENVIRONMENT %] ... |
|
300
|
|
|
|
|
|
|
\end{[% ENVIRONMENT %][% IF STAR %]*[% END %]}[% END %] |
|
301
|
|
|
|
|
|
|
|
|
302
|
|
|
|
|
|
|
=item C<CAPTION_TOP, CAPTION_CMD, SHORTCAPTION, CAPTION, CONTINUED, CONTINUEDMSG> |
|
303
|
|
|
|
|
|
|
|
|
304
|
|
|
|
|
|
|
The variables to build the caption command. Note that there is NO template for |
|
305
|
|
|
|
|
|
|
the C<maincaption> option. C<CAPTION> already includes this maincaption if |
|
306
|
|
|
|
|
|
|
specified. |
|
307
|
|
|
|
|
|
|
|
|
308
|
|
|
|
|
|
|
=item C<LABEL> |
|
309
|
|
|
|
|
|
|
|
|
310
|
|
|
|
|
|
|
The label: |
|
311
|
|
|
|
|
|
|
|
|
312
|
|
|
|
|
|
|
[% IF LABEL %]\label{[% LABEL %]}[% END %] |
|
313
|
|
|
|
|
|
|
|
|
314
|
|
|
|
|
|
|
=item C<TABULAR_ENVIRONMENT, WIDTH, COLDEF> |
|
315
|
|
|
|
|
|
|
|
|
316
|
|
|
|
|
|
|
These three options define the tabular environment: |
|
317
|
|
|
|
|
|
|
|
|
318
|
|
|
|
|
|
|
\begin{[% TABULAR_ENVIRONMENT %]}[% IF WIDTH %]{[% WIDTH %]}[% END %]{[% COLDEF %]} |
|
319
|
|
|
|
|
|
|
|
|
320
|
|
|
|
|
|
|
=item C<FONTFAMILY, FONTSIZE> |
|
321
|
|
|
|
|
|
|
|
|
322
|
|
|
|
|
|
|
Example: |
|
323
|
|
|
|
|
|
|
|
|
324
|
|
|
|
|
|
|
[% IF FONTSIZE %]\[% FONTSIZE %] |
|
325
|
|
|
|
|
|
|
[% END %][% IF FONTFAMILY %]\[% FONTFAMILY %]family |
|
326
|
|
|
|
|
|
|
[% END %] |
|
327
|
|
|
|
|
|
|
|
|
328
|
|
|
|
|
|
|
=item C<TABLEHEADMSG, TABLETAIL, TABLELASTTAIL, XENTRYSTRETCH> |
|
329
|
|
|
|
|
|
|
|
|
330
|
|
|
|
|
|
|
For the multi-page tables. |
|
331
|
|
|
|
|
|
|
|
|
332
|
|
|
|
|
|
|
=item C<MAXWIDTH, FOOTTABLE> |
|
333
|
|
|
|
|
|
|
|
|
334
|
|
|
|
|
|
|
Currently only used by L<LaTeX::Table::Types::Ctable>. |
|
335
|
|
|
|
|
|
|
|
|
336
|
|
|
|
|
|
|
=back |
|
337
|
|
|
|
|
|
|
|
|
338
|
|
|
|
|
|
|
In addition, some variables already contain formatted LaTeX code: |
|
339
|
|
|
|
|
|
|
|
|
340
|
|
|
|
|
|
|
=over |
|
341
|
|
|
|
|
|
|
|
|
342
|
|
|
|
|
|
|
=item C<HEADER_CODE> |
|
343
|
|
|
|
|
|
|
|
|
344
|
|
|
|
|
|
|
The formatted header: |
|
345
|
|
|
|
|
|
|
|
|
346
|
|
|
|
|
|
|
\toprule |
|
347
|
|
|
|
|
|
|
\multicolumn{2}{c}{Item} & \\ |
|
348
|
|
|
|
|
|
|
\cmidrule(r){1-2} |
|
349
|
|
|
|
|
|
|
Animal & Description & Price \\ |
|
350
|
|
|
|
|
|
|
\midrule |
|
351
|
|
|
|
|
|
|
|
|
352
|
|
|
|
|
|
|
=item C<DATA_CODE> |
|
353
|
|
|
|
|
|
|
|
|
354
|
|
|
|
|
|
|
The formatted data: |
|
355
|
|
|
|
|
|
|
|
|
356
|
|
|
|
|
|
|
Gnat & per gram & 13.65 \\ |
|
357
|
|
|
|
|
|
|
& each & 0.01 \\ |
|
358
|
|
|
|
|
|
|
Gnu & stuffed & 92.59 \\ |
|
359
|
|
|
|
|
|
|
Emu & stuffed & 33.33 \\ |
|
360
|
|
|
|
|
|
|
Armadillo & frozen & 8.99 \\ |
|
361
|
|
|
|
|
|
|
\bottomrule |
|
362
|
|
|
|
|
|
|
|
|
363
|
|
|
|
|
|
|
=item C<RESIZEBOX_BEGIN_CODE, RESIZEBOX_END_CODE> |
|
364
|
|
|
|
|
|
|
|
|
365
|
|
|
|
|
|
|
Everything between these two template variables is resized according the |
|
366
|
|
|
|
|
|
|
C<resizebox> option. |
|
367
|
|
|
|
|
|
|
|
|
368
|
|
|
|
|
|
|
=item C<EXTRA_ROW_HEIGHT_CODE, DEFINE_COLORS_CODE, RULES_COLOR_GLOBAL_CODE, RULES_WIDTH_GLOBAL_CODE> |
|
369
|
|
|
|
|
|
|
|
|
370
|
|
|
|
|
|
|
Specified by the theme. C<EXTRA_ROW_HEIGHT_CODE> will contain the |
|
371
|
|
|
|
|
|
|
corresponding LaTeX extrarowheight command, e.g for '1pt': |
|
372
|
|
|
|
|
|
|
|
|
373
|
|
|
|
|
|
|
\setlength{\extrarowheight}{1pt} |
|
374
|
|
|
|
|
|
|
|
|
375
|
|
|
|
|
|
|
Otherwise it will contain the empty string. The other template variables will |
|
376
|
|
|
|
|
|
|
contain the command specified by the corresponding theme option. |
|
377
|
|
|
|
|
|
|
|
|
378
|
|
|
|
|
|
|
=back |
|
379
|
|
|
|
|
|
|
|
|
380
|
|
|
|
|
|
|
Finally, some variables allow access to internal C<LaTeX::Table> variables: |
|
381
|
|
|
|
|
|
|
|
|
382
|
|
|
|
|
|
|
=over |
|
383
|
|
|
|
|
|
|
|
|
384
|
|
|
|
|
|
|
=item C<LT_NUM_COLUMNS> |
|
385
|
|
|
|
|
|
|
|
|
386
|
|
|
|
|
|
|
Contains the number of columns of the table. |
|
387
|
|
|
|
|
|
|
|
|
388
|
|
|
|
|
|
|
=item C<LT_BOTTOM_RULE_CODE> |
|
389
|
|
|
|
|
|
|
|
|
390
|
|
|
|
|
|
|
Code that draws the rules at the bottom of the table according the theme |
|
391
|
|
|
|
|
|
|
options. |
|
392
|
|
|
|
|
|
|
|
|
393
|
|
|
|
|
|
|
=back |
|
394
|
|
|
|
|
|
|
|
|
395
|
|
|
|
|
|
|
=head1 SEE ALSO |
|
396
|
|
|
|
|
|
|
|
|
397
|
|
|
|
|
|
|
L<LaTeX::Table> |
|
398
|
|
|
|
|
|
|
|
|
399
|
|
|
|
|
|
|
The predefined templates: L<LaTeX::Table::Types::Std>, |
|
400
|
|
|
|
|
|
|
L<LaTeX::Table::Types::Ctable>, L<LaTeX::Table::Types::Longtable>, |
|
401
|
|
|
|
|
|
|
L<LaTeX::Table::Types::Xtab> |
|
402
|
|
|
|
|
|
|
|
|
403
|
|
|
|
|
|
|
=head1 LICENSE AND COPYRIGHT |
|
404
|
|
|
|
|
|
|
|
|
405
|
|
|
|
|
|
|
Copyright (c) 2006-2010 C<< <limaone@cpan.org> >> |
|
406
|
|
|
|
|
|
|
|
|
407
|
|
|
|
|
|
|
This module is free software; you can redistribute it and/or |
|
408
|
|
|
|
|
|
|
modify it under the same terms as Perl itself. See L<perlartistic>. |
|
409
|
|
|
|
|
|
|
|
|
410
|
|
|
|
|
|
|
=cut |
|
411
|
|
|
|
|
|
|
|
|
412
|
|
|
|
|
|
|
# vim: ft=perl sw=4 ts=4 expandtab |