%%
%% This is file `scrpage.sty',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% scrpage.dtx  (with options: `scrpage')
%% 
%% Copyright 1994-1996 Markus Kohm.
%% All rights reserved. For further copyright information see the file
%% legal.txt, and any other copyright indicated in this file.
%% 
%% This file is part of the LaTeX2e KOMA-Script-bundle.
%% ----------------------------------------------------
%% 
%% The KOMA-Script-bundle (but not this file) bases on the
%% Script-family created by Frank Neukam 1993 and the standard
%% documents classes created by the LaTeX3-Team 1994-1996.
%% -------------------------------------------------------------
%% 
%%  This system is distributed in the hope that it will be useful,
%%  but WITHOUT ANY WARRANTY; without even the implied warranty of
%%  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
%% 
%% 
%% IMPORTANT NOTICE:
%% 
%% For error reports in case of UNCHANGED versions see documentation.
%% 
%% Please do not request updates from us directly. Distribution is
%% done through Mail-Servers, Mailboxes and TeX organizations.
%% 
%% You are not allowed to change this file.
%% 
%% You are allowed to distribute this file under the condition that
%% it is distributed together with all files mentioned in readme.txt
%% and liesmich.txt.
%% 
%% If you receive only some of these files from someone, complain!
%% 
%% You are NOT ALLOWED to distribute this file alone.  You are NOT
%% ALLOWED to take money for the distribution or use of either this
%% file or a changed version, except for a nominal charge for copying
%% etc.
%% 
\NeedsTeXFormat{LaTeX2e}[1995/06/01]
\ProvidesPackage{scrpage}
                [1996/12/07 v1.2a LaTeX2e KOMA
                 package]
\DeclareOption{headinclude}{\PassOptionsToPackage{headinclude}{typearea}}
\DeclareOption{headexclude}{\PassOptionsToPackage{headexclude}{typearea}}
\DeclareOption{footinclude}{\PassOptionsToPackage{footinclude}{typearea}}
\DeclareOption{footexclude}{\PassOptionsToPackage{footexclude}{typearea}}
\ExecuteOptions{headinclude,footinclude}
\ProcessOptions
\newif\if@chapter
\ifx\chapter\undefined \@chapterfalse\else\@chaptertrue\fi
\def\@tempa{\newif\if@mainmatter\@mainmattertrue}
\ifx\mainmatter\undefined\else\let\@tempa\relax\fi
\@tempa
\let\headmark\relax
\DeclareRobustCommand\pagemark{{\pnumfont\thepage}}
\def\defpagestyle{%
  \@ifstar
  {\@defpagestyle[-]}%
  {\@defpagestyle[+]}}
