Codebase list liblatex-table-perl / 4963c68
New upstream snapshot. Debian Janitor 1 year, 4 months ago
26 changed file(s) with 251 addition(s) and 94 deletion(s). Raw diff Collapse all Expand all
1515 'Module::Pluggable' => 0,
1616 'Scalar::Util' => 0,
1717 'Carp' => 0,
18 'version' => 0,
1918 'Template' => 0,
2019 'Cwd' => 0,
2120 },
21 configure_requires => { 'Module::Build' => 0 },
2222 build_requires => {
2323 'Test::More' => 0,
2424 'Test::NoWarnings' => 0,
00 Revision history for LaTeX-Table
11
2 1.1 Tue Feb 21 2012
3 - Removed version dependency
4 - Allowed undef values in data and header (thanks Dan, closes #75203)
5
26 1.0.6 Mon Oct 25 2010
37 - eor option (thanks Jens)
48 - POD: Ascii tables of classic themes.
4242 xt/release/perltidyrc
4343 xt/release/pod-coverage.t
4444 xt/release/pod.t
45 META.json
0 {
1 "abstract" : "Perl extension for the automatic generation of LaTeX tables.",
2 "author" : [
3 "<limaone@cpan.org>"
4 ],
5 "dynamic_config" : 1,
6 "generated_by" : "Module::Build version 0.4231",
7 "license" : [
8 "perl_5"
9 ],
10 "meta-spec" : {
11 "url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec",
12 "version" : 2
13 },
14 "name" : "LaTeX-Table",
15 "prereqs" : {
16 "build" : {
17 "requires" : {
18 "File::Spec" : "0",
19 "Test::More" : "0",
20 "Test::NoWarnings" : "0"
21 }
22 },
23 "configure" : {
24 "requires" : {
25 "Module::Build" : "0"
26 }
27 },
28 "runtime" : {
29 "recommends" : {
30 "Getopt::Long" : "0",
31 "LaTeX::Driver" : "0",
32 "LaTeX::Encode" : "0",
33 "Number::Format" : "0",
34 "Text::CSV" : "0",
35 "autodie" : "0"
36 },
37 "requires" : {
38 "Carp" : "0",
39 "Cwd" : "0",
40 "English" : "0",
41 "Module::Pluggable" : "0",
42 "Moose" : "0.76",
43 "MooseX::FollowPBP" : "0.03",
44 "Scalar::Util" : "0",
45 "Template" : "0",
46 "perl" : "v5.8.0"
47 }
48 }
49 },
50 "provides" : {
51 "LaTeX::Table" : {
52 "file" : "lib/LaTeX/Table.pm",
53 "version" : "1.1"
54 },
55 "LaTeX::Table::Themes::Beamer" : {
56 "file" : "lib/LaTeX/Table/Themes/Beamer.pm",
57 "version" : "1.1"
58 },
59 "LaTeX::Table::Themes::Booktabs" : {
60 "file" : "lib/LaTeX/Table/Themes/Booktabs.pm",
61 "version" : "1.1"
62 },
63 "LaTeX::Table::Themes::Classic" : {
64 "file" : "lib/LaTeX/Table/Themes/Classic.pm",
65 "version" : "1.1"
66 },
67 "LaTeX::Table::Themes::Modern" : {
68 "file" : "lib/LaTeX/Table/Themes/Modern.pm",
69 "version" : "1.1"
70 },
71 "LaTeX::Table::Themes::ThemeI" : {
72 "file" : "lib/LaTeX/Table/Themes/ThemeI.pm",
73 "version" : "1.1"
74 },
75 "LaTeX::Table::Types::Ctable" : {
76 "file" : "lib/LaTeX/Table/Types/Ctable.pm",
77 "version" : "1.1"
78 },
79 "LaTeX::Table::Types::Longtable" : {
80 "file" : "lib/LaTeX/Table/Types/Longtable.pm",
81 "version" : "1.1"
82 },
83 "LaTeX::Table::Types::Std" : {
84 "file" : "lib/LaTeX/Table/Types/Std.pm",
85 "version" : "1.1"
86 },
87 "LaTeX::Table::Types::TypeI" : {
88 "file" : "lib/LaTeX/Table/Types/TypeI.pm",
89 "version" : "1.1"
90 },
91 "LaTeX::Table::Types::Xtab" : {
92 "file" : "lib/LaTeX/Table/Types/Xtab.pm",
93 "version" : "1.1"
94 }
95 },
96 "release_status" : "stable",
97 "resources" : {
98 "license" : [
99 "http://dev.perl.org/licenses/"
100 ],
101 "repository" : {
102 "url" : "http://github.com/lima1/p5-latex-table"
103 }
104 },
105 "version" : "1.1",
106 "x_serialization_backend" : "JSON::PP version 4.07"
107 }
00 ---
11 abstract: 'Perl extension for the automatic generation of LaTeX tables.'
22 author:
3 - '<limaone@cpan.org>'
3 - <limaone@cpan.org>
44 build_requires:
5 File::Spec: 0
6 Test::More: 0
7 Test::NoWarnings: 0
5 File::Spec: '0'
6 Test::More: '0'
7 Test::NoWarnings: '0'
88 configure_requires:
9 Module::Build: 0.36
10 generated_by: 'Module::Build version 0.3607'
9 Module::Build: '0'
10 dynamic_config: 1
11 generated_by: 'Module::Build version 0.4231, CPAN::Meta::Converter version 2.150010'
1112 license: perl
1213 meta-spec:
1314 url: http://module-build.sourceforge.net/META-spec-v1.4.html
14 version: 1.4
15 version: '1.4'
1516 name: LaTeX-Table
1617 provides:
1718 LaTeX::Table:
1819 file: lib/LaTeX/Table.pm
19 version: v1.0.6
20 version: '1.1'
2021 LaTeX::Table::Themes::Beamer:
2122 file: lib/LaTeX/Table/Themes/Beamer.pm
22 version: v1.0.6
23 version: '1.1'
2324 LaTeX::Table::Themes::Booktabs:
2425 file: lib/LaTeX/Table/Themes/Booktabs.pm
25 version: v1.0.6
26 version: '1.1'
2627 LaTeX::Table::Themes::Classic:
2728 file: lib/LaTeX/Table/Themes/Classic.pm
28 version: v1.0.6
29 version: '1.1'
2930 LaTeX::Table::Themes::Modern:
3031 file: lib/LaTeX/Table/Themes/Modern.pm
31 version: v1.0.6
32 version: '1.1'
3233 LaTeX::Table::Themes::ThemeI:
3334 file: lib/LaTeX/Table/Themes/ThemeI.pm
34 version: v1.0.6
35 version: '1.1'
3536 LaTeX::Table::Types::Ctable:
3637 file: lib/LaTeX/Table/Types/Ctable.pm
37 version: v1.0.6
38 version: '1.1'
3839 LaTeX::Table::Types::Longtable:
3940 file: lib/LaTeX/Table/Types/Longtable.pm
40 version: v1.0.6
41 version: '1.1'
4142 LaTeX::Table::Types::Std:
4243 file: lib/LaTeX/Table/Types/Std.pm
43 version: v1.0.6
44 version: '1.1'
4445 LaTeX::Table::Types::TypeI:
4546 file: lib/LaTeX/Table/Types/TypeI.pm
46 version: v1.0.6
47 version: '1.1'
4748 LaTeX::Table::Types::Xtab:
4849 file: lib/LaTeX/Table/Types/Xtab.pm
49 version: v1.0.6
50 version: '1.1'
5051 recommends:
51 Getopt::Long: 0
52 LaTeX::Driver: 0
53 LaTeX::Encode: 0
54 Number::Format: 0
55 Text::CSV: 0
56 autodie: 0
52 Getopt::Long: '0'
53 LaTeX::Driver: '0'
54 LaTeX::Encode: '0'
55 Number::Format: '0'
56 Text::CSV: '0'
57 autodie: '0'
5758 requires:
58 Carp: 0
59 Cwd: 0
60 English: 0
61 Module::Pluggable: 0
62 Moose: 0.76
63 MooseX::FollowPBP: 0.03
64 Scalar::Util: 0
65 Template: 0
59 Carp: '0'
60 Cwd: '0'
61 English: '0'
62 Module::Pluggable: '0'
63 Moose: '0.76'
64 MooseX::FollowPBP: '0.03'
65 Scalar::Util: '0'
66 Template: '0'
6667 perl: v5.8.0
67 version: 0
6868 resources:
6969 license: http://dev.perl.org/licenses/
7070 repository: http://github.com/lima1/p5-latex-table
71 version: v1.0.6
71 version: '1.1'
72 x_serialization_backend: 'CPAN::Meta::YAML version 0.018'
2121 'Module::Pluggable' => 0,
2222 'Carp' => 0,
2323 'Scalar::Util' => 0,
24 'version' => 0,
2524 'Template' => 0,
2625 'Text::CSV' => 0,
2726 'Cwd' => 0,
0 LaTeX-Table version 1.0.6
0 LaTeX-Table version 1.1
11
22 This module supports multipage tables via the xtab and the longtable package.
33 For publication quality tables it utilizes the booktabs package. It also
1818 use LaTeX::Encode;
1919 use LaTeX::Driver;
2020
21 use version; our $VERSION = qv('1.0.6');
21 our $VERSION = '1.1';
2222
2323 my ( $infile, $outfile, $outfiletex, $help, $man, $version );
2424
259259
260260 =head1 LICENSE AND COPYRIGHT
261261
262 Copyright (c) 2006-2010, C<< <limaone@cpan.org> >>.
262 Copyright (c) 2006-2011, C<< <limaone@cpan.org> >>.
263263
264264 This program is free software; you can redistribute it and/or
265265 modify it under the same terms as Perl itself. See L<perlartistic>.
55 use LaTeX::Table;
66 use Carp;
77
8 use version; our $VERSION = qv('1.0.6');
9
10 my $line_id = 0;
8 our $VERSION = '1.1';
9
1110 my @input;
12 my $paramline;
1311
1412 while ( my $line = <> ) {
1513 chomp $line;
16 $line =~ s{\s+}{ }xmsg;
14
15 # remove leading and trailing blanks
1716 $line =~ s{\A \s* | \s* \z}{}xmsg;
1817
1918 # remove trailing \\, we do that later
2019 $line =~ s{\A \\\\ \z}{}xmsg;
2120
22 if ( $line_id == 0 ) { #first line contains the parameters
23 $paramline = $line;
24 }
25 else {
26 push @input, $line;
27 }
28 $line_id++;
21 push @input, $line;
2922 }
3023
3124 # remove trailing empty lines
3427 }
3528
3629 # uncomment original input
37 _say( join q{}, map {"\n % $_"} ( $paramline, @input ) );
30 _say( join q{}, map {"\n % $_"} ( @input ) );
31
32 my $paramline = shift @input;
3833
3934 # create rows/column array[array_ref], remove leading and trailing spaces
4035 @input = map {
4540 my %params = map { _parse_param($_) } split m{ ; }xms, $paramline;
4641
4742 my $table = LaTeX::Table->new(
48 { header => [ $input[0] ],
49 data => [ @input[ 1 .. $#input ] ],
43 { header => [ shift @input ],
44 data => \@input,
5045 %params,
5146 }
5247 );
176171
177172 =head1 LICENSE AND COPYRIGHT
178173
179 Copyright (c) 2006-2010, C<< <limaone@cpan.org> >>.
174 Copyright (c) 2006-2011, C<< <limaone@cpan.org> >>.
180175
181176 This program is free software; you can redistribute it and/or
182177 modify it under the same terms as Perl itself. See L<perlartistic>.
0 liblatex-table-perl (1.0.6+git20120221.1.2eb33ac-1) UNRELEASED; urgency=low
1
2 * New upstream snapshot.
3
4 -- Debian Janitor <janitor@jelmer.uk> Mon, 19 Dec 2022 09:26:35 -0000
5
06 liblatex-table-perl (1.0.6-4) unstable; urgency=medium
17
28 [ gregor herrmann ]
Binary diff not shown
22
33 with 'LaTeX::Table::Themes::ThemeI';
44
5 use version; our $VERSION = qv('1.0.6');
5 our $VERSION = '1.1';
66
77 sub _definition {
88 my $themes = {
136136
137137 =head1 LICENSE AND COPYRIGHT
138138
139 Copyright (c) 2006-2010 C<< <limaone@cpan.org> >>
139 Copyright (c) 2006-2011 C<< <limaone@cpan.org> >>
140140
141141 This module is free software; you can redistribute it and/or
142142 modify it under the same terms as Perl itself. See L<perlartistic>.
22
33 with 'LaTeX::Table::Themes::ThemeI';
44
5 use version; our $VERSION = qv('1.0.6');
5 our $VERSION = '1.1';
66
77 sub _definition {
88 my $themes = {
6161
6262 =head1 LICENSE AND COPYRIGHT
6363
64 Copyright (c) 2006-2010 C<< <limaone@cpan.org> >>
64 Copyright (c) 2006-2011 C<< <limaone@cpan.org> >>
6565
6666 This module is free software; you can redistribute it and/or
6767 modify it under the same terms as Perl itself. See L<perlartistic>.
22
33 with 'LaTeX::Table::Themes::ThemeI';
44
5 use version; our $VERSION = qv('1.0.6');
5 our $VERSION = '1.1';
66
77 sub _definition {
88 my $themes = {
127127
128128 =head1 LICENSE AND COPYRIGHT
129129
130 Copyright (c) 2006-2010 C<< <limaone@cpan.org> >>
130 Copyright (c) 2006-2011 C<< <limaone@cpan.org> >>
131131
132132 This module is free software; you can redistribute it and/or
133133 modify it under the same terms as Perl itself. See L<perlartistic>.
22
33 with 'LaTeX::Table::Themes::ThemeI';
44
5 use version; our $VERSION = qv('1.0.6');
5 our $VERSION = '1.1';
66
77 sub _definition {
88 my $themes = {
6363
6464 =head1 LICENSE AND COPYRIGHT
6565
66 Copyright (c) 2006-2010 C<< <limaone@cpan.org> >>
66 Copyright (c) 2006-2011 C<< <limaone@cpan.org> >>
6767
6868 This module is free software; you can redistribute it and/or
6969 modify it under the same terms as Perl itself. See L<perlartistic>.
44
55 use Moose::Role;
66
7 use version; our $VERSION = qv('1.0.6');
7 our $VERSION = '1.1';
88
99 requires '_definition';
1010
214214
215215 =head1 LICENSE AND COPYRIGHT
216216
217 Copyright (c) 2006-2010 C<< <limaone@cpan.org> >>
217 Copyright (c) 2006-2011 C<< <limaone@cpan.org> >>
218218
219219 This module is free software; you can redistribute it and/or
220220 modify it under the same terms as Perl itself. See L<perlartistic>.
22
33 with 'LaTeX::Table::Types::TypeI';
44
5 use version; our $VERSION = qv('1.0.6');
5 our $VERSION = '1.1';
66
77 my $template = <<'EOT'
88 {[% DEFINE_COLORS_CODE %][% IF FONTSIZE %]\[% FONTSIZE %]
6060
6161 =head1 LICENSE AND COPYRIGHT
6262
63 Copyright (c) 2006-2010 C<< <limaone@cpan.org> >>
63 Copyright (c) 2006-2011 C<< <limaone@cpan.org> >>
6464
6565 This module is free software; you can redistribute it and/or
6666 modify it under the same terms as Perl itself. See L<perlartistic>.
22
33 with 'LaTeX::Table::Types::TypeI';
44
5 use version; our $VERSION = qv('1.0.6');
5 our $VERSION = '1.1';
66
77 my $template = <<'EOT'
88 {
7777
7878 =head1 LICENSE AND COPYRIGHT
7979
80 Copyright (c) 2006-2010 C<< <limaone@cpan.org> >>
80 Copyright (c) 2006-2011 C<< <limaone@cpan.org> >>
8181
8282 This module is free software; you can redistribute it and/or
8383 modify it under the same terms as Perl itself. See L<perlartistic>.
22
33 with 'LaTeX::Table::Types::TypeI';
44
5 use version; our $VERSION = qv('1.0.6');
5 our $VERSION = '1.1';
66
77 my $template = <<'EOT'
88 [%IF CONTINUED %]\addtocounter{table}{-1}[% END %][% DEFINE_COLORS_CODE %][% IF ENVIRONMENT %]\begin{[% IF SIDEWAYS %]sidewaystable[% ELSE %][% ENVIRONMENT %][% END %][% IF STAR %]*[% END %]}[% IF POSITION %][[% POSITION %]][% END %]
4646
4747 =head1 LICENSE AND COPYRIGHT
4848
49 Copyright (c) 2006-2010 C<< <limaone@cpan.org> >>
49 Copyright (c) 2006-2011 C<< <limaone@cpan.org> >>
5050
5151 This module is free software; you can redistribute it and/or
5252 modify it under the same terms as Perl itself. See L<perlartistic>.
55 use Moose::Role;
66 use Template;
77
8 use version; our $VERSION = qv('1.0.6');
8 our $VERSION = '1.1';
99
1010 use Carp;
1111
401401
402402 =head1 LICENSE AND COPYRIGHT
403403
404 Copyright (c) 2006-2010 C<< <limaone@cpan.org> >>
404 Copyright (c) 2006-2011 C<< <limaone@cpan.org> >>
405405
406406 This module is free software; you can redistribute it and/or
407407 modify it under the same terms as Perl itself. See L<perlartistic>.
22
33 with 'LaTeX::Table::Types::TypeI';
44
5 use version; our $VERSION = qv('1.0.6');
5 our $VERSION = '1.1';
66
77 my $template = <<'EOT'
88 {
5858
5959 =head1 LICENSE AND COPYRIGHT
6060
61 Copyright (c) 2006-2010 C<< <limaone@cpan.org> >>
61 Copyright (c) 2006-2011 C<< <limaone@cpan.org> >>
6262
6363 This module is free software; you can redistribute it and/or
6464 modify it under the same terms as Perl itself. See L<perlartistic>.
66 use Moose::Util::TypeConstraints;
77 use MooseX::FollowPBP;
88
9 use version; our $VERSION = qv('1.0.6');
9 our $VERSION = '1.1';
1010
1111 use LaTeX::Table::Types::Std;
1212 use LaTeX::Table::Types::Xtab;
8787 has 'resizebox' => ( is => 'rw', isa => 'ArrayRef[Str]' );
8888 has 'columns_like_header' => ( is => 'rw', isa => 'ArrayRef[Int]' );
8989 has 'header' =>
90 ( is => 'rw', isa => 'ArrayRef[ArrayRef[Value]]', default => sub { [] } );
90 ( is => 'rw', isa => 'ArrayRef[ArrayRef]', default => sub { [] } );
9191 has 'data' =>
92 ( is => 'rw', isa => 'ArrayRef[ArrayRef[Value]]', default => sub { [] } );
92 ( is => 'rw', isa => 'ArrayRef[ArrayRef]', default => sub { [] } );
9393 has 'predef_themes' =>
9494 ( is => 'rw', isa => 'HashRef[HashRef]', default => sub { {} } );
9595 has 'custom_themes' =>
248248 my $i = 0;
249249 COL:
250250 for my $col ( @{$row} ) {
251 next COL if $col =~ $strategy->{MISSING_VALUE};
251 next COL if !defined $col || $col =~ $strategy->{MISSING_VALUE};
252252
253253 for my $coltype (@coltypes) {
254254 if ( $col =~ $strategy->{$coltype} ) {
534534
535535 sub _get_mc_def {
536536 my ( $self, $value ) = @_;
537 return { value => undef } if (!defined $value);
537538 return $value =~ m{ \A (.*)\:(\d+)([clr]) \s* \z }xms
538539 ? {
539540 value => $1,
655656
656657 =head1 VERSION
657658
658 This document describes LaTeX::Table version 1.0.6
659 This document describes LaTeX::Table version 1.1
659660
660661 =head1 SYNOPSIS
661662
14421443
14431444 =head1 LICENSE AND COPYRIGHT
14441445
1445 Copyright (c) 2006-2010 C<< <limaone@cpan.org> >>
1446 Copyright (c) 2006-2011 C<< <limaone@cpan.org> >>
14461447
14471448 This module is free software; you can redistribute it and/or
14481449 modify it under the same terms as Perl itself. See L<perlartistic>.
0 use Test::More tests => 21;
0 use Test::More tests => 22;
11 use Test::NoWarnings;
22
33 use LaTeX::Table;
676676 'theme with colordef and resizebox'
677677 ) || diag $output;
678678
679
679 $test_header
680 = [ [ 'Name', 'Beers:2c' ], [ '', 'before 4pm', 'after 4pm' ] ];
681 $test_data = [
682 [ 'Lisa', '0', '0' ],
683 [ 'Marge', '0', '1' ],
684 [ 'Wiggum', '0', '5' ],
685 [ 'Otto', '1', '3' ],
686 [ 'Homer', '2', '6' ],
687 [ 'Barney', '8', undef ],
688 ];
689
690 $table = LaTeX::Table->new(
691 {
692 environment => 0,
693 header => $test_header,
694 data => $test_data,
695 callback => sub {
696 my ( $row, $col, $value, $is_header ) = @_;
697 if (!defined $value) {
698 $value = 'NA';
699 }
700 return $value;
701 }
702 }
703 );
704
705 $expected_output = <<'EOT'
706 \begin{tabular}{lrr}
707 \toprule
708 Name & \multicolumn{2}{c}{Beers} \\
709 & before 4pm & after 4pm \\
710 \midrule
711 Lisa & 0 & 0 \\
712 Marge & 0 & 1 \\
713 Wiggum & 0 & 5 \\
714 Otto & 1 & 3 \\
715 Homer & 2 & 6 \\
716 Barney & 8 & NA \\
717 \bottomrule
718 \end{tabular}
719 EOT
720 ;
721
722
723 $output = $table->generate_string();
724
725 is_deeply(
726 [ split( "\n", $output ) ],
727 [ split( "\n", $expected_output ) ],
728 'undefined columns'
729 ) || diag $output;
0 use Test::More tests => 35;
0 use Test::More tests => 33;
11 use Test::NoWarnings;
22
33 use LaTeX::Table;
109109 'header[0] is not an array reference'
110110 ) || diag $EVAL_ERROR;
111111
112 eval { $table->set_header( [ [ 'A', ['B'] ] ] ); };
113 like( $EVAL_ERROR, qr{Attribute \(header\)}, 'header[0][1] is not a scalar' )
114 || diag $EVAL_ERROR;
115
116112 # data tests
117113 eval {
118114 $table = LaTeX::Table->new(
130126 qr{Attribute \(data\)},
131127 'data[1] is not an array reference'
132128 ) || diag $EVAL_ERROR;
133
134 eval { $table->set_data( [ [ 'A', 'B' ], [ 'A', undef ] ] ); };
135 like( $EVAL_ERROR, qr{Attribute \(data\)}, 'undef value' )
136 || diag $EVAL_ERROR;
137129
138130 $table->set_data($data);
139131 eval { $table->set_coldef_strategy(1); };
99 % theme=Meyrin;label=test;position=htb
1010 % Item:2c & Price
1111 % Gnat& per gram& 13.65
12 % & each& 0.01
12 % & each& 0.01
1313 %
1414 % Gnu& stuffed& 92.59
1515 % Emu& stuffed& 33.33
00 theme=Meyrin;label=test;position=htb
11 Item:2c & Price
22 Gnat& per gram& 13.65
3 & each& 0.01
3 & each& 0.01
44
55 Gnu& stuffed& 92.59
66 Emu& stuffed& 33.33