% Insert a PostScript plot made by IDL into a LaTex document:
% For the ArborText program dvips.
%
% This macro creates a captioned figure of the specified size
% and uses the \special command to insert the PostScript.
%
% Usage: \insertplot{file}{caption}{label}{width}{height}
% 	file = name of file containing the PostScript.
% 	caption = caption of figure
%	label = latex \label{} for figure to be used by \ref{} macro.
%	width = width of figure in inches.
%	height = height of figure, in inches.
%
%
%
%		Insert a plot..
\newcommand{\insertplot}[5]{%
% Usage: \insertplot{file}{caption}{label}{width in inches}{height}
\begin{figure}%
\hfill\hbox to 0.05in{\vbox to #5in{\vfil%
\inputplot{#1}{#4}{#5}% Include the plot file
}\hfill}%
\hfill\vspace{-.1in}% Fudge factor to tighten things up a bit.
\caption{#2}\label{#3}
\end{figure}}
%
%
% Include a PostScript File, this varies according to the DVI program:
% Usage: \inputplot{filename}{width}{height}
% When called from insertplot, the current position is at the bottom CENTER
% of the figure box.
\newcommand{\inputplot}[3]{%
%	Output PostScript commands to scale default sized (7 wide by 5 high)
%	IDL plot into the specified size.  Also set origin to the current
%	point less half the width of the box, centering the box above the
%	current point.
%%  \special{ps:: gsave #2 -36 mul 0 rmoveto currentpoint translate
%%  #2 7.0 div #3 5.0 div scale}%
%%  \special{ps: plotfile #1}\special{ps:: grestore}}
%
\special{insert #1, string="#2 -36 mul 0 rmoveto currentpoint translate
#2 7.0 div #3 5.0 div scale"} }
%
%