\if@twoside
  \def\@defpagestyle[#1]#2#3#4{%
    \expandafter\def\csname ps@#2\endcsname{%
      \def\@tempa{+}%
      \def\@tempb{#1}%
      \ifx\@tempa\@tempb
        \let\@mkboth\markboth
        \if@chapter
          \def\chaptermark####1{%
            \markboth {\ifnum \c@secnumdepth >\m@ne%
              \if@mainmatter\chaptermarkformat\fi\fi ####1}{%
              \ifnum \c@secnumdepth >\m@ne%
              \if@mainmatter\chaptermarkformat\fi\fi ####1}}%
          \def\sectionmark####1{%
            \markright {\ifnum \c@secnumdepth >\z@%
              \sectionmarkformat\fi ####1}}
        \else
          \def\sectionmark####1{%
            \markboth {\ifnum \c@secnumdepth >\z@%
              \sectionmarkformat\fi ####1}{%
              \ifnum \c@secnumdepth >\z@%
              \sectionmarkformat\fi ####1}}
          \def\subsectionmark####1{%
            \markright {\ifnum \c@secnumdepth >\@ne%
              \subsectionmarkformat\fi ####1}}
        \fi
      \else
        \let\@mkboth\@gobbletwo
        \if@chapter
          \def\chaptermark####1{}
        \else
          \def\subsectionmark####1{}
        \fi
        \def\sectionmark####1{}
      \fi
      \def@twosidehead#3
      \def@twosidefoot#4
    }
  }
\else
  \def\@defpagestyle[#1]#2#3#4{%
    \expandafter\def\csname ps@#2\endcsname{%
      \def\@tempa{+}%
      \def\@tempb{#1}%
      \ifx\@tempa\@tempb
        \let\@mkboth\markboth
        \if@chapter
          \def\chaptermark####1{%
            \markright {\ifnum \c@secnumdepth >\m@ne%
              \if@mainmatter\chaptermarkformat\fi\fi ####1}}%
          \def\sectionmark####1{}
        \else
          \def\sectionmark####1{%
            \markright{\ifnum \c@secnumdepth >\z@%
              \sectionmarkformat\fi ####1}}
          \def\subsectionmark####1{}
        \fi
      \else
        \let\@mkboth\@gobbletwo
        \if@chapter
          \def\chaptermark####1{}
        \else
          \def\subsectionmark####1{}
        \fi
        \def\sectionmark####1{}
      \fi
      \def@onesidehead#3
      \def@onesidefoot#4
    }
  }
\fi
\def\def@twosidehead(#1,#2)#3#4#5(#6,#7){
  \def\@evenhead{\let\headmark\leftmark%
    \vbox{\hsize=\textwidth
      \hf@rule{#1}{#2}\vskip#2
      \vskip\baselineskip\hb@xt@\textwidth{{\headfont\strut #3}}
      \hf@rule{#6}{#7}
  }}
  \def\@oddhead{\let\headmark\rightmark%
    \vbox{\hsize=\textwidth
      \hf@rule{#1}{#2}\vskip#2
      \vskip\baselineskip\hb@xt@\textwidth{{\headfont\strut #4}}
      \hf@rule{#6}{#7}
  }}
}
\def\def@onesidehead(#1,#2)#3#4#5(#6,#7){
  \def\@evenhead{}
  \def\@oddhead{\let\headmark\rightmark%
    \vbox{\hsize=\textwidth
      \hf@rule{#1}{#2}\vskip#2
      \vskip\baselineskip\hb@xt@\textwidth{{\headfont\strut #5}}
      \hf@rule{#6}{#7}
  }}
}
\def\def@twosidefoot(#1,#2)#3#4#5(#6,#7){
  \def\@evenfoot{\let\headmark\leftmark%
    \vbox{\hsize=\textwidth
      \topfoot@rule{#1}{#2}\hb@xt@\textwidth{{\headfont\strut #3}}
      \botfoot@rule{#6}{#7}}}
  \def\@oddfoot{\let\headmark\rightmark%
    \vbox{\hsize=\textwidth
      \topfoot@rule{#1}{#2}\hb@xt@\textwidth{{\headfont\strut #4}}
      \botfoot@rule{#6}{#7}}}
}
\def\def@onesidefoot(#1,#2)#3#4#5(#6,#7){
  \def\@evenfoot{}
  \def\@oddfoot{\let\headmark\rightmark%
    \vbox{\hsize=\textwidth
      \topfoot@rule{#1}{#2}\hb@xt@\textwidth{{\headfont\strut #5}}
      \botfoot@rule{#6}{#7}}}
}
\newcommand\topfoot@rule[2]{%
  \@tempdima\baselineskip\advance\@tempdima by-.7\normalbaselineskip
  \advance\@tempdima by -#2
  \vskip\@tempdima\hf@rule{#1}{#2}\vskip-\@tempdima}
\newcommand\botfoot@rule[2]{%
  \@tempdima-\baselineskip\advance\@tempdima by .3\normalbaselineskip
  \advance\@tempdima by #2
  \vskip\@tempdima\hf@rule{#1}{#2}}
\newcommand\hf@rule[2]{%
  \@tempdimb#1
  \hb@xt@\textwidth{\hfill%
    \llap{\vrule\@depth#2\@height\z@\@width.5\@tempdimb}%
    \rlap{\vrule\@depth#2\@height\z@\@width.5\@tempdimb}%
    \hfill}}
\def\newpagestyle{%
  \@ifstar
  {\@newpagestyle[-]}%
  {\@newpagestyle[+]}}
\def\@newpagestyle[#1]#2#3#4{
  \expandafter\ifx\csname ps@#2\endcsname\relax
    \@defpagestyle[#1]{#2}{#3}{#4}
  \else
    \PackageError{scrpage}{Your command was ignored}%
      {There is already a pagestyle named ``#1''.\MessageBreak%
       Use \protect\defpagestyle\space, \protect\renewpagestyle or
       \protect\provide\pagestyle.}
  \fi
}
\def\renewpagestyle{%
  \@ifstar
  {\@renewpagestyle[-]}%
  {\@renewpagestyle[+]}}
\def\@renewpagestyle[#1]#2#3#4{
  \begingroup\expandafter\expandafter\expandafter\endgroup
  \expandafter\ifx\csname ps@#2\endcsname\relax
    \PackageError{scrpage}{Your command was ignored}%
      {There is no pagestyle named ``#1''.\MessageBreak%
       Use \protect\defpagestyle, \protect\newpagestyle or
       \protect\providepagestyle.}
  \else
    \@defpagestyle[#1]{#2}{#3}{#4}
  \fi
}
\def\providepagestyle{%
  \@ifstar
  {\@providepagestyle[-]}%
  {\@providepagestyle[+]}}
\def\@providepagestyle[#1]#2#3#4{
  \expandafter\ifx\csname ps@#2\endcsname\relax
    \@defpagestyle[#1]{#2}{#3}{#4}
  \else
    \PackageInfo{scrpage}{\protect\providepagestyle\protect{#1\protect}
                          ignored.}
  \fi
}
\def\deftripstyle{%
  \@ifstar
  {\@deftripstyle[-]}%
  {\@deftripstyle[+]}}
\def\@deftripstyle[#1]#2{%
  \@ifnextchar[
  {\@@deftripstyle[#1]{#2}}%
  {\@@deftripstyle[#1]{#2}[\z@]}}
\def\@@deftripstyle[#1]#2[#3]{
  \def\@tempa{#1}
  \@ifnextchar[
  {\@@@deftripstyle#2[#3]}%
  {\@@@deftripstyle#2[\z@][#3]}}
\def\@@@deftripstyle#1[#2][#3]#4#5#6#7#8#9{%
  \def\@tempb{+}
  \ifx\@tempa\@tempb%
    \defpagestyle{#1}%
      {(\textwidth,#2)%
       {\rlap{#6}\hfill{#5}\hfill\llap{#4}}%
       {\rlap{#4}\hfill{#5}\hfill\llap{#6}}%
       {\rlap{#4}\hfill{#5}\hfill\llap{#6}}%
       (\textwidth,#3)}
      {(\textwidth,#3)%
       {\rlap{#9}\hfill{#8}\hfill\llap{#7}}%
       {\rlap{#7}\hfill{#8}\hfill\llap{#9}}%
       {\rlap{#7}\hfill{#8}\hfill\llap{#9}}%
       (\textwidth,#2)}
  \else
    \defpagestyle*{#1}%
      {(\textwidth,#2)%
       {\rlap{#6}\hfill{#5}\hfill\llap{#4}}%
       {\rlap{#4}\hfill{#5}\hfill\llap{#6}}%
       {\rlap{#4}\hfill{#5}\hfill\llap{#6}}%
       (\textwidth,#3)}
      {(\textwidth,#3)%
       {\rlap{#9}\hfill{#8}\hfill\llap{#7}}%
       {\rlap{#7}\hfill{#8}\hfill\llap{#9}}%
       {\rlap{#7}\hfill{#8}\hfill\llap{#9}}%
       (\textwidth,#2)}
  \fi
}
\providecommand\pnumfont{\normalfont}
\providecommand\headfont{\normalfont}
\if@chapter
  \providecommand\chaptermarkformat    {\thechapter\quad}
  \providecommand\sectionmarkformat    {\thesection\quad}
\else
  \providecommand\sectionmarkformat    {\thesection\quad}
  \providecommand\subsectionmarkformat {\thesubsection\quad}
\fi
\InputIfFileExists{scrpage.cfg}
           {\typeout{*************************************^^J%
                     * Local config file scrpage.cfg used^^J%
                     *************************************}}
           {}
\endinput
%%
%% End of file `scrpage.sty'.
