%njcarticle.sty 1995-06-21

\typeout{Document Style 'njcarticle'. Version 1995-06-21, Kimmo Raatikainen}

\@twosidetrue \@mparswitchtrue

\def\draft{\overfullrule 5pt} 

\lineskip 1pt \normallineskip 1pt
\def\baselinestretch{0.95}

\def\@normalsize{\@setsize\normalsize{13.6pt}\xipt\@xipt
\abovedisplayskip 11pt plus3pt minus6pt\belowdisplayskip \abovedisplayskip
\abovedisplayshortskip \z@ plus3pt\belowdisplayshortskip 6.5pt plus3.5pt
minus3pt\let\@listi\@listI} 
\def\small{\@setsize\small{12pt}\xpt\@xpt
\abovedisplayskip 10pt plus2pt minus5pt\belowdisplayskip \abovedisplayskip
\abovedisplayshortskip \z@ plus3pt\belowdisplayshortskip 6pt plus3pt minus3pt
\def\@listi{\leftmargin\leftmargini \topsep 6pt plus 2pt minus 2pt\parsep 3pt
plus 2pt minus 1pt
\itemsep \parsep}}
\def\footnotesize{\@setsize\footnotesize{11pt}\ixpt\@ixpt
\abovedisplayskip 8pt plus 2pt minus 4pt\belowdisplayskip \abovedisplayskip
\abovedisplayshortskip \z@ plus 1pt\belowdisplayshortskip 4pt plus 2pt minus
2pt
\def\@listi{\leftmargin\leftmargini \topsep 4pt plus 2pt minus 2pt\parsep 2pt
plus 1pt minus 1pt
\itemsep \parsep}}
\def\scriptsize{\@setsize\scriptsize{9.5pt}\viiipt\@viiipt}
\def\tiny{\@setsize\tiny{7pt}\vipt\@vipt}
\def\large{\@setsize\large{14pt}\xiipt\@xiipt}
\def\Large{\@setsize\Large{18pt}\xivpt\@xivpt}
\def\LARGE{\@setsize\LARGE{22pt}\xviipt\@xviipt}
\def\huge{\@setsize\huge{25pt}\xxpt\@xxpt}
\def\Huge{\@setsize\Huge{30pt}\xxvpt\@xxvpt}
\normalsize 

\oddsidemargin 41.9pt \evensidemargin 46.1pt \marginparwidth 100pt
\marginparsep 10pt 
\topmargin 27pt 
\headheight 12pt \headsep 25pt \footskip 30pt 
\textheight = 208mm
\textwidth 360pt \columnsep 10pt \columnseprule 0pt 

\footnotesep 7.7pt 
\skip\footins 10pt plus 4pt minus 2pt 
\floatsep 12pt plus 2pt minus 2pt \textfloatsep 20pt plus 2pt minus 4pt
\intextsep 12pt plus 2pt minus 2pt \@maxsep 20pt \dblfloatsep 12pt plus 2pt
minus 2pt \dbltextfloatsep 20pt plus 2pt minus 4pt \@dblmaxsep 20pt 
\@fptop 0pt plus 1fil \@fpsep 8pt plus 2fil \@fpbot 0pt plus 1fil 
\@dblfptop 0pt plus 1fil \@dblfpsep 8pt plus 2fil \@dblfpbot 0pt plus 1fil
\marginparpush 5pt 

\parskip 0pt plus 1pt \parindent 9pt \partopsep 3pt plus 1pt minus 2pt 
\@lowpenalty 51 \@medpenalty 151 \@highpenalty 301 
\@beginparpenalty -\@lowpenalty \@endparpenalty -\@lowpenalty \@itempenalty
-\@lowpenalty

\def\part#1{\@warning{Do not use command `\string\part'.}}

\def\section{\@startsection {section}{1}{\z@}{-3.5ex plus -1ex minus 
 -.2ex}{2.3ex plus .2ex}{\centering\normalsize\bf}}
\def\subsection{\@startsection{subsection}{2}{\z@}{-3.25ex plus -1ex minus 
 -.2ex}{1.5ex plus .2ex}{\raggedright\normalsize\it}}
\def\subsubsection{\@startsection{subsubsection}{3}{\z@}{-3.25ex plus 
 -1ex minus -.2ex}{1.5ex plus .2ex}{\raggedright\normalsize\it}}
