% Some help putting postscript figures in LaTeX

% a latex label construct that can echo the label
% in the margin

\newif\ifshowlabels
\showlabelstrue
% \showlabelsfalse

% conditionally display a label in the margin

\def\maybeshowlabel#1{\ifshowlabels \marginpar{\scriptsize \sl #1}\fi}

% define an equation, with a label that is conditionally displayed in 
% the margin

\newenvironment{equationlabel}[1]{\maybeshowlabel{#1}\begin{equation}\label{#1}}{\end{equation}}

% Define a label and conditionally display it in the margin

\def\slabel#1{
    \maybeshowlabel{#1}\label{#1}}


% sneak out some text using picture envt...

\def\maybepicout#1{\ifshowlabels\begin{picture}(0,0)\put(0,0){\scriptsize\sl#1}\end{picture}\fi}

% a default width for inserted postscript


% Fake the insertion of figures so a document can be latexed when
% the figure files aren't around.

\newif\iffakefigures
\fakefiguresfalse

% a rectangle holding some small text.  first arg is text, second is width
\def\fakefigure#1#2{\vbox{
	\hbox{\ }\ \hskip-\wd0
 	\hbox{\fbox{\vbox to 1.0in {
 			\vss
 			\hbox to #2 { \hss 
 				{\scriptsize #1}
 			 \hss }
 			\vss
 			}}}}}



% Insert an mboxed postscript figure, default width is the
% native ps width.  Passes thru extra stuff to psfig.

\def\ps#1{\iffakefigures\fakefigure{#1}{\bigfigureswidth}\else\mbox{\psfig{figure=#1}}\fi}

\def\figureswidth{3.0in}
\def\bigfigureswidth{4.2in}
\def\hugefigureswidth{6.0in}

% Insert an mboxed postscript figure with width controlled by above defaults

\def\psw#1{\iffakefigures\fakefigure{#1}{\figureswidth}\else\mbox{\psfig{figure=#1,width=\figureswidth}}\fi}

\def\psW#1{\iffakefigures\fakefigure{#1}{\bigfigureswidth}\else\mbox{\psfig{figure=#1,width=\bigfigureswidth}}\fi}

\def\PSW#1{\iffakefigures\fakefigure{#1}{\hugefigureswidth}\else\mbox{\psfig{figure=#1,width=\hugefigureswidth}}\fi}

% Make a LaTeX figure with a caption and label
% Conditionally display the label in the margins

%\newcommand{\figures}[3]{
%    \begin{figure}[tbp]
%	\centering 
%	    #1
%	    \maybepicout{#3}
%	    \caption{#2}
%	    \label{#3}
%     \end{figure}}

\newcommand{\figures}[3]{
    \begin{figure}[tbp]
	\centering#1\maybepicout{#3}\caption{#2}\label{#3}\end{figure}}

% example useage:
% \figures{\psw{df-first.ps}\psw{df-second.ps}}
% 	{Proton Density and T2 weighted images}
% 	{FigDFEchos}







\def\easypage{
	\topmargin = -0.5in
	\textwidth = 6.3in
	\textheight = 9in
	\oddsidemargin = 0.0in
	\evensidemargin = 0.0in
	% ``double spaced''...
	\renewcommand{\baselinestretch}{1.15}}

