<br><br><div class="gmail_quote">On Wed, Nov 12, 2008 at 4:10 PM, Denilson Barbosa <span dir="ltr"><<a href="mailto:denilson.barbosa@gmail.com">denilson.barbosa@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
hi there,<br>
<br>
I've made this feature request for improving the latex bundle and got<br>
a reply that maybe the user discussion list would be more appropriate.<br>
So here it is:<br>
<br>
pstricks remains extremely useful and pdflatex seems to be the future<br>
of LaTeX, although it does not support pstricks directly.<br>
<br>
There is a simple and elegant way of having then coexist, which is to<br>
use the pst-pdf package, which defines a new environment to wrap<br>
pstricks figures. However, this now requires that we compile the ps<br>
and pdf parts separately as follows:<br>
<br>
    latex <file.tex><br>
    dvips -Ppdf -o <<a href="http://file-pics.ps" target="_blank">file-pics.ps</a>> <file.dvi><br>
    ps2pdf -dAutoRotatePages=/None <<a href="http://file-pics.ps" target="_blank">file-pics.ps</a>> <file-pics.pdf><br>
    pdflatex <file.tex><br>
<br>
This is properly documented in<br>
<a href="http://tug.org/PSTricks/main.cgi?file=pdf/pdfoutput" target="_blank">http://tug.org/PSTricks/main.cgi?file=pdf/pdfoutput</a><br>
<br>
The LaTeX bundle should be extended with a new test to see if the<br>
pst-pdf package is loaded and perform the steps above, removing the<br>
.ps file after the last step.<br>
<br>
Has anyone been able to extend the latex bundle with a way to handle pst-pdf?<br></blockquote><div><br></div><div>I am curious to know how many people such an extension would benefit.  I think one of the nice things about the Bundle as it stands now is that it does the things that the majority of people want pretty well.  And... it is extensible enough for cases like this to be handled elegantly by the user.</div>
<div><br></div><div>For example:  These lines could be  re-written placed in a script file in your home directory somewhere:</div><div>   latex <file.tex><br>   dvips -Ppdf -o <<a href="http://file-pics.ps" target="_blank">file-pics.ps</a>> <file.dvi><br>
   ps2pdf -dAutoRotatePages=/None <<a href="http://file-pics.ps" target="_blank">file-pics.ps</a>> <file-pics.pdf><br>   pdflatex <file.tex><br></div><div><br></div><div><div>The lines above would need to be re-written to use the TM_FILENAME environment variable as follows:</div>
<div><br></div><div>#!/bin/bash</div><div><br></div><div>filebase=`basename -s .tex ${TM_FILENAME}</div><div>latex ${TM_FILENAME}</div><div>dvips- -Ppdf -o $<a href="http://filebase-pics.ps">filebase-pics.ps</a> $filebase.dvi</div>
<div>ps2pdf -dAutoRotatePages=/None $<a href="http://filebase-pics.ps">filebase-pics.ps</a> $filebase-pics.pdf</div><div>pdflatex ${TM_FILENAME}</div><div>rm $<a href="http://filebase-pics.ps">filebase-pics.ps</a></div><div>
<br></div></div><div><br></div><div>Now, at the top of your latex file you can put the line:</div><div><br></div><div>%!TEX TS-program = /path/to/my/script </div><div><br></div><div>From now on the LaTeX bundle will use your script to typeset your file.  Because the script is written using TM_FILENAME it will work for any files you want to do this with.</div>
<div><br></div><div>If this is a common case, then I think it would be good to add to the Bundle directly but if this is something only used by 1 or 2 people then I think the solution above is the way to go.</div><div><br>
</div><div>Brad</div><div><br></div><div><br></div><div><br></div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<br>
Thanks<br>
<br>
Denilson<br>
<br>
_______________________________________________<br>
textmate mailing list<br>
<a href="mailto:textmate@lists.macromates.com">textmate@lists.macromates.com</a><br>
<a href="http://lists.macromates.com/listinfo/textmate" target="_blank">http://lists.macromates.com/listinfo/textmate</a><br>
</blockquote></div><br><br clear="all"><br>-- <br>Brad Miller<br>Assistant Professor, Computer Science<br>Luther College<br>