
% \iffalse
%%% From File: sections.dtx
% \fi
%
%    \begin{macrocode}

%<*sections>
%    \end{macrocode}
% \subsection{Секции и параграфы}
%
% \subsubsection{Section}
%
% \paragraph{Параметры формата записи в оглавлении}
%
% \DescribeMacro{\tocprethesection}\index{Макросы!\verb*+\tocprethesection+}
% \DescribeMacro{\tocpostthesection}\index{Макросы!\verb*+\tocpostthesection+}
% \DescribeMacro{\tocsectionfill}\index{Макросы!\verb*+\tocsectionfill+}
% \DescribeMacro{\tocsectionfont}\index{Макросы!\verb*+\tocsectionfont+}
% \DescribeMacro{\tocsectionfillfont}\index{Макросы!\verb*+\tocsectionfillfont+}
% \DescribeMacro{\tocsectionnumfont}\index{Макросы!\verb*+\tocsectionnumfont+}
%    \begin{macrocode}
\providecommand\tocprethesection{}
\providecommand\tocpostthesection{.\@postskip}
\providecommand\tocsectionfill{\tocfill{.}}

\providecommand\tocsectionfont{\normalfont}
\providecommand\tocsectionfillfont{}
\providecommand\tocsectionnumfont{}
%    \end{macrocode}
% \DescribeMacro{\tocsectionindent}\index{Макросы!\verb*+\tocsectionindent+}
% Величина отступа записи в оглавлении.
%    \begin{macrocode}
\providecommand\tocsectionindent{1.5em}
%    \end{macrocode}
% \DescribeMacro{\tocsectionnameindent}\index{Макросы!\verb*+\tocsectionnameindent+}
% Пробел после номера.
%    \begin{macrocode}
\providecommand\tocsectionnameindent{2.6em}

%    \end{macrocode}
% \paragraph{Параметры формата в тексте}
%
% \DescribeMacro{\sectionfont}\index{Макросы!\verb*+\sectionfont+}
% \DescribeMacro{\prethesection}\index{Макросы!\verb*+\prethesection+}
% \DescribeMacro{\postthesection}\index{Макросы!\verb*+\postthesection+}
%    \begin{macrocode}
\providecommand\sectionfont{\normalfont\large\bfseries}

\providecommand\prethesection{}
\providecommand\postthesection{.~}

%    \end{macrocode}
% \DescribeMacro{\sectionindent}\index{Макросы!\verb*+\sectionindent+}
% Величина отступа заголовка секции на странице.
%    \begin{macrocode}
\providecommand\sectionindent{\z@}
%    \end{macrocode}
% \DescribeMacro{\beforesection}\index{Макросы!\verb*+\beforesection+}
% Величина вертикального отступа перед заголовком секции.
%    \begin{macrocode}
\providecommand\beforesection{-3.5ex \@plus -1ex \@minus -.2ex}
%    \end{macrocode}
% \DescribeMacro{\aftersection}\index{Макросы!\verb*+\aftersection+}
% Величина вертикального отступа после заголовка секции.
%    \begin{macrocode}
\providecommand\aftersection{2.3ex \@plus.2ex}
%    \end{macrocode}
% \DescribeMacro{\sectionalign}\index{Макросы!\verb*+\sectionalign+}
% Выравнивание заголовка.
%    \begin{macrocode}
\providecommand\sectionalign{\raggedright}

%    \end{macrocode}
% \subsubsection{Subsection}
% \paragraph{Параметры формата записи в оглавлении}
%
% \DescribeMacro{\tocprethesubsection}\index{Макросы!\verb*+\tocprethesubsection+}
% \DescribeMacro{\tocpostthesubsection}\index{Макросы!\verb*+\tocpostthesubsection+}
% \DescribeMacro{\tocsubsectionfill}\index{Макросы!\verb*+\tocsubsectionfill+}
% \DescribeMacro{\tocsubsectionfont}\index{Макросы!\verb*+\tocsubsectionfont+}
% \DescribeMacro{\tocsubsectionfillfont}\index{Макросы!\verb*+\tocsubsectionfillfont+}
% \DescribeMacro{\tocsubsectionnumfont}\index{Макросы!\verb*+\tocsubsectionnumfont+}
% \DescribeMacro{\tocsubsectionindent}\index{Макросы!\verb*+\tocsubsectionindent+}
% \DescribeMacro{\tocsubsectionnameindent}\index{Макросы!\verb*+\tocsubsectionnameindent+}
%    \begin{macrocode}
\providecommand\tocprethesubsection{}
\providecommand\tocpostthesubsection{.\@postskip}
\providecommand\tocsubsectionfill{\tocfill{.}}

