% 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{xespdtitle}[2020/03/20 v1.00 Title GOST 2.105]

\RequirePackage{xespdstamp}
\RequirePackage{xespdlang}
\RequirePackage{xespdinfo}
\RequirePackage{xespdtotal}
\RequirePackage{xespdtitlebase}
\RequirePackage{ifthen}

\newcommand{\XESPD@title@split@field}[2]{%
  \parbox[t]{.4\hsize}{\raggedright#1}\hfill
  \parbox[t]{.4\hsize}{\raggedright#2}}

\renewcommand{\XESPDtheTitleFieldI}{%
  \XESPDtheDepartment\par\XESPDtheCompany}

\def\XESPDtheTitleFieldIIl{}
\renewcommand{\XESPDtheTitleFieldIIl}{%
  \XESPDtheClassCode}
\def\XESPDtheTitleFieldIIr{}
\renewcommand{\XESPDtheTitleFieldIIr}{}
\renewcommand{\XESPDtheTitleFieldII}{%
  \XESPD@title@split@field{\XESPDtheTitleFieldIIl}{\XESPDtheTitleFieldIIr}}

\def\XESPDtheTitleFieldIIIl{}
\renewcommand{\XESPDtheTitleFieldIIIl}{%
  \ifx\XESPD@title@approving@sheet\@undefined
    \expandafter\ifx\csname XESPD@title@agreed@name@1\endcsname\relax\else
      \text{\MakeUppercase{\XESPDagreedName}}\\
      \XESPD@title@make@stamp{agreed}{1}
    \fi
  \else
    \textrm{\MakeUppercase{\XESPDapprovedName}}\\
    \XESPD@title@approving@sheet
  \fi}
\def\XESPDtheTitleFieldIIIr{}
\renewcommand{\XESPDtheTitleFieldIIIr}{%
  \ifx\XESPD@title@approving@sheet\@undefined
    \expandafter\ifx\csname XESPD@title@approved@name@1\endcsname\relax\else
      \text{\MakeUppercase{\XESPDapprovingName}}\\
      \XESPD@title@make@stamp{approved}{1}
    \fi
  \fi}
\renewcommand{\XESPDtheTitleFieldIII}{%
  \XESPD@title@split@field{\XESPDtheTitleFieldIIIl}{\XESPDtheTitleFieldIIIr}}

\renewcommand{\XESPDtheTitleFieldIV}{%
    {\MakeUppercase{\XESPDtheTitle}\par\XESPDtheDocName}%
}

\renewcommand{\XESPDtheTitleFieldV}{}

\renewcommand{\XESPDtheTitleFieldVI}{%
  \MakeUppercase{\XESPDtheSignature}}

\renewcommand{\XESPDtheTitleFieldVIa}{%
  {\XESPDtheFileName}}

%\renewcommand{\XESPDtheTitleFieldVII}{}
\renewcommand{\XESPDtheTitleFieldVII}{\normalfont\cyr\CYRL\cyri\cyrs\cyrt\cyro\cyrv\ \XESPDtotal{page}}

\def\XESPDtheTitleFieldVIIIl{}
\renewcommand{\XESPDtheTitleFieldVIIIl}{%
  \ifx\XESPD@title@approving@sheet\@undefined
    \XESPD@tmpcnta = 1
    \loop
    \ifnum \XESPD@tmpcnta < \XESPD@title@agreed@cnt
      \advance \XESPD@tmpcnta 1
      \XESPD@title@make@stamp{agreed}{\number\XESPD@tmpcnta}
      \par\vspace{5mm}
    \repeat
  \fi}
\def\XESPDtheTitleFieldVIIIr{}
\renewcommand{\XESPDtheTitleFieldVIIIr}{%
  \ifx\XESPD@title@approving@sheet\@undefined
    \XESPD@tmpcnta = 0
    \loop
    \ifnum \XESPD@tmpcnta < \XESPD@title@designed@cnt
      \advance \XESPD@tmpcnta 1
      \XESPD@title@make@stamp{designed}{\number\XESPD@tmpcnta}
      \par\vspace{5mm}
    \repeat
  \fi}
\renewcommand{\XESPDtheTitleFieldVIII}{%
  \XESPD@title@split@field{\XESPDtheTitleFieldVIIIl}{\XESPDtheTitleFieldVIIIr}}

\renewcommand{\XESPDtheTitleFieldX}{\XESPDtheYear}
\renewcommand{\XESPDtheTitleFieldXI}{\cyr\CYRL\cyri\cyrt\cyre\cyrr\cyra\ \cyr\CYRO\ \cyr\CYRO$_1$}

\renewcommand{\XESPDtitleFontI}{\XESPDfontV}
\renewcommand{\XESPDtitleFontII}{\XESPDfontV}
\renewcommand{\XESPDtitleFontIII}{\XESPDfontV}
\renewcommand{\XESPDtitleFontIV}{\XESPDfontV}
\renewcommand{\XESPDtitleFontV}{\XESPDfontV}
\renewcommand{\XESPDtitleFontVI}{\XESPDfontV}
\renewcommand{\XESPDtitleFontVIa}{\XESPDfontV}
\renewcommand{\XESPDtitleFontVII}{\XESPDfontV}
\renewcommand{\XESPDtitleFontVIII}{\XESPDfontV}
\renewcommand{\XESPDtitleFontX}{\XESPDfontV}
\renewcommand{\XESPDtitleFontXI}{\XESPDfontV}

\renewcommand{\maketitle}{%
  \begin{XESPDtitlePage}
  \setlength{\topsep}{0mm}
  \noindent
  \parbox[c][.28\vsize][t]{\hsize}{%
    \begin{center}\XESPDtitleFontI\bfseries\XESPDtheTitleFieldI\end{center}
    \vspace{5mm \@plus 15mm \@minus 3mm}
	\begin{center}\XESPDtitleFontIII\XESPDtheTitleFieldIII\end{center}}
  \par\vspace{10mm \@plus 2mm \@minus 4mm}\noindent
  \parbox[c][.30\vsize][t]{\hsize}{%
    \ifthenelse{\equal{\XESPDtheTitleFieldIV}{}}{}
    {\begin{center}\XESPDtitleFontIV\XESPDtheTitleFieldIV\end{center}}
    \ifthenelse{\equal{\XESPDtheTitleFieldV}{}}{}
    {\begin{center}\XESPDtitleFontV\XESPDtheTitleFieldV\end{center}}
    \ifthenelse{\equal{\XESPDtheTitleFieldVI}{}}{}
    {\begin{center}\XESPDtitleFontVI\XESPDtheTitleFieldVI\end{center}}
    \ifthenelse{\equal{\XESPDtheTitleFieldVIa}{}}{}
    {\begin{center}\XESPDtitleFontVI\XESPDtheTitleFieldVIa\end{center}}
    \ifthenelse{\equal{\XESPDtheTitleFieldVII}{}}{}
    {\begin{center}\XESPDtitleFontVII\XESPDtheTitleFieldVII\end{center}}}
  \par\vspace{4mm \@plus 2mm \@minus 2mm}\noindent
  \begin{center}\XESPDtitleFontVIII\XESPDtheTitleFieldVIII\end{center}
  \vfill
  \begin{center}\XESPDtitleFontX\XESPDtheTitleFieldX\end{center}
  \begin{flushright}\XESPDtitleFontXI\XESPDtheTitleFieldXI\hspace{20mm}\enspace\end{flushright}% Литера
  \end{XESPDtitlePage}}

