%Originally prepared by Ken Goldberg
%Modified by Pankaj K. Agarwal, Jan. 7, 1997.

%Please DO NOT modify this file.


% Papers should prepared using the standard article format with
% included .sty files as follows (see example.sty for details):
%	\documentstyle[wafr,psfig]{article}
%	\title{Title}
%	\author{Author 1, {\em Affiliation, City, State, Country} \\
%	Author 2, {\em Address, City, State, Country} \\}
% \begin{document}
% ...
% \bibliography{bibliography-file}
% \bibliographystyle{plain}
% \end{document}

%Besides formatting preamble, section headings,
%bibliographies, fifgures, etc., the file also contains a few 
%theorem-like environments: theorem, corollary, lemma,
%proposition, obeservation. Two other enviroments defined are
%proof and definition. If you need  another theorem-like
%environment, define them in your tex file and  please use the same 
% counter "theorem"  to number them.

\typeout{Latex style for WAFR}

\renewcommand{\ps@myheadings}{\let\@mkboth\@gobbletwo
\def\@oddhead{\hbox{}\sl\rightmark\hfil}\def\@oddfoot{}\def\@evenhead{\hfil\sl\leftmark\hbox{}}
\def\@evenfoot{}\def\sectionmark##1{}\def\subsectionmark##1{}}

% Physical page layout
\setlength\topmargin{0.1in}
 \setlength\oddsidemargin{-0.14in}
\setlength\evensidemargin{-0.14in}
\setlength\textheight{8.1in}
 \setlength\textwidth{6.85in}
\setlength\columnsep{0.29in}  \newlength\titlebox
 \setlength\titlebox{42mm}
\setlength\headheight{12pt}  
 \setlength\headsep{14pt}
\setlength\footheight{0pt}   \setlength\footskip{0pt}
\thispagestyle{empty}	     \pagestyle{myheadings}
\flushbottom \twocolumn \sloppy

% We're never going to need a table of contents, so just flush it to
% save space --- suggested by drstrip@sandia-2
\def\addcontentsline#1#2#3{}

\def\maketitle{\par
 \begingroup
   \def\thefootnote{\fnsymbol{footnote}}
   \def\@makefnmark{\hbox to 0pt{$^{\@thefnmark}$\hss}}
   \twocolumn[\@maketitle] \@thanks
 \endgroup
 \setcounter{footnote}{0}
 \let\maketitle\relax \let\@maketitle\relax
 \gdef\@thanks{}\gdef\@author{}\gdef\@title{}\let\thanks\relax}
\def\@maketitle{\vbox to \titlebox{\hsize\textwidth
 \linewidth\hsize \vskip 0.125in minus 0.125in 
 {\LARGE\bf \@title \par} \vskip 1.5em
 {\large \lineskip .5em   \@author \par}
 \vskip 1.5em}
}
\renewenvironment{abstract}{\em \noindent}{\par\vskip 1ex}

% sections with less space
\def\section{\@startsection {section}{1}{\z@}{-2.0ex plus
    -0.5ex minus -.2ex}{1.5ex plus 0.3ex minus .2ex}{\large\bf}}
\def\subsection{\@startsection{subsection}{2}{\z@}{-1.8ex plus
    -0.5ex minus -.2ex}{0.8ex plus .2ex}{\normalsize\bf}}
\def\subsubsection{\@startsection{subsubsection}{3}{\z@}{1.5ex plus
   0.5ex minus .2ex}{0.5ex plus .2ex}{\small\bf}}
\def\paragraph{\@startsection{paragraph}{4}{\z@}{1.5ex plus
   0.5ex minus .2ex}{-1em}{\normalsize\bf}}
\def\subparagraph{\@startsection{subparagraph}{5}{\parindent}{1.5ex plus
   0.5ex minus .2ex}{-1em}{\normalsize\bf}}

% Footnotes
\footnotesep 6.65pt %
\skip\footins 9pt plus 4pt minus 2pt
\def\footnoterule{\kern-3pt \hrule width 5pc \kern 2.6pt}
\setcounter{footnote}{0}

% Lists and paragraphs
\parindent 1em
\topsep 4pt plus 1pt minus 2pt
\partopsep 1pt plus 0.5pt minus 0.5pt
\itemsep 2pt plus 1pt minus 0.5pt
\parsep 2pt plus 1pt minus 0.5pt
\parskip 4pt plus 2.5pt minus 1.5pt  % Added by KYG to improve legibility

\leftmargin 2em \leftmargini\leftmargin \leftmarginii 2em
\leftmarginiii 1.5em \leftmarginiv 1.0em \leftmarginv .5em 
\leftmarginvi .5em
\labelwidth\leftmargini\advance\labelwidth-\labelsep \labelsep 5pt

\def\@listi{\leftmargin\leftmargini}
\def\@listii{\leftmargin\leftmarginii
   \labelwidth\leftmarginii\advance\labelwidth-\labelsep
   \topsep 2pt plus 1pt minus 0.5pt
   \parsep 1pt plus 0.5pt minus 0.5pt
   \itemsep \parsep}
\def\@listiii{\leftmargin\leftmarginiii
    \labelwidth\leftmarginiii\advance\labelwidth-\labelsep
    \topsep 1pt plus 0.5pt minus 0.5pt 
    \parsep \z@ \partopsep 0.5pt plus 0pt minus 0.5pt
    \itemsep \topsep}
\def\@listiv{\leftmargin\leftmarginiv
 \labelwidth\leftmarginiv\advance\labelwidth-\labelsep}
\def\@listv{\leftmargin\leftmarginv
 \labelwidth\leftmarginv\advance\labelwidth-\labelsep}
\def\@listvi{\leftmargin\leftmarginvi
 \labelwidth\leftmarginvi\advance\labelwidth-\labelsep}

\abovedisplayskip 7pt plus2pt minus5pt%
\belowdisplayskip \abovedisplayskip
\abovedisplayshortskip  0pt plus3pt%   
\belowdisplayshortskip  4pt plus3pt minus3pt%

% Less leading in most fonts (due to the narrow columns)
% The choices were between 1-pt and 1.5-pt leading
\def\@normalsize{\@setsize\normalsize{11pt}\xpt\@xpt}
\def\small{\@setsize\small{10pt}\ixpt\@ixpt}
\def\footnotesize{\@setsize\footnotesize{10pt}\ixpt\@ixpt}
\def\scriptsize{\@setsize\scriptsize{8pt}\viipt\@viipt}
\def\tiny{\@setsize\tiny{7pt}\vipt\@vipt}
\def\large{\@setsize\large{14pt}\xiipt\@xiipt}
\def\Large{\@setsize\Large{16pt}\xivpt\@xivpt}
\def\LARGE{\@setsize\LARGE{20pt}\xviipt\@xviipt}
\def\huge{\@setsize\huge{23pt}\xxpt\@xxpt}
\def\Huge{\@setsize\Huge{28pt}\xxvpt\@xxvpt}

% These commands allow TeX to place figures that fill
% say, 2/3 of a column in a column 
% with text.  Otherwise, TeX insists on placing these figures
% in a column without text, wasting precious page space.

\renewcommand{\topfraction}{0.99}
\renewcommand{\textfraction}{0.01}
\renewcommand{\floatpagefraction}{0.95}
\renewcommand{\textfloatsep}{6mm}

\renewcommand{\baselinestretch}{1.1}

\long\def\@makecaption#1#2{
 \vskip 10pt 
 \setbox\@tempboxa\hbox{\small \em {\bf #1:} #2}
 \ifdim \wd\@tempboxa >\hsize {\small \em {\bf #1:} #2}\par \else \hbox
to\hsize{\hfil\box\@tempboxa\hfil} 
 \fi}

%%%%% Print bibliography in small size.

\def\thebibliography#1{\section*{References}\list
{[\arabic{enumi}]}{\settowidth\labelwidth{[#1]}\leftmargin\labelwidth
 \advance\leftmargin\labelsep
 \usecounter{enumi}}
 \def\newblock{\hskip .11em plus .33em minus .07em}
 \sloppy\clubpenalty4000\widowpenalty4000
 \sfcode`\.=1000\relax \small}
\let\endthebibliography=\endlist


%%% Theorem-like environment. Using a single counter.

\newtheorem{theorem}{Theorem}
\newtheorem{lemma}[theorem]{Lemma}
\newtheorem{corollary}[theorem]{Corollary}
\newtheorem{proposition}[theorem]{Proposition}
\newtheorem{claim}[theorem]{Claim}
\newtheorem{fact}[theorem]{Fact}
\newtheorem{conjecture}[theorem]{Conjecture}
\newtheorem{openquestion}[theorem]{Open Question}
\newtheorem{observation}[theorem]{Observation}


\newenvironment{definition}{\par\addvspace{13pt}\noindent{\bf Definition
                \addtocounter{theorem}{1} \hspace{-1mm}\thelemma
                \hspace{2mm}}}{\par\addvspace{10pt}}


\newenvironment{proof}{\noindent {\bf Proof:}}{\hfill $\Box$\vspace{2mm}\par}

