% 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{espdplain}[2011/05/09 v0.98 Plain Page Style]

\RequirePackage{espdstamp}
\RequirePackage{setspace}
\RequirePackage{calc}

\def\ESPD@plain@vt{%
  \setlength{\ESPD@tmpdimc}{%
    \ESPDframeY+\ESPDframeH-\ESPD@padding@v}}

\def\ESPD@plain@vb{%
  \setlength{\ESPD@tmpdimc}{%
    \ESPDframeY+\ESPD@padding@v-15mm}}

\def\ESPD@plain@hl{%
  \ifESPD@twoside 
    \ifodd\c@page\raggedright\else\raggedleft\fi
  \else\raggedright\fi}

\def\ESPD@plain@hr{%
  \ifESPD@twoside
    \ifodd\c@page\raggedleft\else\raggedright\fi
  \else\raggedleft\fi}

\def\ESPD@plain@hc{\centering}

\let\ESPD@plain@ha\ESPD@plain@hc
\let\ESPD@plain@va\ESPD@plain@vb

\DeclareOption{numbertop}{\let\ESPD@plain@va\ESPD@plain@vt}
\DeclareOption{numberbottom}{\let\ESPD@plain@va\ESPD@plain@vb}
\DeclareOption{numberleft}{\let\ESPD@plain@ha\ESPD@plain@hl}
\DeclareOption{numbercenter}{\let\ESPD@plain@ha\ESPD@plain@hc}
\DeclareOption{numberright}{\let\ESPD@plain@ha\ESPD@plain@hr}

\ProcessOptions\relax

\newcommand{\ESPDdrawPlainPageNumber}{
  \setlength{\ESPD@tmpdima}{\ESPDframeX+\ESPD@padding@h}
  \setlength{\ESPD@tmpdimb}{\ESPDframeW-2\ESPD@padding@h}
  \ESPD@plain@va
  \put(\ESPDltu{\ESPD@tmpdima},\ESPDltu{\ESPD@tmpdimc}){%
    \parbox[b][20mm][c]{\ESPD@tmpdimb}{%
      \begin{singlespace}
      \reset@font\normalsize
      \ESPD@plain@ha\thepage \\ \MakeUppercase\ESPDtheSignature
      \end{singlespace}
      }}}

\ESPDnewStyle{plain}{0mm}
\ESPDputOnStyle{plain}{pagenumber}{\ESPDdrawPlainPageNumber}

\ESPDdefaultTitleStyle{empty}
\ESPDdefaultFirstStyle{plain}
\ESPDdefaultStyle{plain}

\renewcommand{\ESPDtheTitleFieldIII}{}
\renewcommand{\ESPDtheTitleFieldVII}{}
\renewcommand{\ESPDtheTitleFieldX}{}
\renewcommand{\ESPDtheTitleFieldXI}{}

