latex-style-esdpx/xespdsect.sty

234 lines
8.3 KiB
Plaintext
Raw Normal View History

2020-03-14 11:58:37 +00:00
% Copyright 2006 Konstantin Korikov <lostclus@ua.fm>
%
% This work may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either version 1.3
% of this license or (at your option) any later version.
% The latest version of this license is in
% http://www.latex-project.org/lppl.txt
% and version 1.3 or later is part of all distributions of LaTeX
% version 2003/12/01 or later.
%
% This work has the LPPL maintenance status "maintained".
%
% This Current Maintainer of this work is Konstantin Korikov.
%
% This work consists of all files listed in manifest.txt.
%
%
% This is automaticaly generated file, do not edit it.
%
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{xespdsect}[2020/03/20 v1.00 Sectioning]
2020-03-14 18:07:06 +00:00
\RequirePackage{calc}
2020-03-14 11:58:37 +00:00
\newcommand{\XESPD@point@style}{single}
\DeclareOption{pointsingle}{\renewcommand{\XESPD@point@style}{single}}
\DeclareOption{pointsection}{\renewcommand{\XESPD@point@style}{section}}
\DeclareOption{pointsubsection}{\renewcommand{\XESPD@point@style}{subsection}}
\ProcessOptions\relax
\def\@startsection#1#2#3#4#5#6{%
\if@noskipsec \leavevmode \fi
\par
\@tempskipa #4\relax
\@afterindenttrue
\ifdim \@tempskipa <\z@
\@tempskipa -\@tempskipa \@afterindentfalse
\fi
\if@nobreak
\everypar{}%
\divide \@tempskipa by 2
\vskip -\@tempskipa
\vskip\z@skip
\else
\addpenalty\@secpenalty\addvspace\@tempskipa
\fi
\@ifstar
{\@ssect{#3}{#4}{#5}{#6}}%
{\@dblarg{\@sect{#1}{#2}{#3}{#4}{#5}{#6}}}}
\newcommand{\XESPDsectAlignLeft}{%
\let\\\@centercr\@rightskip\@flushglue \rightskip\@rightskip%
\leftskip\z@skip}
\newcommand{\XESPDsectAlignRight}{%
\let\\\@centercr\rightskip\z@skip\leftskip\@flushglue
\parindent\z@\parfillskip\z@skip}
\newcommand{\XESPDsectAlignCenter}{%
\let\\\@centercr
\rightskip\@flushglue\leftskip\@flushglue
\parindent\z@\parfillskip\z@skip}
\newcommand{\XESPDsectionAlign}{\XESPDsectAlignLeft}
\newcommand{\XESPDsubsectionAlign}{\XESPDsectAlignLeft}
\newcommand{\XESPDsubsubsectionAlign}{\XESPDsectAlignLeft}
\newcommand{\XESPDsectAlign}[2]{%
\expandafter\renewcommand\csname\string XESPD#1Align\endcsname{%
\@nameuse{XESPDsectAlign#2}}}
2020-03-14 18:07:06 +00:00
\newcommand{\XESPDsectionStyle}{\normalfont\normalsize\MakeUppercase}
\newcommand{\XESPDsubsectionStyle}{\normalfont\normalsize}
\newcommand{\XESPDsubsubsectionStyle}{\normalfont\normalsize}
2020-03-14 11:58:37 +00:00
\newcommand{\XESPDsectStyle}[2]{%
\expandafter\renewcommand\csname\string XESPD#1Style\endcsname{#2}}
\newlength{\XESPDsectionSkipBefore}
\newlength{\XESPDsectionSkipAfter}
2020-03-14 18:07:06 +00:00
\setlength{\XESPDsectionSkipBefore}{-5mm \@plus -3mm \@minus -2mm}
\setlength{\XESPDsectionSkipAfter}{5mm \@plus 1mm \@minus 2mm}
2020-03-14 11:58:37 +00:00
\newlength{\XESPDsubsectionSkipBefore}
\newlength{\XESPDsubsectionSkipAfter}
2020-03-14 18:07:06 +00:00
\setlength{\XESPDsubsectionSkipBefore}{-6pt \@plus -0mm \@minus -0mm}
\setlength{\XESPDsubsectionSkipAfter}{6pt \@plus 0mm \@minus 0mm}
2020-03-14 11:58:37 +00:00
\newlength{\XESPDsubsubsectionSkipBefore}
\newlength{\XESPDsubsubsectionSkipAfter}
2020-03-14 18:07:06 +00:00
\setlength{\XESPDsubsubsectionSkipBefore}{-6pt \@plus -0mm \@minus -0mm}
\setlength{\XESPDsubsubsectionSkipAfter}{6pt \@plus 0mm \@minus 0mm}
2020-03-14 11:58:37 +00:00
\providecommand{\plus}{\@plus}
\providecommand{\minus}{\@minus}
\newcommand{\XESPDsectSkip}[3]{%
\expandafter\setlength\csname\string XESPD#1SkipBefore\endcsname{#2}%
\expandafter\setlength\csname\string XESPD#1SkipAfter\endcsname{#3}}
\renewcommand\section{\@startsection {section}{1}{\parindent}%
{\XESPDsectionSkipBefore}%
{\XESPDsectionSkipAfter}%
{\XESPDsectionAlign\XESPDsectionStyle}}
\renewcommand\subsection{\@startsection{subsection}{2}{\parindent}%
{\XESPDsubsectionSkipBefore}%
{\XESPDsubsectionSkipAfter}%
{\XESPDsubsectionAlign\XESPDsubsectionStyle}}
\renewcommand\subsubsection{\@startsection{subsubsection}{3}{\parindent}%
{\XESPDsubsubsectionSkipBefore}%
{\XESPDsubsubsectionSkipAfter}%
{\XESPDsubsubsectionAlign\XESPDsubsubsectionStyle}}
2020-03-14 18:07:06 +00:00
\let\oldsection\section
\renewcommand\section{\clearpage\oldsection}
2020-03-14 11:58:37 +00:00
\renewcommand{\thesection}{\arabic{section}}
\renewcommand{\thesubsection}{\thesection.\arabic{subsection}}
\renewcommand{\thesubsubsection}{\thesubsection.\arabic{subsubsection}}
\newif\ifXESPD@point@style@single
\XESPD@point@style@singlefalse
\newcommand{\XESPD@point@style@single}{
\newcounter{point}
\renewcommand{\thepoint}{\arabic{point}}
\newcommand{\theHpoint}{\arabic{point}}
\XESPD@point@style@singletrue}
\newcommand{\XESPD@point@style@section}{
\newcounter{point}[section]
\renewcommand{\thepoint}{\thesection.\arabic{point}}
\newcommand{\theHpoint}{\theHsection.\arabic{point}}}
\newcommand{\XESPD@point@style@subsection}{
\newcounter{point}[subsection]
\renewcommand{\thepoint}{\thesubsection.\arabic{point}}
\newcommand{\theHpoint}{\theHsubsection.\arabic{point}}}
\@nameuse{XESPD@point@style@\XESPD@point@style}
\newcounter{subpoint}[point]
\newcounter{subsubpoint}[subpoint]
\renewcommand{\thesubpoint}{\thepoint.\arabic{subpoint}}
\newcommand{\theHsubpoint}{\theHpoint.\arabic{subpoint}}
\renewcommand{\thesubsubpoint}{\thesubpoint.\arabic{subsubpoint}}
\newcommand{\theHsubsubpoint}{\theHsubpoint.\arabic{subsubpoint}}
\newcommand{\point}{%
2020-03-14 18:07:06 +00:00
\par\refstepcounter{point}\thepoint\hspace{0.45em}}
2020-03-14 11:58:37 +00:00
\newcommand{\subpoint}{%
2020-03-14 18:07:06 +00:00
\par\refstepcounter{subpoint}\thesubpoint\hspace{0.45em}}
2020-03-14 11:58:37 +00:00
\newcommand{\subsubpoint}{%
2020-03-14 18:07:06 +00:00
\par\refstepcounter{subsubpoint}\thesubsubpoint\hspace{0.45em}}
\newcommand{\XESPDforeword}{\section*{\MakeTextUppercase{\XESPDforewordName{}}}}
\newcommand{\XESPDabbreviationsList}{
\section*{\MakeUppercase{\XESPDabbreviationsListName{}}}
\pdfbookmark[1]{\XESPDabbreviationsListName{}}{toc}
\addcontentsline{toc}{section}{\XESPDabbreviationsListName{}}}
2020-03-14 11:58:37 +00:00
\newcounter{appendix}
\renewcommand{\theappendix}{\Asbuk{appendix}}
\newlength{\XESPDappendixSkip}
\setlength{\XESPDappendixSkip}{15mm \@plus 3mm \@minus 10mm}
\newcommand{\XESPDappendix}[2]{%
\XESPDclearDoublePage%
\refstepcounter{appendix}%
\setcounter{point}{0}%
\ifXESPD@point@style@single%
\renewcommand{\thepoint}{\theappendix.\arabic{point}}%
\fi
\setcounter{section}{0}%
\renewcommand{\thesection}{\theappendix.\arabic{section}}%
\setcounter{equation}{0}%
\renewcommand{\theequation}{\theappendix.\arabic{equation}}%
\setcounter{figure}{0}%
\renewcommand{\thefigure}{\theappendix.\arabic{figure}}%
\setcounter{table}{0}%
\renewcommand{\thetable}{\theappendix.\arabic{table}}%
\addcontentsline{toc}{section}{\appendixname\ \theappendix\ #2}%
\begin{list}{}{%
\setlength{\itemindent}{0mm}%
\setlength{\labelwidth}{0mm}%
\setlength{\labelsep}{0mm}%
\setlength{\leftmargin}{0mm}%
\setlength{\topsep}{0mm}%
\setlength{\parskip}{0mm}%
\setlength{\partopsep}{0mm}%
\setlength{\itemsep}{0mm}%
\setlength{\parsep}{0mm}}
\item\centering\appendixname\ \theappendix
\ifx#1\@empty\else\\(#1)\fi\\
\item\centering\bf #2
\end{list}%
\par\nobreak\addvspace{\XESPDappendixSkip}}
2020-03-14 18:07:06 +00:00
%\renewcommand\tableofcontents{%
% \begingroup
% \XESPDsectAlign{section}{Center}
% \section*{\contentsname
% \@mkboth{%
% \MakeUppercase\contentsname}{\MakeUppercase\contentsname}}%
% \endgroup
% \@starttoc{toc}}
\RequirePackage[style]{abstract}
\renewcommand{\abstitlestyle}[1]{\center\normalsize\MakeUppercase #1}
\XESPDsectAlign{section}{Center}
\makeatletter
2020-03-20 20:17:42 +00:00
\renewcommand*{\@seccntformat}[1]{\csname the#1\endcsname.\hspace{0.9em}}
2020-03-14 18:07:06 +00:00
\makeatother
\RequirePackage[titles]{tocloft}
\renewcommand{\cftsecfont}{\normalfont\normalsize}
\renewcommand{\cftsubsecfont}{\normalfont\normalsize}
\renewcommand{\cftsubsubsecfont}{\normalfont\normalsize}
\renewcommand{\cftsecpagefont}{\normalfont\normalsize}
\renewcommand{\cftsubsecpagefont}{\normalfont\normalsize}
\renewcommand{\cftsubsubsecpagefont}{\normalfont\normalsize}
\renewcommand{\cftsecaftersnum}{.}
\renewcommand{\cftsubsecaftersnum}{.}
\renewcommand{\cftsubsubsecaftersnum}{.}
\renewcommand{\cftsecafterpnum}{\vskip0pt}
\renewcommand{\cftsubsecafterpnum}{\vskip0pt}
\renewcommand{\cftsubsubsecafterpnum}{\vskip0pt}
\renewcommand{\cftbeforesecskip}{0pt}
\renewcommand{\cftbeforesubsecskip}{0pt}
\renewcommand{\cftbeforesubsubsecskip}{0pt}
\renewcommand{\cftdot}{}
2020-03-14 11:58:37 +00:00