=head2 C<unit>
+The unit in which lengths are printed.
+Valid units are C<cm> for centimeters and C<pt> for points.
+
+Defaults to C<cm>.
+
=cut
has 'unit' => (
=head2 C<format>
+The format used to print the numbers.
+
+Defaults to C<%s>.
+
=cut
has 'format' => (
=head2 C<scale>
+The scale of the drawing.
+
+Defaults to C<1>.
+
=cut
has 'scale' => (
=head2 C<width>
+The width of the drawing area.
+
+Defaults to C<undef> for none.
+
=cut
has 'width' => (
=head2 C<height>
+The height of the drawing area.
+
+Defaults to C<undef> for none.
+
=cut
has 'height' => (
=head2 C<origin>
+A point coerced into a L<LaTeX::TikZ::Point> object that represents the logical origin of the printed area.
+If L</width> and L</height> are set, the canvas will be equivalent to a rectangle whose lower left corner at C<-$origin> and of given width and length.
+
+Defaults to C<(0, 0)>, meaning that the drawing area goes from C<(0, 0)> to C<($width, $height)>.
+
=cut
has 'origin' => (
=head2 C<id>
+An unique identifier of the formatter object.
+
=cut
sub id {
} map($tikz->$_, qw/unit format scale width height/), $origin;
}
-=head2 C<render>
+=head2 C<render @sets>
+
+Processes all the L<LaTeX::TikZ::Set> objects given in C<@sets> to produce the actual TikZ code to insert in the LaTeX file.
+First, all the mods applied to the sets and their subsets are collected, and a declaration is emitted if needed for each of them by calling L<LaTeX::TikZ::Mod/declare>.
+Then, the image code is generated for each set.
+
+This method returns a list of array references :
+
+=over 4
+
+=item *
+
+The first one contains the header lines to include between the C<\documentclass> and the C<\begin{document}>.
+
+=item *
+
+The second one contains the mod declaration lines to put inside the document, between C<\begin{document}> and C<\end{document}>.
+
+=item *
+
+Finally, there's one array reference for each given TikZ set, which contain the lines for the actual TikZ pictures.
+
+=back
+
+ my ($header, $declarations, $seq1_body, $seq2_body) = $formatter->render($set1, $set2);
=cut
return \@header, \@decls, @bodies;
}
-=head2 C<len>
+=head2 C<len $len>
+
+Format the given length according to the formatter options.
=cut
sprintf $tikz->format . $tikz->unit, $len * $tikz->scale;
}
-=head2 C<angle>
+=head2 C<angle $theta>
+
+Format the given angle (in radians) according to the formatter options.
=cut
sprintf $tikz->format, POSIX::ceil($a);
}
-=head2 C<label>
+=head2 C<label $name, $pos>
+
+Returns the TikZ code for a point labeled C<$name> at position C<$pos> according to the formatter options.
=cut
=head2 C<thickness>
+Format the given line thickness according to the formatter options.
+
=cut
sub thickness {