[OS X TeX] BoundingBox

Michael Sharpe msharpe at ucsd.edu
Wed Feb 11 18:24:13 CET 2009

On Feb 11, 2009, at 8:25 AM, riccardo nisi wrote:

> (3) I have cropped the the graphic of qqq.pdf with the Preview  
> application and  saved the new qqq.pdf.
> (4) I am in need of to insert my graphics into an other source file,  
> wich uses
> the PSTricks package (the first line is %TEX TS-program =latex),  
> with \incudegraphics{qqq}.
> (4) When I tipeset the (4)sourcefile, TexShop says that it does not  
> find the  qqq file.
> If the  \includegraphics argument is qqq.pdf, TexShop says that the  
> graphic file has no the
> BoundingBox.

A file using pstricks cannot include a pdf graphic, so you need to  
make a workflow that makes a  trimmed eps file. There must be many  
ways to do this, but the following works reliably for me.

Save the following script as, say, makeeps.
######cut here
#! /bin/bash
docroot=`basename $1 .tex`
thedir=`dirname $1`
pushd $thedir
if [ ! -f $docroot.tex ]; then
	echo "No tex file $docroot.tex"
	exit 1
latex --shell-escape --synctex=1 $docroot
if [ ! -f $docroot.dvi ]; then exit 1
dvips -R0 -Poutline -o$docroot.ps $docroot.dvi
if [ ! -f $docroot.ps ]; then exit 1
ps2eps -l -f $docroot.ps
if [ ! -f $docroot.eps ]; then exit 1
epstopdf $docroot.eps
######cut here

Save the script to somewhere in your PATH, say, /usr/local/bin, and  
make it executable with chmod 755 /usr/local/bin/makeps.

In TeXShop preferences->Misc, enter /usr/local/bin/makeeps in the  
Latex program box.

For files you wish to process with this script, change %!TEX TS- 
program = latex to %!TEX TS-program = personallatex. This has the same  
effect as choosing Personal Script and Latex from the Typeset menu.


More information about the macostex-archives mailing list