\let\paragraph\par
\let\subparagraph\par

\setcounter{secnumdepth}{3}

\def\appendix{\par
 \setcounter{section}{0}
 \setcounter{subsection}{0}
 \def\thesection{Appendix \Alph{section}}}

\leftmargini 2.5em
\leftmarginii 2.2em \leftmarginiii 1.87em \leftmarginiv 1.7em \leftmarginv 1em
\leftmarginvi 1em
\leftmargin\leftmargini
\labelsep .5em
\labelwidth\leftmargini\advance\labelwidth-\labelsep

\def\@listI{\leftmargin\leftmargini \parsep 4.5pt plus 2pt minus 1pt\topsep
9pt plus 3pt minus 5pt\itemsep 4.5pt plus 2pt minus 1pt}
\def\@listInjc{\leftmargin\leftmargini \parsep 2pt plus 2pt minus 1pt\topsep
2pt plus 2pt minus 1pt\itemsep 2pt plus 2pt minus 1pt\partopsep0pt}
\let\@listi\@listI
\@listi 
\def\@listii{\leftmargin\leftmarginii
 \labelwidth\leftmarginii\advance\labelwidth-\labelsep
 \topsep 2pt plus 2pt minus 1pt
 \parsep 0pt \itemsep \parsep}
\def\@listiii{\leftmargin\leftmarginiii
 \labelwidth\leftmarginiii\advance\labelwidth-\labelsep
 \topsep 2pt plus 1pt minus 1pt 
 \parsep \z@ 
 \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}


\@afterindenttrue

\def\labelenumi{(\arabic{enumi})} 
\def\theenumi{\arabic{enumi}} 
\def\labelenumii{(\alph{enumii})}
\def\theenumii{\alph{enumii}}
\def\p@enumii{\theenumi}

\def\labelitemi{$\circ$}
\def\labelitemii{\bf --}

