\ProvidesFile{nccbook.clo}
         [2002/03/24 v1.00 Book subclass (NCC)]
%
\@addtoreset{footnote}{chapter}
\setcounter{tocdepth}{2}
\setcounter{secnumdepth}{2}
\def\NCC@tochead#1{\noheadingtag\skipwritingtoaux\chapter{#1}}
\def\NCC@idxhead#1{%
  \twocolumn 
  \noheadingtag\skipwritingtoaux\chapter{#1}%
}
%
% \frontmatter, \mainmatter, \backmatter
%
\newif\if@mainmatter \@mainmattertrue
\newcommand\frontmatter{%
  \@mainmatterfalse\pagenumbering{roman}%
}
\newcommand\mainmatter{%
  {\@openrighttrue\openrightorany}%
  \@mainmattertrue
  \pagenumbering{arabic}%
}
\newcommand\backmatter{%
  \openrightorany \@mainmatterfalse
}
%
% Control of appearance chapter name in header and toc:
%
% \ChapterPrefixStyle{header,toc}
%
% The parameter list can contain two words: header and/or toc.
% Using them you set prefix style for header and/or toc respectively.
%
\newcommand{\@chapapp}{\chaptername}
\newcommand*{\ChapterPrefixStyle}[1]{%
  \def\NCC@thetocchapter{\thechapter}%
  \def\NCC@theheadchapter{\thechapter}%
  \@for\@tempa:=#1\do
    {\csname NCC@chapin@\@tempa\endcsname}%
}
\def\NCC@chapin@toc{\def\NCC@@thetocchapter{\@chapapp\ \thechapter}}
\def\NCC@chapin@header{\def\NCC@theheadchapter{\@chapapp\ \thechapter}}
\@onlypreamble\ChapterPrefixStyle
\@onlypreamble\NCC@chapin@toc
\@onlypreamble\NCC@chapin@header
\ChapterPrefixStyle{} % no prefix by default
%
% \ps@headings, \ps@myheadings
%
\def\ps@headings{\NCC@setpsheading
  \def\partmark##1{%
    \NCC@firstmark{\ifnum \c@secnumdepth>-2\relax
        \partname\ \thepart.\enskip \fi
      \ignorespaces##1}}%
  \def\chaptermark##1{%
    \NCC@firstmark{\ifnum \c@secnumdepth>\m@ne
         \if@mainmatter \NCC@theheadchapter.\enskip \fi \fi
       \ignorespaces##1}}%
  \def\sectionmark##1{%
    \NCC@secondmark{\ifnum\c@secnumdepth>\z@\thesection.\enskip\fi
      \ignorespaces##1}}%
}  
\def\ps@myheadings{\NCC@setpsheading
  \let\partmark   \@gobble
  \let\chaptermark\@gobble
  \let\sectionmark\@gobble
}
%
% \appendix
%
\newcommand{\appendix}{\par
  \setcounter{chapter}{-1}\stepcounter{chapter}%
  \gdef\@chapapp{\appendixname}%
  \gdef\thechapter{\@Alph\c@chapter}%
}
%
% thebibliography
%
\newenvironment{thebibliography}{%
  \noheadingtag \chapter{\bibname}\biblist[0]%
}{\endbiblist}
%
% Redefine start chapter hook
%
\def\NCC@startchap{%
  \openrightorany
  \thispageheading{}%
  \global\@topnum\z@
}
%
% \part and \l@part commands
%
\newcommand\part{%
  \openrightorany
  \thispageheading{}%
  \if@twocolumn  \onecolumn \@tempswatrue
  \else \@tempswafalse \fi
  \NCC@null\vfill
  \secdef\@part\@spart
}
\def\@part[#1]#2{%
  \def\NCC@makesectag##1{\@chapapp\nobreakspace##1}%
  \NCC@makesection{part}{\m@ne}{%
    \NCC@makepart{#2}{}%
  }{%
    \NCC@makepart{#2}{%
      \NCC@makesecmark{part}{#1}{%
        \addcontentsline{toc}{part}{%
          \ifnum \c@secnumdepth>-2\relax 
            \protect\numberline{\partname\ \thepart}\fi
          #1%
        }%
      }%
    }%
  }%
}
\def\@spart#1{%
  \let\@svsec\@empty \NCC@makepart{#1}{}%
}
\def\NCC@makepart#1#2{%
  \begingroup
    \normalfont \centering
    \interlinepenalty \@M
    \ifx\@svsec\@empty \else
      {\ifNCC@small\Large\else\LARGE\fi\bff \@svsec\@@par}%
      \vskip 2em \nobreak 
    \fi
    \ifNCC@small \huge\else \Huge\fi \bff #1\par
  \endgroup #2%
  \vfill\newpage \if@tempswa \twocolumn \fi
}
\newcommand*\l@part[2]{%
  \ifnum \c@tocdepth >-2\relax
    \par\addpenalty{-\@highpenalty}%
    \addvspace{4ex \@plus .2ex}%
    \begingroup
      \parindent \z@ \rightskip \@pnumwidth
      \parfillskip -\@pnumwidth
      \leavevmode
      \large \bff
      \settowidth\@tempdima{\NCC@maketocnum{\partname\ II}}%
      #1\hfil \hb@xt@\@pnumwidth{\hss #2}\par
      \nobreak
      \global\@nobreaktrue
      \everypar{\global\@nobreakfalse\everypar{}}%
    \endgroup
  \fi
}
\endinput