\providecommand\tocsubsectionfont{\normalfont}
\providecommand\tocsubsectionfillfont{}
\providecommand\tocsubsectionnumfont{}

\providecommand\tocsubsectionindent{4.1em}
\providecommand\tocsubsectionnameindent{3.5em}

%    \end{macrocode}
% \paragraph{Параметры формата в тексте}
%
% \DescribeMacro{\subsectionfont}\index{Макросы!\verb*+\subsectionfont+}
% \DescribeMacro{\prethesubsection}\index{Макросы!\verb*+\prethesubsection+}
% \DescribeMacro{\postthesubsection}\index{Макросы!\verb*+\postthesubsection+}
% \DescribeMacro{\subsectionindent}\index{Макросы!\verb*+\subsectionindent+}
% \DescribeMacro{\beforesubsection}\index{Макросы!\verb*+\beforesubsection+}
% \DescribeMacro{\aftersubsection}\index{Макросы!\verb*+\aftersubsection+}
% \DescribeMacro{\subsectionalign}\index{Макросы!\verb*+\subsectionalign+}
%    \begin{macrocode}
\providecommand\subsectionfont{\normalfont\normalsize\bfseries}

\providecommand\prethesubsection{}
\providecommand\postthesubsection{.~}

\providecommand\subsectionindent{\z@}
\providecommand\beforesubsection{-3.25ex\@plus -1ex \@minus -.2ex}
\providecommand\aftersubsection{1.5ex \@plus .2ex}
\providecommand\subsectionalign{\raggedright}

%    \end{macrocode}
% \subsubsection{Subsubsection}
% \paragraph{Параметры формата записи в оглавлении}
%
% \DescribeMacro{\tocprethesubsubsection}\index{Макросы!\verb*+\tocprethesubsubsection+}
% \DescribeMacro{\tocpostthesubsubsection}\index{Макросы!\verb*+\tocpostthesubsubsection+}
% \DescribeMacro{\tocsubsubsectionfill}\index{Макросы!\verb*+\tocsubsubsectionfill+}
%
% \DescribeMacro{\tocsubsubsectionfont}\index{Макросы!\verb*+\tocsubsubsectionfont+}
% \DescribeMacro{\tocsubsubsectionfillfont}\index{Макросы!\verb*+\tocsubsubsectionfillfont+}
% \DescribeMacro{\tocsubsubsectionnumfont}\index{Макросы!\verb*+\tocsubsubsectionnumfont+}
%
% \DescribeMacro{\tocsubsubsectionindent}\index{Макросы!\verb*+\tocsubsubsectionindent+}
% \DescribeMacro{\tocsubsubsectionnameindent}\index{Макросы!\verb*+\tocsubsubsectionnameindent+}
%    \begin{macrocode}
\providecommand\tocprethesubsubsection{}
\providecommand\tocpostthesubsubsection{.\@postskip}
\providecommand\tocsubsubsectionfill{\tocfill{.}}

\providecommand\tocsubsubsectionfont{\normalfont}
\providecommand\tocsubsubsectionfillfont{}
\providecommand\tocsubsubsectionnumfont{}

\providecommand\tocsubsubsectionindent{7.6em}
\providecommand\tocsubsubsectionnameindent{4.7em}

%    \end{macrocode}
% \paragraph{Параметры формата в тексте}
%
% \DescribeMacro{\subsubsectionfont}\index{Макросы!\verb*+\subsubsectionfont+}
% \DescribeMacro{\prethesubsubsection}\index{Макросы!\verb*+\prethesubsubsection+}
% \DescribeMacro{\postthesubsubsection}\index{Макросы!\verb*+\postthesubsubsection+}
% \DescribeMacro{\subsubsectionindent}\index{Макросы!\verb*+\subsubsectionindent+}
% \DescribeMacro{\beforesubsubsection}\index{Макросы!\verb*+\beforesubsubsection+}
% \DescribeMacro{\aftersubsubsection}\index{Макросы!\verb*+\aftersubsubsection+}
% \DescribeMacro{\subsubsectionalign}\index{Макросы!\verb*+\subsubsectionalign+}
%    \begin{macrocode}
\providecommand\subsubsectionfont{\normalfont\normalsize\bfseries}

