%%
%% This is file `geometry.sty',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% geometry.dtx  (with options: `package')
%% 
%% geometry.dtx Copyright (C) 1996,1997,1998
%% Hideo Umeki (hideo.umeki@toshiba.co.jp)
%%
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{geometry}[1998/04/08 v2.0a Page Geometry]
\RequirePackage{keyval}
\newif\ifGeom@verbose
\newif\ifGeom@landscape
\newif\ifGeom@nohead
\newif\ifGeom@nofoot
\newif\ifGeom@includemp
\newif\ifGeom@passincmp
\newif\ifGeom@hbody
\newif\ifGeom@vbody
\newif\ifGeom@dvips
\newif\ifGeom@pdftex
\newcount\geom@cnth
\newcount\geom@cntv
\def\geom@warning#1{%
  \ifGeom@verbose\PackageWarningNoLine{geometry}{#1}\fi}
\def\Geom@Dhscale{0.8}
\def\Geom@Dvscale{0.9}
\def\Geom@Dtwosideshift{20pt}
\def\geom@init{%
  \Geom@hbodyfalse
  \Geom@vbodyfalse
  \let\Geom@width\undefined
  \let\Geom@height\undefined
  \let\Geom@textwidth\undefined
  \let\Geom@textheight\undefined
  \let\Geom@hscale\undefined
  \let\Geom@vscale\undefined
  \let\Geom@lmargin\undefined
  \let\Geom@rmargin\undefined
  \let\Geom@tmargin\undefined
  \let\Geom@bmargin\undefined
  \def\Geom@twosideshift{\Geom@Dtwosideshift}%
  \@twosidefalse
  \@mparswitchfalse
  \Geom@verbosefalse
  \Geom@landscapefalse
  \Geom@noheadfalse
  \Geom@nofootfalse
  \Geom@includempfalse
  \Geom@passincmpfalse
  \Geom@dvipsfalse
  \geom@initpdftex}
\def\geom@initpdftex{%
\ifx\undefined\pdfpagewidth
  \Geom@pdftexfalse
\else
  \ifnum\pdfoutput=1\relax\Geom@pdftextrue\else\Geom@pdftexfalse\fi
\fi}
\def\geom@setbool#1#2{%
  \csname #2\ifx\relax#1\relax true\else#1\fi\endcsname}
\def\geom@checkbool#1{%
  \csname ifGeom@#1\endcsname #1\space\else\fi}
\def\geom@detiv#1#2#3#4{% determine #4.
  \setlength\@tempdima{\@nameuse{paper#1}}%
  \setlength\@tempdimb{\@nameuse{Geom@#2}}%
  \addtolength\@tempdima{-\@tempdimb}%
  \setlength\@tempdimb{\@nameuse{Geom@#3}}%
  \addtolength\@tempdima{-\@tempdimb}%
  \ifdim\@tempdima<\z@
    \geom@warning{`#4' results in NEGATIVE (\the\@tempdima).%
    ^^J\@spaces Parameters of `#2' and `#3' should be shortened}%
  \fi
  \expandafter\edef\csname Geom@#4\endcsname{\the\@tempdima}}
\def\geom@detiiandiii#1#2#3{% determine #2 and #3.
  \setlength\@tempdima{\@nameuse{paper#1}}%
  \setlength\@tempdimb{\@nameuse{Geom@#1}}%
  \addtolength\@tempdima{-\@tempdimb}%
  \divide\@tempdima\tw@
  \ifdim\@tempdima<\z@
    \geom@warning{`#2' and `#3' result in NEGATIVE (\the\@tempdima).%
                  ^^J\@spaces Parameter for `#1' should be shortened}%
  \fi
  \expandafter\edef\csname Geom@#2\endcsname{\the\@tempdima}%
  \expandafter\edef\csname Geom@#3\endcsname{\the\@tempdima}}
\def\geom@detall#1#2#3#4{%
  \@tempcnta\z@
  \if#1h
    \ifx\undefined\Geom@lmargin\else\advance\@tempcnta4\relax\fi
    \ifGeom@hbody\advance\@tempcnta2\relax\fi
    \ifx\undefined\Geom@rmargin\else\advance\@tempcnta1\relax\fi
    \geom@cnth\@tempcnta
  \else
    \ifx\undefined\Geom@tmargin\else\advance\@tempcnta4\relax\fi
    \ifGeom@vbody\advance\@tempcnta2\relax\fi
    \ifx\undefined\Geom@bmargin\else\advance\@tempcnta1\relax\fi
    \geom@cntv\@tempcnta
  \fi
  \ifcase\@tempcnta               % 0:(*,*,*)
    \if#1h
      \edef\Geom@width{\Geom@Dhscale\paperwidth}%
    \else
      \edef\Geom@height{\Geom@Dvscale\paperheight}%
    \fi
    \geom@detiiandiii{#2}{#3}{#4}%
  \or                             % 1:(*,*,S) goto (5)
    \geom@warning{`#3' was forced to equal `#4'}%
    \expandafter\edef\csname Geom@#3\endcsname{\@nameuse{Geom@#4}}%
    \geom@detiv{#2}{#3}{#4}{#2}%
  \or\geom@detiiandiii{#2}{#3}{#4}% 2:(*,S,*)
  \or\geom@detiv{#2}{#2}{#4}{#3}  % 3:(*,S,S)
  \or                             % 4:(S,*,*) goto (5)
    \geom@warning{`#4' was forced to equal `#3'}%
    \expandafter\edef\csname Geom@#4\endcsname{\@nameuse{Geom@#3}}%
    \geom@detiv{#2}{#3}{#4}{#2}%
  \or\geom@detiv{#2}{#3}{#4}{#2}  % 5:(S,*,S)
  \or\geom@detiv{#2}{#2}{#3}{#4}  % 6:(S,S,*)
  \or                             % 7:(S,S,S) goto (5)
    \geom@warning{Redundant specification in `#1'-direction.%
                  ^^J\@spaces `#2' (\@nameuse{Geom@#2}) is ignored}%
    \geom@detiv{#2}{#3}{#4}{#2}%
  \else\fi}
\def\geom@clean{%
  \ifnum\geom@cnth<4\let\Geom@lmargin\undefined\fi
  \ifodd\geom@cnth\else\let\Geom@rmargin\undefined\fi
  \ifnum\geom@cntv<4\let\Geom@tmargin\undefined\fi
  \ifodd\geom@cntv\else\let\Geom@bmargin\undefined\fi
  \ifGeom@hbody\else
    \let\Geom@hscale\undefined
    \let\Geom@width\undefined
    \let\Geom@textwidth\undefined
  \fi
  \ifGeom@vbody\else
    \let\Geom@vscale\undefined
    \let\Geom@height\undefined
    \let\Geom@textheight\undefined
  \fi}
\def\geom@parse@divide#1#2#3#4{%
  \def\Geom@star{*}%
  \@tempcnta\z@
  \@for\Geom@tmp:=#1\do{%
    \expandafter\KV@@sp@def\expandafter\Geom@frag\expandafter{\Geom@tmp}%
    \edef\Geom@value{\Geom@frag}%
    \ifcase\@tempcnta\relax% cnta == 0
            \edef\Geom@key{#2}%
    \or    \edef\Geom@key{#3}%
    \else  \edef\Geom@key{#4}%
    \fi
    \@nameuse{Geom@set\Geom@key false}%
    \ifx\empty\Geom@value\else
    \ifx\Geom@star\Geom@value\else
      \setkeys{Geom}{\Geom@key=\Geom@value}%
    \fi\fi
    \advance\@tempcnta\@ne}%
  \let\Geom@star\relax}
\def\geom@branch#1#2#3{%
  \@tempcnta\z@
  \@for\Geom@tmp:=#1\do{%
    \KV@@sp@def\Geom@frag{\Geom@tmp}%
    \edef\Geom@value{\Geom@frag}%
    \ifcase\@tempcnta\relax% cnta == 0
      \setkeys{Geom}{#2=\Geom@value}%
    \or% cnta == 1
      \setkeys{Geom}{#3=\Geom@value}%
    \else\fi
    \advance\@tempcnta\@ne}%
  \ifnum\@tempcnta=\@ne
    \setkeys{Geom}{#2=\Geom@value}%
    \setkeys{Geom}{#3=\Geom@value}%
  \fi}
\def\geom@setpaper(#1,#2){\setlength\paperwidth{#1}%
                          \setlength\paperheight{#2}}
\@namedef{Geom@a0paper}{\geom@setpaper(841mm,1189mm)}
\@namedef{Geom@a1paper}{\geom@setpaper(595mm,841mm)}
\@namedef{Geom@a2paper}{\geom@setpaper(420mm,595mm)}
\@namedef{Geom@a3paper}{\geom@setpaper(297mm,420mm)}
\@namedef{Geom@a4paper}{\geom@setpaper(210mm,297mm)}
\@namedef{Geom@a5paper}{\geom@setpaper(149mm,210mm)}
\@namedef{Geom@b0paper}{\geom@setpaper(1000mm,1414mm)}
\@namedef{Geom@b1paper}{\geom@setpaper(707mm,1000mm)}
\@namedef{Geom@b2paper}{\geom@setpaper(500mm,707mm)}
\@namedef{Geom@b3paper}{\geom@setpaper(353mm,500mm)}
\@namedef{Geom@b4paper}{\geom@setpaper(250mm,353mm)}
\@namedef{Geom@b5paper}{\geom@setpaper(176mm,250mm)}
\@namedef{Geom@letterpaper}{\geom@setpaper(8.5in,11in)}
\@namedef{Geom@legalpaper}{\geom@setpaper(8.5in,14in)}
\@namedef{Geom@executivepaper}{\geom@setpaper(7.25in,10.5in)}
\define@key{Geom}{paper}{\setkeys{Geom}{#1}}
\define@key{Geom}{a0paper}[true]{\def\Geom@paper{a0paper}}
\define@key{Geom}{a1paper}[true]{\def\Geom@paper{a1paper}}
\define@key{Geom}{a2paper}[true]{\def\Geom@paper{a2paper}}
\define@key{Geom}{a3paper}[true]{\def\Geom@paper{a3paper}}
\define@key{Geom}{a4paper}[true]{\def\Geom@paper{a4paper}}
\define@key{Geom}{a5paper}[true]{\def\Geom@paper{a5paper}}
\define@key{Geom}{b0paper}[true]{\def\Geom@paper{b0paper}}
\define@key{Geom}{b1paper}[true]{\def\Geom@paper{b1paper}}
\define@key{Geom}{b2paper}[true]{\def\Geom@paper{b2paper}}
\define@key{Geom}{b3paper}[true]{\def\Geom@paper{b3paper}}
\define@key{Geom}{b4paper}[true]{\def\Geom@paper{b4paper}}
\define@key{Geom}{b5paper}[true]{\def\Geom@paper{b5paper}}
\define@key{Geom}{letterpaper}[true]{\def\Geom@paper{letterpaper}}
\define@key{Geom}{legalpaper}[true]{\def\Geom@paper{legalpaper}}
\define@key{Geom}{executivepaper}[true]{\def\Geom@paper{executivepaper}}
\define@key{Geom}{papersize}{\geom@branch{#1}{paperwidth}{paperheight}}
\define@key{Geom}{paperwidth}{\setlength\paperwidth{#1}%
                              \let\Geom@paper\undefined}
\define@key{Geom}{paperheight}{\setlength\paperheight{#1}%
                              \let\Geom@paper\undefined}
\define@key{Geom}{total}{\geom@branch{#1}{width}{height}}
\define@key{Geom}{width}{\Geom@hbodytrue\edef\Geom@width{#1}}
\define@key{Geom}{height}{\Geom@vbodytrue\edef\Geom@height{#1}}
\define@key{Geom}{body}{\geom@branch{#1}{textwidth}{textheight}}
\define@key{Geom}{textwidth}{\Geom@hbodytrue\edef\Geom@textwidth{#1}}
\define@key{Geom}{textheight}{\Geom@vbodytrue\edef\Geom@textheight{#1}}
\define@key{Geom}{scale}{\geom@branch{#1}{hscale}{vscale}}
\define@key{Geom}{hscale}{\Geom@hbodytrue\edef\Geom@hscale{#1}}
\define@key{Geom}{vscale}{\Geom@vbodytrue\edef\Geom@vscale{#1}}
\define@key{Geom}{margin}{\geom@branch{#1}{lmargin}{tmargin}%
                          \geom@branch{#1}{rmargin}{bmargin}}
\define@key{Geom}{hmargin}{\geom@branch{#1}{lmargin}{rmargin}}
\define@key{Geom}{vmargin}{\geom@branch{#1}{tmargin}{bmargin}}
\define@key{Geom}{lmargin}{\edef\Geom@lmargin{#1}}
\define@key{Geom}{rmargin}{\edef\Geom@rmargin{#1}}
\define@key{Geom}{tmargin}{\edef\Geom@tmargin{#1}}
\define@key{Geom}{bmargin}{\edef\Geom@bmargin{#1}}
\define@key{Geom}{divide}{\geom@parse@divide{#1}{lmargin}{width}{rmargin}%
                         \geom@parse@divide{#1}{tmargin}{height}{bmargin}}
\define@key{Geom}{hdivide}{\geom@parse@divide{#1}{lmargin}{width}{rmargin}}
\define@key{Geom}{vdivide}{\geom@parse@divide{#1}{tmargin}{height}{bmargin}}
\define@key{Geom}{offset}{\geom@branch{#1}{hoffset}{voffset}}
\define@key{Geom}{hoffset}{\setlength\hoffset{#1}}
\define@key{Geom}{voffset}{\setlength\voffset{#1}}
\define@key{Geom}{headheight}{\Geom@noheadfalse\setlength\headheight{#1}}
\define@key{Geom}{headsep}{\Geom@noheadfalse\setlength\headsep{#1}}
\define@key{Geom}{footskip}{\Geom@nofootfalse\setlength\footskip{#1}}
\define@key{Geom}{marginparwidth}%
           {\ifGeom@passincmp\else\Geom@includemptrue\fi%
            \setlength\marginparwidth{#1}}
\define@key{Geom}{marginparsep}%
           {\ifGeom@passincmp\else\Geom@includemptrue\fi%
            \setlength\marginparsep{#1}}
\define@key{Geom}{verbose}[true]{%
            \lowercase{\geom@setbool{#1}}{Geom@verbose}}
\define@key{Geom}{reset}[true]{%
            \lowercase{\expandafter\csname if#1\endcsname\geom@init\fi}}
\define@key{Geom}{includemp}[true]{%
            \Geom@passincmptrue
            \lowercase{\geom@setbool{#1}}{Geom@includemp}}
\define@key{Geom}{reversemp}[true]{%
            \ifGeom@passincmp\else\Geom@includemptrue\fi%
            \lowercase{\geom@setbool{#1}}{@reversemargin}}
\define@key{Geom}{reversemarginpar}[true]{%
            \ifGeom@passincmp\else\Geom@includemptrue\fi%
            \lowercase{\geom@setbool{#1}}{@reversemargin}}
\define@key{Geom}{twoside}[true]{%
            \lowercase{\geom@setbool{#1}}{@twoside}%
            \lowercase{\geom@setbool{#1}}{@mparswitch}}
\define@key{Geom}{twosideshift}{\@twosidetrue\def\Geom@twosideshift{#1}}
\define@key{Geom}{nohead}[true]{%
            \lowercase{\geom@setbool{#1}}{Geom@nohead}}
\define@key{Geom}{nofoot}[true]{%
            \lowercase{\geom@setbool{#1}}{Geom@nofoot}}
\define@key{Geom}{noheadfoot}[true]{%
            \lowercase{\geom@setbool{#1}}{Geom@nohead}%
            \lowercase{\geom@setbool{#1}}{Geom@nofoot}}
\define@key{Geom}{landscape}[true]{%
            \lowercase{\geom@setbool{#1}}{Geom@landscape}}
\define@key{Geom}{portrait}[true]{%
            \lowercase{\expandafter\csname if#1\endcsname
            \Geom@landscapefalse\else\Geom@landscapetrue\fi}}
\define@key{Geom}{dvips}[true]{%
            \lowercase{\geom@setbool{#1}}{Geom@dvips}}
\define@key{Geom}{pdftex}[true]{%
            \lowercase{\geom@setbool{#1}}{Geom@pdftex}}
\let\KV@Geom@papername\KV@Geom@paper
\let\KV@Geom@totalwidth\KV@Geom@width
\let\KV@Geom@totalheight\KV@Geom@height
\let\KV@Geom@text\KV@Geom@body
\let\KV@Geom@left\KV@Geom@lmargin
\let\KV@Geom@right\KV@Geom@rmargin
\let\KV@Geom@top\KV@Geom@tmargin
\let\KV@Geom@bottom\KV@Geom@bmargin
\let\KV@Geom@head\KV@Geom@headheight
\let\KV@Geom@foot\KV@Geom@footskip
\let\KV@Geom@marginpar\KV@Geom@marginparwidth
\def\geom@process{
  \ifx\undefined\Geom@paper\else\@nameuse{Geom@\Geom@paper}\fi
  \ifGeom@landscape
    \setlength\@tempdima{\paperwidth}%
    \setlength\paperwidth{\paperheight}%
    \setlength\paperheight{\@tempdima}%
  \fi
  \ifGeom@nohead
    \setlength\headheight{0pt}%
    \setlength\headsep{0pt}%
  \fi
  \ifGeom@nofoot
    \setlength\footskip{0pt}%
  \fi
  \ifGeom@hbody
    \ifx\undefined\Geom@width
      \ifx\undefined\Geom@hscale
        \edef\Geom@width{\Geom@Dhscale\paperwidth}%
      \else
        \edef\Geom@width{\Geom@hscale\paperwidth}%
      \fi
    \fi
    \ifx\undefined\Geom@textwidth\else
      \setlength\@tempdima{\Geom@textwidth}%
      \ifGeom@includemp
        \addtolength\@tempdima{\marginparwidth}%
        \addtolength\@tempdima{\marginparsep}%
      \fi
      \edef\Geom@width{\the\@tempdima}%
    \fi
  \fi
  \ifGeom@vbody
    \ifx\undefined\Geom@height%
      \ifx\undefined\Geom@vscale%
        \edef\Geom@height{\Geom@Dvscale\paperheight}%
      \else
        \edef\Geom@height{\Geom@vscale\paperheight}%
      \fi
    \fi
    \ifx\undefined\Geom@textheight\else%
      \setlength\@tempdima{\Geom@textheight}%
      \addtolength\@tempdima{\headheight}%
      \addtolength\@tempdima{\headsep}%
      \addtolength\@tempdima{\footskip}%
      \edef\Geom@height{\the\@tempdima}%
    \fi
  \fi
  \geom@detall{h}{width}{lmargin}{rmargin}%
  \geom@detall{v}{height}{tmargin}{bmargin}%
  \setlength\textwidth{\Geom@width}%
  \setlength\textheight{\Geom@height}%
  \setlength\topmargin{\Geom@tmargin}%
  \setlength\oddsidemargin{\Geom@lmargin}%
  \ifGeom@includemp
    \addtolength\textwidth{-\marginparwidth}%
    \addtolength\textwidth{-\marginparsep}%
    \if@reversemargin
       \addtolength\oddsidemargin{\marginparwidth}%
       \addtolength\oddsidemargin{\marginparsep}%
    \fi
  \fi
  \addtolength\textheight{-\headheight}%
  \addtolength\textheight{-\headsep}%
  \addtolength\textheight{-\footskip}%
  \addtolength\topmargin{-1in}%
  \addtolength\oddsidemargin{-1in}%
  \if@twoside
    \setlength\evensidemargin{\Geom@rmargin}%
    \addtolength\evensidemargin{-1in}%
    \setlength\@tempdima{\Geom@twosideshift}%
    \addtolength\oddsidemargin{\@tempdima}%
    \addtolength\evensidemargin{-\@tempdima}%
    \ifGeom@includemp
      \if@mparswitch
        \setlength\@tempdima{\marginparwidth}%
        \addtolength\@tempdima{\marginparsep}%
        \addtolength\evensidemargin{\@tempdima}%
        \if@reversemargin
          \addtolength\evensidemargin{-\marginparwidth}%
          \addtolength\evensidemargin{-\marginparsep}%
        \fi
      \fi
    \fi
  \else
    \setlength\evensidemargin{\oddsidemargin}%
  \fi}
\def\geom@showparams{%
  \typeout{----------------------- Geometry parameters^^J%
  mode: %
  \ifx\undefined\Geom@paper\else
     \Geom@paper\space
  \fi
  \geom@checkbool{landscape}%
  \geom@checkbool{nohead}%
  \geom@checkbool{nofoot}%
  \geom@checkbool{includemp}%
  \if@reversemargin reversemp\space\fi%
  \if@twoside twoside\space\fi%
  \geom@checkbool{dvips}%
  \geom@checkbool{pdftex}^^J%
  h-parts: \Geom@lmargin, \Geom@width, \Geom@rmargin%
  \ifnum\geom@cnth=\z@\space(default)\fi^^J%
  v-parts: \Geom@tmargin, \Geom@height, \Geom@bmargin%
  \ifnum\geom@cntv=\z@\space(default)\fi^^J%
  \if@twoside
    twosideshift: \Geom@twosideshift^^J%
  \fi
  ----------------------- Page layout dimensions^^J%
  \string\paperwidth\space\space\the\paperwidth^^J%
  \string\paperheight\space\the\paperheight^^J%
  \string\textwidth\space\space\the\textwidth^^J%
  \string\textheight\space\the\textheight^^J%
  \string\oddsidemargin\space\space\the\oddsidemargin^^J%
  \string\evensidemargin\space\the\evensidemargin^^J%
  \string\topmargin\space\space\the\topmargin^^J%
  \string\headheight\space\the\headheight^^J%
  \string\headsep\@spaces\the\headsep^^J%
  \string\footskip\space\space\space\the\footskip^^J%
  \ifGeom@includemp
    \string\marginparwidth\space\the\marginparwidth^^J%
    \string\marginparsep\space\space\space\the\marginparsep^^J%
  \fi
  \string\hoffset\space\the\hoffset^^J%
  \string\voffset\space\the\voffset^^J%
  (1in=72.27pt, 1cm=28.45pt)^^J%
  -----------------------}}
\let\Geom@paper\undefined
\def\geom@setkey{\setkeys{Geom}}
\let\geom@origExecuteOptions\ExecuteOptions
\let\ExecuteOptions\geom@setkey
\ExecuteOptions{reset}
\InputIfFileExists{geometry.cfg}{}{}
\let\ExecuteOptions\geom@origExecuteOptions
\def\ProcessOptionsWithKV#1{%
  \let\@tempa\@empty
  \@for\CurrentOption:=\@classoptionslist\do{%
    \@ifundefined{KV@#1@\CurrentOption}%
    {}{\edef\@tempa{\@tempa,\CurrentOption,}}}%
  \edef\@tempa{%
    \noexpand\setkeys{#1}{\@tempa\@ptionlist{\@currname.\@currext}}}%
  \@tempa
  \AtEndOfPackage{\let\@unprocessedoptions\relax}}
\ProcessOptionsWithKV{Geom}
\geom@process
\AtBeginDocument{%
  \ifx\undefined\pdfpagewidth % latex command is used.
    \Geom@pdftexfalse
  \else                       % pdflatex command is used
    \ifGeom@pdftex\Geom@dvipsfalse\fi
  \fi
  \ifGeom@dvips
    \AtBeginDvi{\special{%
    papersize=\the\paperwidth,\the\paperheight}}%
  \fi
  \ifGeom@pdftex
    \pdfoutput=1\relax
    \pdfpagewidth=\the\paperwidth
    \pdfpageheight=\the\paperheight
  \fi
  \ifGeom@verbose
    \geom@showparams
  \fi}
\def\geometry#1{%
  \geom@clean
  \setkeys{Geom}{#1}%
  \geom@process}
\endinput
%%
%% End of file `geometry.sty'.
