=head1 VERSION
-Version 0.01
+Version 0.02
=cut
-our $VERSION = '0.01';
+our $VERSION = '0.02';
=head1 DESCRIPTION
use LaTeX::TikZ::Tools;
-use Any::Moose;
-use Any::Moose 'Util::TypeConstraints';
+use Mouse;
+use Mouse::Util::TypeConstraints;
=head1 ATTRIBUTES
has 'unit' => (
is => 'ro',
- isa => enum([ qw/cm pt/ ]),
+ isa => enum([ qw<cm pt> ]),
default => 'cm',
);
my $origin = $tikz->origin;
if (defined $origin) {
- my ($x, $y) = map $origin->$_, qw/x y/;
+ my ($x, $y) = map $origin->$_, qw<x y>;
$origin = "($x;$y)";
} else {
$origin = "(0;0)";
join $;, map {
defined() ? "$_" : '(undef)';
- } map($tikz->$_, qw/unit format scale width height/), $origin;
+ } map($tikz->$_, qw<unit format scale width height>), $origin;
}
=head2 C<render @sets>
=back
- my ($header, $declarations, $seq1_body, $seq2_body) = $formatter->render($set1, $set2);
+The lines returned by L</render> don't end with a line feed.
+
+ my ($header, $declarations, $set1_body, $set2_body) = $formatter->render($set1, $set2);
+
+ open my $tex, '>', 'test.tex' or die "open('>test.tex'): $!";
+
+ print $tex "$_\n" for (
+ "\\documentclass[12pt]{article}",
+ @$header,
+ "\\begin{document}",
+ "\\pagestyle{empty}",
+ @$declarations,
+ "First set :"
+ "\\begin{center}",
+ @$set1_body,
+ "\\end{center}",
+ "Second set :"
+ "\\begin{center}",
+ @$set2_body,
+ "\\end{center}",
+ "\\end{document}",
+ );
=cut
}
}
- my @subsets = $set->isa('LaTeX::TikZ::Set::Sequence')
+ my @subsets = $set->does('LaTeX::TikZ::Set::Container')
? $set->kids
- : $set->isa('LaTeX::TikZ::Set::Path')
- ? $set->ops
- : ();
+ : ();
$find_mods_rec->($_, $layers, $others) for @subsets;
});
=head1 COPYRIGHT & LICENSE
-Copyright 2010 Vincent Pit, all rights reserved.
+Copyright 2010,2011,2012,2013,2014,2015 Vincent Pit, all rights reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.