]> git.vpit.fr Git - perl/modules/LaTeX-TikZ.git/commitdiff
Complete the example for Formatter->render
authorVincent Pit <vince@profvince.com>
Thu, 29 Jul 2010 10:49:08 +0000 (12:49 +0200)
committerVincent Pit <vince@profvince.com>
Thu, 29 Jul 2010 10:49:08 +0000 (12:49 +0200)
lib/LaTeX/TikZ/Formatter.pm

index 368e0afea2475dc24b6c86dc636c9f0ee026c277..86d1b14bd114884e67459a41892c5016d075693a 100644 (file)
@@ -166,7 +166,28 @@ Finally, there's one array reference for each given TikZ set, which contain the
 
 =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