[OS X TeX] One More Pdftricks Engine

Herb Schulz herbs at wideopenwest.com
Tue Feb 15 02:41:36 CET 2005


Howdy,

Here is one last pdftricks engine for TeXShop for those who don't like to
use \write18 (i.e., --shell-enable for pdflatex). Save the following as
pdftricks.engine in ~/Library/TeXShop/Engines/ and make it executable:

#!/bin/sh
location=$(dirname "$1")
basefname="${location}/`basename "$1" .tex`"
pdflatex "${basefname}"
# process the figures
for file in "${location}/${basefname}"-fig*.tex ;
do
    figbasefname="${location}/`basename "${file}" .tex`"
    altpdflatex --maxpfb --extratexopts "--interaction=batchmode" "${file}"
    if [ -e "${figbasefname}.pdf" ] ; then
        pdfcrop "${figbasefname}.pdf"
        /bin/mv "${figbasefname}-crop.pdf" "${figbasefname}.pdf"
    fi
    /bin/rm "${figbasefname}.dvi" "${figbasefname}.log"
"${figbasefname}.aux"
done
pdflatex "${basefname}"

Then use \usepackage[noshell]{pdftricks} and typeset with this engine. It
will
1)process the original file with pdflatex (which produces the
<file>-fig*.tex files and the common tmp.inputs file.
2)process each of the <file>-fig*.tex files through altpdflatex
(latex->dvips->ps2pdf13) and pdfcrop (to get he correct BoundingBox).
Renaming as needed.
3)process the original file through pdflatex again to typeset the figures.

Of course you can add/subtract as needed. Once the figures are produced as
needed you need only continue any processing (e.g., to get the toc, cross
references, etc.) through pdflatex alone.

Good Luck,

Herb Schulz
(herbs at wideopenwest.com)

--------------------- Info ---------------------
Mac-TeX Website: http://www.esm.psu.edu/mac-tex/
           & FAQ: http://latex.yauh.de/faq/
TeX FAQ: http://www.tex.ac.uk/faq
List Post: <mailto:MacOSX-TeX at email.esm.psu.edu>





More information about the macostex-archives mailing list