%%%%%%%%%%%%%%%%%%%%%%%%%%%%%CUT HERE%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% This is ptexproc.sty
% This file may be freely distributed but may not be altered in any way. 
% Any comments or questions regarding these macros should be directed to: 
 
%                 Corey Gray 
%                 SIAM 
%                 3600 University City Science Center 
%                 Philadelphia, PA 19104-2688 
%                 USA 
%                 Telephone: (215) 382-9800 
%                 Fax: (215) 386-7999 
%                 e-mail: gray@siam.org 
 
% 
%       This is a file of macros and definitions for creating a chapter 
%       for publication in the SIAM Proceedings Series using Plain TeX. 
 
%    Report the version. 
\message{*** SIAM Plain TeX Proceedings Series macro package, version 1.0, 
November 6, 1992.***} 
 
% Make the @ sign a letter for internal control sequences. 
\catcode`\@=11 
% 
% 
% 
 
\overfullrule=0pt
\baselineskip=14truept 
 
 
%%%  DIMENSIONS  %%% 
 
\hsize=36truepc 
\vsize=55truepc 
%\hoffset=.5in 
\parindent=18truept 
\def\firstpar{\parindent=0pt\global\everypar{\parindent=18truept}} 
\parskip=0pt 
 
 
%%%  FONTS  %%% 
 
\font\tenrm=cmr10 
\font\tenbf=cmbx10 
\font\tenit=cmti10                   
\font\tensmc=cmcsc10 
\def\tenpoint{% 
   \def\rm{\tenrm}\def\bf{\tenbf}% 
   \def\it{\tenit}\def\smc{\tensmc} 
        \textfont0=\tenrm \scriptfont0=\sevenrm 
        \textfont1=\teni \scriptfont1=\seveni 
        \textfont2=\tensy \scriptfont2=\sevensy 
        \textfont3=\tenex \scriptfont3=\tenex 
\baselineskip=12pt\rm}% 
 
\font\ninerm=cmr9 
\font\ninebf=cmbx9 
\font\nineit=cmti9 
\def\ninepoint{% 
   \def\rm{\ninerm}\def\bf{\ninebf}% 
   \def\it{\nineit}\baselineskip=11pt\rm}% 
 
\font\eightrm=cmr8 
\font\eightbf=cmbx8 
\font\eightit=cmti8         
\font\eighti=cmmi8 
\font\eightsy=cmsy8 
\def\eightpoint{% 
   \def\rm{\eightrm}\def\bf{\eightbf}% 
   \def\it{\eightit}\def\smc{\eightrm}\baselineskip=10pt\rm% 
        \textfont0=\eightrm \scriptfont0=\sixrm 
        \textfont1=\eighti \scriptfont1=\sixi 
        \textfont2=\eightsy \scriptfont2=\sixsy 
        \textfont3=\tenex \scriptfont3=\tenex 
} 
 
\font\sixrm=cmr6 
\font\sixbf=cmbx6 
\font\sixi=cmmi6         
\font\sixsmc=cmr5 
\font\sixsy=cmsy6 
\def\sixpoint{% 
   \def\rm{\sixrm}\def\bf{\sixbf}% 
   \def\smc{\sixsmc}\baselineskip=8pt\rm}% 
 
\fontdimen13\tensy=2.6pt 
\fontdimen14\tensy=2.6pt 
\fontdimen15\tensy=2.6pt 
\fontdimen16\tensy=1.2pt 
\fontdimen17\tensy=1.2pt 
\fontdimen18\tensy=1.2pt               
 
\font\eightrm=cmr8 
\font\ninerm=cmr9 
\font\elevenrm=cmr10 scaled\magstephalf
\font\fourteenrm=cmr10 scaled\magstep 1
\font\eighteenrm=cmr10 scaled\magstep 3
\font\twelvebf=cmbx10 scaled\magstep 1
\font\elevenbf=cmbx10 scaled\magstephalf
\font\elevenit=cmti10 scaled\magstephalf
\font\elevensc=cmcsc10 scaled\magstephalf

\def\theoremfont{\elevensc}
\def\textfont{\elevenrm}
\def\itfont{\elevenit}
\def\headfont{\twelvebf}
\def\smallheadfont{\elevenbf}
\def\titlefont{\eighteenrm} 
\def\chapterfont{\fourteenrm} 
\def\authorfont{\fourteenrm} 
\def\rheadfont{\tenrm} 
\def\abstractfont{\tenrm}
\def\smc{\tensmc} 
\font\eightsmc=cmcsc8 
 
\def\footnote#1{\baselineskip=11truept\edef\@sf{\spacefactor\the\spacefactor}#1\@sf
  \insert\footins\bgroup\ninepoint\hsize=36pc
  \interlinepenalty10000 \let\par=\endgraf
   \leftskip=0pt \rightskip=0pt
   \splittopskip=10pt plus 1pt minus 1pt \floatingpenalty=20000
\smallskip   
\item{#1}\bgroup\baselineskip=10pt\strut
\aftergroup\@foot\let\next}
\skip\footins=12pt plus 2pt minus 4pt
\dimen\footins=36pc



%%%  CHAPTER OPENING MACROS  %%% 
 
\def\startchapter{\topinsert\vglue54pt\endinsert} 

\def\title#1\endtitle{\titlefont\centerline{#1}\vglue5pt}%\vskip40truept\tenrm} 
\def\lasttitle#1\endlasttitle{\titlefont\centerline{#1}\vskip1.32truepc}
\def\author#1\endauthor{\authorfont\centerline{#1}\vglue8pt\textfont} 
\def\lastauthor#1\endlastauthor{\authorfont\centerline{#1}\vglue2.56pc\textfont} 
\def\abstract#1\endabstract{\baselineskip=12pt\leftskip=2.25pc
     \rightskip=2.25pc\abstractfont{#1}\textfont} 

%%%  COUNTERS FOR HEADINGS  %%% 
 
\newcount\headcount 
\headcount=1 
\newcount\seccount 
\seccount=1 
\newcount\subseccount 
\subseccount=1 
\def\secreset{\global\seccount=1} 
 \def\subsecreset{\global\subseccount=1}
 
%%%  HEADINGS  %%% 
 
\def\headone#1{\baselineskip=14pt\leftskip=0pt\rightskip=0pt\vskip17truept\parindent=0pt
{\headfont\the\headcount\hskip14truept #1}
\par\nobreak\firstpar\global\advance\headcount by 0 
   \global\advance\headcount by 1\secreset\vskip2truept\textfont} 

\def\headtwo#1{\advance\headcount by -1% 
   \vskip17truept\parindent=0pt{\headfont\the\headcount.% 
   \the\seccount\hskip14truept #1}%\enspace\ignorespaces\firstpar 
   \global\advance\headcount by 1\global\advance\seccount by 1 
   \global\advance\subseccount by 1\subsecreset\vskip2pt\textfont} 
 
 \def\headthree#1{\advance\headcount by -1\advance\seccount by -1
%   \advance\subseccount by -1% 
   \vskip17truept\parindent=0pt{\smallheadfont\the\headcount.% 
   \the\seccount.\the\subseccount\hskip11truept #1}\hskip6pt\ignorespaces 
   \firstpar\global\advance\headcount by 1\global\advance\seccount by 1 
   \global\advance\subseccount by 1\textfont} 
 
%%%  THEOREMS, PROOFS, DEFINITIONS, etc.  %%% 
 
\def\thm#1{{\theoremfont 
#1\enspace} 
\hskip-5pt\begingroup\itfont\ignorespaces} 
 
\let\lem=\thm 
\let\cor=\thm 
\let\prop=\thm 
 
\def\endthm{\endgroup\textfont} 
\let\endlem=\endthm 
\let\endcor=\endthm 
\let\endprop=\endthm 
 
\def\prf#1{{\itfont #1.}\textfont\enspace\ignorespaces} 
\let\rem=\prf 
\let\case=\prf 
 
\def\endprf{\textfont} 
\let\endrem=\endprf 
\let\endcase=\endprf 

\def\qed{{\qquad \vbox{\hrule\hbox{%
   \vrule height1.3ex\hskip0.8ex\vrule}\hrule
  }}\par}  
 
\def\dfn#1{{\theoremfont
#1\enspace} 
\textfont\ignorespaces} 
 
\let\fact=\dfn 
 
\def\enddfn{\textfont} 
 
\let\endfact=\enddfn 

%%%  FIGURES AND CAPTIONS  %%% 


\newcount\figcount
\figcount=1


%\newcount\tablenumber
%\tablenumber=1

\def\\{\hfill\break}

\newbox\TestBox
\newdimen\setwd
\newskip\belowcaptionskip
\belowcaptionskip=6pt plus 1pt

\def\endinsert{\egroup % finish the \vbox
  \if@mid \dimen@\ht\z@ \advance\dimen@\dp\z@
    \advance\dimen@12\p@ \advance\dimen@\pagetotal
    \ifdim\dimen@>\pagegoal\@midfalse\p@gefalse\fi\fi
   \if@mid\vskip\belowcaptionskip\box\z@\par \penalty-200\vskip\belowcaptionskip
  \else\insert\topins{\penalty100 % floating insertion
    \splittopskip\z@skip
    \splitmaxdepth\maxdimen \floatingpenalty\z@
    \ifp@ge \dimen@\dp\z@
    \vbox to\vsize{\unvbox\z@\kern-\dimen@}% depth is zero
    \else \box\z@\nobreak\vskip\belowcaptionskip\fi}\fi\endgroup}




\def\fig#1#2#3{%
       \setbox\TestBox=\hbox{\tenpoint #3.}\setwd=\wd\TestBox
        \topinsert
       \vskip #1
                \vskip 12pt
        \ifdim\setwd > 23pc
          {\tenit{\smc #2.}\ \ #3}
        \else
         \centerline{\tenit\noindent 
                {\smc #2.}\ \  #3}\fi%
               % \global\advance\figcount by 1
        \endinsert}


 
%%%  REFERENCES  %%% 
 
\newdimen\refindent@ 
\newdimen\refhangindent@ 
\newbox\refbox@ 
\setbox\refbox@=\hbox{\tenrm\baselineskip=11pt [00]}%   Default 2 digits 
\refindent@=\wd\refbox@ 
 
\def\resetrefindent#1{% 
        \setbox\refbox@=\hbox{\tenrm\baselineskip=11pt [#1]}% 
        \refindent@=\wd\refbox@} 
 
\def\Refs{% 
        \unskip\vskip1pc 
        \leftline{\noindent\headfont References}% 
        \penalty10000 
        \vskip4pt 
        \penalty10000 
        \refhangindent@=\refindent@ 
        \global\advance\refhangindent@ by .5em 
        \global\everypar{\hangindent\refhangindent@}% 
        \parindent=0pt\baselineskip=12pt\tenrm} 
                                       
\def\sameauthor{\leavevmode\vbox to 1ex{\vskip 0pt plus 100pt 
    \hbox to 2em{\leaders\hrule\hfil}\vskip 0pt plus 300pt}} 
     
\def\ref#1\\#2\endref{\leavevmode\hbox to \refindent@{\hfil[#1]}\enspace #2\par} 
 
 
%%%  OUTPUT  %%% 
 
\def\rightheadline{\hfill\tensmc\rightrh\hskip2pc\tenrm\folio} 
\def\leftheadline{\tenrm\folio\hskip2pc\tensmc\leftrh\hfill} 
 
\global\footline={\hss\tenrm\folio\hss}% first page 
 
\output{\plainoutput} 
\def\plainoutput{\shipout\vbox{\makeheadline\pagebody\makefootline}% 
  \advancepageno 
  \ifnum\pageno>1 
        \global\footline={\hfill}% 
  \fi      
  \ifodd\pageno 
        \global\headline={\rightheadline}% 
  \else 
        \global\headline={\leftheadline}% 
  \fi 
  \ifnum\outputpenalty>-\@MM \else\dosupereject\fi} 
\def\pagebody{\vbox to\vsize{\boxmaxdepth\maxdepth \pagecontents}} 
\def\makeheadline{\vbox to\z@{\vskip-22.5\p@ 
  \line{\vbox to8.5\p@{}\rheadfont\the\headline}\vss}% 
    \nointerlineskip} 
\def\makefootline{\baselineskip24\p@\vskip-6\p@\line{\the\footline}} 
\def\dosupereject{\ifnum\insertpenalties>\z@ % something is being held over 
  \line{}\kern-\topskip\nobreak\vfill\supereject\fi} 

\def\footnoterule{\vskip11pt\kern -4\p@\hrule width 3pc \kern 3.6\p@ } % rule = .4 pt high 

%       Turn off @ as being a letter. 
% 
\catcode`\@=13 
 
%end of style file 
