Revision history for LaTeX-TikZ
+0.02 2010-08-02 13:00 UTC
+ + Add : The functor rules now default to be appended to the list of
+ existent rules ; except if there's already a rule of the same
+ name, in which case it is always replaced.
+ If you want to replace all the subclass/subroles, prepend the
+ target name by '+'.
+ + Chg : INCOMPATIBLE CHANGE : LT::Mod->cover was renamed to
+ LT::Mod->covers.
+ + Chg : The default space width for Dots and Lines patterns has been
+ bumped to 10.
+ + Chg : perl 5.8 is required.
+ + Doc : Completed documentation of LT::Formatter, LT::Functor and
+ LT::Meta::TC::Autocoerce.
+ + Doc : Many typos were fixed.
+ + Fix : Some raw and pattern mods could be wrongly optimized away.
+ + Fix : Warnings with Moose 1.09.
+ + Tst : Test autocoercion in t/02-autocoerce.t.
+ + Tst : More user tests.
+
0.01 2010-07-03 11:40 UTC
First version, released on an unsuspecting world.
LaTeX::TikZ - Perl object model for generating PGF/TikZ code.
VERSION
- Version 0.01
+ Version 0.02
SYNOPSIS
use LaTeX::TikZ;
# 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;
$octo->mod(Tikz->pattern(class => 'Dots'));
# 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);
print "$_\n" for map @$_, $head, $decl, $body;
DESCRIPTION
- This module provides an object model for TikZ, a graphical tookit for
+ This module provides an object model for TikZ, a graphical toolkit for
LaTeX. It allows you to build structures representing geometrical
figures, apply a wide set of modifiers on them, transform them globally
with functors, and print them in the context of an existing TeX
document.
CONCEPTS
- Traditionnaly, in TikZ, there are two ways of grouping elements, or
+ Traditionally, in TikZ, there are two ways of grouping elements, or
*ops*, together :
* either as a *sequence*, where each element is drawn in its own line
\draw (0cm,0cm) -- (0cm,1cm) (0cm,0cm) -- (1cm,0cm) ;
- 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 *sets* assembled together in a
tree.
You can define automatic coercions from your user point types to
LaTeX::TikZ::Point by writing your own
- LaTeX::TikZ::Point::My::User::Point class. See
+ "LaTeX::TikZ::Point::My::User::Point" class. See
LaTeX::TikZ::Meta::TypeConstraint::Autocoerce for the rationale and
LaTeX::TikZ::Point::Math::Complex for an example.
"Tikz->closed_polyline(@points)"
Creates a LaTeX::TikZ::Set::Polyline object that cycles through
- successive eleemnts of @points.
+ successive elements of @points.
my $diamond = Tikz->closed_polyline(
Tikz->point(0, 1),
"Tikz->functor(@rules)"
Creates a LaTeX::TikZ::Functor anonymous subroutine that can be called
against LaTeX::TikZ::Set trees to clone them according to the given
- rules. @rules should be made of array references whose first element is
- the class/role to match against and the second the handler to run.
+ rules. @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;
# A mod stripper
my $strip = Tikz->functor(
- 'LaTeX::TikZ::Mod' => sub { return },
+ '+LaTeX::TikZ::Mod' => sub { return },
);
my $naked = $set->$strip;