From: Vincent Pit Date: Thu, 29 Jul 2010 10:49:08 +0000 (+0200) Subject: Complete the example for Formatter->render X-Git-Tag: v0.02~28 X-Git-Url: http://git.vpit.fr/?a=commitdiff_plain;h=b8e5d217d4c1ac94edf4fc3e6492f411462bb31e;p=perl%2Fmodules%2FLaTeX-TikZ.git Complete the example for Formatter->render --- diff --git a/lib/LaTeX/TikZ/Formatter.pm b/lib/LaTeX/TikZ/Formatter.pm index 368e0af..86d1b14 100644 --- a/lib/LaTeX/TikZ/Formatter.pm +++ b/lib/LaTeX/TikZ/Formatter.pm @@ -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 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