\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{ncclatex}
         [2002/05/19 v1.02 NCC-LaTeX Extension Package (NCC)]
%
% \changes{v1.00}{2002/03/16}{This version is uploaded to CTAN}
% \changes{v1.01}{2002/05/17}{Package extdash is loaded with cyremdash}
% \changes{v1.01}{2002/05/17}{The equation counter is dynamic now}
% \changes{v1.02}{2002/05/19}{Vskip after table's caption is reduced}
%
% Define headers for theorem-like environments and acknowledgements.
%
\newcommand{\theoremname}{Theorem}
\newcommand{\lemmaname}{Lemma}
\newcommand{\propositionname}{Proposition}
\newcommand{\corollaryname}{Corollary}
\newcommand{\definitionname}{Definition}
\newcommand{\statementname}{Statement}
\newcommand{\examplename}{Example}
\newcommand{\remarkname}{Remark}
\newcommand{\proofname}{Proof}
\newcommand{\acknowname}{Acknowledgements}
%
% Russian headings (Babel needed)
%
\newif\ifNCC@rus \NCC@rusfalse
\DeclareOption{russian}{\NCC@rustrue}
%
% Smaller headings of sections
%
\newif\ifNCC@small \NCC@smallfalse
\DeclareOption{small}{\NCC@smalltrue}
\ProcessOptions\relax
%
% Load packages
%
\RequirePackage{desclist}
\RequirePackage[shortcuts,cyremdash]{extdash}
\RequirePackage{nccboxes}
\RequirePackage{nccfoots}
\RequirePackage{nccmath}
\RequirePackage{nccpic}
\RequirePackage{nccthm}
\RequirePackage{nccsect}[2002/02/08]
\RequirePackage{nccfloats}
\ifNCC@rus
  \RequirePackage{nccltrus}
\else
  \def\tg{\qopname\relax o{tg}}
  \def\arctg{\qopname\relax o{arctg}}
  \def\ctg{\qopname\relax o{ctg}}
  \def\arcctg{\qopname\relax o{arcctg}}
  \@ifundefined{No}{\def\No{\mbox{No.}}}{}
\fi
%
% Declare the equation counter in the dynamic style.
%
\let\theequation\relax
\AtBeginDocument{\ifx\theequation\relax \DynamicCount{equation}\fi}
%
% \cref{label} is cite without square brackets
%
\newcommand*{\cref}[1]{{\def\@cite##1##2{##1}\cite{#1}}}
%
% Prepare theorem-like environments
%
\newtheorem{theorem}{\theoremname}
\newtheorem{lemma}{\lemmaname}
\newtheorem{proposition}{\propositionname}
\newtheorem{corollary}{\corollaryname}
\newtheorem{statement}{\statementname}[remark]
\newtheorem{definition}{\definitionname}[remark]
\newtheorem{example}{\examplename}[remark]
\newtheorem{remark}{\remarkname}[remark]
%
% Prepare APAR theorem-like environments
%
\newtheorem*{atheorem}{\theoremname}
\newtheorem*{alemma}{\lemmaname}
\newtheorem*{aproposition}{\propositionname}
\newtheorem*{acorollary}{\corollaryname}
\newtheorem*{astatement}{\statementname}[remark]
\newtheorem*{adefinition}{\definitionname}[remark]
\newtheorem*{anexample}{\examplename}[remark]
\newtheorem*{aremark}{\remarkname}[remark]
%
% Prepare manual theorem-like environments
%
\newenvironment{Theorem}{\liketheorem{\theoremname}}{\qef}
\newenvironment{Lemma}{\liketheorem{\lemmaname}}{\qef}
\newenvironment{Proposition}{\liketheorem{\propositionname}}{\qef}
\newenvironment{Corollary}{\liketheorem{\corollaryname}}{\qef}
\newenvironment{Statement}{\likeremark{\statementname}}{\qef}
\newenvironment{Definition}{\likeremark{\definitionname}}{\qef}
\newenvironment{Example}{\likeremark{\examplename}}{\qef}
\newenvironment{Remark}{\likeremark{\remarkname}}{\qef}
%
% Change default settings for theorems
%
\renewtheoremtype{remark}{\bfseries}{}{}
\TheoremCommentDelimiters{}{}
\AfterTheoremHeaderChar{.}
\AfterTheoremHeaderSkip{\hskip .7em \@plus .2em \@minus .1em}
\AparStyleParameters{\bff}{\bff}{.\enskip}
\ProofStyleParameters{\bff}{\proofname}
%
% \acknow starts acknowledgements.
%
\newcommand{\acknow}{\likeremark{\normalfont\itshape\acknowname}{}}
%
% \mop{FOO} is equivalent to \operatorname{FOO}
%
\newcommand{\mop}{\operatorname}
%
% Simple alignment commands. Useful in tables for change alignment in cells.
%
\newcommand{\tl}[1]{#1\hspace*{\fill}}
\newcommand{\tc}[1]{\hspace*{\fill}#1\hspace*{\fill}}
\newcommand{\tr}[1]{\hspace*{\fill}#1}
%
% Customize sections and captions.
%
\def\NCC@runskip{2.3ex \@plus 1ex \@minus .2ex}
\DeclareSection{-2}{table}{\bfseries}{\z@}{1.3ex}{\small}
\DeclareSection{-1}{figure}{\bfseries}{2ex}{\z@}{\small}
\ifNCC@small
  \@ifundefined{chapter}{%
    \DeclareSection*0{part}{\large\bff}%
                    {4ex \@plus 1ex \@minus .2ex}%
                    {2.8ex \@plus .2ex}{\LARGE\bff}
  }{%
    \DeclareSection*0{chapter}{\vspace{1.5ex}\large\bff}{\z@}%
                    {6ex \@plus .2ex}{\LARGE\bff}
  }
  \DeclareSection*1{section}{}%
                  {3.1ex \@plus 1ex \@minus .2ex}%
                  {1.5ex \@plus .2ex}{\large\bff}
  \DeclareSection*2{subsection}{}%
                  {2.7ex \@plus 1ex \@minus .2ex}%
                  {1.5ex \@plus .2ex}{\normalsize\bff}
  \DeclareSection*3{subsubsection}{}%
                  {\NCC@runskip}%
                  {1.5ex \@plus .2ex}{\normalsize\bff\itshape}
\else
  \@ifundefined{chapter}{%
    \DeclareSection*0{part}{\Large\bff}%
                    {5ex \@plus 1ex \@minus .2ex}%
                    {3.8ex \@plus .2ex}{\huge\bff}
  }{%
    \DeclareSection*0{chapter}{\vspace{2ex}\Large\bff}{\z@}%
                    {8ex \@plus .2ex}{\huge\bff}
  }
  \DeclareSection*1{section}{}%
                  {3.5ex \@plus 1ex \@minus .2ex}%
                  {2.3ex \@plus .2ex}{\Large\bff}
  \DeclareSection*2{subsection}{}%
                  {3.1ex \@plus 1ex \@minus .2ex}%
                  {1.5ex \@plus .2ex}{\large\bff}
  \DeclareSection*3{subsubsection}{}%
                  {2.7ex \@plus 1ex \@minus .2ex}%
                  {1.5ex \@plus .2ex}{\normalsize\bff}
\fi
\DeclareSection4{paragraph}{}{\NCC@runskip}%
                {-.6em \@plus -.2em \@minus -.1em}{\normalsize\bff}
\DeclareSection5{subparagraph}[\parindent]{}{\NCC@runskip}%
                {-.6em \@plus -.2em \@minus -.1em}{\normalsize\bff}
\SectionTagSuffix{.\hskip .6em}
\CaptionTagSuffix{.\hskip .6em \@plus .2em \@minus .1em}
\NumberlineSuffix{.\hskip .6em}{.\hskip .4em}
\sectionstyle{hangindent*}
%
% Millimeters are default units in NCC-LaTeX.
%
\unitlength=1mm
\renewcommand{\cboxstyle}{\scriptsize}
\endinput
