%% This is file `extbook.cls',
%% Copyright 1993 1994 1995 1996 1997 1998 1999
%% The LaTeX3 Project and any individual authors listed elsewhere
%% in this file.
\NeedsTeXFormat{LaTeX2e}[1995/12/01]
\ProvidesClass{bookvvmrus}
              [1999/01/07 v1.4a
 NON-Standard LaTeX document class]
\newcommand\@ptsize{}
\newif\if@restonecol
\newif\if@titlepage
\@titlepagetrue
\newif\if@openright
\newif\if@mainmatter \@mainmattertrue
\newif\if@frontmatter \@frontmattertrue
\DeclareOption{f70x100_16}
   {\setlength\paperheight {240mm}%
    \setlength\paperwidth  {170mm}}
\DeclareOption{a4paper}
   {\setlength\paperheight {297mm}%
    \setlength\paperwidth  {210mm}}
\DeclareOption{a5paper}
   {\setlength\paperheight {210mm}%
    \setlength\paperwidth  {148mm}}
\DeclareOption{b5paper}
   {\setlength\paperheight {250mm}%
    \setlength\paperwidth  {176mm}}
\DeclareOption{letterpaper}
   {\setlength\paperheight {11in}%
    \setlength\paperwidth  {8.5in}}
\DeclareOption{legalpaper}
   {\setlength\paperheight {14in}%
    \setlength\paperwidth  {8.5in}}
\DeclareOption{executivepaper}
   {\setlength\paperheight {10.5in}%
    \setlength\paperwidth  {7.25in}}
\DeclareOption{landscape}
   {\setlength\@tempdima   {\paperheight}%
    \setlength\paperheight {\paperwidth}%
    \setlength\paperwidth  {\@tempdima}}
\DeclareOption{8pt}{\renewcommand\@ptsize{8}}
\DeclareOption{9pt}{\renewcommand\@ptsize{9}}
\DeclareOption{10pt}{\renewcommand\@ptsize{0}}
\DeclareOption{11pt}{\renewcommand\@ptsize{1}}
\DeclareOption{12pt}{\renewcommand\@ptsize{2}}
\DeclareOption{14pt}{\renewcommand\@ptsize{14}}
\DeclareOption{17pt}{\renewcommand\@ptsize{17}}
\DeclareOption{20pt}{\renewcommand\@ptsize{20}}
\DeclareOption{oneside}{\@twosidefalse \@mparswitchfalse}
\DeclareOption{twoside}{\@twosidetrue  \@mparswitchtrue}
\DeclareOption{draft}{\setlength\overfullrule{5pt}}
\DeclareOption{final}{\setlength\overfullrule{0pt}}
\DeclareOption{titlepage}{\@titlepagetrue}
\DeclareOption{notitlepage}{\@titlepagefalse}
\DeclareOption{openright}{\@openrighttrue}
\DeclareOption{openany}{\@openrightfalse}
\DeclareOption{onecolumn}{\@twocolumnfalse}
\DeclareOption{twocolumn}{\@twocolumntrue}
\DeclareOption{leqno}{\input{leqno.clo}}
\DeclareOption{fleqn}{\input{fleqn.clo}}
\DeclareOption{openbib}{%
  \AtEndOfPackage{%
   \renewcommand\@openbib@code{%
      \advance\leftmargin\bibindent
      \itemindent -\bibindent
      \listparindent \itemindent
      \parsep \z@
      }%
   \renewcommand\newblock{\par}}%
}
\ExecuteOptions{letterpaper,10pt,twoside,onecolumn,final,openright}
\ProcessOptions
\def\EC@family#1#2#3#4#5{%
  \DeclareFontShape{#1}{#2}{#3}{#4}%
  {<5><6><7><8><9><10><10.95><12><14.4>%
   <17.28><20.74><24.88><29.86><35.83><42.99><51.59>genb*#5}{}}
\EC@family{T1}{cmr}{m}{n}{ecrm}
\EC@family{T1}{cmr}{m}{sl}{ecsl}
\EC@family{T1}{cmr}{m}{it}{ecti}
\EC@family{T1}{cmr}{m}{sc}{eccc}
\EC@family{T1}{cmr}{bx}{n}{ecbx}
\EC@family{T1}{cmr}{b}{n}{ecrb}
\EC@family{T1}{cmr}{bx}{it}{ecbi}
\EC@family{T1}{cmr}{bx}{sl}{ecbl}
\EC@family{T1}{cmr}{bx}{sc}{ecxc}
\EC@family{T1}{cmr}{m}{ui}{ecui}
\DeclareFontShape{OT1}{cmr}{m}{n}%
     {<5><6><7><8><9><10><12>gen*cmr%
      <10.95>cmr10%
      <14.4>cmr12%
      <17.28><20.74><24.88><29.86><35.83><42.99><51.59>cmr17}{}
\DeclareFontShape{OT1}{cmr}{m}{sl}%
     {<5><6><7>cmsl8%
      <8><9>gen*cmsl%
      <10><10.95>cmsl10%
      <12><14.4><17.28><20.74><24.88><29.86><35.83><42.99><51.59>cmsl12%
      }{}
\DeclareFontShape{OT1}{cmr}{m}{it}%
     {<5><6><7>cmti7%
      <8>cmti8%
      <9>cmti9%
      <10><10.95>cmti10%
      <12><14.4><17.28><20.74><24.88><29.86><35.83><42.99><51.59>cmti12%
      }{}
\DeclareFontShape{OT1}{cmr}{m}{sc}%
     {<5><6><7><8><9><10><10.95><12>%
      <14.4><17.28><20.74><24.88><29.86><35.83><42.99><51.59>cmcsc10%
      }{}
\DeclareFontShape{OT1}{cmr}{m}{ui}
   {<5><6><7><8><9><10><10.95><12>%
      <14.4><17.28><20.74><24.88><29.86><35.83><42.99><51.59>cmu10%
      }{}
\DeclareFontShape{OT1}{cmr}{b}{n}
     {<5><6><7><8><9><10><10.95><12>%
      <14.4><17.28><20.74><24.88><29.86><35.83><42.99><51.59>cmb10%
      }{}
\DeclareFontShape{OT1}{cmr}{bx}{n}
   {<5><6><7><8><9>gen*cmbx%
      <10><10.95>cmbx10%
      <12><14.4><17.28><20.74><24.88><29.86><35.83><42.99><51.59>cmbx12%
      }{}
\DeclareFontShape{OT1}{cmr}{bx}{sl}
      {<5><6><7><8><9>%
      <10><10.95><12><14.4><17.28><20.74><24.88><29.86><35.83><42.99><51.59>cmbxsl10%
      }{}
\DeclareFontShape{OT1}{cmr}{bx}{it}
      {<5><6><7><8><9>%
      <10><10.95><12><14.4><17.28><20.74><24.88><29.86><35.83><42.99><51.59>cmbxti10%
      }{}
\ifnum\@ptsize<3
  \input{bk1\@ptsize.clo}
\else
  \input{size\@ptsize.clo}
\fi
%%==============================================================================
\RequirePackage{exscale}
\RequirePackage{calc}
\RequirePackage{fontspec}
\newlength{\WoLongestChNm}\setlength{\WoLongestChNm}{1.5em}
\newlength{\WoLongestApxNm}\setlength{\WoLongestApxNm}{1.5em}
\newlength{\AsterixLen}\setlength{\AsterixLen}{2.75em}
\newlength{\ParagrLen}\setlength{\ParagrLen}{2.75em}
\newlength{\SectTocMarkIndent}\setlength{\SectTocMarkIndent}{2.75em}
\newlength{\WoLongestSeNm}\setlength{\WoLongestSeNm}{2.3em}
\newlength{\TotlWoLongestSect}\setlength{\TotlWoLongestSect}{2.3em}
\def\@SectPrefix{\textsection}%

%%==============================================================================
\setlength\lineskip{1\p@}
\setlength\normallineskip{1\p@}
\renewcommand\baselinestretch{}
\setlength\parskip{0\p@ \@plus \p@}
\@lowpenalty   51
\@medpenalty  151
\@highpenalty 301
\setcounter{topnumber}{2}
\renewcommand\topfraction{.7}
\setcounter{bottomnumber}{1}
\renewcommand\bottomfraction{.3}
\setcounter{totalnumber}{3}
\renewcommand\textfraction{.2}
\renewcommand\floatpagefraction{.5}
\setcounter{dbltopnumber}{2}
\renewcommand\dbltopfraction{.7}
\renewcommand\dblfloatpagefraction{.5}
\if@twoside
  \def\ps@headings{%
      \let\@oddfoot\@empty\let\@evenfoot\@empty
      \def\@evenhead{\thepage\hfil\slshape\leftmark}%
      \def\@oddhead{{\slshape\rightmark}\hfil\thepage}%
      \let\@mkboth\markboth
    \def\chaptermark##1{%
      \markboth {\MakeUppercase{%
        \ifnum \c@secnumdepth >\m@ne
          \if@mainmatter
             \@chapapp\ \thechapter. \ %
          \fi
        \fi
        ##1}}{}}%
    \def\sectionmark##1{%
      \markright {\MakeUppercase{%
        \ifnum \c@secnumdepth >\z@
          \thesection. \ %
        \fi
        ##1}}}}
\else
  \def\ps@headings{%
    \let\@oddfoot\@empty
    \def\@oddhead{{\slshape\rightmark}\hfil\thepage}%
    \let\@mkboth\markboth
    \def\chaptermark##1{%
      \markright {\MakeUppercase{%
        \ifnum \c@secnumdepth >\m@ne
          \if@mainmatter
            \@chapapp\ \thechapter. \ %
          \fi
        \fi
        ##1}}}}
\fi
\def\ps@myheadings{%
    \let\@oddfoot\@empty\let\@evenfoot\@empty
    \def\@evenhead{\thepage\hfil\slshape\leftmark}%
    \def\@oddhead{{\slshape\rightmark}\hfil\thepage}%
    \let\@mkboth\@gobbletwo
    \let\chaptermark\@gobble
    \let\sectionmark\@gobble
    }
  \if@titlepage
  \newcommand\maketitle{\begin{titlepage}%
  \let\footnotesize\small
  \let\footnoterule\relax
  \let \footnote \thanks
  \null\vfil
  \vskip 60\p@
  \begin{center}%
    {\LARGE \@title \par}%
    \vskip 3em%
    {\large
     \lineskip .75em%
      \begin{tabular}[t]{c}%
        \@author
      \end{tabular}\par}%
      \vskip 1.5em%
    {\large \@date \par}%       % Set date in \large size.
  \end{center}\par
  \@thanks
  \vfil\null
  \end{titlepage}%
  \setcounter{footnote}{0}%
  \global\let\thanks\relax
  \global\let\maketitle\relax
  \global\let\@thanks\@empty
  \global\let\@author\@empty
  \global\let\@date\@empty
  \global\let\@title\@empty
  \global\let\title\relax
  \global\let\author\relax
  \global\let\date\relax
  \global\let\and\relax
}
\else
\newcommand\maketitle{\par
  \begingroup
    \renewcommand\thefootnote{\@fnsymbol\c@footnote}%
    \def\@makefnmark{\rlap{\@textsuperscript{\normalfont\@thefnmark}}}%
    \long\def\@makefntext##1{\parindent 1em\noindent
            \hb@xt@1.8em{%
                \hss\@textsuperscript{\normalfont\@thefnmark}}##1}%
    \if@twocolumn
      \ifnum \col@number=\@ne
        \@maketitle
      \else
        \twocolumn[\@maketitle]%
      \fi
    \else
      \newpage
      \global\@topnum\z@   % Prevents figures from going at top of page.
      \@maketitle
    \fi
    \thispagestyle{plain}\@thanks
  \endgroup
  \setcounter{footnote}{0}%
  \global\let\thanks\relax
  \global\let\maketitle\relax
  \global\let\@maketitle\relax
  \global\let\@thanks\@empty
  \global\let\@author\@empty
  \global\let\@date\@empty
  \global\let\@title\@empty
  \global\let\title\relax
  \global\let\author\relax
  \global\let\date\relax
  \global\let\and\relax
}
\def\@maketitle{%
  \newpage
  \null
  \vskip 2em%
  \begin{center}%
  \let \footnote \thanks
    {\LARGE \@title \par}%
    \vskip 1.5em%
    {\large
      \lineskip .5em%
      \begin{tabular}[t]{c}%
        \@author
      \end{tabular}\par}%
    \vskip 1em%
    {\large \@date}%
  \end{center}%
  \par
  \vskip 1.5em}
\fi
\newcommand*\partmark[1]{}
\newcommand*\chaptermark[1]{}
\setcounter{secnumdepth}{2}
\newcounter {part}
\newcounter {chapter}
\newcounter {section}
\newcounter {subsection}[section]
\newcounter {subsubsection}[subsection]
\newcounter {paragraph}[subsubsection]
\newcounter {subparagraph}[paragraph]
\renewcommand \thepart {\@Roman\c@part}
\renewcommand \thechapter {\@Roman\c@chapter}
\renewcommand \thesection {\@arabic\c@section}
\renewcommand\thesubsection   {\thesection.\@arabic\c@subsection}
\renewcommand\thesubsubsection{\thesubsection .\@arabic\c@subsubsection}
\renewcommand\theparagraph    {\thesubsubsection.\@arabic\c@paragraph}
\renewcommand\thesubparagraph {\theparagraph.\@arabic\c@subparagraph}
\newcommand\@partapp{\partname}
\newcommand\@chapapp{\chaptername}
\newcommand\frontmatter{%
    \cleardoublepage
    \@mainmatterfalse
    \pagenumbering{arabic}%
    \renewcommand{\partmark}[1]{}%
    \renewcommand{\chaptermark}[1]{\markboth{{\small ##1}}{{\small ##1}}}%
    \renewcommand{\sectionmark}[1]{}%
    \fancyhead[CE]{\itshape\nouppercase{\leftmark}}%
    \fancyhead[CO]{\itshape\nouppercase{\rightmark}}%
}
\newcommand\mainmatter{%
    \cleardoublepage
    \@mainmattertrue
    \renewcommand{\partmark}[1]{}%
    \renewcommand{\chaptermark}[1]{%
        \markboth{{\small Ч. \thepart, гл. \thechapter. ##1}}{}}%
    \renewcommand{\sectionmark}[1]{%
        \markright{{\small \textsection\ \thesection. ##1}}}%
    \fancyhead[CE]{\itshape\nouppercase{\leftmark}}%
    \fancyhead[CO]{\itshape\nouppercase{\rightmark}}%
}
\newcommand\backmatter{%
    \if@openright
        \cleardoublepage
    \else
        \clearpage
    \fi
    \@mainmatterfalse
    \renewcommand{\partmark}[1]{}%
    \renewcommand{\chaptermark}[1]{\markboth{{\small ##1}}{{\small ##1}}}%
    \renewcommand{\sectionmark}[1]{}%
    \fancyhead[CE]{\itshape\nouppercase{\leftmark}}%
    \fancyhead[CO]{\itshape\nouppercase{\rightmark}}%
}
\newcommand\part{%
  \if@openright
    \cleardoublepage
  \else
    \clearpage
  \fi
  \thispagestyle{empty}%
  \if@twocolumn
    \onecolumn
    \@tempswatrue
  \else
    \@tempswafalse
  \fi
  \null\vfil
  \secdef\@part\@spart}

\def\@part[#1]#2{%
    \ifnum \c@secnumdepth >-2\relax
        \refstepcounter{part}%
        \addcontentsline{toc}{part}{%
            \texorpdfstring{%
                {\sparseFnt\partname\hspace*{.5em}}\thepart\\*
                \vskip 1ex
                {\bfseries\MakeUppercase{#1}}
            }{Ч.\thepart. #1}%
        }%
        %{\thepart\hspace{1em}#1}%
    \else
      \addcontentsline{toc}{part}{#1}%
    \fi
    \markboth{}{}%
    {\centering
     \interlinepenalty \@M
     \normalfont
     \ifnum \c@secnumdepth >-2\relax
       \large {\sparseFnt\MakeUppercase{\partname}\hspace*{1em}}\thepart%
       \par
       \vskip 20\p@
     \fi
     \Large \bfseries \MakeUppercase{#2}\par}%
    \@endpart}
\def\@spart#1{%
    \addcontentsline{toc}{part}{%
      \texorpdfstring{\bfseries\MakeUppercase{#1}}{#1}}
    \partmark{#1}%
    {\centering
     \interlinepenalty \@M
     \normalfont
     \Large \bfseries \MakeUppercase{#1}\par}%
    \@endpart}
\def\@endpart{\vfil\newpage
              \if@twoside
                \null
                \thispagestyle{empty}%
                \newpage
              \fi
              \if@tempswa
                \twocolumn
              \fi}
\newcommand\chapter{
    \if@mainmatter%
        \if@openright\cleardoublepage\else\clearpage\fi%
    \else%
        \ifx\YouAreInAppendix\undefined%
        \newpage\fi%
    \fi%
    \thispagestyle{empty}%
    \global\@topnum\z@%
    \@afterindentfalse%
    \secdef\@chapter\@schapter%
}
\def\@chapter[#1]#2{%
    \ifnum \c@secnumdepth >\m@ne
        \if@mainmatter
            \refstepcounter{chapter}%
            \typeout{\@chapapp\space\thechapter.}%
            \addcontentsline{toc}{chapter}{%
                \texorpdfstring{%
                    \hbox to \WoLongestChNm {%
                        {\sparseFnt\chaptername}\hfil\thechapter.\hfil}%
                \bfseries #1}{гл.\thechapter. #1}%
            }
        \else
            \refstepcounter{chapter}%
            \typeout{\@chapapp\space\thechapter.}%
            \addcontentsline{toc}{appendix}{%
                \texorpdfstring{%
                     \hbox to \WoLongestApxNm {%
                        {\sparseFnt\chaptername}\hfil\thechapter.\hfil}%
                \bfseries #1}{доб.\thechapter. #1}%
            }
        \fi
    \else
        \addcontentsline{toc}{appendix}{#1}%
    \fi
    \chaptermark{#1}%
    \addtocontents{lof}{\protect\addvspace{10\p@}}%
    \addtocontents{lot}{\protect\addvspace{10\p@}}%
    \if@twocolumn
        \@topnewpage[\@makechapterhead{#2}]%
    \else
        \@makechapterhead{#2}%
        \@afterheading
    \fi%
    \setcounter{footnote}{0}%
    }
\def\@makechapterhead#1{%
    \if@mainmatter
        \vspace*{50\p@}%
        {\parindent \z@ \centering \normalfont
            \ifnum \c@secnumdepth >\m@ne
                \large
                {\itshape {\sparseFnt\chaptername} \space \thechapter}
                \par\nobreak
                \vskip 1.5ex
            \fi
            \interlinepenalty\@M
            \bfseries\MakeUppercase{#1}\par\nobreak
            \vskip 1.5ex
        }%
    \else
        \vspace*{3ex}%
        {
            \parindent \z@
            \centering\normalfont
            \interlinepenalty\@M
            \normalsize
            {\itshape {\sparseFnt\MakeUppercase{\chaptername}}\space\thechapter}
            %
            % грязный хак
            %
            \ifnum \c@chapter =1 %
                \footnote[1]{%
                    Редактор перевода не принимал участия
                    в редактировании этих добавлений.
                    --- \textit{Прим. ред.}}
            \fi
            \par\nobreak\vskip 1.5ex%
            \bfseries%
            \MakeUppercase{#1}\par\nobreak
            \vskip 1.5ex
        }%
    \fi
}
\def\@schapter#1{%
    \ifx\YouAreInToC\undefined
        \addcontentsline{toc}{chapter}{%
            \texorpdfstring{%
                {\sparseFnt#1}}{#1}%
        }%
    \fi
    \chaptermark{#1}%
    \if@twocolumn
        \@topnewpage[\@makeschapterhead{#1}]%
    \else
        \@makeschapterhead{#1}%
        \@afterheading
    \fi}
\def\@makeschapterhead#1{\vspace*{50\p@}%
    {\parindent \z@ \centering
        \normalfont
        \interlinepenalty\@M
        \normalsize%
        {\sparseFnt\MakeUppercase{#1}}%
        \par\nobreak
        \vskip 3ex
    }}
\newcommand\section{\secdef\@section\@ssection}
\def\@section[#1]#2{%
    \ifnum \c@secnumdepth >\m@ne
        \if@mainmatter
            \refstepcounter{section}%
            \ifnum%
             \ifnum \c@section=4 1\else
              \ifnum \c@section=5 1\else
               \ifnum \c@section=9 1\else
                \ifnum \c@section=24 1\else
                 \ifnum \c@section=34 1\else
                  \ifnum \c@section=37 1\else
                   \ifnum \c@section=40 1\else
                    \ifnum \c@section=47 1\else
                     \ifnum \c@section=53 1\else
                      \ifnum \c@section=59 1\else
                       \ifnum \c@section=71 1\else
                        \ifnum \c@section=74 1\else
                         \ifnum \c@section=79 1\else 0\fi
             \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi%
            =1 \def\@SectPrefix{{\bfseries *}\textsection}%
            \else \def\@SectPrefix{\hspace*{\AsterixLen}\textsection}%
            \fi
            \typeout{\@SectPrefix \thesection. #1}%
            \addcontentsline{toc}{section}{%
                \texorpdfstring{%
                    \@SectPrefix %
                    \hbox to \WoLongestSeNm {\hfil\thesection.\hspace*{0.25em}}%
                    #1}%
                    {\@SectPrefix\thesection. #1}%
            }%
        \else
            \addcontentsline{toc}{section}{#1}%
        \fi
    \else
        \addcontentsline{toc}{section}{#1}%
    \fi
    \sectionmark{#1}%
    \addtocontents{lof}{\protect\addvspace{10\p@}}%
    \addtocontents{lot}{\protect\addvspace{10\p@}}%
    \if@twocolumn
        \@topnewpage[\@makesectionhead{#2}]%
    \else
        \@makesectionhead{#2}%
        \@afterheading
    \fi}
\def\@makesectionhead#1{%
  \vspace*{3ex}%
  {\parindent \z@
    \centering\normalfont
    \interlinepenalty\@M
    \normalsize\bfseries%
    \@SectPrefix\hspace*{.25em}\thesection.\hspace*{.25em}%
    \MakeUppercase{#1}\par\nobreak
    \vskip 1.5ex
  }}
\def\@ssection#1{\if@twocolumn
                   \@topnewpage[\@makessectionhead{#1}]%
                 \else
                   \@makessectionhead{#1}%
                   \@afterheading
                 \fi}
\def\@makessectionhead#1{%
  \vspace*{3ex}%
  {\parindent \z@ \centering
    \normalfont
    \interlinepenalty\@M
    \normalsize\bfseries%
    \hspace*{.25em}\thesection.\hspace*{.25em}%
    \MakeUppercase{#1}\par\nobreak
    \vskip 1ex
  }}
\newcommand\subsection{\@startsection{subsection}{2}{\z@}%
                                     {-3.25ex\@plus -1ex \@minus -.2ex}%
                                     {1.5ex \@plus .2ex}%
                                     {\normalfont\large\bfseries}}
\newcommand\subsubsection{\@startsection{subsubsection}{3}{\z@}%
                                     {-3.25ex\@plus -1ex \@minus -.2ex}%
                                     {1.5ex \@plus .2ex}%
                                     {\normalfont\normalsize\bfseries}}
\newcommand\paragraph{\@startsection{paragraph}{4}{\z@}%
                                    {3.25ex \@plus1ex \@minus.2ex}%
                                    {-1em}%
                                    {\normalfont\normalsize\bfseries}}
\newcommand\subparagraph{\@startsection{subparagraph}{5}{\parindent}%
                                       {3.25ex \@plus1ex \@minus .2ex}%
                                       {-1em}%
                                      {\normalfont\normalsize\bfseries}}
\if@twocolumn
  \setlength\leftmargini  {2em}
\else
  \setlength\leftmargini  {2.5em}
\fi
\leftmargin  \leftmargini
\setlength\leftmarginii  {2.2em}
\setlength\leftmarginiii {1.87em}
\setlength\leftmarginiv  {1.7em}
\if@twocolumn
  \setlength\leftmarginv  {.5em}
  \setlength\leftmarginvi {.5em}
\else
  \setlength\leftmarginv  {1em}
  \setlength\leftmarginvi {1em}
\fi
\setlength  \labelsep  {.5em}
\setlength  \labelwidth{\leftmargini}
\addtolength\labelwidth{-\labelsep}
\@beginparpenalty -\@lowpenalty
\@endparpenalty   -\@lowpenalty
\@itempenalty     -\@lowpenalty
\renewcommand\theenumi{\@arabic\c@enumi}
\renewcommand\theenumii{\@alph\c@enumii}
\renewcommand\theenumiii{\@roman\c@enumiii}
\renewcommand\theenumiv{\@Alph\c@enumiv}
\newcommand\labelenumi{\theenumi.}
\newcommand\labelenumii{(\theenumii)}
\newcommand\labelenumiii{\theenumiii.}
\newcommand\labelenumiv{\theenumiv.}
\renewcommand\p@enumii{\theenumi}
\renewcommand\p@enumiii{\theenumi(\theenumii)}
\renewcommand\p@enumiv{\p@enumiii\theenumiii}
\newcommand\labelitemi{\textbullet}
\newcommand\labelitemii{\normalfont\bfseries \textendash}
\newcommand\labelitemiii{\textasteriskcentered}
\newcommand\labelitemiv{\textperiodcentered}
\newenvironment{description}
               {\list{}{\labelwidth\z@ \itemindent-\leftmargin
                        \let\makelabel\descriptionlabel}}
               {\endlist}
\newcommand*\descriptionlabel[1]{\hspace\labelsep
                                \normalfont\bfseries #1}
\newenvironment{verse}
               {\let\\\@centercr
                \list{}{\itemsep      \z@
                        \itemindent   -1.5em%
                        \listparindent\itemindent
                        \rightmargin  \leftmargin
                        \advance\leftmargin 1.5em}%
                \item\relax}
               {\endlist}
\newenvironment{quotation}
               {\list{}{\listparindent 1.5em%
                        \itemindent    \listparindent
                        \rightmargin   \leftmargin
                        \parsep        \z@ \@plus\p@}%
                \item\relax}
               {\endlist}
\newenvironment{quote}
               {\list{}{\rightmargin\leftmargin}%
                \item\relax}
               {\endlist}
\newenvironment{titlepage}
    {%
      \cleardoublepage
      \if@twocolumn
        \@restonecoltrue\onecolumn
      \else
        \@restonecolfalse\newpage
      \fi
      \thispagestyle{empty}%
      \setcounter{page}\@ne
    }%
    {\if@restonecol\twocolumn \else \newpage \fi
     \if@twoside\else
        \setcounter{page}\@ne
     \fi
    }
\newcommand\appendix{\par
    \@mainmatterfalse
    \def\YouAreInAppendix{1}%
    \setcounter{chapter}{0}%
    \setcounter{section}{0}%
    \renewcommand{\chaptername}{Добавление}%
    \gdef\@chapapp{\appendixname}%
    \gdef\thechapter{\@Roman\c@chapter}%
    \renewcommand{\partmark}[1]{\markboth{{\small Добавления}}{}}%
    \renewcommand{\chaptermark}[1]{%
        \markright{{\small\chaptername\hspace*{0.5em}\thechapter}}}%
    \renewcommand{\sectionmark}[1]{}%
    \fancyhead[CE]{\itshape\nouppercase{\leftmark}}%
    \fancyhead[CO]{\itshape\nouppercase{\rightmark}}%
}
\setlength\arraycolsep{5\p@}
\setlength\tabcolsep{6\p@}
\setlength\arrayrulewidth{.4\p@}
\setlength\doublerulesep{2\p@}
\setlength\tabbingsep{\labelsep}
\skip\@mpfootins = \skip\footins
\setlength\fboxsep{3\p@}
\setlength\fboxrule{.4\p@}
\@addtoreset {equation}{chapter}
\renewcommand\theequation
  {\ifnum \c@chapter>\z@ \thechapter.\fi \@arabic\c@equation}
\newcounter{figure}[chapter]
\renewcommand \thefigure
     {\ifnum \c@chapter>\z@ \thechapter.\fi \@arabic\c@figure}
\def\fps@figure{tbp}
\def\ftype@figure{1}
\def\ext@figure{lof}
\def\fnum@figure{\figurename~\thefigure}
\newenvironment{figure}
               {\@float{figure}}
               {\end@float}
\newenvironment{figure*}
               {\@dblfloat{figure}}
               {\end@dblfloat}
\newcounter{table}[chapter]
\renewcommand \thetable
     {\ifnum \c@chapter>\z@ \thechapter.\fi \@arabic\c@table}
\def\fps@table{tbp}
\def\ftype@table{2}
\def\ext@table{lot}
\def\fnum@table{\tablename~\thetable}
\newenvironment{table}
               {\@float{table}}
               {\end@float}
\newenvironment{table*}
               {\@dblfloat{table}}
               {\end@dblfloat}
\newlength\abovecaptionskip
\newlength\belowcaptionskip
\setlength\abovecaptionskip{10\p@}
\setlength\belowcaptionskip{0\p@}
\long\def\@makecaption#1#2{%
  \vskip\abovecaptionskip
  \sbox\@tempboxa{#1: #2}%
  \ifdim \wd\@tempboxa >\hsize
    #1: #2\par
  \else
    \global \@minipagefalse
    \hb@xt@\hsize{\hfil\box\@tempboxa\hfil}%
  \fi
  \vskip\belowcaptionskip}
\DeclareOldFontCommand{\rm}{\normalfont\rmfamily}{\mathrm}
\DeclareOldFontCommand{\sf}{\normalfont\sffamily}{\mathsf}
\DeclareOldFontCommand{\tt}{\normalfont\ttfamily}{\mathtt}
\DeclareOldFontCommand{\bf}{\normalfont\bfseries}{\mathbf}
\DeclareOldFontCommand{\it}{\normalfont\itshape}{\mathit}
\DeclareOldFontCommand{\sl}{\normalfont\slshape}{\@nomath\sl}
\DeclareOldFontCommand{\sc}{\normalfont\scshape}{\@nomath\sc}
\DeclareRobustCommand*\cal{\@fontswitch\relax\mathcal}
\DeclareRobustCommand*\mit{\@fontswitch\relax\mathnormal}
\newcommand\@pnumwidth{1.55em}
\newcommand\@tocrmarg{2.55em}
\newcommand\@dotsep{4.5}
\setcounter{tocdepth}{2}
\newcommand\tableofcontents{%
    \def\YouAreInToC{1}
    \if@twocolumn
      \@restonecoltrue\onecolumn
    \else
      \@restonecolfalse
    \fi
    \newpage%
    \chapter*{\contentsname}%
    \@mkboth{{\small\contentsname}}{{\small\contentsname}}
    \@starttoc{toc}%
    \if@restonecol\twocolumn\fi}

\newcommand*\l@part[2]{%
    \ifnum \c@tocdepth >-2\relax
        {\centering \parindent \z@ \relax
            \vskip 1.5ex
            #1 \nopagebreak
            \vskip 1.5ex
        \par}
    \fi}
\newcommand*\l@chapter[2]{%
    \ifnum \c@tocdepth >\m@ne
        \vskip \z@ \@plus.2\p@
        {\leftskip \z@ \relax
            \rightskip \@tocrmarg \parfillskip -\rightskip
            \parindent \z@ \relax\@afterindenttrue
            \interlinepenalty\@M
            \leavevmode
            \@tempdima \WoLongestChNm\relax
            \advance\leftskip \@tempdima \null\nobreak\hskip -\leftskip
            {#1}\nobreak
            \leaders\hbox{$\m@th
                \mkern \@dotsep mu\hbox{.}\mkern \@dotsep
                mu$}\hfill
            \nobreak
            \hb@xt@\@pnumwidth{{\hfil\normalfont \normalcolor #2}}%
            \par\nopagebreak%
        }%
    \fi}
%% ======= Section ToC =======
\newcommand*\l@section[2]{
    \ifnum \c@tocdepth >\m@ne
        \vskip \z@ \@plus.2\p@
        {\leftskip \SectTocMarkIndent\relax %\SectTocIndent\relax
            \rightskip \@tocrmarg \parfillskip -\rightskip
            \parindent \SectTocMarkIndent \relax\@afterindenttrue
            \interlinepenalty\@M
            \leavevmode
            \@tempdima \TotlWoLongestSect\relax%\WoLongestSeNm\relax
            \advance\leftskip \@tempdima
            \null\nobreak\hskip -\leftskip
            {#1}\nobreak
            \leaders\hbox{$\m@th
                \mkern \@dotsep mu\hbox{.}\mkern \@dotsep
                mu$}\hfill
            \nobreak
            \hb@xt@\@pnumwidth{{\hfil\normalfont \normalcolor #2}}%
            \par%
        }%
    \fi}
\newcommand*\l@subsection{\@dottedtocline{2}{3.8em}{3.2em}}
\newcommand*\l@subsubsection{\@dottedtocline{3}{7.0em}{4.1em}}
\newcommand*\l@paragraph{\@dottedtocline{4}{10em}{5em}}
\newcommand*\l@subparagraph{\@dottedtocline{5}{12em}{6em}}
\newcommand*\l@appendix[2]{%
    \ifnum \c@tocdepth >\m@ne
        \vskip \z@ \@plus.2\p@
        {\leftskip \z@\relax
            \rightskip \@tocrmarg \parfillskip -\rightskip
            \parindent \z@ \relax\@afterindenttrue
            \interlinepenalty\@M
            \leavevmode
            \@tempdima \WoLongestApxNm\relax
            \advance\leftskip \@tempdima \null\nobreak\hskip -\leftskip
            {#1}\nobreak
            \leaders\hbox{$\m@th
                \mkern \@dotsep mu\hbox{.}\mkern \@dotsep
                mu$}\hfill
            \nobreak
            \hb@xt@\@pnumwidth{{\hfil\normalfont \normalcolor #2}}%
            \par\nopagebreak%
        }%
    \fi}
\newcommand\listoffigures{%
    \if@twocolumn
      \@restonecoltrue\onecolumn
    \else
      \@restonecolfalse
    \fi
    \chapter*{\listfigurename
      \@mkboth{{\small\MakeUppercase\listfigurename}}%
              {{\small\MakeUppercase\listfigurename}}}%
    \@starttoc{lof}%
    \if@restonecol\twocolumn\fi
    }
\newcommand*\l@figure{\@dottedtocline{1}{1.5em}{2.3em}}
\newcommand\listoftables{%
    \if@twocolumn
        \@restonecoltrue\onecolumn
    \else
        \@restonecolfalse
    \fi
    \chapter*{\listtablename
        \@mkboth{{\small\MakeUppercase\listtablename}}%
            {{\small\MakeUppercase\listtablename}}}%
    \@starttoc{lot}%
    \if@restonecol\twocolumn\fi
}
\let\l@table\l@figure
\newdimen\bibindent
\setlength\bibindent{1.5em}
\newenvironment{thebibliography}[1]
     {\chapter*{\bibname }%
      \@mkboth{{\small\bibname}}{{\small\bibname}}
      \list{\@biblabel{\@arabic\c@enumiv}}%
           {\settowidth\labelwidth{\@biblabel{#1}}%
            \leftmargin\labelwidth
            \advance\leftmargin\labelsep
            \@openbib@code
            \usecounter{enumiv}%
            \let\p@enumiv\@empty
            \renewcommand\theenumiv{\@arabic\c@enumiv}}%
      \sloppy
      \clubpenalty4000
      \@clubpenalty \clubpenalty
      \widowpenalty4000%
      \sfcode`\.\@m}
     {\def\@noitemerr
       {\@latex@warning{Empty `thebibliography' environment}}%
      \endlist}
\newcommand\newblock{\hskip .11em\@plus.33em\@minus.07em}
\let\@openbib@code\@empty
\newenvironment{theindex}
               {\if@twocolumn
                  \@restonecolfalse
                \else
                  \@restonecoltrue
                \fi
                \columnseprule \z@
                \columnsep 35\p@
                \twocolumn[\@makeschapterhead{\indexname}]%
                \@mkboth{{\small\MakeUppercase\indexname}}%
                        {{\small\MakeUppercase\indexname}}%
                \thispagestyle{plain}\parindent\z@
                \parskip\z@ \@plus .3\p@\relax
                \let\item\@idxitem}
               {\if@restonecol\onecolumn\else\clearpage\fi}
\newcommand\@idxitem{\par\hangindent 40\p@}
\newcommand\subitem{\@idxitem \hspace*{20\p@}}
\newcommand\subsubitem{\@idxitem \hspace*{30\p@}}
\newcommand\indexspace{\par \vskip 10\p@ \@plus5\p@ \@minus3\p@\relax}
\renewcommand\footnoterule{%
  \kern-3\p@
  \hrule\@width.4\columnwidth
  \kern2.6\p@}
\@addtoreset{footnote}{chapter}
\newcommand\@makefntext[1]{%
    \parindent 1em%
    \noindent
    \hb@xt@1.8em{\hss\@makefnmark}#1}
\newcommand\contentsname{Contents}
\newcommand\listfigurename{List of Figures}
\newcommand\listtablename{List of Tables}
\newcommand\bibname{Bibliography}
\newcommand\indexname{Index}
\newcommand\figurename{Figure}
\newcommand\tablename{Table}
\newcommand\partname{Part}
\newcommand\chaptername{Chapter}
\newcommand\appendixname{Appendix}
\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\fi
  \space\number\day, \number\year}
\setlength\columnsep{10\p@}
\setlength\columnseprule{0\p@}
\pagestyle{headings}
\pagenumbering{arabic}
\if@twoside
\else
  \raggedbottom
\fi
\if@twocolumn
  \twocolumn
  \sloppy
  \flushbottom
\else
  \onecolumn
\fi
\endinput
%%
%% End of file `book.cls'.
