% -*- Mode: TEX -*-

%%% To include Postscript illustrations into Tex documents, 
%%% include this file in your preamble. 

%%% Usage : 

%%% Setup \def\illustrationfileprefix{<file-prefix>}

%%% Illustrations are centered by default, this can to turned off
%%% by using the command \illustrationcenterfalse

%%% Use \illustration{<filename>} to insert postscript file with ``.ps''
%%% suffix in your document.

%%% Use \illustrationxy{<filename>}{<xdim>}{<ydim>} to insert the 
%%% the illusration in the specified filename scaled to fit x-dim
%%% and y-dim.  
%%% \illustrationx and \illustrationy scale the other dimension automatically.

%%% NOTE: The epsf macros depend upon the BoundingBox comment.  Use 
%%% bbfig to calculate the bounding box if needed.

%%% NOTE: rawillustration directly uses the psfile special, with no
%%%  additional macro support.

%%% [acaro]: Rewritten to use EPSF macros instead of psadobe.

\def\illustrationfileprefix{}                          % Default is no
                                                       % prefix

\def\illustrationfilesuffix{.ps}                       % Default is .ps
                                                       % suffix
\newif\ifillustrationcenter	%Center illustrations?
\illustrationcentertrue		%True by default.


\def\illustration#1{\ifillustrationcenter\begin{center}
 \leavevmode\fi
 {\epsfxsize=\hsize
 \epsfbox{\illustrationfileprefix#1\illustrationfilesuffix}}
 \ifillustrationcenter\end{center}\fi}

\def\illcharacter#1{{\epsfbox{\illustrationfileprefix#1\illustrationfilesuffix}}}

\def\illustrationxy#1#2#3{\ifillustrationcenter\begin{center}
 \leavevmode\fi
 {\epsfxsize=#2 \epsfysize=#3
 \epsfbox{\illustrationfileprefix#1\illustrationfilesuffix}}
 \ifillustrationcenter\end{center}\fi
 }	

\def\illustrationx#1#2{\ifillustrationcenter\begin{center}
 \leavevmode\fi
 {\epsfxsize=#2
 \epsfbox{\illustrationfileprefix#1\illustrationfilesuffix}}
 \ifillustrationcenter\end{center}\fi
}

\def\illustrationy#1#2{\ifillustrationcenter\begin{center}
 \leavevmode\fi
 {\epsfysize=#2
 \epsfbox{\illustrationfileprefix#1\illustrationfilesuffix}}
 \ifillustrationcenter\end{center}\fi
}

\def\illustrationpercent#1#2{\ifillustrationcenter\begin{center}\fi
{\psadobepercent{#2}{\illustrationfileprefix#1\illustrationfilesuffix}}
\ifillustrationcenter\end{center}\fi}


%% dvips supports the following:
%%  hoffset, voffset (default 0)
%%  hsize (612), vsize (792) clipping sizes
%%  hscale (100), vscale (100) percent
%%  angle (0). [clip]
%% RAWILLUSTRATIONPERCENT: {psfile}{vbox}{x-scale}{y-scale}{x-offset}{y-offset}
\def\rawillustrationpercent#1#2#3#4#5#6{
 \vbox to #2{\vfill\special{psfile=\illustrationfileprefix#1\illustrationfilesuffix%
  hscale=#3 vscale=#4 hoffset=#5 voffset=#6}}}

%% RAWILLUSTRATIONXY: {psfile}{vbox}{x-size}{y-size}{x-offset}{y-offset}
\def\rawillustrationxy#1#2#3#4#5#6{
 \vbox to #2{\vfill\special{psfile=\illustrationfileprefix#1\illustrationfilesuffix%
  rwi=#3 rhi=#4 hoffset=#5 voffset=#6}}}


%%%% Edit History: /home/srco/new/lib/tex/localinputs/illustrations.tex

%%%+/home/jj/acaro/Scratch/Dvips/my-illustrations.tex 
%%% [acaro] 10/ 1/92 23:17  Modified to use EPSF instead of PSADOBE. I
%%% had to change the illustration percent to take a scale factor
%%% rather than a percent. I also added macros that use the facilities
%%% provided by EPSF for resizing.
%%%+/home/srco/new/lib/tex/localinputs/illustrations.tex 
%%% [rpaul]  9/ 7/93 17:04  I added the \rawillustration for direct 
%%% access to the psfile special (as understood by dvips-5493).