\def\enumerate{\ifnum \@enumdepth >1 \@toodeep\else
      \advance\@enumdepth \@ne \let\@listi\@listInjc
      \edef\@enumctr{enum\romannumeral\the\@enumdepth}\list
      {\csname label\@enumctr\endcsname}{\usecounter
        {\@enumctr}\def\makelabel##1{\hss\llap{##1}}}\fi}

\def\itemize{\ifnum \@itemdepth >1 \@toodeep\else
	\advance\@itemdepth \@ne \let\@listi\@listInjc
	\edef\@itemitem{labelitem\romannumeral\the\@itemdepth}\list
	{\csname\@itemitem\endcsname}{\def\makelabel##1{\hss\llap{##1}}}\fi}

\def\verse{\let\\=\@centercr 
 \list{}{\itemsep\z@ \itemindent -1.5em\listparindent \itemindent 
 \rightmargin\leftmargin\advance\leftmargin 1.5em}\item[]}
\let\endverse\endlist
\def\quotation{\list{}{\listparindent 1.5em
 \itemindent\listparindent
 \rightmargin\leftmargin \parsep 0pt plus 1pt}\item[]}
\let\endquotation=\endlist
\def\quote{\list{}{\rightmargin\leftmargin}\item[]}
\let\endquote=\endlist

\def\descriptionlabel#1{\hspace\labelsep \bf #1}
\def\description{\let\@listi\@listInjc\list
	{}{\labelwidth\z@ \itemindent-\leftmargin
	\let\makelabel\descriptionlabel}}
\let\enddescription\endlist

\def\titlepage{\@warning{Do not use environment `\string\titlepage'.}}
\def\endtitlepage{\relax}

\arraycolsep 5pt \tabcolsep 6pt \arrayrulewidth .4pt \doublerulesep 2pt 
\tabbingsep \labelsep 

\skip\@mpfootins = \skip\footins
\fboxsep = 3pt \fboxrule = .4pt 

\newcounter {section}
\newcounter {subsection}[section]
\newcounter {subsubsection}[subsection]

\def\thepart{\Roman{part}} \def\thesection {\arabic{section}}
\def\thesubsection {\thesection.\arabic{subsection}}
\def\thesubsubsection {\thesubsection .\arabic{subsubsection}}

\def\@pnumwidth{1.55em}
\def\@tocrmarg {2.55em}
\def\@dotsep{4.5}
\setcounter{tocdepth}{0}

\def\tableofcontents{\@warning{Do not use command `\string\tableofcontents'.}}
\def\listoffigures{\@warning{Do not use command `\string\listoffigures'.}}
\def\listoftables{\@warning{Do not use command `\string\listoftables'.}}

\def\thebibliography#1{\section*{References}\footnotesize\list
  {[\arabic{enumi}]}{\settowidth\labelwidth{[#1]}\leftmargin\labelwidth
  \advance\leftmargin\labelsep\itemsep=0pt \parsep=0pt
  \usecounter{enumi}}
  \def\newblock{\hskip .11em plus .33em minus -.07em}
  \sloppy
  \sfcode`\.=1000\relax
}
\let\endthebibliography=\endlist
\def\@lbibitem[#1]#2{\item\if@filesw \immediate\write\@auxout
	{\string\bibcite{#2}{\the\c@enumi}}\fi\ignorespaces}

\def\njccitationstyle{
 \def\thebibliography##1{\section*{References}%\vskip-\lastskip
    \topsep=0pt \parskip=0pt \partopsep=0pt \parindent=0pt
    \hangindent=7mm \hangafter=1
    \def\newblock{\hskip .11em plus .33em minus -.07em}
    \sloppy
    \sfcode`\.=1000\relax
    \footnotesize
 }
 \def\endthebibliography{\par}
 \def\@lbibitem{\njc@lbibitem} \let\@internalcite\cite
 \def\@citeseppen{-1000}
 \def\cite{\let\@cite\njc@cite@one%
	\@ifnextchar [{\@tempswatrue\njc@cite}{\@tempswafalse\njc@cite[]}}
 \def\bracketcite{\let\@cite\njc@cite@two%
	\@ifnextchar [{\@tempswatrue\njc@cite}{\@tempswafalse\njc@cite[]}}
 \def\shortcite{\let\@cite\njc@cite@three%
	\@ifnextchar [{\@tempswatrue\njc@cite}{\@tempswafalse\njc@cite[]}}
 \def\citeauthor{\let\@cite\njc@cite@four\@tempswafalse%
	\@ifnextchar [{\@warning
	  {Do not use an optional argument in \string\citeauthor'.}\njc@cite}%
	{\njc@cite[]}}
 \def\citeyear{\let\@cite\njc@cite@five\@tempswafalse%
	\@ifnextchar [{\@warning
	  {Do not use an optional argument in \string\citeyear'.}\njc@cite}%
	{\njc@cite[]}}
 \def\citemul{\@ifnextchar [{\@warning
	  {Do not use an optional argument in \string\citemul'.}\njc@citemul}%
	{\njc@citemul[]}}
 \let\mulcite\citemul
 \def\bibcite##1##2{\global\@namedef{b@##1}{##2}}
}

\def\njc@lbibitem[#1]#2{\par\hangindent=7mm \hangafter=1\if@filesw
	{ \def\protect##1{\string ##1\space}\def\etal{\string\etal}\immediate
	  \write\@auxout{\string\bibcite{#2}{#1}}}\fi\ignorespaces}
\def\njc@cite[#1]#2{\njc@citex[#1]#2,\@\@}
\def\njc@citex[#1]#2,#3\@\@{\def\tempa{#3}%
	\ifx\tempa\@empty \else \@warning
	  {Use multiple arguments only in `\string\mulcite'.}\fi%
	\if@filesw\immediate\write\@auxout{\string\citation{#2}}\fi%
	\@ifundefined{b@#2}{\@cite{{\bf ?}}{{\bf ?}}{#1}\@warning
        {Citation `#2' on page \thepage \space undefined}}%
 	{\edef\@tempa{\@nameuse{b@#2}}\@cite{\expandafter
            \@car\@tempa \@nil\null}{\expandafter
            \@cdr\@tempa\@nil\null}{#1}}%
% 	{\@cite{\@nameuse{ba@#2}}{\@nameuse{by@#2}}{#1}}%
}
\def\njc@cite@one#1#2#3{#1\ [#2\if@tempswa , #3\fi]}
\def\njc@cite@two#1#2#3{[#1\ #2\if@tempswa , #3\fi]}
\def\njc@cite@three#1#2#3{#1\ #2\if@tempswa , #3\fi}
\def\njc@cite@four#1#2#3{#1}
\def\njc@cite@five#1#2#3{#2}

\def\njc@citemul[#1]#2{\njc@mcite #2\@\@}
\def\njc@mcite#1,#2\@\@{%
 	\if@filesw\immediate\write\@auxout{\string\citation{#1,#2}}\fi%
	\@ifundefined{b@#1}{{\bf ?}\@warning
        {Citation `#1' on page \thepage \space undefined}}%
 	{\edef\@tempa{\@nameuse{b@#1}}\expandafter
	 \@car\@tempa\@nil\ }\def\@citea{[}\@for\@citeb:=#1,#2\do
        {\@citea\def\@citea{,\penalty\@citeseppen\ }\@ifundefined
	{b@\@citeb}{{\bf ?}\@warning
	{Citation `\@citeb' on page \thepage \space undefined}}%
	{\edef\@tempa{\@nameuse{b@\@citeb}}\expandafter
	 \@cdr\@tempa\@nil}}]%
}

\newcommand\etal{{\noexpand\sl et al.\/}}

\def\eqnref#1{Eq.~(\ref{#1})}
\def\figref#1{Fig.~\ref{#1}}
\def\tableref#1{Table~\ref{#1}}

\def\usenjcepsmacros{\makeatletter\@input{njcepsmacros.sty}%
	\makeatother\global\let\usenjcepsmacros=\relax}

\def\makeepsbox{\@ifnextchar[{\@makeepsbox}{\@makeepsbox[c]}}
\def\@makeepsbox[#1]#2{\@ifnextchar[{\@@makeepsbox[#1]#2}{%
	\@@makeepsbox[#1]#2[scale=1000]}}
\def\@@makeepsbox[#1]#2[#3]{%
	\@warning{njcepsmacros not initialized: use command %
     `\string\usenjcepsmacros' in the preamble}}
\newif\ifnjcputspecial \global\njcputspecialtrue
\def\epsdraft{\global\njcputspecialfalse}
 
\newif\if@restonecol
\def\theindex{\@warning{Do not use environment `\string\theindex'.}}
\def\endtheindex{\relax}
\def\@idxitem{\par\hangindent 40pt}
\def\subitem{\par\hangindent 40pt \hspace*{20pt}}
\def\subsubitem{\par\hangindent 40pt \hspace*{30pt}}
\def\indexspace{\par \vskip 10pt plus 5pt minus 3pt\relax}

\def\footnoterule{\kern-3\p@ 
 \hrule width 0.5in 
 \kern 2.6\p@} 

\long\def\@makefntext#1{\parindent 0pt\noindent$^{\@thefnmark}$\enspace#1}


\setcounter{topnumber}{2}
\def\topfraction{.7}
\setcounter{bottomnumber}{1}
\def\bottomfraction{.5}
\setcounter{totalnumber}{3}
\def\textfraction{.1}
\def\floatpagefraction{.8}
\setcounter{dbltopnumber}{2}
\def\dbltopfraction{.7}
\def\dblfloatpagefraction{.5}

\def\continued{\@makecaption{\csname fnum@\@captype\endcsname}{{\em (cont.)}}}

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

\let\njcfloatsize\footnotesize
\def\fps@figure{tbp}
\def\ftype@figure{1}
\def\ext@figure{lof}
\def\fnum@figure{{\bf Fig.~\thefigure}}
\def\figure{\njcfloatsize\@float{figure}}
\let\endfigure\end@float
\@namedef{figure*}{\njcfloatsize\@dblfloat{figure}}
\@namedef{endfigure*}{\end@dblfloat}
\def\fps@table{tbp}
\def\ftype@table{2}
\def\ext@table{lot}
\def\fnum@table{{\sc Table~\thetable}}
\def\table{\njcfloatsize\@float{table}}
\let\endtable\end@float
\@namedef{table*}{\njcfloatsize\@dblfloat{table}}
\@namedef{endtable*}{\end@dblfloat}

%\global\let\thanks=\@gobble
\def\maketitle{\par
 \begingroup
 \def\thefootnote{\fnsymbol{footnote}}
 \def\@makefnmark{\hbox 
 to 0pt{$^{\@thefnmark}$\hss}} 
 \newpage
 \global\@topnum\z@ \@maketitle \thispagestyle{njcfirstpage}\@thanks
 \endgroup
 \setcounter{footnote}{0}
 \let\maketitle\relax
 \let\@maketitle\relax
 \gdef\@thanks{}\gdef\@author{}\gdef\@title{}\let\thanks\relax}
\def\@maketitle{\newpage
 \null
 \vskip 2em \begin{center}
 {\Large \@title \par} \vskip 1.5em {\small\it \lineskip .5em
\begin{tabular}[t]{c}
\small\rm\@author
%\@affilation
 \end{tabular}\par} 
 \end{center}
 \vskip 1.5em} 

\def\abstract{%
\noindent\small{\bf Abstract.\ }\ignorespaces\rm
}
\def\endabstract{\par\normalsize}

\def\subject{\vskip1em \noindent\small{\bf CR Classification:\ }\ignorespaces\rm
}
\def\endsubject{\par\normalsize}

\def\keywords{\vskip1em
\noindent\small{\bf Key words:\ }\ignorespaces}
\def\endkeywords{\par\normalsize}

\def\acknowledgements{\section*{Acknowledgements}}
\def\endacknowledgements{}


\def\and{%%                             % \begin{tabular} 
\end{tabular}\hskip 1em plus .17fil\begin{tabular}[t]{c}%
\small\rm%% \end{tabular}
}

\def\AND{%%                             % \begin{tabular} 
\end{tabular}\vskip 12pt plus 6pt minus 4pt\begin{tabular}[t]{c}%
\small\rm%% \end{tabular}
}

\mark{{}{}} 
\let\pagestyle\@gobble

\def\ps@njcheadings{\let\@mkboth\@gobbletwo
\def\@oddhead{\hbox{}\hfil{\scriptsize \rightmark} \hfil \rm\thepage}
\def\@oddfoot{}
\def\@evenhead{\rm \thepage\hfil{\scriptsize\leftmark}\hfil\hbox {}}
\def\@evenfoot{}\def\sectionmark##1{}\def\subsectionmark##1{}}
%Special layout of first page
\def\ps@njcfirstpage{\let\@mkboth\@gobbletwo
\def\@oddhead{\scriptsize\@njcinfo\hfill\putlogo}
\def\@oddfoot{\scriptsize\@dates\hfill}
\let\@evenhead\@oddhead\let\@evenfoot\@oddfoot
\def\sectionmark##1{}\def\subsectionmark##1{}}

\newcommand\putlogo{\relax}
%%%\newcommand\putlogo{\raisebox{-10bp}[25bp][0bp]{\special{psfile=njc2.eps}%
%%%\kern97bp}}

\def\njcinfo#1{\gdef\@njcinfo{Nordic Journal of Computing\ #1}}
\njcinfo{}
\def\dates#1{\gdef\@dates{#1}}
\dates{Received \today.}

\def\authorhead#1{\xdef\leftmark{\uppercase{#1}}}
\def\titlehead#1{\xdef\rightmark{\uppercase{#1}}}

\def\today{\ifcase \month  ? \or January \or February \or
	March \or April \or May \or June \or July \or
	August \or September \or October \or November
	\or December \else ? \fi\space \number\year}

\ps@njcheadings\pagenumbering{arabic} \onecolumn 
\@twosidetrue


\def\@startsection#1#2#3#4#5#6{\if@noskipsec\gdef\@period{} \leavevmode
  \gdef\@period{.} \fi
   \par \@tempskipa #4\relax
   \@afterindenttrue
   \ifdim \@tempskipa <\z@ \@tempskipa -\@tempskipa \@afterindentfalse\fi
   \if@nobreak \everypar{}\else
     \addpenalty{\@secpenalty}\addvspace{\@tempskipa}\fi \@ifstar
     {\@ssect{#3}{#4}{#5}{#6}}{\@dblarg{\@sect{#1}{#2}{#3}{#4}{#5}{#6}}}}

\def\@sect#1#2#3#4#5#6[#7]#8{\ifnum #2>\c@secnumdepth
     \def\@svsec{}\else 
     \refstepcounter{#1}\edef\@svsec{\csname the#1\endcsname\ifnum
	#2=1.\fi\hskip 0.5em }\fi
     \@tempskipa #5\relax
      \ifdim \@tempskipa>\z@ 
        \begingroup #6\relax
          \@hangfrom{\hskip #3\relax\@svsec}{\interlinepenalty \@M #8\par}%
        \endgroup
       \csname #1mark\endcsname{#7}\addcontentsline
         {toc}{#1}{\ifnum #2>\c@secnumdepth \else
                      \protect\numberline{\csname the#1\endcsname}\fi
                    #7}\else
        \def\@svsechd{#6\hskip #3\relax  %% \relax added 2 May 90
                   \@svsec #8\csname #1mark\endcsname
                      {#7}\addcontentsline
                           {toc}{#1}{\ifnum #2>\c@secnumdepth \else
                             \protect\numberline{\csname the#1\endcsname}\fi
                       #7}}\fi
     \@xsect{#5}}

\def\@xsect#1{\@tempskipa #1\relax
      \ifdim \@tempskipa>\z@
       \par \nobreak
       \vskip \@tempskipa
       \@afterheading
    \else \global\@nobreakfalse \global\@noskipsectrue
       \everypar{\if@noskipsec \global\@noskipsecfalse
                   \clubpenalty\@M \hskip -\parindent
                   \begingroup \@svsechd \endgroup \unskip
                   \hskip -#1\relax  % relax added 14 Jan 91
                  \else \clubpenalty \@clubpenalty
                    \everypar{}\fi}\fi\ignorespaces}


\def\twolevelnumbering#1{\@for \njc@countername :=#1\do{
	\@namedef{njc@\njc@countername}{\relax}\relax}\relax
}

% \njcnewtheorem{BODYSTYLE}{NAME}{TEXT}
\def\njcnewtheorem#1#2#3{\expandafter\@ifdefinable\csname #2\endcsname
{\@definecounter{#2}\@ifundefined{njc@#2}{%
\expandafter\xdef\csname the#2\endcsname{\@thmcounter{#2}}%
\global\@namedef{#2}{\@thm{#1}{#2}{#3}}\global\@namedef{end#2}{\@endtheorem}}{%
\@addtoreset{#2}{section}%
\expandafter\xdef\csname the#2\endcsname{\expandafter\noexpand
  \thesection \@thmcountersep \@thmcounter{#2}}%
\global\@namedef{#2}{\@thm{#1}{#2}{#3}}\global\@namedef{end#2}{\@endtheorem}}
\global\@namedef{#2*}{\@starthm{#1}{#3}}%
      \global\@namedef{end#2*}{\@endstartheorem}
}}

\def\@starthm#1#2{%
	\@ifnextchar[{\@starythm{#1}{#2}}{\@starxthm{#1}{#2}}}
\def\@starxthm#1#2{\@beginstartheorem{#2}\ignorespaces#1}
\def\@starythm#1#2[#3]{\@opargbeginstartheorem{#2}{#3}\ignorespaces#1}
\def\@beginstartheorem#1{\trivlist \item[\hskip \labelsep{\sc #1.}]}
\def\@opargbeginstartheorem#1#2{\trivlist
      \item[\hskip \labelsep{\sc #1.\ (#2)}]}
\def\@endstartheorem{\endtrivlist}

\def\@thm#1#2#3{\refstepcounter
    {#2}\@ifnextchar[{\@ythm{#1}{#2}{#3}}{\@xthm{#1}{#2}{#3}}}

\def\@xthm#1#2#3{\@begintheorem{#3}{\csname the#2\endcsname.}\ignorespaces#1}
\def\@ythm#1#2#3[#4]{\@opargbegintheorem{#3}{\csname
       the#2\endcsname.}{#4}\ignorespaces#1}
\def\@begintheorem#1#2{\trivlist \item[\hskip \labelsep{\sc #1\ #2}]}
\def\@opargbegintheorem#1#2#3{\trivlist
      \item[\hskip \labelsep{\sc #1\ #2\ (#3)}]}
\def\@endtheorem{\endtrivlist}


\def\njc@environments{
\@ifundefined{njc@figure}{\newcounter{figure}%
         \gdef\thefigure{\@arabic\c@figure}}
	{\newcounter{figure}[section]%
        \gdef\thefigure{\@arabic\c@section.\@arabic\c@figure}}
\@ifundefined{njc@table}{\newcounter{table}%
        \gdef\thetable{\@Roman\c@table}}
	{\newcounter{table}[section]%
        \gdef\thetable{\@arabic\c@section.\@arabic\c@table}}

\@ifundefined{njc@equation}{\gdef\theequation{\@arabic\c@equation}}{%
\@addtoreset{equation}{section}\gdef\theequation{%
        \@arabic\c@section.\@arabic\c@equation}}

\njcnewtheorem{\it}{theorem}{Theorem}
\njcnewtheorem{\it}{lemma}{Lemma}
\njcnewtheorem{\it}{corollary}{Corollary}
\njcnewtheorem{\it}{proposition}{Proposition}
\njcnewtheorem{\it}{definition}{Definition}
\njcnewtheorem{\it}{conjecture}{Conjecture}
\njcnewtheorem{\it}{claim}{Claim}

\njcnewtheorem{\rm}{problem}{Problem}
\njcnewtheorem{\rm}{example}{Example}
\njcnewtheorem{\rm}{fact}{Fact}
\njcnewtheorem{\rm}{remark}{Remark}
\njcnewtheorem{\rm}{observation}{Observation}

\gdef\proof{\relax{\noindent\sc Proof.\ \ }}
\gdef\endproof{\ifhmode\nobreak\qed\par\fi\medskip}
\gdef\qed{\raisebox{-.2ex}{$\Box$}}
}

\def\document{\njc@environments\endgroup
  \@colht\textheight  \@colroom\textheight \vsize\textheight
   \columnwidth\textwidth \@clubpenalty\clubpenalty
   \if@twocolumn \advance\columnwidth -\columnsep
      \divide\columnwidth\tw@ \hsize\columnwidth \@firstcolumntrue
   \fi
  \hsize\columnwidth \linewidth\hsize
%  \headwidth\textwidth
  \begingroup\@floatplacement\@dblfloatplacement
   \makeatletter\let\@writefile\@gobbletwo
   \@input{\jobname.aux}\endgroup
  \if@filesw \immediate\openout\@mainaux=\jobname.aux
    \immediate\write\@mainaux{\relax}\fi
  \@ifundefined{process@table}{\relax}{\process@table}
  \let\glb@currsize\@empty
  \gdef\twolevelnumbering##1{\@warning{Command %
        `\string\twolevelnumering' can only be used in the preamble.}}
  \gdef\draft{\@warning{Command `\string\draft' %
         can only be used in the preamble.}}
  \gdef\njccitationstyle{\@warning{Command `\string\njccitationstyle' %
         can only be used in the preamble.}}
  \def\do##1{\let ##1\@notprerr}%
  \@preamblecmds
  \let\do\noexpand
  \@normalsize\everypar{}\@noskipsecfalse
}
\newbox\@tabbingstrutbox

\def\@startline{\global\@curtabmar\@nxttabmar\relax
   \global\@curtab\@curtabmar\global\setbox\@curline\hbox % missing \global
    {}\@startfield\@tabbingstrut}                         % added 17 Jun 86

\def\tabbingstretch{1}
\def\tabbing{\setbox\@tabbingstrutbox=\hbox{\vrule
     height \tabbingstretch \ht\strutbox
     depth \tabbingstretch \dp\strutbox
     width\z@}\lineskip \z@\let\>\@rtab\let\<\@ltab\let\=\@settab
     \let\+\@tabplus\let\-\@tabminus\let\`\@tabrj\let\'\@tablab
     \let\\=\@tabcr
     \global\@hightab\@firsttab
     \global\@nxttabmar\@firsttab
     \dimen\@firsttab\@totalleftmargin
     \global\@tabpush0 \global\@rjfieldfalse
     \trivlist \item[]\if@minipage\else\vskip\parskip\fi
     \setbox\@tabfbox\hbox{\rlap{\indent\hskip\@totalleftmargin
       \the\everypar}}\def\@itemfudge{\box\@tabfbox}\@startline\ignorespaces}

\def\@tabbingstrut{\relax\ifmmode\copy\@tabbingstrutbox\else%
    \unhcopy\@tabbingstrutbox\fi}

