%* Last edited: Jul 15 13:59 1997 (viola)
% 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}

\newlength{\smallfigureswidth}
\newlength{\tinyfigureswidth}
\newlength{\smsmallfigureswidth}
\newlength{\figureswidth}
\newlength{\bigfigureswidth}

\setlength{\tinyfigureswidth}{0.10 \textwidth}
\setlength{\smsmallfigureswidth}{0.25 \textwidth}
\setlength{\smallfigureswidth}{0.3 \textwidth}
\setlength{\figureswidth}{0.45 \textwidth}
\setlength{\bigfigureswidth}{0.65 \textwidth}

\def\hugefigureswidth{\textwidth}

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

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

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

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

\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}

\newcommand{\figuretableTWO}[3]{
\begin{table}[tbp]
\begin{center}
\begin{tabular}{cc}
#1
\end{tabular}
\end{center}
\caption{#2}
\label{#3}    
\end{table}
}

%* Last edited: May  5 19:52 1995 (viola)


% 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}[t]
        \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}}

