marketing

Marketing materials (presentations, posters, flyers)
Log | Files | Refs

geometry.sty (40502B)


      1 %%
      2 %% This is file `geometry.sty',
      3 %% generated with the docstrip utility.
      4 %%
      5 %% The original source files were:
      6 %%
      7 %% geometry.dtx  (with options: `package')
      8 %% 
      9 %% Copyright (C) 1996-2010
     10 %% by Hideo Umeki <latexgeometry@gmail.com>
     11 %% 
     12 %% This work may be distributed and/or modified under the conditions of
     13 %% the LaTeX Project Public License, either version 1.3c of this license
     14 %% or (at your option) any later version. The latest version of this
     15 %% license is in
     16 %%    http://www.latex-project.org/lppl.txt
     17 %% and version 1.3c or later is part of all distributions of LaTeX
     18 %% version 2005/12/01 or later.
     19 %% 
     20 %% This work is "maintained" (as per the LPPL maintenance status)
     21 %% by Hideo Umeki.
     22 %% 
     23 %% This work consists of the files geometry.dtx and
     24 %% the derived files: geometry.{sty,ins,drv}, geometry-samples.tex.
     25 %% 
     26 \NeedsTeXFormat{LaTeX2e}
     27 \ProvidesPackage{geometry}
     28   [2010/09/12 v5.6 Page Geometry]
     29 \RequirePackage{keyval}%
     30 \RequirePackage{ifpdf}%
     31 \RequirePackage{ifvtex}%
     32 \RequirePackage{ifxetex}%
     33 \newif\ifGm@verbose
     34 \newif\ifGm@landscape
     35 \newif\ifGm@swap@papersize
     36 \newif\ifGm@includehead
     37 \newif\ifGm@includefoot
     38 \newif\ifGm@includemp
     39 \newif\ifGm@hbody
     40 \newif\ifGm@vbody
     41 \newif\ifGm@heightrounded
     42 \newif\ifGm@showframe
     43 \newif\ifGm@showcrop
     44 \newif\ifGm@pass
     45 \newif\ifGm@resetpaper
     46 \newif\ifGm@layout
     47 \newif\ifGm@newgm
     48 \newcount\Gm@cnth
     49 \newcount\Gm@cntv
     50 \newcount\c@Gm@tempcnt
     51 \newdimen\Gm@bindingoffset
     52 \newdimen\Gm@wd@mp
     53 \newdimen\Gm@odd@mp
     54 \newdimen\Gm@even@mp
     55 \newdimen\Gm@layoutwidth
     56 \newdimen\Gm@layoutheight
     57 \newdimen\Gm@layouthoffset
     58 \newdimen\Gm@layoutvoffset
     59 \newtoks\Gm@dimlist
     60 \def\Gm@warning#1{\PackageWarningNoLine{geometry}{#1}}%
     61 \def\ifGm@preamble#1{%
     62   \ifGm@newgm
     63    \Gm@warning{`#1': not available in `\string\newgeometry'; skipped}%
     64   \else
     65     \expandafter\@firstofone
     66   \fi}%
     67 \def\Gm@Dhratio{1:1}% = left:right default for oneside
     68 \def\Gm@Dhratiotwo{2:3}% = inner:outer default for twoside.
     69 \def\Gm@Dvratio{2:3}% = top:bottom default
     70 \def\Gm@Dhscale{0.7}%
     71 \def\Gm@Dvscale{0.7}%
     72 \def\Gm@dvips{dvips}%
     73 \def\Gm@dvipdfm{dvipdfm}%
     74 \def\Gm@pdftex{pdftex}%
     75 \def\Gm@xetex{xetex}%
     76 \def\Gm@vtex{vtex}%
     77 \def\Gm@true{true}%
     78 \def\Gm@false{false}%
     79 \edef\Gm@orgpw{\the\paperwidth}%
     80 \edef\Gm@orgph{\the\paperheight}%
     81 \def\Gm@savelength#1{%
     82   \g@addto@macro\Gm@restore{\expandafter\noexpand\expandafter\csname
     83   #1\endcsname\expandafter=\expandafter\the\csname #1\endcsname\relax}}%
     84 \def\Gm@saveboolean#1{%
     85   \csname if#1\endcsname
     86     \g@addto@macro\Gm@restore{\expandafter\noexpand\csname #1true\endcsname}%
     87   \else
     88     \g@addto@macro\Gm@restore{\expandafter\noexpand\csname #1false\endcsname}%
     89   \fi}%
     90 \def\Gm@restore{}%
     91 \def\Gm@save{%
     92   \Gm@savelength{paperwidth}%
     93   \Gm@savelength{paperheight}%
     94   \Gm@savelength{textwidth}%
     95   \Gm@savelength{textheight}%
     96   \Gm@savelength{evensidemargin}%
     97   \Gm@savelength{oddsidemargin}%
     98   \Gm@savelength{topmargin}%
     99   \Gm@savelength{headheight}%
    100   \Gm@savelength{headsep}%
    101   \Gm@savelength{topskip}%
    102   \Gm@savelength{footskip}%
    103   \Gm@savelength{baselineskip}%
    104   \Gm@savelength{marginparwidth}%
    105   \Gm@savelength{marginparsep}%
    106   \Gm@savelength{columnsep}%
    107   \Gm@savelength{hoffset}%
    108   \Gm@savelength{voffset}
    109   \Gm@savelength{Gm@layoutwidth}%
    110   \Gm@savelength{Gm@layoutheight}%
    111   \Gm@savelength{Gm@layouthoffset}%
    112   \Gm@savelength{Gm@layoutvoffset}%
    113   \Gm@saveboolean{@twocolumn}%
    114   \Gm@saveboolean{@twoside}%
    115   \Gm@saveboolean{@mparswitch}%
    116   \Gm@saveboolean{@reversemargin}}%
    117 \def\Gm@initnewgm{%
    118   \Gm@passfalse
    119   \Gm@swap@papersizefalse
    120   \Gm@dimlist={}
    121   \Gm@hbodyfalse
    122   \Gm@vbodyfalse
    123   \Gm@heightroundedfalse
    124   \Gm@includeheadfalse
    125   \Gm@includefootfalse
    126   \Gm@includempfalse
    127   \let\Gm@width\@undefined
    128   \let\Gm@height\@undefined
    129   \let\Gm@textwidth\@undefined
    130   \let\Gm@textheight\@undefined
    131   \let\Gm@lines\@undefined
    132   \let\Gm@hscale\@undefined
    133   \let\Gm@vscale\@undefined
    134   \let\Gm@hmarginratio\@undefined
    135   \let\Gm@vmarginratio\@undefined
    136   \let\Gm@lmargin\@undefined
    137   \let\Gm@rmargin\@undefined
    138   \let\Gm@tmargin\@undefined
    139   \let\Gm@bmargin\@undefined
    140   \Gm@layoutfalse
    141   \Gm@layouthoffset\z@
    142   \Gm@layoutvoffset\z@
    143   \Gm@bindingoffset\z@}%
    144 \def\Gm@initall{%
    145   \let\Gm@driver\@empty
    146   \let\Gm@truedimen\@empty
    147   \let\Gm@paper\@undefined
    148   \Gm@resetpaperfalse
    149   \Gm@landscapefalse
    150   \Gm@verbosefalse
    151   \Gm@showframefalse
    152   \Gm@showcropfalse
    153   \Gm@newgmfalse
    154   \Gm@initnewgm}%
    155 \def\Gm@setdriver#1{%
    156   \expandafter\let\expandafter\Gm@driver\csname Gm@#1\endcsname}%
    157 \def\Gm@unsetdriver#1{%
    158   \expandafter\ifx\csname Gm@#1\endcsname\Gm@driver\let\Gm@driver\@empty\fi}%
    159 \def\Gm@setbool{\@dblarg\Gm@@setbool}%
    160 \def\Gm@setboolrev{\@dblarg\Gm@@setboolrev}%
    161 \def\Gm@@setbool[#1]#2#3{\Gm@doif{#1}{#3}{\csname Gm@#2\Gm@bool\endcsname}}%
    162 \def\Gm@@setboolrev[#1]#2#3{\Gm@doifelse{#1}{#3}%
    163   {\csname Gm@#2\Gm@false\endcsname}{\csname Gm@#2\Gm@true\endcsname}}%
    164 \def\Gm@doif#1#2#3{%
    165   \lowercase{\def\Gm@bool{#2}}%
    166   \ifx\Gm@bool\@empty
    167     \let\Gm@bool\Gm@true
    168   \fi
    169   \ifx\Gm@bool\Gm@true
    170   \else
    171     \ifx\Gm@bool\Gm@false
    172     \else
    173       \let\Gm@bool\relax
    174     \fi
    175   \fi
    176   \ifx\Gm@bool\relax
    177     \Gm@warning{`#1' should be set to `true' or `false'}%
    178   \else
    179     #3
    180   \fi}%
    181 \def\Gm@doifelse#1#2#3#4{%
    182   \Gm@doif{#1}{#2}{\ifx\Gm@bool\Gm@true #3\else #4\fi}}%
    183 \def\Gm@reverse#1{%
    184   \csname ifGm@#1\endcsname
    185   \csname Gm@#1false\endcsname\else\csname Gm@#1true\endcsname\fi}%
    186 \def\Gm@defbylen#1#2{%
    187   \begingroup\setlength\@tempdima{#2}%
    188   \expandafter\xdef\csname Gm@#1\endcsname{\the\@tempdima}\endgroup}%
    189 \def\Gm@defbycnt#1#2{%
    190   \begingroup\setcounter{Gm@tempcnt}{#2}%
    191   \expandafter\xdef\csname Gm@#1\endcsname{\the\value{Gm@tempcnt}}\endgroup}%
    192 \def\Gm@sep@ratio#1:#2{\@tempcnta=#1\@tempcntb=#2}%
    193 \def\Gm@setbyratio[#1]#2#3#4{% determine #4 by ratio
    194   \expandafter\Gm@sep@ratio\Gm@mratio\relax
    195   \if#1b
    196     \edef\@@tempa{\the\@tempcnta}%
    197     \@tempcnta=\@tempcntb
    198     \@tempcntb=\@@tempa\relax
    199   \fi
    200   \expandafter\setlength\expandafter\@tempdimb\expandafter
    201     {\csname Gm@#3\endcsname}%
    202   \ifnum\@tempcntb>\z@
    203     \multiply\@tempdimb\@tempcnta
    204     \divide\@tempdimb\@tempcntb
    205   \fi
    206   \expandafter\edef\csname Gm@#4\endcsname{\the\@tempdimb}}%
    207 \def\Gm@detiv#1#2#3#4{% determine #4.
    208   \expandafter\setlength\expandafter\@tempdima\expandafter
    209     {\csname Gm@layout#1\endcsname}%
    210   \expandafter\setlength\expandafter\@tempdimb\expandafter
    211     {\csname Gm@#2\endcsname}%
    212   \addtolength\@tempdima{-\@tempdimb}%
    213   \expandafter\setlength\expandafter\@tempdimb\expandafter
    214     {\csname Gm@#3\endcsname}%
    215   \addtolength\@tempdima{-\@tempdimb}%
    216   \ifdim\@tempdima<\z@
    217     \Gm@warning{`#4' results in NEGATIVE (\the\@tempdima).%
    218     ^^J\@spaces `#2' or `#3' should be shortened in length}%
    219   \fi
    220   \expandafter\edef\csname Gm@#4\endcsname{\the\@tempdima}}%
    221 \def\Gm@detiiandiii#1#2#3{% determine #2 and #3.
    222   \expandafter\setlength\expandafter\@tempdima\expandafter
    223     {\csname Gm@layout#1\endcsname}%
    224   \expandafter\setlength\expandafter\@tempdimb\expandafter
    225     {\csname Gm@#1\endcsname}%
    226   \addtolength\@tempdima{-\@tempdimb}%
    227   \ifdim\@tempdima<\z@
    228     \Gm@warning{`#2' and `#3' result in NEGATIVE (\the\@tempdima).%
    229                   ^^J\@spaces `#1' should be shortened in length}%
    230   \fi
    231   \ifx\Gm@mratio\@undefined
    232     \expandafter\Gm@sep@ratio\Gm@Dmratio\relax
    233   \else
    234     \expandafter\Gm@sep@ratio\Gm@mratio\relax
    235     \ifnum\@tempcntb>\z@\else
    236       \Gm@warning{margin ratio a:b should be non-zero; default used}%
    237       \expandafter\Gm@sep@ratio\Gm@Dmratio\relax
    238     \fi
    239   \fi
    240   \@tempdimb=\@tempdima
    241   \advance\@tempcntb\@tempcnta
    242   \divide\@tempdima\@tempcntb
    243   \multiply\@tempdima\@tempcnta
    244   \advance\@tempdimb-\@tempdima
    245   \expandafter\edef\csname Gm@#2\endcsname{\the\@tempdima}%
    246   \expandafter\edef\csname Gm@#3\endcsname{\the\@tempdimb}}%
    247 \def\Gm@detall#1#2#3#4{%
    248   \@tempcnta\z@
    249   \if#1h
    250     \let\Gm@mratio\Gm@hmarginratio
    251     \edef\Gm@Dmratio{\if@twoside\Gm@Dhratiotwo\else\Gm@Dhratio\fi}%
    252   \else
    253     \let\Gm@mratio\Gm@vmarginratio
    254     \edef\Gm@Dmratio{\Gm@Dvratio}%
    255   \fi
    256   \if#1h
    257     \ifx\Gm@lmargin\@undefined\else\advance\@tempcnta4\relax\fi
    258     \ifGm@hbody\advance\@tempcnta2\relax\fi
    259     \ifx\Gm@rmargin\@undefined\else\advance\@tempcnta1\relax\fi
    260     \Gm@cnth\@tempcnta
    261   \else
    262     \ifx\Gm@tmargin\@undefined\else\advance\@tempcnta4\relax\fi
    263     \ifGm@vbody\advance\@tempcnta2\relax\fi
    264     \ifx\Gm@bmargin\@undefined\else\advance\@tempcnta1\relax\fi
    265     \Gm@cntv\@tempcnta
    266   \fi
    267   \ifcase\@tempcnta
    268     \if#1h
    269       \Gm@defbylen{width}{\Gm@Dhscale\Gm@layoutwidth}%
    270     \else
    271       \Gm@defbylen{height}{\Gm@Dvscale\Gm@layoutheight}%
    272     \fi
    273     \Gm@detiiandiii{#2}{#3}{#4}%
    274   \or
    275     \ifx\Gm@mratio\@undefined
    276       \if#1h
    277         \Gm@defbylen{width}{\Gm@Dhscale\Gm@layoutwidth}%
    278       \else
    279         \Gm@defbylen{height}{\Gm@Dvscale\Gm@layoutheight}%
    280       \fi
    281       \setlength\@tempdimc{\@nameuse{Gm@#4}}%
    282       \Gm@detiiandiii{#2}{#3}{#4}%
    283       \expandafter\let\csname Gm@#2\endcsname\@undefined
    284       \Gm@defbylen{#4}{\@tempdimc}%
    285     \else
    286       \Gm@setbyratio[f]{#1}{#4}{#3}%
    287     \fi
    288     \Gm@detiv{#2}{#3}{#4}{#2}%
    289   \or\Gm@detiiandiii{#2}{#3}{#4}%
    290   \or\Gm@detiv{#2}{#2}{#4}{#3}%
    291   \or
    292     \ifx\Gm@mratio\@undefined
    293       \if#1h
    294         \Gm@defbylen{width}{\Gm@Dhscale\Gm@layoutwidth}%
    295       \else
    296         \Gm@defbylen{height}{\Gm@Dvscale\Gm@layoutheight}%
    297       \fi
    298       \setlength\@tempdimc{\@nameuse{Gm@#3}}%
    299       \Gm@detiiandiii{#2}{#4}{#3}%
    300       \expandafter\let\csname Gm@#2\endcsname\@undefined
    301       \Gm@defbylen{#3}{\@tempdimc}%
    302     \else
    303       \Gm@setbyratio[b]{#1}{#3}{#4}%
    304     \fi
    305     \Gm@detiv{#2}{#3}{#4}{#2}%
    306   \or\Gm@detiv{#2}{#3}{#4}{#2}%
    307   \or\Gm@detiv{#2}{#2}{#3}{#4}%
    308   \or\Gm@warning{Over-specification in `#1'-direction.%
    309                   ^^J\@spaces `#2' (\@nameuse{Gm@#2}) is ignored}%
    310     \Gm@detiv{#2}{#3}{#4}{#2}%
    311   \else\fi}%
    312 \def\Gm@clean{%
    313   \ifnum\Gm@cnth<4\let\Gm@lmargin\@undefined\fi
    314   \ifodd\Gm@cnth\else\let\Gm@rmargin\@undefined\fi
    315   \ifnum\Gm@cntv<4\let\Gm@tmargin\@undefined\fi
    316   \ifodd\Gm@cntv\else\let\Gm@bmargin\@undefined\fi
    317   \ifGm@hbody\else
    318     \let\Gm@hscale\@undefined
    319     \let\Gm@width\@undefined
    320     \let\Gm@textwidth\@undefined
    321   \fi
    322   \ifGm@vbody\else
    323     \let\Gm@vscale\@undefined
    324     \let\Gm@height\@undefined
    325     \let\Gm@textheight\@undefined
    326   \fi
    327   }%
    328 \def\Gm@parse@divide#1#2#3#4{%
    329   \def\Gm@star{*}%
    330   \@tempcnta\z@
    331   \@for\Gm@tmp:=#1\do{%
    332     \expandafter\KV@@sp@def\expandafter\Gm@frag\expandafter{\Gm@tmp}%
    333     \edef\Gm@value{\Gm@frag}%
    334     \ifcase\@tempcnta\relax\edef\Gm@key{#2}%
    335       \or\edef\Gm@key{#3}%
    336       \else\edef\Gm@key{#4}%
    337     \fi
    338     \@nameuse{Gm@set\Gm@key false}%
    339     \ifx\empty\Gm@value\else
    340     \ifx\Gm@star\Gm@value\else
    341       \setkeys{Gm}{\Gm@key=\Gm@value}%
    342     \fi\fi
    343     \advance\@tempcnta\@ne}%
    344   \let\Gm@star\relax}%
    345 \def\Gm@branch#1#2#3{%
    346   \@tempcnta\z@
    347   \@for\Gm@tmp:=#1\do{%
    348     \KV@@sp@def\Gm@frag{\Gm@tmp}%
    349     \edef\Gm@value{\Gm@frag}%
    350     \ifcase\@tempcnta\relax% cnta == 0
    351       \setkeys{Gm}{#2=\Gm@value}%
    352     \or% cnta == 1
    353       \setkeys{Gm}{#3=\Gm@value}%
    354     \else\fi
    355     \advance\@tempcnta\@ne}%
    356   \ifnum\@tempcnta=\@ne
    357     \setkeys{Gm}{#3=\Gm@value}%
    358   \fi}%
    359 \def\Gm@magtooffset{%
    360   \@tempdima=\mag\Gm@truedimen sp%
    361   \@tempdimb=1\Gm@truedimen in%
    362   \divide\@tempdimb\@tempdima
    363   \multiply\@tempdimb\@m
    364   \addtolength{\hoffset}{1\Gm@truedimen in}%
    365   \addtolength{\voffset}{1\Gm@truedimen in}%
    366   \addtolength{\hoffset}{-\the\@tempdimb}%
    367   \addtolength{\voffset}{-\the\@tempdimb}}%
    368 \def\Gm@setlength#1#2{%
    369   \let\Gm@len=\relax\let\Gm@td=\relax
    370   \edef\addtolist{\noexpand\Gm@dimlist=%
    371   {\the\Gm@dimlist \Gm@len{#1}{#2}}}\addtolist}%
    372 \def\Gm@expandlengths{%
    373   \def\Gm@td{\Gm@truedimen}%
    374   \def\Gm@len##1##2{\setlength{##1}{##2}}%
    375   \the\Gm@dimlist}%
    376 \def\Gm@setsize#1(#2,#3)#4{%
    377   \let\Gm@td\relax
    378   \expandafter\Gm@setlength\csname #1width\endcsname{#2\Gm@td #4}%
    379   \expandafter\Gm@setlength\csname #1height\endcsname{#3\Gm@td #4}%
    380   \ifGm@landscape\Gm@swap@papersizetrue\else\Gm@swap@papersizefalse\fi}%
    381 \def\Gm@setpaper@ifpre#1{%
    382   \ifGm@preamble{#1}{\def\Gm@paper{#1}\@nameuse{Gm@#1}{paper}}}%
    383 \@namedef{Gm@a0paper}#1{\Gm@setsize{#1}(841,1189){mm}}% ISO A0
    384 \@namedef{Gm@a1paper}#1{\Gm@setsize{#1}(594,841){mm}}% ISO A1
    385 \@namedef{Gm@a2paper}#1{\Gm@setsize{#1}(420,594){mm}}% ISO A2
    386 \@namedef{Gm@a3paper}#1{\Gm@setsize{#1}(297,420){mm}}% ISO A3
    387 \@namedef{Gm@a4paper}#1{\Gm@setsize{#1}(210,297){mm}}% ISO A4
    388 \@namedef{Gm@a5paper}#1{\Gm@setsize{#1}(148,210){mm}}% ISO A5
    389 \@namedef{Gm@a6paper}#1{\Gm@setsize{#1}(105,148){mm}}% ISO A6
    390 \@namedef{Gm@b0paper}#1{\Gm@setsize{#1}(1000,1414){mm}}% ISO B0
    391 \@namedef{Gm@b1paper}#1{\Gm@setsize{#1}(707,1000){mm}}% ISO B1
    392 \@namedef{Gm@b2paper}#1{\Gm@setsize{#1}(500,707){mm}}% ISO B2
    393 \@namedef{Gm@b3paper}#1{\Gm@setsize{#1}(353,500){mm}}% ISO B3
    394 \@namedef{Gm@b4paper}#1{\Gm@setsize{#1}(250,353){mm}}% ISO B4
    395 \@namedef{Gm@b5paper}#1{\Gm@setsize{#1}(176,250){mm}}% ISO B5
    396 \@namedef{Gm@b6paper}#1{\Gm@setsize{#1}(125,176){mm}}% ISO B6
    397 \@namedef{Gm@c0paper}#1{\Gm@setsize{#1}(917,1297){mm}}% ISO C0
    398 \@namedef{Gm@c1paper}#1{\Gm@setsize{#1}(648,917){mm}}% ISO C1
    399 \@namedef{Gm@c2paper}#1{\Gm@setsize{#1}(458,648){mm}}% ISO C2
    400 \@namedef{Gm@c3paper}#1{\Gm@setsize{#1}(324,458){mm}}% ISO C3
    401 \@namedef{Gm@c4paper}#1{\Gm@setsize{#1}(229,324){mm}}% ISO C4
    402 \@namedef{Gm@c5paper}#1{\Gm@setsize{#1}(162,229){mm}}% ISO C5
    403 \@namedef{Gm@c6paper}#1{\Gm@setsize{#1}(114,162){mm}}% ISO C6
    404 \@namedef{Gm@b0j}#1{\Gm@setsize{#1}(1030,1456){mm}}% JIS B0
    405 \@namedef{Gm@b1j}#1{\Gm@setsize{#1}(728,1030){mm}}% JIS B1
    406 \@namedef{Gm@b2j}#1{\Gm@setsize{#1}(515,728){mm}}% JIS B2
    407 \@namedef{Gm@b3j}#1{\Gm@setsize{#1}(364,515){mm}}% JIS B3
    408 \@namedef{Gm@b4j}#1{\Gm@setsize{#1}(257,364){mm}}% JIS B4
    409 \@namedef{Gm@b5j}#1{\Gm@setsize{#1}(182,257){mm}}% JIS B5
    410 \@namedef{Gm@b6j}#1{\Gm@setsize{#1}(128,182){mm}}% JIS B6
    411 \@namedef{Gm@ansiapaper}#1{\Gm@setsize{#1}(8.5,11){in}}%
    412 \@namedef{Gm@ansibpaper}#1{\Gm@setsize{#1}(11,17){in}}%
    413 \@namedef{Gm@ansicpaper}#1{\Gm@setsize{#1}(17,22){in}}%
    414 \@namedef{Gm@ansidpaper}#1{\Gm@setsize{#1}(22,34){in}}%
    415 \@namedef{Gm@ansiepaper}#1{\Gm@setsize{#1}(34,44){in}}%
    416 \@namedef{Gm@letterpaper}#1{\Gm@setsize{#1}(8.5,11){in}}%
    417 \@namedef{Gm@legalpaper}#1{\Gm@setsize{#1}(8.5,14){in}}%
    418 \@namedef{Gm@executivepaper}#1{\Gm@setsize{#1}(7.25,10.5){in}}%
    419 \@namedef{Gm@screen}#1{\Gm@setsize{#1}(225,180){mm}}%
    420 \define@key{Gm}{paper}{\setkeys{Gm}{#1}}%
    421 \let\KV@Gm@papername\KV@Gm@paper
    422 \define@key{Gm}{a0paper}[true]{\Gm@setpaper@ifpre{a0paper}}%
    423 \define@key{Gm}{a1paper}[true]{\Gm@setpaper@ifpre{a1paper}}%
    424 \define@key{Gm}{a2paper}[true]{\Gm@setpaper@ifpre{a2paper}}%
    425 \define@key{Gm}{a3paper}[true]{\Gm@setpaper@ifpre{a3paper}}%
    426 \define@key{Gm}{a4paper}[true]{\Gm@setpaper@ifpre{a4paper}}%
    427 \define@key{Gm}{a5paper}[true]{\Gm@setpaper@ifpre{a5paper}}%
    428 \define@key{Gm}{a6paper}[true]{\Gm@setpaper@ifpre{a6paper}}%
    429 \define@key{Gm}{b0paper}[true]{\Gm@setpaper@ifpre{b0paper}}%
    430 \define@key{Gm}{b1paper}[true]{\Gm@setpaper@ifpre{b1paper}}%
    431 \define@key{Gm}{b2paper}[true]{\Gm@setpaper@ifpre{b2paper}}%
    432 \define@key{Gm}{b3paper}[true]{\Gm@setpaper@ifpre{b3paper}}%
    433 \define@key{Gm}{b4paper}[true]{\Gm@setpaper@ifpre{b4paper}}%
    434 \define@key{Gm}{b5paper}[true]{\Gm@setpaper@ifpre{b5paper}}%
    435 \define@key{Gm}{b6paper}[true]{\Gm@setpaper@ifpre{b6paper}}%
    436 \define@key{Gm}{c0paper}[true]{\Gm@setpaper@ifpre{c0paper}}%
    437 \define@key{Gm}{c1paper}[true]{\Gm@setpaper@ifpre{c1paper}}%
    438 \define@key{Gm}{c2paper}[true]{\Gm@setpaper@ifpre{c2paper}}%
    439 \define@key{Gm}{c3paper}[true]{\Gm@setpaper@ifpre{c3paper}}%
    440 \define@key{Gm}{c4paper}[true]{\Gm@setpaper@ifpre{c4paper}}%
    441 \define@key{Gm}{c5paper}[true]{\Gm@setpaper@ifpre{c5paper}}%
    442 \define@key{Gm}{c6paper}[true]{\Gm@setpaper@ifpre{c6paper}}%
    443 \define@key{Gm}{b0j}[true]{\Gm@setpaper@ifpre{b0j}}%
    444 \define@key{Gm}{b1j}[true]{\Gm@setpaper@ifpre{b1j}}%
    445 \define@key{Gm}{b2j}[true]{\Gm@setpaper@ifpre{b2j}}%
    446 \define@key{Gm}{b3j}[true]{\Gm@setpaper@ifpre{b3j}}%
    447 \define@key{Gm}{b4j}[true]{\Gm@setpaper@ifpre{b4j}}%
    448 \define@key{Gm}{b5j}[true]{\Gm@setpaper@ifpre{b5j}}%
    449 \define@key{Gm}{b6j}[true]{\Gm@setpaper@ifpre{b6j}}%
    450 \define@key{Gm}{ansiapaper}[true]{\Gm@setpaper@ifpre{ansiapaper}}%
    451 \define@key{Gm}{ansibpaper}[true]{\Gm@setpaper@ifpre{ansibpaper}}%
    452 \define@key{Gm}{ansicpaper}[true]{\Gm@setpaper@ifpre{ansicpaper}}%
    453 \define@key{Gm}{ansidpaper}[true]{\Gm@setpaper@ifpre{ansidpaper}}%
    454 \define@key{Gm}{ansiepaper}[true]{\Gm@setpaper@ifpre{ansiepaper}}%
    455 \define@key{Gm}{letterpaper}[true]{\Gm@setpaper@ifpre{letterpaper}}%
    456 \define@key{Gm}{legalpaper}[true]{\Gm@setpaper@ifpre{legalpaper}}%
    457 \define@key{Gm}{executivepaper}[true]{\Gm@setpaper@ifpre{executivepaper}}%
    458 \define@key{Gm}{screen}[true]{\Gm@setpaper@ifpre{screen}}%
    459 \define@key{Gm}{paperwidth}{\ifGm@preamble{paperwidth}{%
    460   \def\Gm@paper{custom}\Gm@setlength\paperwidth{#1}}}%
    461 \define@key{Gm}{paperheight}{\ifGm@preamble{paperheight}{%
    462   \def\Gm@paper{custom}\Gm@setlength\paperheight{#1}}}%
    463 \define@key{Gm}{papersize}{\ifGm@preamble{papersize}{%
    464   \def\Gm@paper{custom}\Gm@branch{#1}{paperwidth}{paperheight}}}%
    465 \define@key{Gm}{layout}{\Gm@layouttrue\@nameuse{Gm@#1}{Gm@layout}}%
    466 \let\KV@Gm@layoutname\KV@Gm@layout
    467 \define@key{Gm}{layoutwidth}{\Gm@layouttrue\Gm@setlength\Gm@layoutwidth{#1}}%
    468 \define@key{Gm}{layoutheight}{\Gm@layouttrue\Gm@setlength\Gm@layoutheight{#1}}%
    469 \define@key{Gm}{layoutsize}{\Gm@branch{#1}{layoutwidth}{layoutheight}}%
    470 \define@key{Gm}{landscape}[true]{\ifGm@preamble{landscape}{%
    471   \Gm@doifelse{landscape}{#1}%
    472   {\ifGm@landscape\else\Gm@landscapetrue\Gm@reverse{swap@papersize}\fi}%
    473   {\ifGm@landscape\Gm@landscapefalse\Gm@reverse{swap@papersize}\fi}}}%
    474 \define@key{Gm}{portrait}[true]{\ifGm@preamble{portrait}{%
    475   \Gm@doifelse{portrait}{#1}%
    476   {\ifGm@landscape\Gm@landscapefalse\Gm@reverse{swap@papersize}\fi}%
    477   {\ifGm@landscape\else\Gm@landscapetrue\Gm@reverse{swap@papersize}\fi}}}%
    478 \define@key{Gm}{hscale}{\Gm@hbodytrue\edef\Gm@hscale{#1}}%
    479 \define@key{Gm}{vscale}{\Gm@vbodytrue\edef\Gm@vscale{#1}}%
    480 \define@key{Gm}{scale}{\Gm@branch{#1}{hscale}{vscale}}%
    481 \define@key{Gm}{width}{\Gm@hbodytrue\Gm@defbylen{width}{#1}}%
    482 \define@key{Gm}{height}{\Gm@vbodytrue\Gm@defbylen{height}{#1}}%
    483 \define@key{Gm}{total}{\Gm@branch{#1}{width}{height}}%
    484 \let\KV@Gm@totalwidth\KV@Gm@width
    485 \let\KV@Gm@totalheight\KV@Gm@height
    486 \define@key{Gm}{textwidth}{\Gm@hbodytrue\Gm@defbylen{textwidth}{#1}}%
    487 \define@key{Gm}{textheight}{\Gm@vbodytrue\Gm@defbylen{textheight}{#1}}%
    488 \define@key{Gm}{text}{\Gm@branch{#1}{textwidth}{textheight}}%
    489 \let\KV@Gm@body\KV@Gm@text
    490 \define@key{Gm}{lines}{\Gm@vbodytrue\Gm@defbycnt{lines}{#1}}%
    491 \define@key{Gm}{includehead}[true]{\Gm@setbool{includehead}{#1}}%
    492 \define@key{Gm}{includefoot}[true]{\Gm@setbool{includefoot}{#1}}%
    493 \define@key{Gm}{includeheadfoot}[true]{\Gm@doifelse{includeheadfoot}{#1}%
    494   {\Gm@includeheadtrue\Gm@includefoottrue}%
    495   {\Gm@includeheadfalse\Gm@includefootfalse}}%
    496 \define@key{Gm}{includemp}[true]{\Gm@setbool{includemp}{#1}}%
    497 \define@key{Gm}{includeall}[true]{\Gm@doifelse{includeall}{#1}%
    498   {\Gm@includeheadtrue\Gm@includefoottrue\Gm@includemptrue}%
    499   {\Gm@includeheadfalse\Gm@includefootfalse\Gm@includempfalse}}%
    500 \define@key{Gm}{ignorehead}[true]{%
    501   \Gm@setboolrev[ignorehead]{includehead}{#1}}%
    502 \define@key{Gm}{ignorefoot}[true]{%
    503   \Gm@setboolrev[ignorefoot]{includefoot}{#1}}%
    504 \define@key{Gm}{ignoreheadfoot}[true]{\Gm@doifelse{ignoreheadfoot}{#1}%
    505   {\Gm@includeheadfalse\Gm@includefootfalse}%
    506   {\Gm@includeheadtrue\Gm@includefoottrue}}%
    507 \define@key{Gm}{ignoremp}[true]{%
    508   \Gm@setboolrev[ignoremp]{includemp}{#1}}%
    509 \define@key{Gm}{ignoreall}[true]{\Gm@doifelse{ignoreall}{#1}%
    510   {\Gm@includeheadfalse\Gm@includefootfalse\Gm@includempfalse}%
    511   {\Gm@includeheadtrue\Gm@includefoottrue\Gm@includemptrue}}%
    512 \define@key{Gm}{heightrounded}[true]{\Gm@setbool{heightrounded}{#1}}%
    513 \define@key{Gm}{hdivide}{\Gm@parse@divide{#1}{lmargin}{width}{rmargin}}%
    514 \define@key{Gm}{vdivide}{\Gm@parse@divide{#1}{tmargin}{height}{bmargin}}%
    515 \define@key{Gm}{divide}{\Gm@parse@divide{#1}{lmargin}{width}{rmargin}%
    516   \Gm@parse@divide{#1}{tmargin}{height}{bmargin}}%
    517 \define@key{Gm}{lmargin}{\Gm@defbylen{lmargin}{#1}}%
    518 \define@key{Gm}{rmargin}{\Gm@defbylen{rmargin}{#1}}%
    519 \let\KV@Gm@left\KV@Gm@lmargin
    520 \let\KV@Gm@inner\KV@Gm@lmargin
    521 \let\KV@Gm@innermargin\KV@Gm@lmargin
    522 \let\KV@Gm@right\KV@Gm@rmargin
    523 \let\KV@Gm@outer\KV@Gm@rmargin
    524 \let\KV@Gm@outermargin\KV@Gm@rmargin
    525 \define@key{Gm}{tmargin}{\Gm@defbylen{tmargin}{#1}}%
    526 \define@key{Gm}{bmargin}{\Gm@defbylen{bmargin}{#1}}%
    527 \let\KV@Gm@top\KV@Gm@tmargin
    528 \let\KV@Gm@bottom\KV@Gm@bmargin
    529 \define@key{Gm}{hmargin}{\Gm@branch{#1}{lmargin}{rmargin}}%
    530 \define@key{Gm}{vmargin}{\Gm@branch{#1}{tmargin}{bmargin}}%
    531 \define@key{Gm}{margin}{\Gm@branch{#1}{lmargin}{tmargin}%
    532   \Gm@branch{#1}{rmargin}{bmargin}}%
    533 \define@key{Gm}{hmarginratio}{\edef\Gm@hmarginratio{#1}}%
    534 \define@key{Gm}{vmarginratio}{\edef\Gm@vmarginratio{#1}}%
    535 \define@key{Gm}{marginratio}{\Gm@branch{#1}{hmarginratio}{vmarginratio}}%
    536 \let\KV@Gm@hratio\KV@Gm@hmarginratio
    537 \let\KV@Gm@vratio\KV@Gm@vmarginratio
    538 \let\KV@Gm@ratio\KV@Gm@marginratio
    539 \define@key{Gm}{hcentering}[true]{\Gm@doifelse{hcentering}{#1}%
    540   {\def\Gm@hmarginratio{1:1}}{}}%
    541 \define@key{Gm}{vcentering}[true]{\Gm@doifelse{vcentering}{#1}%
    542   {\def\Gm@vmarginratio{1:1}}{}}%
    543 \define@key{Gm}{centering}[true]{\Gm@doifelse{centering}{#1}%
    544   {\def\Gm@hmarginratio{1:1}\def\Gm@vmarginratio{1:1}}{}}%
    545 \define@key{Gm}{twoside}[true]{\Gm@doifelse{twoside}{#1}%
    546   {\@twosidetrue\@mparswitchtrue}{\@twosidefalse\@mparswitchfalse}}%
    547 \define@key{Gm}{asymmetric}[true]{\Gm@doifelse{asymmetric}{#1}%
    548   {\@twosidetrue\@mparswitchfalse}{}}%
    549 \define@key{Gm}{bindingoffset}{\Gm@setlength\Gm@bindingoffset{#1}}%
    550 \define@key{Gm}{headheight}{\Gm@setlength\headheight{#1}}%
    551 \define@key{Gm}{headsep}{\Gm@setlength\headsep{#1}}%
    552 \define@key{Gm}{footskip}{\Gm@setlength\footskip{#1}}%
    553 \let\KV@Gm@head\KV@Gm@headheight
    554 \let\KV@Gm@foot\KV@Gm@footskip
    555 \define@key{Gm}{nohead}[true]{\Gm@doifelse{nohead}{#1}%
    556   {\Gm@setlength\headheight\z@\Gm@setlength\headsep\z@}{}}%
    557 \define@key{Gm}{nofoot}[true]{\Gm@doifelse{nofoot}{#1}%
    558   {\Gm@setlength\footskip\z@}{}}%
    559 \define@key{Gm}{noheadfoot}[true]{\Gm@doifelse{noheadfoot}{#1}%
    560   {\Gm@setlength\headheight\z@\Gm@setlength\headsep
    561   \z@\Gm@setlength\footskip\z@}{}}%
    562 \define@key{Gm}{footnotesep}{\Gm@setlength{\skip\footins}{#1}}%
    563 \define@key{Gm}{marginparwidth}{\Gm@setlength\marginparwidth{#1}}%
    564 \let\KV@Gm@marginpar\KV@Gm@marginparwidth
    565 \define@key{Gm}{marginparsep}{\Gm@setlength\marginparsep{#1}}%
    566 \define@key{Gm}{nomarginpar}[true]{\Gm@doifelse{nomarginpar}{#1}%
    567   {\Gm@setlength\marginparwidth\z@\Gm@setlength\marginparsep\z@}{}}%
    568 \define@key{Gm}{columnsep}{\Gm@setlength\columnsep{#1}}%
    569 \define@key{Gm}{hoffset}{\Gm@setlength\hoffset{#1}}%
    570 \define@key{Gm}{voffset}{\Gm@setlength\voffset{#1}}%
    571 \define@key{Gm}{offset}{\Gm@branch{#1}{hoffset}{voffset}}%
    572 \define@key{Gm}{layouthoffset}{\Gm@setlength\Gm@layouthoffset{#1}}%
    573 \define@key{Gm}{layoutvoffset}{\Gm@setlength\Gm@layoutvoffset{#1}}%
    574 \define@key{Gm}{layoutoffset}{\Gm@branch{#1}{layouthoffset}{layoutvoffset}}%
    575 \define@key{Gm}{twocolumn}[true]{%
    576   \Gm@doif{twocolumn}{#1}{\csname @twocolumn\Gm@bool\endcsname}}%
    577 \define@key{Gm}{onecolumn}[true]{%
    578   \Gm@doifelse{onecolumn}{#1}{\@twocolumnfalse}{\@twocolumntrue}}%
    579 \define@key{Gm}{reversemp}[true]{%
    580   \Gm@doif{reversemp}{#1}{\csname @reversemargin\Gm@bool\endcsname}}%
    581 \define@key{Gm}{reversemarginpar}[true]{%
    582   \Gm@doif{reversemarginpar}{#1}{\csname @reversemargin\Gm@bool\endcsname}}%
    583 \define@key{Gm}{driver}{\ifGm@preamble{driver}{%
    584   \edef\@@tempa{#1}\edef\@@auto{auto}\edef\@@none{none}%
    585   \ifx\@@tempa\@empty\let\Gm@driver\relax\else
    586   \ifx\@@tempa\@@none\let\Gm@driver\relax\else
    587   \ifx\@@tempa\@@auto\let\Gm@driver\@empty\else
    588   \setkeys{Gm}{#1}\fi\fi\fi\let\@@auto\relax\let\@@none\relax}}%
    589 \define@key{Gm}{dvips}[true]{\ifGm@preamble{dvips}{%
    590   \Gm@doifelse{dvips}{#1}{\Gm@setdriver{dvips}}{\Gm@unsetdriver{dvips}}}}%
    591 \define@key{Gm}{dvipdfm}[true]{\ifGm@preamble{dvipdfm}{%
    592   \Gm@doifelse{dvipdfm}{#1}{\Gm@setdriver{dvipdfm}}{\Gm@unsetdriver{dvipdfm}}}}%
    593 \define@key{Gm}{pdftex}[true]{\ifGm@preamble{pdftex}{%
    594   \Gm@doifelse{pdftex}{#1}{\Gm@setdriver{pdftex}}{\Gm@unsetdriver{pdftex}}}}%
    595 \define@key{Gm}{xetex}[true]{\ifGm@preamble{xetex}{%
    596   \Gm@doifelse{xetex}{#1}{\Gm@setdriver{xetex}}{\Gm@unsetdriver{xetex}}}}%
    597 \define@key{Gm}{vtex}[true]{\ifGm@preamble{vtex}{%
    598   \Gm@doifelse{vtex}{#1}{\Gm@setdriver{vtex}}{\Gm@unsetdriver{vtex}}}}%
    599 \define@key{Gm}{verbose}[true]{\ifGm@preamble{verbose}{\Gm@setbool{verbose}{#1}}}%
    600 \define@key{Gm}{reset}[true]{\ifGm@preamble{reset}{%
    601   \Gm@doifelse{reset}{#1}{\Gm@restore@org\Gm@initall
    602   \ProcessOptionsKV[c]{Gm}\Gm@setdefaultpaper}{}}}%
    603 \define@key{Gm}{resetpaper}[true]{\ifGm@preamble{resetpaper}{%
    604   \Gm@setbool{resetpaper}{#1}}}%
    605 \define@key{Gm}{mag}{\ifGm@preamble{mag}{\mag=#1}}%
    606 \define@key{Gm}{truedimen}[true]{\ifGm@preamble{truedimen}{%
    607   \Gm@doifelse{truedimen}{#1}{\let\Gm@truedimen\Gm@true}%
    608   {\let\Gm@truedimen\@empty}}}%
    609 \define@key{Gm}{pass}[true]{\ifGm@preamble{pass}{\Gm@setbool{pass}{#1}}}%
    610 \define@key{Gm}{showframe}[true]{\Gm@setbool{showframe}{#1}}%
    611 \define@key{Gm}{showcrop}[true]{\Gm@setbool{showcrop}{#1}}%
    612 \def\Gm@setdefaultpaper{%
    613   \ifx\Gm@paper\@undefined
    614     \Gm@setsize{paper}(\strip@pt\paperwidth,\strip@pt\paperheight){pt}%
    615     \Gm@setsize{Gm@layout}(\strip@pt\paperwidth,\strip@pt\paperheight){pt}%
    616     \Gm@swap@papersizefalse
    617   \fi}%
    618 \def\Gm@adjustpaper{%
    619   \ifdim\paperwidth>\p@\else
    620     \PackageError{geometry}{%
    621     \string\paperwidth\space(\the\paperwidth) too short}{%
    622     Set a paper type (e.g., `a4paper').}%
    623   \fi
    624   \ifdim\paperheight>\p@\else
    625     \PackageError{geometry}{%
    626     \string\paperheight\space(\the\paperheight) too short}{%
    627     Set a paper type (e.g., `a4paper').}%
    628   \fi
    629   \ifGm@swap@papersize
    630     \setlength\@tempdima{\paperwidth}%
    631     \setlength\paperwidth{\paperheight}%
    632     \setlength\paperheight{\@tempdima}%
    633   \fi
    634   \ifGm@layout\else
    635     \setlength\Gm@layoutwidth{\paperwidth}%
    636     \setlength\Gm@layoutheight{\paperheight}%
    637   \fi}%
    638 \def\Gm@checkmp{%
    639   \ifGm@includemp\else
    640     \@tempcnta\z@\@tempcntb\@ne
    641     \if@twocolumn
    642       \@tempcnta\@ne
    643     \else
    644       \if@reversemargin
    645         \@tempcnta\@ne\@tempcntb\z@
    646       \fi
    647     \fi
    648     \@tempdima\marginparwidth
    649     \advance\@tempdima\marginparsep
    650     \ifnum\@tempcnta=\@ne
    651       \@tempdimc\@tempdima
    652       \setlength\@tempdimb{\Gm@lmargin}%
    653       \advance\@tempdimc-\@tempdimb
    654       \ifdim\@tempdimc>\z@
    655         \Gm@warning{The marginal notes overrun the paper edge.^^J
    656         \@spaces Add \the\@tempdimc\space and more to the left margin}%
    657       \fi
    658     \fi
    659     \ifnum\@tempcntb=\@ne
    660       \@tempdimc\@tempdima
    661       \setlength\@tempdimb{\Gm@rmargin}%
    662       \advance\@tempdimc-\@tempdimb
    663       \ifdim\@tempdimc>\z@
    664         \Gm@warning{The marginal notes overrun the paper.^^J
    665         \@spaces Add \the\@tempdimc\space and more to the right margin}%
    666       \fi
    667     \fi
    668   \fi}%
    669 \def\Gm@adjustmp{%
    670   \ifGm@includemp
    671     \@tempdimb\marginparwidth
    672     \advance\@tempdimb\marginparsep
    673     \Gm@wd@mp\@tempdimb
    674     \Gm@odd@mp\z@
    675     \Gm@even@mp\z@
    676     \if@twocolumn
    677       \Gm@wd@mp2\@tempdimb
    678       \Gm@odd@mp\@tempdimb
    679       \Gm@even@mp\@tempdimb
    680     \else
    681       \if@reversemargin
    682         \Gm@odd@mp\@tempdimb
    683         \if@mparswitch\else
    684           \Gm@even@mp\@tempdimb
    685         \fi
    686       \else
    687         \if@mparswitch
    688           \Gm@even@mp\@tempdimb
    689         \fi
    690       \fi
    691     \fi
    692   \fi}%
    693 \def\Gm@adjustbody{
    694   \ifGm@hbody
    695     \ifx\Gm@width\@undefined
    696       \ifx\Gm@hscale\@undefined
    697         \Gm@defbylen{width}{\Gm@Dhscale\Gm@layoutwidth}%
    698       \else
    699         \Gm@defbylen{width}{\Gm@hscale\Gm@layoutwidth}%
    700       \fi
    701     \fi
    702     \ifx\Gm@textwidth\@undefined\else
    703       \setlength\@tempdima{\Gm@textwidth}%
    704       \ifGm@includemp
    705         \advance\@tempdima\Gm@wd@mp
    706       \fi
    707       \edef\Gm@width{\the\@tempdima}%
    708     \fi
    709   \fi
    710   \ifGm@vbody
    711     \ifx\Gm@height\@undefined
    712       \ifx\Gm@vscale\@undefined
    713         \Gm@defbylen{height}{\Gm@Dvscale\Gm@layoutheight}%
    714       \else
    715         \Gm@defbylen{height}{\Gm@vscale\Gm@layoutheight}%
    716       \fi
    717     \fi
    718     \ifx\Gm@lines\@undefined\else
    719       \ifdim\topskip<\ht\strutbox
    720         \setlength\@tempdima{\topskip}%
    721         \setlength\topskip{\ht\strutbox}%
    722         \Gm@warning{\noexpand\topskip was changed from \the\@tempdima\space
    723         to \the\topskip}%
    724       \fi
    725       \setlength\@tempdima{\baselineskip}%
    726       \multiply\@tempdima\Gm@lines
    727       \addtolength\@tempdima{\topskip}%
    728       \addtolength\@tempdima{-\baselineskip}%
    729       \edef\Gm@textheight{\the\@tempdima}%
    730     \fi
    731     \ifx\Gm@textheight\@undefined\else
    732       \setlength\@tempdima{\Gm@textheight}%
    733       \ifGm@includehead
    734         \addtolength\@tempdima{\headheight}%
    735         \addtolength\@tempdima{\headsep}%
    736       \fi
    737       \ifGm@includefoot
    738         \addtolength\@tempdima{\footskip}%
    739       \fi
    740       \edef\Gm@height{\the\@tempdima}%
    741     \fi
    742   \fi}%
    743 \def\Gm@process{%
    744   \ifGm@pass
    745     \Gm@restore@org
    746   \else
    747     \Gm@@process
    748   \fi}%
    749 \def\Gm@@process{%
    750   \Gm@expandlengths
    751   \Gm@adjustpaper
    752   \addtolength\Gm@layoutwidth{-\Gm@bindingoffset}%
    753   \Gm@adjustmp
    754   \Gm@adjustbody
    755   \Gm@detall{h}{width}{lmargin}{rmargin}%
    756   \Gm@detall{v}{height}{tmargin}{bmargin}%
    757   \setlength\textwidth{\Gm@width}%
    758   \setlength\textheight{\Gm@height}%
    759   \setlength\topmargin{\Gm@tmargin}%
    760   \setlength\oddsidemargin{\Gm@lmargin}%
    761   \addtolength\oddsidemargin{-1\Gm@truedimen in}%
    762   \ifGm@includemp
    763     \advance\textwidth-\Gm@wd@mp
    764     \advance\oddsidemargin\Gm@odd@mp
    765   \fi
    766   \if@mparswitch
    767     \setlength\evensidemargin{\Gm@rmargin}%
    768     \addtolength\evensidemargin{-1\Gm@truedimen in}%
    769     \ifGm@includemp
    770       \advance\evensidemargin\Gm@even@mp
    771     \fi
    772   \else
    773     \evensidemargin\oddsidemargin
    774   \fi
    775   \advance\oddsidemargin\Gm@bindingoffset
    776   \addtolength\topmargin{-1\Gm@truedimen in}%
    777   \ifGm@includehead
    778     \addtolength\textheight{-\headheight}%
    779     \addtolength\textheight{-\headsep}%
    780   \else
    781     \addtolength\topmargin{-\headheight}%
    782     \addtolength\topmargin{-\headsep}%
    783   \fi
    784   \ifGm@includefoot
    785     \addtolength\textheight{-\footskip}%
    786   \fi
    787   \ifGm@heightrounded
    788     \setlength\@tempdima{\textheight}%
    789     \addtolength\@tempdima{-\topskip}%
    790     \@tempcnta\@tempdima
    791     \@tempcntb\baselineskip
    792     \divide\@tempcnta\@tempcntb
    793     \setlength\@tempdimb{\baselineskip}%
    794     \multiply\@tempdimb\@tempcnta
    795     \advance\@tempdima-\@tempdimb
    796     \multiply\@tempdima\tw@
    797     \ifdim\@tempdima>\baselineskip
    798       \addtolength\@tempdimb{\baselineskip}%
    799     \fi
    800     \addtolength\@tempdimb{\topskip}%
    801     \textheight\@tempdimb
    802   \fi
    803   \advance\oddsidemargin\Gm@layouthoffset%
    804   \advance\evensidemargin\Gm@layouthoffset%
    805   \advance\topmargin\Gm@layoutvoffset%
    806   \addtolength\Gm@layoutwidth{\Gm@bindingoffset}%
    807   }% end of \Gm@@process
    808 \def\Gm@detectdriver{%
    809   \ifx\Gm@driver\@empty
    810     \typeout{*geometry* driver: auto-detecting}%
    811     \ifpdf
    812       \Gm@setdriver{pdftex}%
    813     \else
    814       \Gm@setdriver{dvips}%
    815     \fi
    816     \ifvtex
    817       \Gm@setdriver{vtex}%
    818     \fi
    819     \ifxetex
    820       \Gm@setdriver{xetex}
    821     \fi
    822   \else
    823     \ifx\Gm@driver\Gm@xetex %%
    824       \ifxetex\else
    825         \Gm@warning{Wrong driver setting: `xetex'; trying `pdftex' driver}%
    826         \Gm@setdriver{pdftex}
    827       \fi
    828     \fi
    829     \ifx\Gm@driver\Gm@vtex
    830       \ifvtex\else
    831         \Gm@warning{Wrong driver setting: `vtex'; trying `dvips' driver}%
    832         \Gm@setdriver{dvips}%
    833       \fi
    834     \fi
    835   \fi
    836   \ifx\Gm@driver\relax
    837     \typeout{*geometry* detected driver: <none>}%
    838   \else
    839     \typeout{*geometry* detected driver: \Gm@driver}%
    840   \fi}%
    841 \def\Gm@showparams#1{%
    842   \ifGm@verbose\expandafter\typeout\else\expandafter\wlog\fi
    843   {\Gm@logcontent{#1}}}%
    844 \def\Gm@showdim#1{* \string#1=\the#1^^J}%
    845 \def\Gm@showbool#1{\@nameuse{ifGm@#1}#1\space\fi}%
    846 \def\Gm@logcontent#1{%
    847   *geometry* verbose mode - [ #1 ] result:^^J%
    848   \ifGm@pass * pass: disregarded the geometry package!^^J%
    849   \else
    850   * driver: \if\Gm@driver<none>\else\Gm@driver\fi^^J%
    851   * paper: \ifx\Gm@paper\@undefined<default>\else\Gm@paper\fi^^J%
    852   * layout: \ifGm@layout<custom>\else<same size as paper>\fi^^J%
    853   \ifGm@layout
    854   * layout(width,height): (\the\Gm@layoutwidth,\the\Gm@layoutheight)^^J%
    855   \fi
    856   * layoutoffset:(h,v)=(\the\Gm@layouthoffset,\the\Gm@layoutvoffset)^^J%
    857   \@ifundefined{Gm@lines}{}{* lines: \Gm@lines^^J}%
    858   \@ifundefined{Gm@hmarginratio}{}{* hratio: \Gm@hmarginratio^^J}%
    859   \@ifundefined{Gm@vmarginratio}{}{* vratio: \Gm@vmarginratio^^J}%
    860   \ifdim\Gm@bindingoffset=\z@\else
    861   * bindingoffset: \the\Gm@bindingoffset^^J\fi
    862   * modes: %
    863    \Gm@showbool{landscape}%
    864    \Gm@showbool{includehead}%
    865    \Gm@showbool{includefoot}%
    866    \Gm@showbool{includemp}%
    867    \if@twoside twoside\space\fi%
    868    \if@mparswitch\else\if@twoside asymmetric\space\fi\fi%
    869    \Gm@showbool{heightrounded}%
    870    \ifx\Gm@truedimen\@empty\else truedimen\space\fi%
    871    \Gm@showbool{showframe}%
    872    \Gm@showbool{showcrop}%
    873   ^^J%
    874   * h-part:(L,W,R)=(\Gm@lmargin, \Gm@width, \Gm@rmargin)^^J%
    875   * v-part:(T,H,B)=(\Gm@tmargin, \Gm@height, \Gm@bmargin)^^J%
    876   \fi
    877   \Gm@showdim{\paperwidth}%
    878   \Gm@showdim{\paperheight}%
    879   \Gm@showdim{\textwidth}%
    880   \Gm@showdim{\textheight}%
    881   \Gm@showdim{\oddsidemargin}%
    882   \Gm@showdim{\evensidemargin}%
    883   \Gm@showdim{\topmargin}%
    884   \Gm@showdim{\headheight}%
    885   \Gm@showdim{\headsep}%
    886   \Gm@showdim{\topskip}%
    887   \Gm@showdim{\footskip}%
    888   \Gm@showdim{\marginparwidth}%
    889   \Gm@showdim{\marginparsep}%
    890   \Gm@showdim{\columnsep}%
    891   * \string\skip\string\footins=\the\skip\footins^^J%
    892   \Gm@showdim{\hoffset}%
    893   \Gm@showdim{\voffset}%
    894   \Gm@showdim{\mag}%
    895   * \string\@twocolumn\if@twocolumn true\else false\fi^^J%
    896   * \string\@twoside\if@twoside true\else false\fi^^J%
    897   * \string\@mparswitch\if@mparswitch true\else false\fi^^J%
    898   * \string\@reversemargin\if@reversemargin true\else false\fi^^J%
    899   * (1in=72.27pt=25.4mm, 1cm=28.453pt)^^J}%
    900 \def\Gm@cropmark(#1,#2,#3,#4){%
    901   \begin{picture}(0,0)
    902     \setlength\unitlength{1truemm}%
    903     \linethickness{0.25pt}%
    904     \put(#3,0){\line(#1,0){17}}%
    905     \put(0,#4){\line(0,#2){17}}%
    906   \end{picture}}%
    907 \providecommand*\vb@xt@{\vbox to}%
    908 \def\Gm@vrule{\vrule width 0.2pt height\textheight depth\z@}%
    909 \def\Gm@hrule{\hrule height 0.2pt depth\z@ width\textwidth}%
    910 \def\Gm@hruled{\hrule height\z@ depth0.2pt width\textwidth}%
    911 \newcommand*{\Gm@vrules@mpi}{%
    912   \hb@xt@\@tempdima{\llap{\Gm@vrule}\ignorespaces
    913   \hskip \textwidth\Gm@vrule\hskip \marginparsep
    914   \llap{\Gm@vrule}\hfil\Gm@vrule}}%
    915 \newcommand*{\Gm@vrules@mpii}{%
    916   \hb@xt@\@tempdima{\hskip-\marginparwidth\hskip-\marginparsep
    917   \llap{\Gm@vrule}\ignorespaces
    918   \hskip \marginparwidth\rlap{\Gm@vrule}\hskip \marginparsep
    919   \llap{\Gm@vrule}\hskip\textwidth\rlap{\Gm@vrule}\hss}}%
    920 \newcommand*{\Gm@pageframes}{%
    921   \vb@xt@\z@{%
    922    \ifGm@showcrop
    923     \vb@xt@\z@{\vskip-1\Gm@truedimen in\vskip\Gm@layoutvoffset%
    924      \hb@xt@\z@{\hskip-1\Gm@truedimen in\hskip\Gm@layouthoffset%
    925       \vb@xt@\Gm@layoutheight{%
    926        \let\protect\relax
    927        \hb@xt@\Gm@layoutwidth{\Gm@cropmark(-1,1,-3,3)\hfil\Gm@cropmark(1,1,3,3)}%
    928        \vfil
    929        \hb@xt@\Gm@layoutwidth{\Gm@cropmark(-1,-1,-3,-3)\hfil\Gm@cropmark(1,-1,3,-3)}}%
    930      \hss}%
    931     \vss}%
    932    \fi%
    933    \ifGm@showframe
    934     \if@twoside
    935      \ifodd\count\z@
    936        \let\@themargin\oddsidemargin
    937      \else
    938        \let\@themargin\evensidemargin
    939      \fi
    940     \fi
    941     \moveright\@themargin%
    942     \vb@xt@\z@{%
    943      \vskip\topmargin\vb@xt@\z@{\vss\Gm@hrule}%
    944      \vskip\headheight\vb@xt@\z@{\vss\Gm@hruled}%
    945      \vskip\headsep\vb@xt@\z@{\vss\Gm@hrule}%
    946      \@tempdima\textwidth
    947      \advance\@tempdima by \marginparsep
    948      \advance\@tempdima by \marginparwidth
    949      \if@mparswitch
    950       \ifodd\count\z@
    951        \Gm@vrules@mpi
    952       \else
    953        \Gm@vrules@mpii
    954       \fi
    955      \else
    956       \Gm@vrules@mpi
    957      \fi
    958      \vb@xt@\z@{\vss\Gm@hrule}%
    959      \vskip\footskip\vb@xt@\z@{\vss\Gm@hruled}%
    960      \vss}%
    961     \fi%
    962   }}%
    963 \def\ProcessOptionsKV{\@ifnextchar[%]
    964   {\@ProcessOptionsKV}{\@ProcessOptionsKV[]}}%
    965 \def\@ProcessOptionsKV[#1]#2{%
    966   \let\@tempa\@empty
    967   \@tempcnta\z@
    968   \if#1p\@tempcnta\@ne\else\if#1c\@tempcnta\tw@\fi\fi
    969   \ifodd\@tempcnta
    970    \edef\@tempa{\@ptionlist{\@currname.\@currext}}%
    971   \else
    972     \@for\CurrentOption:=\@classoptionslist\do{%
    973       \@ifundefined{KV@#2@\CurrentOption}%
    974       {}{\edef\@tempa{\@tempa,\CurrentOption,}}}%
    975     \ifnum\@tempcnta=\z@
    976       \edef\@tempa{\@tempa,\@ptionlist{\@currname.\@currext}}%
    977     \fi
    978   \fi
    979   \edef\@tempa{\noexpand\setkeys{#2}{\@tempa}}%
    980   \@tempa
    981   \AtEndOfPackage{\let\@unprocessedoptions\relax}}%
    982 \def\Gm@setkeys{\setkeys{Gm}}%
    983 \def\Gm@processconfig{%
    984   \let\Gm@origExecuteOptions\ExecuteOptions
    985   \let\ExecuteOptions\Gm@setkeys
    986   \InputIfFileExists{geometry.cfg}{}{}
    987   \let\ExecuteOptions\Gm@origExecuteOptions}%
    988 \Gm@save
    989 \edef\Gm@restore@org{\Gm@restore}%
    990 \Gm@initall
    991 \Gm@processconfig
    992 \ProcessOptionsKV[c]{Gm}%
    993 \Gm@setdefaultpaper
    994 \ProcessOptionsKV[p]{Gm}%
    995 \Gm@process
    996 \AtBeginDocument{%
    997   \Gm@savelength{paperwidth}%
    998   \Gm@savelength{paperheight}%
    999   \edef\Gm@restore@org{\Gm@restore}%
   1000   \ifGm@resetpaper
   1001     \edef\Gm@pw{\Gm@orgpw}%
   1002     \edef\Gm@ph{\Gm@orgph}%
   1003   \else
   1004     \edef\Gm@pw{\the\paperwidth}%
   1005     \edef\Gm@ph{\the\paperheight}%
   1006   \fi
   1007   \ifGm@pass\else
   1008     \ifnum\mag=\@m\else
   1009       \Gm@magtooffset
   1010       \divide\paperwidth\@m
   1011       \multiply\paperwidth\the\mag
   1012       \divide\paperheight\@m
   1013       \multiply\paperheight\the\mag
   1014     \fi
   1015   \fi
   1016   \Gm@detectdriver
   1017   \ifx\Gm@driver\Gm@xetex
   1018     \@ifundefined{pdfpagewidth}{}{%
   1019       \setlength\pdfpagewidth{\Gm@pw}%
   1020       \setlength\pdfpageheight{\Gm@ph}}%
   1021     \ifnum\mag=\@m\else
   1022       \ifx\Gm@truedimen\Gm@true
   1023         \setlength\paperwidth{\Gm@pw}%
   1024         \setlength\paperheight{\Gm@ph}%
   1025       \fi
   1026     \fi
   1027   \fi
   1028   \ifx\Gm@driver\Gm@pdftex
   1029     \@ifundefined{pdfpagewidth}{}{%
   1030       \setlength\pdfpagewidth{\Gm@pw}%
   1031       \setlength\pdfpageheight{\Gm@ph}}%
   1032     \ifnum\mag=\@m\else
   1033       \@tempdima=\mag sp%
   1034       \@ifundefined{pdfhorigin}{}{%
   1035         \divide\pdfhorigin\@tempdima
   1036         \multiply\pdfhorigin\@m
   1037         \divide\pdfvorigin\@tempdima
   1038         \multiply\pdfvorigin\@m}%
   1039       \ifx\Gm@truedimen\Gm@true
   1040         \setlength\paperwidth{\Gm@pw}%
   1041         \setlength\paperheight{\Gm@ph}%
   1042       \fi
   1043     \fi
   1044   \fi
   1045   \ifx\Gm@driver\Gm@vtex
   1046     \@ifundefined{mediawidth}{}{%
   1047       \mediawidth=\paperwidth
   1048       \mediaheight=\paperheight}%
   1049     \ifvtexdvi
   1050       \AtBeginDvi{\special{papersize=\the\paperwidth,\the\paperheight}}%
   1051     \fi
   1052   \fi
   1053   \ifx\Gm@driver\Gm@dvips
   1054     \AtBeginDvi{\special{papersize=\the\paperwidth,\the\paperheight}}%
   1055     \ifx\Gm@driver\Gm@dvips\ifGm@landscape
   1056       \AtBeginDvi{\special{! /landplus90 true store}}%
   1057     \fi\fi
   1058   \else\ifx\Gm@driver\Gm@dvipdfm
   1059     \ifcase\ifx\AtBeginShipoutFirst\relax\@ne\else
   1060         \ifx\AtBeginShipoutFirst\@undefined\@ne\else\z@\fi\fi
   1061       \AtBeginShipoutFirst{\special{papersize=\the\paperwidth,\the\paperheight}}%
   1062     \or
   1063       \AtBeginDvi{\special{papersize=\the\paperwidth,\the\paperheight}}%
   1064     \fi
   1065   \fi\fi
   1066   \@tempswafalse
   1067   \ifGm@showframe
   1068     \@tempswatrue
   1069   \else\ifGm@showcrop
   1070     \@tempswatrue
   1071   \fi\fi
   1072   \if@tempswa
   1073     \RequirePackage{atbegshi}%
   1074       \AtBeginShipout{\setbox\AtBeginShipoutBox=\vbox{%
   1075         \baselineskip\z@skip\lineskip\z@skip\lineskiplimit\z@
   1076         \Gm@pageframes\box\AtBeginShipoutBox}}%
   1077   \fi
   1078   \Gm@save
   1079   \edef\Gm@restore@pkg{\Gm@restore}%
   1080   \ifGm@verbose\ifGm@pass\else\Gm@checkmp\fi\fi
   1081   \Gm@showparams{preamble}%
   1082   \let\Gm@pw\relax
   1083   \let\Gm@ph\relax
   1084   }% end of \AtBeginDocument
   1085 \newcommand{\geometry}[1]{%
   1086   \Gm@clean
   1087   \setkeys{Gm}{#1}%
   1088   \Gm@process}%
   1089 \@onlypreamble\geometry
   1090 \DeclareRobustCommand\Gm@changelayout{%
   1091   \setlength{\@colht}{\textheight}
   1092   \setlength{\@colroom}{\textheight}%
   1093   \setlength{\vsize}{\textheight}
   1094   \setlength{\columnwidth}{\textwidth}%
   1095   \if@twocolumn%
   1096     \advance\columnwidth-\columnsep
   1097     \divide\columnwidth\tw@%
   1098     \@firstcolumntrue%
   1099   \fi%
   1100   \setlength{\hsize}{\columnwidth}%
   1101   \setlength{\linewidth}{\hsize}}%
   1102 \newcommand{\newgeometry}[1]{%
   1103   \clearpage
   1104   \Gm@restore@org
   1105   \Gm@initnewgm
   1106   \Gm@newgmtrue
   1107   \setkeys{Gm}{#1}%
   1108   \Gm@newgmfalse
   1109   \Gm@process
   1110   \ifnum\mag=\@m\else\Gm@magtooffset\fi
   1111   \Gm@changelayout
   1112   \Gm@showparams{newgeometry}}%
   1113 \newcommand{\restoregeometry}{%
   1114   \clearpage
   1115   \Gm@restore@pkg
   1116   \Gm@changelayout}%
   1117 \newcommand*{\savegeometry}[1]{%
   1118   \Gm@save
   1119   \expandafter\edef\csname Gm@restore@@#1\endcsname{\Gm@restore}}%
   1120 \newcommand*{\loadgeometry}[1]{%
   1121   \clearpage
   1122   \@ifundefined{Gm@restore@@#1}{%
   1123     \PackageError{geometry}{%
   1124     \string\loadgeometry : name `#1' undefined}{%
   1125     The name `#1' should be predefined with \string\savegeometry}%
   1126   }{\@nameuse{Gm@restore@@#1}%
   1127   \Gm@changelayout}}%
   1128 \endinput
   1129 %%
   1130 %% End of file `geometry.sty'.