\providecommand\prethesubsubsection{}
\providecommand\postthesubsubsection{.~}

\providecommand\subsubsectionindent{\z@}
\providecommand\beforesubsubsection{-3.25ex\@plus -1ex \@minus -.2ex}
\providecommand\aftersubsubsection{1.5ex \@plus .2ex}
\providecommand\subsubsectionalign{\raggedright}

%    \end{macrocode}
% \subsubsection{Paragraph}
% \paragraph{Параметры формата записи в оглавлении}
%
% \DescribeMacro{\tocpretheparagraph}\index{Макросы!\verb*+\tocpretheparagraph+}
% \DescribeMacro{\tocposttheparagraph}\index{Макросы!\verb*+\tocposttheparagraph+}
% \DescribeMacro{\tocparagraphfill}\index{Макросы!\verb*+\tocparagraphfill+}
%
%    \begin{macrocode}
\providecommand\tocpretheparagraph{}
\providecommand\tocposttheparagraph{.\@postskip}
\providecommand\tocparagraphfill{\tocfill{.}}

%    \end{macrocode}
% \DescribeMacro{\tocparagraphfont}\index{Макросы!\verb*+\tocparagraphfont+}
% \DescribeMacro{\tocparagraphfillfont}\index{Макросы!\verb*+\tocparagraphfillfont+}
% \DescribeMacro{\tocparagraphnumfont}\index{Макросы!\verb*+\tocparagraphnumfont+}
%    \begin{macrocode}
\providecommand\tocparagraphfont{\normalfont}
\providecommand\tocparagraphfillfont{}
\providecommand\tocparagraphnumfont{}

%    \end{macrocode}
% \DescribeMacro{\tocparagraphindent}\index{Макросы!\verb*+\tocparagraphindent+}
% \DescribeMacro{\tocparagraphnameindent}\index{Макросы!\verb*+\tocparagraphnameindent+}
%    \begin{macrocode}
\providecommand\tocparagraphindent{10em}
\providecommand\tocparagraphnameindent{5em}

%    \end{macrocode}
% \paragraph{Параметры формата в тексте}
%
% \DescribeMacro{\paragraphfont}\index{Макросы!\verb*+\paragraphfont+}
%
% \DescribeMacro{\pretheparagraph}\index{Макросы!\verb*+\pretheparagraph+}
% \DescribeMacro{\posttheparagraph}\index{Макросы!\verb*+\posttheparagraph+}
%
% \DescribeMacro{\paragraphindent}\index{Макросы!\verb*+\paragraphindent+}
% \DescribeMacro{\beforeparagraph}\index{Макросы!\verb*+\beforeparagraph+}
% \DescribeMacro{\afterparagraph}\index{Макросы!\verb*+\afterparagraph+}
% \DescribeMacro{\paragraphalign}\index{Макросы!\verb*+\paragraphalign+}
%    \begin{macrocode}
\providecommand\paragraphfont{\normalfont\normalsize\bfseries}

\providecommand\pretheparagraph{}
\providecommand\posttheparagraph{.~}

\providecommand\paragraphindent{\z@}
\providecommand\beforeparagraph{3.25ex \@plus1ex \@minus.2ex}
\providecommand\afterparagraph{-1em}
\providecommand\paragraphalign{}

%    \end{macrocode}
% \subsubsection{Subparagraph}
% \paragraph{Параметры формата записи в оглавлении}
%
% \DescribeMacro{\tocprethesubparagraph}\index{Макросы!\verb*+\tocprethesubparagraph+}
% \DescribeMacro{\tocpostthesubparagraph}\index{Макросы!\verb*+\tocpostthesubparagraph+}
% \DescribeMacro{\tocsubparagraphfill}\index{Макросы!\verb*+\tocsubparagraphfill+}
%    \begin{macrocode}
\providecommand\tocprethesubparagraph{}
\providecommand\tocpostthesubparagraph{.\@postskip}
\providecommand\tocsubparagraphfill{\tocfill{.}}

