% this file started Sat 5/10/02
% by stealing from itchapter11.sty

% must be used with prechapter, as of Wed 19/2/03
% because chapter checks this counter, defined in prechapter.sty
%\newcounter{wasaprechapter}
%\setcounter{wasaprechapter}{0}

% changed djcm 18 oct 93 from raggedright and from huge bf
%
% This does the numbered chapter  (\em is not available in Huge, but huge is ok)
%
\def\@makechapterhead#1{ \vspace*{15pt} { \parindent 0pt \centering
 \ifnum \c@secnumdepth >\m@ne \Huge\sc  \thechapter \par
 \vskip 10pt \fi \rule{\textwidth}{1pt} \par \vskip 2pt \huge \sl #1\par
 \nobreak \vskip 50pt } }
%
% This does chapter*{}
\def\@makeschapterhead#1{ \vspace*{15pt} { \parindent 0pt  \centering
 \rule{\textwidth}{1pt} \par \vskip 2pt \huge \sl #1\par 
 \nobreak \vskip 50pt } }

% experiment
  \def\@evenhead{{\sf \thepage} \hfil {\sl \leftmark}\hspace*{-\margindistance}}
  \def\@oddhead{{\sl \rightmark}  \hfil {\sf \thepage}\hspace*{-\margindistance}}

% 
\def\chapter{% problem with cleardoublepage is that prechapter uses this also. Looks silly!
% \cleardoublepage
\clearpage
% \typeout{using MYCHAPTER.STY chapter def}
 \thispagestyle{plain} %  was myheadings
% \thispagestyle{myheadings}% switched to plain Mon 12/5/03
 \markright{\rightmark\leftmark \thepage}% 
% test area
% end testarea
 \global\@topnum\z@
 \@afterindentfalse \secdef\@chapter\@schapter}
% this command seems not very relevant.... :
\def\@chapter[#1]#2{\ifnum \c@secnumdepth >\m@ne
  \refstepcounter{chapter}
  \typeout{\@chapapp\space\thechapter.}
  \addcontentsline{toc}{chapter}{\protect
  \numberline{\thechapter}#1}
 \else
   \addcontentsline{toc}{chapter}{#1}
 \fi
 \chaptermark{#1}
 \addtocontents{lof}{\protect\addvspace{10pt}}
 \addtocontents{lot}{\protect\addvspace{10pt}} 
\if@twocolumn
 \@topnewpage[\@makechapterhead{#2}] 
\else 
 \@makechapterhead{#2}
 \@afterheading \fi
% new Sat 5/4/03
 \ifnum \value{wasaprechapter}>0
\setcounter{wasaprechapter}{0}
\setcounter{figure}{\value{figurecopy}}
\setcounter{algorithm}{\value{algorithmcopy}}
\setcounter{table}{\value{tablecopy}}
\setcounter{floatseq}{\value{floatseqcopy}}
\setcounter{equation}{\value{equationcopy}}
\setcounter{exercisenumber}{\value{exercisecopy}}
\fi
} 
\def\chapterheadhack#1{\def\leftmark{#1}\def\rightmark{#1}}
\def\@schapter#1{\if@twocolumn \@topnewpage[\@makeschapterhead{#1}]
 \else \@makeschapterhead{#1} 
 \@afterheading\fi}

% \@startsection {THE NAME} {THE LEVEL} {INDENT} {BEFORESKIP} {AFTERSKIP} {STYLE}
%
% \def\section{\@startsection {section}{1}{\z@}{-3.5ex plus -1ex minus 
%  -.2ex}{2.3ex plus .2ex}{\Large\bf}}
% \def\subsection{\@startsection{subsection}{2}{\z@}{-3.25ex plus -1ex minus 
%  -.2ex}{1.5ex plus .2ex}{\large\bf}} %was \bf
% \def\subsubsection{\@startsection{subsubsection}{3}{\z@}{-3.25ex plus
%  -1ex minus -.2ex}{1.5ex plus .2ex}{\em}}% was normalsize\bf}}
% see also hangingsecnum2.sty
%\def\section{\@startsection {section}{1}{\z@}{-3.5ex plus -1ex minus 
% -.2ex}{2.3ex plus .2ex}{\large\sffamily\bfseries}}%was \bf}}  % \center
\def\section{\@startsection {section}{1}{\z@}{-3.5ex plus -1ex minus 
 -.2ex}{2.1ex plus .2ex}{\large\sffamily\bfseries}}%was \bf}}  % \center
\def\subsection{\@startsection{subsection}{2}{\z@}{-3.25ex plus -1ex minus 
 -.2ex}{1.5ex plus .2ex}{\large\em}} %was \bf
\def\subsubsection{\@startsection{subsubsection}{3}{\z@}{-3.25ex plus
 -1ex minus -.2ex}{1.5ex plus .2ex}{\em}}% was normalsize\bf}}
\def\paragraph{\@startsection
 {paragraph}{4}{\z@}{3.25ex plus 1ex minus .2ex}{-1em}{\normalsize\bf}}
\def\subparagraph{\@startsection
 {subparagraph}{4}{\parindent}{3.25ex plus 1ex minus 
 .2ex}{-1em}{\normalsize\bf}}

% I tried making the indent negative, and it does the straightforward thing (dumb)
% \@startsection {THE NAME} {THE LEVEL} {INDENT} {BEFORESKIP} {AFTERSKIP} {STYLE}
%
