home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Fresh Fish 8
/
FreshFishVol8-CD1.bin
/
useful
/
text
/
tex
/
pastex
/
macros
/
misc
/
epsfig.sty
< prev
next >
Wrap
Text File
|
1994-06-08
|
27KB
|
859 lines
\def\fileversion{v1.0}
\def\filedate{3 Dec 91}
\immediate\write16{Document style option `epsfig', \fileversion\space
<\filedate> (edited by SPQR)}
%%%--------------------------------------------------------------------
%%% psfig merged with EPSF =epsfig Release 1
%%%
%%% code rearranged by Sebastian Rahtz from work by
%%% Trevor Darrell; Tom Rokicki; Daniel Smith; H. Payne, Robert Russell
%%%
%%% This is a version of Darrell's `psfig' macros which are designed only
%%% to be used with Rokicki's dvips program and the `epsf' macros (these
%%% are automaticaly included by the style file). I did this because the
%%% \special commands used by `epsf' appear to be more robust and
%%% portable than the raw \specials used by `psfig', but I preferred the
%%% psfig interface, and wanted to use some of its features which epsf
%%% did not offer (specifically, clipping to the BoundingBox). This system
%%% preserves the psfig interface, but mainly uses epsf macros to carry out
%%% the job. The user interface is identical to \psfig, but you just use
%%% \epsfig instead. Clipping and rotation uses the original psfig macros,
%%% as do specific settings of the Bounding Box in the call to the macro.
%%% I could not work out how to do rotation or clipping with the epsf macros.
%%%
%%% One behaviour which may confuse people is that setting width= and
%%% height will *not* force a change in the aspect ratio. If you need
%%% behaviour, use the \psfig macro instead of \epsfig. Rokicki's macros
%%% do not provide a way of doing the aspect ration stuff.
%%%
%%% If you *really* want old psfig behaviour regardless, use \psfig. It is
%%% still there. Some of the features have gone, however. \figurepath
%%% seemed redundant, since it could be controlled by the TEXINPUTS
%%% variable anyway. I am not sure whether rheight= etc work or not, I
%%% cannot remember the syntax!
%%%
%%% As an added feature, if a file cannot be found, a file called `file'.bb
%%% is searched for. This should simply contain a %%BoundingBox line. It is
%%% assumed that if this exists, then `file'.Z exists, and is a Unix
%%% compressed file. The macros then read the BB from `file'.bb, but insert
%%% "zcat `file'.Z" in the output for dvips to interpret (don't worry, it
%%% knows about this). Saves a lot of space! Actually, its more
%%% complicated than that; the string passed to dvips for file `foo.ps' is
%%% actually "zcat `texfind foo.ps.Z`", where `texfind' is assumed to be a
%%% shell script which searches the TEXINPUTS path for `foo.ps.Z'. Such a
%%% script comes with dvips. Just alias it to `cat' if you have problems.
%%% If you are *not* on a Unix system and use this, deliberately or by
%%% mischance, you will have problems!
%%%
%%% This file can be included in a dumped format, or used as a LaTeX
%%% style file, or used in plain TeX. It does not load itself twice.
%%%
%%% Sebastian Rahtz December 1991 spqr@uk.ac.soton.ecs
%--------------------------------------------------------------------
%--------------------------------------------------------------------
%%% previous notes. this copy of psfig.tex inherited from version 1.7
%--------------------------------------------------------------------
%%% All psfig/tex software, documentation, and related files
%%% in this distribution of psfig/tex are
%%% Copyright 1987, 1988, 1991 Trevor J. Darrell
%
%%% Permission is granted for use and non-profit distribution of psfig/tex
%%% providing that this notice be clearly maintained. The right to
%%% distribute any portion of psfig/tex for profit or as part of any commercial
%%% product is specifically reserved for the author(s) of that portion.
%%%
%%% Thanks to Greg Hager (GDH) and Ned Batchelder for their contributions
%%% to this project.
%%%--------------------------------------------------------------------------
%%% GDH 7/26/87 -- changed so that it first looks in the local directory,
%%% then in a specified global directory for the ps file.
%%% SPQR 12/91 removed that last change. it follows TEXINPUTS anyway
%%% RPR 6/25/91 -- changed so that it defaults to user-supplied name if
%%% boundingbox info is specified, assuming graphic will be created by
%%% print time.
%%% SPQR 12/91 removed that last change. use LaTeX error message instead
%%% SPQR 12/91 -- `no file found' produces LaTeX error message.
%%% If you recover from that the file name is set in draft
%%% mode in place of the file.
%%%
%%% Modified by J. Daniel Smith on 9 October 1990 to accept the
%%% %%BoundingBox: comment with or without a space after the colon. Stole
%%% file reading code from Tom Rokicki's EPSF.TEX file (see below).
%%% --- SPQR 12.91 removed most of this to use epsf directly
%%%
%%% More modifications by J. Daniel Smith on 29 March 1991 to allow the
%%% the included PostScript figure to be rotated. The amount of
%%% rotation is specified by the "angle=" parameter of the \epsfig command.
%%%
%%% Modified by Robert Russell on June 25, 1991 to allow users to specify
%%% .ps filenames which don't yet exist, provided they explicitly provide
%%% boundingbox information via the \epsfig command. Note: This will only work
%%% if the "file=" parameter follows all four "bb???=" parameters in the
%%% command. This is due to the order in which psfig interprets these params.
%%% ---- SPQR 12.91 removed all this
%%%
%%% 3 Jul 1991 JDS check if file already read in once
%%%
%%% Modified by H. Payne on 9 October 1991 to allow rotation through
%%% arbitrary angles, not just angles in the first quadrant.
%--------------------------------------------------------------------------
%%%
%%% check to see if macros already loaded in (maybe some other file says
%%% "\input epsfig") ...
%%% from a suggestion by eijkhout@csrd.uiuc.edu to allow
%%% loading as a style file:
\edef\epsfigRestoreAt{\catcode`@=\number\catcode`@\relax}
\catcode`\@=11\relax
\ifx\typeout\undefined%
\newwrite\@unused
\def\typeout#1{{\let\protect\string\immediate\write\@unused{#1}}}
\fi
\ifx\undefined\epsfig%
\else
\typeout{EPSFIG --- already loaded}\endinput
\fi
%
%
% we try to put a box round space of missing figures. plain TeX
% doesn't have an easy command, so just ignore it
\ifx\undefined\fbox\def\fbox#1{#1}\fi
%%%
%%% we need Rokicki's EPSF macros anyway, unless they are already loaded
%
\ifx\undefined\epsfbox\input epsf\fi
%
%% SPQR 12.91 handling of errors using standard LaTeX error
%% mechanism. In case we are plain TeX we first define the
%% error routines...
\ifx\undefined\@latexerr
\newlinechar`\^^J
\def\@spaces{\space\space\space\space}
\def\@latexerr#1#2{%
\edef\@tempc{#2}\expandafter\errhelp\expandafter{\@tempc}%
\typeout{Error. \space see a manual for explanation.^^J
\space\@spaces\@spaces\@spaces Type \space H <return> \space for
immediate help.}\errmessage{#1}}
\fi
%------------------------
%% a couple of LaTeX error messages
\def\@whattodo{You tried to include a PostScript figure which
cannot be found^^JIf you press return to carry on anyway,^^J
The failed name will be printed in place of the figure.^^J
or type X to quit}
\def\@whattodobb{You tried to include a PostScript figure which
has no^^Jbounding box, and you supplied none.^^J
If you press return to carry on anyway,^^J
The failed name will be printed in place of the figure.^^J
or type X to quit}
%------------------------
%
\newwrite\@unused
%------------------------------------------------------------------------
%------------------------------------------------------------------------
%%% @psdo control structure -- similar to Latex @for.
%%% I redefined these with different names so that psfig can
%%% be used with TeX as well as LaTeX, and so that it will not
%%% be vunerable to future changes in LaTeX's internal
%%% control structure,
%
\def\@nnil{\@nil}
\def\@empty{}
\def\@psdonoop#1\@@#2#3{}
\def\@psdo#1:=#2\do#3{\edef\@psdotmp{#2}\ifx\@psdotmp\@empty \else
\expandafter\@psdoloop#2,\@nil,\@nil\@@#1{#3}\fi}
\def\@psdoloop#1,#2,#3\@@#4#5{\def#4{#1}\ifx #4\@nnil \else
#5\def#4{#2}\ifx #4\@nnil \else#5\@ipsdoloop #3\@@#4{#5}\fi\fi}
\def\@ipsdoloop#1,#2\@@#3#4{\def#3{#1}\ifx #3\@nnil
\let\@nextwhile=\@psdonoop \