%    \end{macrocode}
% \DescribeMacro{\tocsubparagraphfont}\index{Макросы!\verb*+\tocsubparagraphfont+}
% \DescribeMacro{\tocsubparagraphfillfont}\index{Макросы!\verb*+\tocsubparagraphfillfont+}
% \DescribeMacro{\tocsubparagraphnumfont}\index{Макросы!\verb*+\tocsubparagraphnumfont+}
%    \begin{macrocode}
\providecommand\tocsubparagraphfont{\normalfont}
\providecommand\tocsubparagraphfillfont{}
\providecommand\tocsubparagraphnumfont{}

%    \end{macrocode}
% \DescribeMacro{\tocsubparagraphindent}\index{Макросы!\verb*+\tocsubparagraphindent+}
% \DescribeMacro{\tocsubparagraphnameindent}\index{Макросы!\verb*+\tocsubparagraphnameindent+}
%    \begin{macrocode}
\providecommand\tocsubparagraphindent{12em}
\providecommand\tocsubparagraphnameindent{6em}

%    \end{macrocode}
% \paragraph{Параметры формата в тексте}
%
% \DescribeMacro{\subparagraphfont}\index{Макросы!\verb*+\subparagraphfont+}
%
% \DescribeMacro{\prethesubparagraph}\index{Макросы!\verb*+\prethesubparagraph+}
% \DescribeMacro{\postthesubparagraph}\index{Макросы!\verb*+\postthesubparagraph+}
%
% \DescribeMacro{\subparagraphindent}\index{Макросы!\verb*+\subparagraphindent+}
% \DescribeMacro{\beforesubparagraph}\index{Макросы!\verb*+\beforesubparagraph+}
% \DescribeMacro{\aftersubparagraph}\index{Макросы!\verb*+\aftersubparagraph+}
% \DescribeMacro{\subparagraphalign}\index{Макросы!\verb*+\subparagraphalign+}
%    \begin{macrocode}
\providecommand\subparagraphfont{\normalfont\normalsize\bfseries}

\providecommand\prethesubparagraph{}
\providecommand\postthesubparagraph{.~}

\providecommand\subparagraphindent{\parindent}
\providecommand\subparagraphalign{\raggedright}
\providecommand\beforesubparagraph{3.25ex \@plus1ex \@minus .2ex}
\providecommand\aftersubparagraph{-1em}

