X-Git-Url: http://git.vpit.fr/?a=blobdiff_plain;f=lib%2FLaTeX%2FTikZ.pm;h=5e5b7315e6f773edf4dc6fc956aa2ecbc2c2d175;hb=718a71648b669dadb4c548574b19d1c2b942d1dc;hp=c91ea8ca8dd341f80513185481b625d9ecda4dbc;hpb=c872d62c868ae84bbfe6f6abe6210920cd10c9fd;p=perl%2Fmodules%2FLaTeX-TikZ.git diff --git a/lib/LaTeX/TikZ.pm b/lib/LaTeX/TikZ.pm index c91ea8c..5e5b731 100644 --- a/lib/LaTeX/TikZ.pm +++ b/lib/LaTeX/TikZ.pm @@ -21,7 +21,7 @@ our $VERSION = '0.01'; # A couple of lines my $hline = Tikz->line(-1 => 1); - my $vline = Tikz->line([ 0, -1 ] => [ 0, -1 ]); + my $vline = Tikz->line([ 0, -1 ] => [ 0, 1 ]); # Paint them in red $_->mod(Tikz->color('red')) for $hline, $vline; @@ -36,10 +36,10 @@ our $VERSION = '0.01'; $octo->clip(Tikz->rectangle(-0.5*(1+i), 2*(1+i))); # Fill it with dots - $octo->mod(Tikz->pattern(class => 'Dots')); + $octo->mod(Tikz->pattern(class => 'Dots', space_width => 10)); # Create a formatter object - my $tikz = Tikz->formatter; + my $tikz = Tikz->formatter(scale => 5); # Put those objects all together and print them my $seq = Tikz->seq($octo, $hline, $vline); @@ -72,7 +72,7 @@ or as a I, where elements are all drawn as one line : =back -This distinction is important because there are some primitves that only apply to paths but not to sequences, and vice versa. +This distinction is important because there are some primitives that only apply to paths but not to sequences, and vice versa. Figures are made of ops, path or sequence I assembled together in a tree. @@ -146,7 +146,7 @@ If C<$point> is a L object, the L by writing your own L class. +You can define automatic coercions from your user point types to L by writing your own C class. See L for the rationale and L for an example. =head3 C<< Tikz->line($from => $to) >> @@ -169,7 +169,7 @@ Creates a L object that links the successive element =head3 C<< Tikz->closed_polyline(@points) >> -Creates a L object that cycles through successive eleemnts of C<@points>. +Creates a L object that cycles through successive elemnts of C<@points>. my $diamond = Tikz->closed_polyline( Tikz->point(0, 1), @@ -300,7 +300,7 @@ Creates a L object that can render a L =head3 C<< Tikz->functor(@rules) >> Creates a L anonymous subroutine that can be called against L trees to clone them according to the given rules. -C<@rules> should be made of array references whose first element is the class/role to match against and the second the handler to run. +C<@rules> should be a list of array references whose first element is the class/role to match against and the second the handler to execute. # The default is a clone method my $clone = Tikz->functor;