|
NAMELaTeX::Table::Themes::ThemeI - Interface for LaTeX table themes. SYNOPSIS package MyThemes::Custom;
use Moose;
with 'LaTeX::Table::Themes::ThemeI';
sub _definition {
return { CENTRALPARK =>
{
'HEADER_FONT_STYLE' => 'bf',
'HEADER_FONT_COLOR' => 'white',
'HEADER_BG_COLOR' => 'latextbl',
'DATA_BG_COLOR_ODD' => 'latextbl!25',
'DATA_BG_COLOR_EVEN' => 'latextbl!10',
'DEFINE_COLORS' => '\definecolor{latextbl}{RGB}{93,127,114}',
'HEADER_CENTERED' => 1,
'VERTICAL_RULES' => [ 1, 0, 0 ],
'HORIZONTAL_RULES' => [ 1, 1, 0 ],
'BOOKTABS' => 0,
'EXTRA_ROW_HEIGHT' => '1pt',
}};
}
1;
DESCRIPTIONThis is the theme interface (or Moose role), that all theme objects must use. CREATING THEMESA theme is defined as an hash reference containing all options: # a very ugly theme...
my $theme = {
'Duisburg' => {
'HEADER_FONT_STYLE' => 'sc',
'HEADER_FONT_COLOR' => 'white',
'HEADER_BG_COLOR' => 'blue',
'HEADER_CENTERED' => 1,
'DATA_BG_COLOR_ODD' => 'blue!30',
'DATA_BG_COLOR_EVEN' => 'blue!10',
'CAPTION_FONT_STYLE' => 'sc',
'VERTICAL_RULES' => [ 1, 2, 1 ],
'HORIZONTAL_RULES' => [ 1, 2, 0 ],
'EXTRA_ROW_HEIGHT' => '2pt',
'BOOKTABS' => 0,
},
};
You can either quickly add themes after initiation of an LaTeX::Table: $table->set_custom_themes($theme); Or, you can build a "THEME MODULE" and extend the list of predefined themes. THEME MODULENow, to build a theme that you can easily load, take the "SYNOPSIS" template, change it and then make it accessible in "LaTeX::Table" by saving it under the "LaTeX::Table::Themes::*" namespace. Alternatively, you can use the search_path() method to add custom paths. For example save the "SYNOPSIS" module as "./MyThemes/Custom.pm" and then add "MyThemes" in the script that uses the new theme: # in ./script.pl $table->search_path( add => 'MyThemes'); If your theme looks nice, please contribute it. SEE ALSOLaTeX::Table LICENSE AND COPYRIGHTCopyright (c) 2006-2010 "<limaone@cpan.org>" This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See perlartistic.
|