%    \end{macrocode}
% \subsubsection{Низкоуровневые команды}
%
% \DescribeMacro{\@startsection}\index{Макросы!\verb*+"\"@startsection+}
% Команда, создающая заголовки секций.
%    \begin{macrocode}
\def\@startsection#1#2{%
  \if@noskipsec \leavevmode \fi
  \par
  \@tempskipa \csname before#1\endcsname\relax
  \@afterindenttrue
  \ifdim \@tempskipa <\z@
    \@tempskipa -\@tempskipa \@afterindentfalse
  \fi
  \if@nobreak
    \everypar{}%
  \else
    \addpenalty\@secpenalty\addvspace\@tempskipa
  \fi
  \@ifstar
    {\@ssect{\csname #1indent\endcsname}%
            {\csname before#1\endcsname}{\csname after#1\endcsname}%
            {\csname #1font\endcsname\csname #1align\endcsname}}%
    {\@dblarg{\@sect{#1}{#2}{\csname #1indent\endcsname}%
            {\csname before#1\endcsname}{\csname after#1\endcsname}%
            {\csname #1font\endcsname\csname #1align\endcsname}}}%
}

%    \end{macrocode}
% \DescribeMacro{\@ssect}\index{Макросы!\verb*+"\"@ssect+}
% Для ненумеруемых секций.
%    \begin{macrocode}
\def\@ssect#1#2#3#4#5{%
  \@tempskipa #3\relax
  \ifdim \@tempskipa>\z@
    \begingroup
      #4{%
        \@hangfrom{\hskip #1}%
          \interlinepenalty \@M #5\@@par}%
    \endgroup
  \else
    \def\@svsechd{#4{\hskip #1\relax #5}}%
  \fi
  \@xsect{#3}%
}

%    \end{macrocode}
% \DescribeMacro{\@sect}\index{Макросы!\verb*+"\"@sect+}
% Для нумеруемых секций.
%    \begin{macrocode}
\def\@sect#1#2#3#4#5#6[#7]#8{%
  \ifnum #2>\c@secnumdepth
    \let\@svsec\@empty
  \else
    \refstepcounter{#1}%
    \protected@edef\@svsec{\@seccntformat{#1}\relax}%
  \fi
  \@tempskipa #5\relax
  \ifdim \@tempskipa>\z@
    \begingroup
      #6{%
        \@hangfrom{\hskip #3\relax\@svsec}%
          \interlinepenalty \@M #8\@@par}%
    \endgroup
    \csname #1mark\endcsname{#7}%
    \addcontentsline{toc}{#1}{%
      \ifnum #2>\c@secnumdepth \else
        \protect\numberline{\@tocseccntformat{#1}}%
      \fi
      #7}%
  \else
    \def\@svsechd{%
      #6{\hskip #3\relax
      \@svsec #8}%
      \csname #1mark\endcsname{#7}%
      \addcontentsline{toc}{#1}{%
        \ifnum #2>\c@secnumdepth \else
          \protect\numberline{\@tocseccntformat{#1}}%
        \fi
        #7}%
    }%
  \fi
  \@xsect{#5}%
}

%    \end{macrocode}
% \DescribeMacro{\@tocline}\index{Макросы!\verb*+"\"@tocline+}
% Обобщенная версия стандартной команды, добавляющей запись в оглавление.
%    \begin{macrocode}
\def\@tocline#1#2#3#4{%
  \ifnum #2>\c@tocdepth \else
    \vskip \z@ \@plus.2\p@
    {\leftskip \csname toc#1indent\endcsname\relax%
     \rightskip \@tocrmarg \parfillskip -\rightskip
     \parindent \csname toc#1indent\endcsname\relax%
     \@afterindenttrue
     \interlinepenalty\@M
     \leavevmode
     \@tempdima \csname toc#1nameindent\endcsname\relax
     \csname toc#1font\endcsname
     \advance\leftskip \@tempdima \null\nobreak\hskip -\leftskip
     {#3}\nobreak
     \csname toc#1fillfont\endcsname \csname toc#1fill\endcsname\hfill
     \nobreak\hb@xt@\@pnumwidth{\hfil\csname toc#1numfont\endcsname #4}%
     \par%
    }%
  \fi
}

%    \end{macrocode}
% Команды, создающие заголовки секций в тексте и записи в оглавлении.
% \DescribeMacro{\section}\index{Макросы!\verb*+\section+}
% \DescribeMacro{\l@section}\index{Макросы!\verb*+"\l"@section+}
%    \begin{macrocode}
\newcommand\section{\@startsection{section}{1}}
\newcommand*\l@section{\@tocline{section}{1}}

%    \end{macrocode}
% \DescribeMacro{\subsection}\index{Макросы!\verb*+\subsection+}
% \DescribeMacro{\l@subsection}\index{Макросы!\verb*+"\l"@subsection+}
%    \begin{macrocode}
\newcommand\subsection{\@startsection{subsection}{2}}
\newcommand*\l@subsection{\@tocline{subsection}{2}}

%    \end{macrocode}
% \DescribeMacro{\subsubsection}\index{Макросы!\verb*+\subsubsection+}
% \DescribeMacro{\l@subsubsection}\index{Макросы!\verb*+"\l"@subsubsection+}
%    \begin{macrocode}
\newcommand\subsubsection{\@startsection{subsubsection}{3}}
\newcommand*\l@subsubsection{\@tocline{subsubsection}{3}}

%    \end{macrocode}
% \DescribeMacro{\paragraph}\index{Макросы!\verb*+\paragraph+}
% \DescribeMacro{\l@paragraph}\index{Макросы!\verb*+"\l"@paragraph+}
%    \begin{macrocode}
\newcommand\paragraph{\@startsection{paragraph}{4}}
\newcommand*\l@paragraph{\@tocline{paragraph}{4}}

%    \end{macrocode}
% \DescribeMacro{\subparagraph}\index{Макросы!\verb*+\subparagraph+}
% \DescribeMacro{\l@subparagraph}\index{Макросы!\verb*+"\l"@subparagraph+}
%    \begin{macrocode}
\newcommand\subparagraph{\@startsection{subparagraph}{5}}
\newcommand*\l@subparagraph{\@tocline{subparagraph}{5}}

%</sections>
%    \end{macrocode}
