%%
%% This is file `scrpage.sty',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% scrpage.dtx  (with options: `scrpage,v1')
%% scrlogo.dtx  (with options: `logo')
%% 
%% Copyright (c) 1994-2010
%% Markus Kohm and any individual authors listed elsewhere in this file.
%% 
%% This file was generated from file(s) of the KOMA-Script bundle.
%% ---------------------------------------------------------------
%% 
%% It may be distributed under the conditions of the
%% LaTeX Project Public License in the version distributed together
%% with KOMA-Script, see file `lppl.txt' or `lppl-de.txt'.
%% 
%% This file may only be distributed together with a copy of the
%% KOMA-Script bundle.  You may however distribute the
%% KOMA-Script bundle without all such generated files.  See also
%% `lppl.txt' or `lppl-de.txt' for additional information.
%% 
%% The list of files belonging to KOMA-Script distribution is given in
%% the file `manifest.txt'.  See also `lppl.txt' or `lppl-de.txt' for
%% additional information.
%% 
%% If this file is a beta version, you may not be allowed to distribute
%% it.  Look at the comments below to see if this is the case.
%% 
%% English and German manuals are part of KOMA-Script bundle.
%% ----------------------------------------------------------
%% 
%% See `README'.
%% 
%% The KOMA-Script bundle (but maybe not this file) was based upon the
%% LaTeX 2.09 Script family created by Frank Neukam 1993 and the LaTeX2e
%% standard classes created by The LaTeX3 Project 1994-1996.  You may
%% find a complete unmodified copy of LaTeX2e at
%% <http://www.ctan.org/pub/tex-archive/macros/latex/base/>.
%% 
%%% From File: scrpage.dtx
\NeedsTeXFormat{LaTeX2e}[1995/06/01]
\ProvidesPackage{scrpage}[2008/02/29 v1.3e KOMA-Script
                 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\relax
\newif\if@chapter
\begingroup\expandafter\expandafter\expandafter\endgroup
\expandafter\ifx\csname chapter\endcsname\relax
  \@chapterfalse
\else
  \@chaptertrue
\fi
\def\@tempa{\newif\if@mainmatter\@mainmattertrue}
\begingroup\expandafter\expandafter\expandafter\endgroup
\expandafter\ifx\csname mainmatter\endcsname\relax
\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@%
              \if@mainmatter\sectionmarkformat\fi\fi ####1}{%
              \ifnum \c@secnumdepth >\z@%
              \if@mainmatter\sectionmarkformat\fi\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@%
              \if@mainmatter\sectionmarkformat\fi\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%
    \hss\hskip\@evenheadshift\vbox{\hsize=\@headwidth\relax%
      \hf@rule{#1}{#2}{\@headwidth}%
      \vskip#2
      \vskip\baselineskip
      \hb@xt@\@headwidth{{%
          \headfont\strut #3}}%
      \hf@rule{#6}{#7}{\@headwidth}%
  }\hskip\@oddheadshift\hss}%
  \def\@oddhead{\let\headmark\rightmark
    \hss\hskip\@oddheadshift\vbox{\hsize=\@headwidth\relax
      \hf@rule{#1}{#2}{\@headwidth}%
      \vskip#2%
      \vskip\baselineskip
      \hb@xt@\@headwidth{{%
          \headfont\strut #4}}%
      \hf@rule{#6}{#7}{\@headwidth}%
  }\hskip\@evenheadshift\hss}%
}
\def\def@onesidehead(#1,#2)#3#4#5(#6,#7){%
  \def\@evenhead{}%
  \def\@oddhead{\let\headmark\rightmark
    \hss\hskip\@oddheadshift\vbox{\hsize=\@headwidth\relax
      \hf@rule{#1}{#2}{\@headwidth}%
      \vskip#2%
      \vskip\baselineskip
      \hb@xt@\@headwidth{{%
          \headfont\strut #5}}%
      \hf@rule{#6}{#7}{\@headwidth}%
  }\hskip\@evenheadshift\hss}%
}
\def\def@twosidefoot(#1,#2)#3#4#5(#6,#7){%
  \def\@evenfoot{\let\headmark\leftmark
    \hss\hskip\@evenfootshift\vbox{\hsize=\@footwidth\relax
      \topfoot@rule{#1}{#2}\hb@xt@\@footwidth{{%
          \headfont\footfont\strut #3}}%
      \botfoot@rule{#6}{#7}}\hskip\@oddfootshift\hss}%
  \def\@oddfoot{\let\headmark\rightmark
    \hss\hskip\@oddfootshift\vbox{\hsize=\@footwidth\relax
      \topfoot@rule{#1}{#2}\hb@xt@\@footwidth{{%
          \headfont\footfont\strut #4}}%
      \botfoot@rule{#6}{#7}}\hskip\@evenfootshift\hss}%
}
\def\def@onesidefoot(#1,#2)#3#4#5(#6,#7){%
  \def\@evenfoot{}%
  \def\@oddfoot{\let\headmark\rightmark
    \hss\hskip\@oddfootshift\vbox{\hsize=\@footwidth\relax
      \topfoot@rule{#1}{#2}\hb@xt@\@footwidth{{%
          \headfont\footfont\strut #5}}
      \botfoot@rule{#6}{#7}}\hskip\@evenfootshift\hss}%
}

\newcommand\topfoot@rule[2]{%
  \@tempdima\baselineskip\advance\@tempdima by-.7\normalbaselineskip
  \advance\@tempdima by -#2
  \vskip\@tempdima\hf@rule{#1}{#2}{\@footwidth}%
  \vskip-\@tempdima}
\newcommand\botfoot@rule[2]{%
  \@tempdima-\baselineskip\advance\@tempdima by .3\normalbaselineskip
  \advance\@tempdima by #2
  \vskip\@tempdima\hf@rule{#1}{#2}{\@footwidth}%
}
\newcommand\hf@rule[3]{%
  \setlength{\@tempdimb}{#1}
      \setlength{\@tempdimb}{.5\@tempdimb}%
    \hb@xt@#3{%
        \hfill%
        \llap{\vrule\@depth#2\@height\z@\@width\@tempdimb}%
        \rlap{\vrule\@depth#2\@height\z@\@width\@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\providepagestyle.}%
  \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}%
      {(\@headwidth,#2)%
       {\rlap{#6}\hfill{#5}\hfill\llap{#4}}%
       {\rlap{#4}\hfill{#5}\hfill\llap{#6}}%
       {\rlap{#4}\hfill{#5}\hfill\llap{#6}}%
       (\@headwidth,#3)}%
      {(\@footwidth,#3)%
       {\rlap{#9}\hfill{#8}\hfill\llap{#7}}%
       {\rlap{#7}\hfill{#8}\hfill\llap{#9}}%
       {\rlap{#7}\hfill{#8}\hfill\llap{#9}}%
       (\@footwidth,#2)}%
  \else
    \defpagestyle*{#1}%
      {(\@headwidth,#2)%
       {\rlap{#6}\hfill{#5}\hfill\llap{#4}}%
       {\rlap{#4}\hfill{#5}\hfill\llap{#6}}%
       {\rlap{#4}\hfill{#5}\hfill\llap{#6}}%
       (\@headwidth,#3)}%
      {(\@footwidth,#3)%
       {\rlap{#9}\hfill{#8}\hfill\llap{#7}}%
       {\rlap{#7}\hfill{#8}\hfill\llap{#9}}%
       {\rlap{#7}\hfill{#8}\hfill\llap{#9}}%
       (\@footwidth,#2)}%
  \fi
}
\newcommand*{\settowidthof}[2]{%
  \edef\@tempa{#2}%
  \edef\@tempb{paper}\ifx\@tempa\@tempb
    \setlength{#1}{\paperwidth}%
  \else\edef\@tempb{text}\ifx\@tempa\@tempb
      \setlength{#1}{\textwidth}%
    \else\edef\@tempb{textwithmarginpar}\ifx\@tempa\@tempb
        \setlength{#1}{\textwidth}%
        \addtolength{#1}{\marginparwidth}%
        \addtolength{#1}{\marginparsep}%
      \else\edef\@tempb{head}\ifx\@tempa\@tempb
          \setlength{#1}{\@headwidth}%
        \else\edef\@tempb{foot}\ifx\@tempa\@tempb
            \setlength{#1}{\@footwidth}%
          \else\edef\@tempb{headtopline}\ifx\@tempa\@tempb
              \setlength{#1}{\scr@headabove@linelength}%
            \else\edef\@tempb{headsepline}\ifx\@tempa\@tempb
                \setlength{#1}{\scr@headbelow@linelength}%
              \else\edef\@tempb{footsepline}\ifx\@tempa\@tempb
                  \setlength{#1}{\scr@footabove@linelength}%
                \else\edef\@tempb{footbotline}\ifx\@tempa\@tempb
                    \setlength{#1}{\scr@footbelow@linelength}%
                  \else\edef\@tempb{page}\ifx\@tempa\@tempb
                      \setlength{#1}{\paperwidth}%
                      \begingroup\expandafter\expandafter\expandafter\endgroup
                      \expandafter\ifx\csname ta@bcor\endcsname\relax\else
                        \addtolength{#1}{-\ta@bcor}%
                      \fi
                    \else
                      \setlength{#1}{#2}%
                    \fi
                  \fi
                \fi
              \fi
            \fi
          \fi
        \fi
      \fi
    \fi
  \fi
}
\newcommand*{\deftowidthof}[2]{%
  \edef\@tempa{#2}\edef\@tempb{autohead}\ifx\@tempa\@tempb
    \expandafter\def\csname #1\endcsname{\@headwidth}%
  \else\edef\@tempb{autofoot}\ifx\@tempa\@tempb
      \expandafter\def\csname #1\endcsname{\@footwidth}%
    \else
      \settowidthof{\@tempdima}{#2}%
      \expandafter\edef\csname #1\endcsname{\the\@tempdima}%
    \fi
  \fi
}
\newcommand*{\setheadwidth}[2][\@empty]{%
  \set@hf@width{head}{#1}{#2} %
}
\newcommand*{\setfootwidth}[2][\@empty]{%
  \set@hf@width{foot}{#1}{#2}%
}
\newcommand*{\set@hf@width}[3]{%
  \settowidthof{\@tempdima}{#3}%
  \ifdim\@tempdima>\paperwidth
    \PackageWarning
      {scrpage}%
      {You've set width of #1 to a value\MessageBreak
        greater than width of page!\MessageBreak%
        I`ll reduce width of #1 to width of page}%
    \setlength{\@tempdima}{\paperwidth}%
  \else
    \ifdim\@tempdima<\z@
       \PackageWarning
         {scrpage}%
         {You've set width of #1 to negative value!\MessageBreak%
           I'll set it to 0pt}%
       \setlength{\@tempdima}{\z@}%
     \fi
  \fi
  \expandafter\edef\csname @#1width\endcsname{\the\@tempdima}%
  \edef\@tempa{#2}%
  \setlength{\@tempdima}{\textwidth}%
  \addtolength{\@tempdima}{-\csname @#1width\endcsname}%
  \ifx\@tempa\@empty
    \if@twoside
      \setlength{\@tempdimb}{.3333333333\@tempdima}%
    \else
      \setlength{\@tempdimb}{.5\@tempdima}%
    \fi
  \else
    \setlength{\@tempdimb}{#2}%
  \fi
  \addtolength{\@tempdima}{-\@tempdimb}%
  \ifdim\@tempdimb<\z@
    \setlength{\@tempdimb}{-\@tempdimb}%
    \expandafter\edef\csname @odd#1shift\endcsname{-\the\@tempdimb}%
  \else
    \expandafter\edef\csname @odd#1shift\endcsname{\the\@tempdimb}%
  \fi
  \ifdim\@tempdima<\z@
    \setlength{\@tempdima}{-\@tempdima}%
    \expandafter\edef\csname @even#1shift\endcsname{-\the\@tempdima}%
  \else
    \expandafter\edef\csname @even#1shift\endcsname{\the\@tempdima}%
  \fi
}
\newcommand*{\@headwidth}{\textwidth}%
\newcommand*{\@oddheadshift}{\z@}%
\newcommand*{\@evenheadshift}{\z@}%
\newcommand*{\@footwidth}{\textwidth}%
\newcommand*{\@oddfootshift}{\z@}%
\newcommand*{\@evenfootshift}{\z@}%
\providecommand*{\pnumfont}{\normalfont}
\providecommand*{\headfont}{\normalfont%
}
\providecommand{\partmarkformat}         {\partname\ \thepart. \ }
\if@chapter
  \providecommand{\chaptermarkformat}    {\@chapapp\ \thechapter. \ }
  \providecommand{\sectionmarkformat}    {\thesection. \ }
\else
  \providecommand{\sectionmarkformat}    {\thesection\quad}
  \providecommand{\subsectionmarkformat} {\thesubsection\quad}
\fi
\InputIfFileExists{scrpage.cfg}
           {\typeout{*************************************^^J%
                     * Local config file scrpage.cfg used^^J%
                     *************************************}}
           {}
%%% From File: scrlogo.dtx
\@ifundefined{KOMAScript}{%
  \DeclareRobustCommand{\KOMAScript}{\textsf{K\kern.05em O\kern.05em%
      M\kern.05em A\kern.1em-\kern.1em Script}}}{}
\endinput
%%
%% End of file `scrpage.sty'.
