[comp.text.tex] making psfig act sensibly

S.P.Q.Rahtz@ecs.soton.ac.uk (Sebastian Rahtz) (10/10/90)

A reluctant LaTeX user here got miffed at the wonderful \psfig macros
because they failed to report accurately that a PS file was missing,
as opposed to being malformed. My suggestion is to change \@p@@sfile
(and \@p@@sfigure} as follows, so that the error is explicitly
reported, but the job carries on, writing merely a FAILED message
where the file should have been (imitating \psdraft by increasing
\@p@scost). No doubt someone will tell me that LaTeX should stop and
give an error - suggestions?

Sebastian

\def\@p@@sfile#1{\def\@p@sfile{FAILED:#1}%
	        \openin1=#1
		\ifeof1\closein1%
		       \openin1=\figurepath#1
			\ifeof1\typeout{ERROR! PostScript file #1 not found}
                        \@p@@sbbllx{100bp}
                        \@p@@sbblly{100bp}
                        \@p@@sbburx{200bp}
                        \@p@@sbbury{200bp}
                        \def\@p@scost{200}
			\else\closein1
			    \edef\@p@sfile{\figurepath#1}%
                        \fi%
		 \else\closein1%
		       \def\@p@sfile{#1}%
		 \fi}

jdolter@eecs.umich.edu (James W. Dolter) (10/11/90)

What we have done is define a newif indicating that the file 
was not found.  If false the bounding box calulations are not
performed. The action on what to do if there is an error can
also be controlled by the user.

We also found that it was useful to have a colon seperated path
to search for the figures. This was accomplished by taking the 
@for structure from latex.tex (similar to what was done for @psdo)
and have the delimiter be ':' rather than ','.

If interested I will mail you our modifications.


-- Jim Dolter
   jdolter@pyrenees.eecs.umich.edu