%% 
%% This is file `typearea.sty',
%% generated with the docstrip utility.
%% 
%% The original source files were:
%% 
%% scrclass.dtx  (with options: `typearea')
%% 
%% Copyright 1994-1996 Markus Kohm and Frank Neukam. 
%% All rights reserved. For further copyright information see the file 
%% readme.txt or liesmich.txt, and any other copyright indicated in this 
%% file. 
%% 
%% This file is part of the LaTeX2e KOMA-Script bundle. 
%% ---------------------------------------------------- 
%% 
%% The KOMA-Script bundle 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/12/01]
\ProvidesPackage{typearea}
              [1996/11/09 v2.4h LaTeX2e KOMA
               package]
\typeout{Package: typearea, Copyright (C) Frank Neukam, 1992-1994
      ^^J\space\space\space\space\space\space\space\space\space
         \space\space\space\space\space\space\space\space\space\space
                            Copyright (C) Markus Kohm, 1994-1996}
\newif\if@hincl
\newif\if@fincl
\newcommand*\SetDIVList[1]{\def\ta@divlist{#1}}
\newdimen\ta@bcor
\def\@BCOR{\@ifnextchar B{\@@BCOR}{\@DIV}}
\def\@@BCOR B{\@ifnextchar C{\@@@BCOR}{\ta@TraceError B}}
\def\@@@BCOR C{\@ifnextchar O{\@@@@BCOR}{\ta@TraceError BC}}
\def\@@@@BCOR O{\@ifnextchar R{\@v@BCOR}{\ta@TraceError BCO}}
\def\@v@BCOR R{\@ifnextchar .{\@vi@BCOR}
               {\@ifnextchar 0{\@vi@BCOR}
                {\@ifnextchar 1{\@vi@BCOR}
                 {\@ifnextchar 2{\@vi@BCOR}
                  {\@ifnextchar 3{\@vi@BCOR}
                   {\@ifnextchar 4{\@vi@BCOR}
                    {\@ifnextchar 5{\@vi@BCOR}
                     {\@ifnextchar 6{\@vi@BCOR}
                      {\@ifnextchar 7{\@vi@BCOR}
                       {\@ifnextchar 8{\@vi@BCOR}
                        {\@ifnextchar 9{\@vi@BCOR}
                         {\ta@TraceError BCOR}}}}}}}}}}}}
\def\@vi@BCOR#1|{\ta@bcor#1}
\newcount\ta@div
\def\@DIV{\@ifnextchar D{\@@DIV}{\ta@TraceError}}
\def\@@DIV D{\@ifnextchar I{\@@@DIV}{\ta@TraceError D}}
\def\@@@DIV I{\@ifnextchar V{\@@@@DIV}{\ta@TraceError DI}}
\def\@@@@DIV V{\@ifnextchar 0{\@v@DIV}
               {\@ifnextchar 1{\@v@DIV}
                {\@ifnextchar 2{\@v@DIV}
                 {\@ifnextchar 3{\@v@DIV}
                  {\@ifnextchar 4{\@v@DIV}
                   {\@ifnextchar 5{\@v@DIV}
                    {\@ifnextchar 6{\@v@DIV}
                     {\@ifnextchar 7{\@v@DIV}
                      {\@ifnextchar 8{\@v@DIV}
                       {\@ifnextchar 9{\@v@DIV}
                        {\ta@TraceError DIV}}}}}}}}}}}
\def\@v@DIV #1|{\ta@div #1}
\def\ta@TraceError#1|{\PackageError{typearea}{Unknown option #1}
                      {You've used an unknown option.\MessageBreak
                       Read the KOMA-Script-documentation for further
                       information.}}
\DeclareOption{headinclude}{\@hincltrue}
\DeclareOption{headexclude}{\@hinclfalse}
\DeclareOption{footinclude}{\@fincltrue}
\DeclareOption{footexclude}{\@finclfalse}
\DeclareOption{a4paper}
   {\setlength\paperheight {297mm}%
    \setlength\paperwidth  {210mm}}
\DeclareOption{a5paper}
   {\setlength\paperheight {210mm}%
    \setlength\paperwidth  {148mm}}
\DeclareOption{b5paper}
   {\setlength\paperheight {250mm}%
    \setlength\paperwidth  {176mm}}
\DeclareOption{letterpaper}
   {\setlength\paperheight {11in}%
    \setlength\paperwidth  {8.5in}}
\DeclareOption{legalpaper}
   {\setlength\paperheight {14in}%
    \setlength\paperwidth  {8.5in}}
\DeclareOption{executivepaper}
   {\setlength\paperheight {10.5in}%
    \setlength\paperwidth  {7.25in}}
\DeclareOption{landscape}
   {\setlength\@tempdima   {\paperheight}%
    \setlength\paperheight {\paperwidth}%
    \setlength\paperwidth  {\@tempdima}}
\DeclareOption{DIVcalc}{\providecommand\ta@divlist{{1}{1}{1}}}
\if@compatibility\else
  \DeclareOption*{\expandafter\@BCOR\CurrentOption|}
\fi
\InputIfFileExists{typearea.cfg}
           {\typeout{***************************************^^J%
                     * Local config file typearea.cfg used^^J%
                     ***************************************}}
           {}
\ExecuteOptions{headexclude,footexclude,a4paper}
\ProcessOptions\relax
\providecommand\ta@divlist{{8}{10}{12}}
\newdimen\ta@hblk
\newdimen\ta@vblk
\newdimen\ta@temp
\newcommand*\typearea[2][\z@]{
 \ta@bcor #1
 \ta@div=#2
 \ifnum\ta@div=\z@
  \@ifundefined{@ptsize}{%
   \PackageWarningNoLine{typearea}{\string\@ptsize not defined!\MessageBreak
                                   Using calculated DIV}
  }{%
   \ta@divfor{\@ptsize}
  }
 \fi
 \ifnum\ta@div<4
  \setlength{\textwidth}{\paperwidth}
  \addtolength{\textwidth}{-\ta@bcor}
  \settowidth{\ta@hblk}{abcdefghijklmnopqrstuvwxyz}
  \multiply\ta@hblk by 66
  \settowidth{\ta@temp}{ABCDEFGHIJKLMNOPQRSTUVWXYZ}
  \multiply\ta@temp by 3
  \addtolength{\ta@hblk}{\ta@temp}
  \divide\ta@hblk by 26
  \if@twocolumn
    \addtolength{\ta@hblk}{\ta@hblk}
    \addtolength{\ta@hblk}{\columnsep}
  \fi
  \setlength{\ta@temp}{-\ta@hblk}
  \setlength{\ta@hblk}{\textwidth}
  \addtolength{\ta@hblk}{\ta@temp}
  \divide\ta@hblk by 3
  \ta@temp14pt
  \ifdim\ta@hblk<\ta@temp\ta@hblk\ta@temp\fi
  \ta@div=6
  \setlength{\ta@temp}{\textwidth}
  \divide\ta@temp by \ta@div
  \@whiledim\ta@temp>\ta@hblk
   \do{\advance\ta@div by \@ne
       \setlength{\ta@temp}{\textwidth}
       \divide\ta@temp by \ta@div}
  \ifnum\ta@div>6
   \setlength{\@tempdima}{\ta@hblk}\addtolength{\@tempdima}{-\ta@temp}
   \ifdim\@tempdima<\z@\setlength{\@tempdima}{-\@tempdima}\fi
   \advance\ta@div by -1
   \ta@temp\textwidth\divide\ta@temp by \ta@div
   \setlength{\@tempdimb}{\ta@hblk}\addtolength{\@tempdimb}{-\ta@temp}
   \ifdim\@tempdimb<\z@\setlength{\@tempdimb}{-\@tempdimb}\fi
   \ifdim\@tempdima<\@tempdimb\advance\ta@div by\@ne\fi
  \fi
  \ifdim\paperheight<\textwidth
   \ta@vblk\paperheight\divide\ta@vblk by \ta@div
   \ta@temp14pt
   \@whiledim\ta@vblk<\ta@temp
    \do{\ifnum\ta@div>6
         \advance\ta@div by -\@ne
         \ta@vblk\paperheight
         \divide\ta@vblk by \ta@div
        \else
         \ta@temp\ta@vblk
        \fi}
  \fi
 \fi
 \ta@hblk \paperwidth
 \advance \ta@hblk by -\ta@bcor
 \divide\ta@hblk by \ta@div
 \oddsidemargin -1in
 \evensidemargin -1in
 \if@twoside
  \advance\oddsidemargin by \ta@hblk
  \advance\oddsidemargin by \ta@bcor
  \advance\evensidemargin by 2\ta@hblk
 \else
  \advance\oddsidemargin by 1.5\ta@hblk
  \advance\oddsidemargin by \ta@bcor
  \evensidemargin\oddsidemargin
 \fi
 \textwidth \paperwidth
 \advance\textwidth by -\ta@bcor
 \advance\textwidth by -3\ta@hblk
\@ifundefined{ta@hh}{
  \headheight 15\p@
  \advance\headheight \@ptsize\p@
 }{\headheight\ta@hh}
 \headsep 1.5\baselineskip
 \footskip 3.5\baselineskip
 \ta@vblk \paperheight
 \divide\ta@vblk by \ta@div
 \ta@temp \paperheight
 \advance\ta@temp by -3\ta@vblk
 \if@hincl
  \advance\ta@temp by -\headheight
  \advance\ta@temp by -\headsep
 \fi
 \if@fincl
  \advance\ta@temp by -\footskip
 \fi
 \textheight \topskip
 \@whiledim\textheight<\ta@temp
  \do{\advance\textheight by \baselineskip}
 \topmargin \ta@vblk
 \advance\topmargin by -1in
 \if@hincl \else
  \advance\topmargin by -\headheight
  \advance\topmargin by -\headsep
 \fi
 \if@twoside
  \marginparwidth 1.5\ta@hblk
 \else
  \marginparwidth \ta@hblk
 \fi
 \PackageInfo{typearea}{%
    These are the values describing the layout:\MessageBreak
    DIV\space\space=\space\number\ta@div\MessageBreak
    BCOR\space=\space\the\ta@bcor\MessageBreak
    \string\paperwidth\space\space\space\space\space\space=%
                         \space\the\paperwidth\MessageBreak
    \space\string\textwidth\space\space\space\space\space\space=%
                         \space\the\textwidth\MessageBreak
    \space\string\evensidemargin\space=%
                         \space\the\evensidemargin\MessageBreak
    \space\string\oddsidemargin\space=%
                         \space\the\oddsidemargin\MessageBreak
    \string\paperheight\space\space\space\space\space=%
                         \space\the\paperheight\MessageBreak
    \space\string\textheight\space\space\space\space\space=%
                         \space\the\textheight\MessageBreak
    \space\string\topmargin\space\space\space\space\space\space=%
                         \space\the\topmargin\MessageBreak
    \space\string\headheight\space\space\space\space\space=%
                         \space\the\headheight\MessageBreak
    \space\string\headsep\space\space\space\space\space\space\space\space=%
                         \space\the\headsep\MessageBreak
    \space\string\topskip\space\space\space\space\space\space\space\space=%
                         \space\the\topskip\MessageBreak
    \space\string\textheight\space\space\space\space\space=%
                         \space\the\textheight\MessageBreak
    \space\string\footskip\space\space\space\space\space\space\space=%
                         \space\the\footskip\MessageBreak
  }
 \marginparsep 1cc
 \marginparpush 0.45\baselineskip}
\newcommand*\areaset[3][\z@]{
 \ta@bcor #1
 \textwidth #2
 \textheight #3
 \ta@hblk \paperwidth
 \advance\ta@hblk by -\ta@bcor
 \advance\ta@hblk by -\textwidth
 \divide\ta@hblk by 3
 \oddsidemargin -1in
 \evensidemargin -1in
 \if@twoside
  \advance\oddsidemargin by \ta@hblk
  \advance\oddsidemargin by \ta@bcor
  \advance\evensidemargin by 2\ta@hblk
 \else
  \advance\oddsidemargin by 1.5\ta@hblk
  \advance\oddsidemargin by \ta@bcor
  \evensidemargin\oddsidemargin
 \fi
 \headheight 15\p@
 \advance\headheight \@ptsize\p@
 \headsep 1.5\baselineskip
 \footskip 3.5\baselineskip
 \ta@vblk \paperheight
 \advance\ta@vblk by -\textheight
 \divide\ta@vblk by 3
 \if@hincl
  \advance\textheight by -\headheight
  \advance\textheight by -\headsep
 \fi
 \if@fincl
  \advance\textheight by -\footskip
 \fi
 \topmargin \ta@vblk
 \advance\topmargin by -1in
 \if@hincl \else
  \advance\topmargin by -\headheight
  \advance\topmargin by -\headsep
 \fi
 \if@twoside
  \marginparwidth 1.5\ta@hblk
 \else
  \marginparwidth \ta@hblk
 \fi
 \marginparsep 1cc
 \marginparpush 0.45\baselineskip}
\def\ta@divfor#1{
 \xdef\@tempa{\ta@divlist{}}
 \ta@div=#1\relax
 \@whilenum \ta@div >0 \do {%
  \ifx\@tempa\empty \relax%
   \else \xdef\@tempa{\expandafter\@cdr\@tempa\@nil}%
  \fi
  \advance\ta@div by -1 %
 }
 \ifx\@tempa\empty %
  \PackageWarningNoLine{typearea}{%
              DIV for 1#1pt and used papersize\MessageBreak
              not defined!\MessageBreak
              Using calculated DIV}
  \ta@div=1
 \else %
  \xdef\@tempa{\expandafter\@car\@tempa\@nil}
  \ta@div=\@tempa\relax
 \fi}
\typearea[\ta@bcor]{\ta@div}
\endinput
%% 
%% End of file `typearea.sty'.
