<HTML><BODY style="word-wrap: break-word; -khtml-nbsp-mode: space; -khtml-line-break: after-white-space; "><BR><DIV><DIV>On Oct 24, 2006, at 4:02 PM, Ivars Finvers wrote:</DIV><BR class="Apple-interchange-newline"><BLOCKQUOTE type="cite"><P style="margin: 0.0px 0.0px 0.0px 0.0px"><FONT face="Helvetica" size="3" style="font: 12.0px Helvetica">I saw a message saying the Tioga 1.2.x has the ability to directly <SPAN class="Apple-converted-space"> </SPAN></FONT></P> <P style="margin: 0.0px 0.0px 0.0px 0.0px"><FONT face="Helvetica" size="3" style="font: 12.0px Helvetica">produce a "final" version of a figure's pdf. A quick browse of the <SPAN class="Apple-converted-space"> </SPAN></FONT></P> <P style="margin: 0.0px 0.0px 0.0px 0.0px"><FONT face="Helvetica" size="3" style="font: 12.0px Helvetica">documentation didn't reveal how to do this (or even, exactly what the <SPAN class="Apple-converted-space"> </SPAN></FONT></P> <P style="margin: 0.0px 0.0px 0.0px 0.0px"><FONT face="Helvetica" size="3" style="font: 12.0px Helvetica">new commands are).</FONT></P> <P style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica; min-height: 14.0px"><BR></P> <P style="margin: 0.0px 0.0px 0.0px 0.0px"><FONT face="Helvetica" size="3" style="font: 12.0px Helvetica">For those of us who aren't intimate with the details of Tioga, would <SPAN class="Apple-converted-space"> </SPAN></FONT></P> <P style="margin: 0.0px 0.0px 0.0px 0.0px"><FONT face="Helvetica" size="3" style="font: 12.0px Helvetica">it be possible to provide an example of using the new pdf mode?</FONT></P> </BLOCKQUOTE></DIV><BR><DIV><BR class="khtml-block-placeholder"></DIV><DIV>Hi Ivars,</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>Thanks for the email.  It seems that the releases have gotten out in front of the documentation again!</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>Before going into details of commands, please allow me to take another shot at explaining this talk about "final" versions of a figure's pdf means.  For me, there's been a change of view not unlike the famous visual illusion (is it a vase or is it a reflected profile?):</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV><IMG src="cid:0AD007CF-B135-4422-9544-2ECD2AE81833@local"></DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>In the "old days", I thought of Tioga as producing intermediate files (the *_figure.tex and *_figure.txt files) that would at some later time be combined by TeX to create a figure in a TeX document.  So, in that view, the "final" figure PDF was created by TeX as part of typesetting a document.  However, I naturally wanted to see what the figure looked like while I was debugging it, and so there was a "preview" ability in Tioga as well.  And before long it became clear that I was looking at things in the "wrong" way.</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>So there was a reversal in my image, and now I think of the process as Tioga producing the final PDF for the figure and, as part of that, calling TeX as a subroutine to get the job done.  Then the figure PDF can be used however you wish -- as part of a TeX document of course, but for anything else as well.  There is no longer any need for a "preview" and the *_figure files can be deleted immediately since they're now just temporaries created to drive TeX.</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>There wasn't too much needed to provide better support for this new view of things.  Mainly, you need to be able to specify exact sizes for figure and fonts.</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>Now for specifics.  Please take a quick look at tioga samples/plots/plots.rb that is part of the download.   At the end of the initialize routine, at line 63, there is a new addition:</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>        t.def_enter_page_function { enter_page }</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>This tells tioga that whenever it is about to create a new PDF page, it should call the 'enter_page' method which is defined in the next few lines of the file:</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>    def enter_page</DIV><DIV>        t.page_setup(11*72/2,8.5*72/2)</DIV><DIV>        t.set_frame_sides(0.15,0.85,0.85,0.15) # left, right, top, bottom in page coords        </DIV><DIV>    end</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>The page_setup routine takes the desired width and height in "big points" (72 per inch).   So in this case, the PDF will be 5.5 inches wide and 4.25 inches high.  The set_frame_sides routine takes fractional positions on the page (i.e., page coordinates).  If you wanted to change the fonts, you could do that in the enter_page routine as well by adding a line like this:</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>        t.set_default_font_size(14)</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>I hope this helps to clarify things.</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>Cheers,</DIV><DIV>Bill</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV><BR class="khtml-block-placeholder"></DIV></BODY></HTML>