summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/geometry
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2010-03-02 00:44:35 +0000
committerKarl Berry <karl@freefriends.org>2010-03-02 00:44:35 +0000
commit65293db75e3702db6206732e71cc68adbb0075a7 (patch)
tree177ac7f2e0c39f831b7937f4bafa8fd61290e220 /Master/texmf-dist/source/latex/geometry
parent22e1ea793c2800134b08e2148376a5dfa8722750 (diff)
geometry 5.2 (28feb10)
git-svn-id: svn://tug.org/texlive/trunk@17268 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/latex/geometry')
-rw-r--r--Master/texmf-dist/source/latex/geometry/geometry.dtx265
-rw-r--r--Master/texmf-dist/source/latex/geometry/geometry.ins2
2 files changed, 152 insertions, 115 deletions
diff --git a/Master/texmf-dist/source/latex/geometry/geometry.dtx b/Master/texmf-dist/source/latex/geometry/geometry.dtx
index 97135e1db6b..d8c03e6031c 100644
--- a/Master/texmf-dist/source/latex/geometry/geometry.dtx
+++ b/Master/texmf-dist/source/latex/geometry/geometry.dtx
@@ -50,12 +50,12 @@
%</ignore>
%<package|driver>\NeedsTeXFormat{LaTeX2e}
%<package>\ProvidesPackage{geometry}
-%<package> [2010/02/15 v5.1 Page Geometry]
+%<package> [2010/03/01 v5.2 Page Geometry]
%<*install>
\input docstrip.tex
\Msg{************************************************************************}
\Msg{* Installation}
-\Msg{* Package: geometry 2010/02/15 v5.1 Page Geometry}
+\Msg{* Package: geometry 2010/03/01 v5.2 Page Geometry}
\Msg{************************************************************************}
\keepsilent
@@ -121,7 +121,7 @@ the derived files: geometry.{sty,ins,drv}, geometry-samples.tex.
%</driver>
% \fi
%
-% \CheckSum{2722}
+% \CheckSum{2720}
%
% \CharacterTable
% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
@@ -189,9 +189,9 @@ the derived files: geometry.{sty,ins,drv}, geometry-samples.tex.
% This package provides a flexible and easy interface to page dimensions.
% You can change the page layout with intuitive parameters. For instance,
% if you want to set a margin to 2cm from each edge of the paper,
-% you can go just |\usepackage[margin=2cm]{geometry}|. With
-% |\newgeometry| command you can change the layout anywhere in the
-% document.
+% you can go just |\usepackage[margin=2cm]{geometry}|.
+% The page layout can be changed in the middle of the document
+% with |\newgeometry| command.
% \end{abstract}
%
% \section{Preface to version 5}
@@ -1111,6 +1111,10 @@ the derived files: geometry.{sty,ins,drv}, geometry-samples.tex.
% |offset=|\argii{hoffset}{voffset} or |offset=|\meta{length}.
% \item[twocolumn] sets |twocolumn| mode with \cs{@twocolumntrue}.
% |twocolumn=false| denotes onecolumn mode with\cs{@twocolumnfalse}.
+% Instead of |twocolumn=false|, you can specify |onecolumn| (which
+% defaults to |true|)
+% \item[onecolumn] works as |twocolumn=false|. On the other hand,
+% |onecolumn=false| is equivalent to |twocolumn|.
% \item[twoside] sets both \cs{@twosidetrue} and \cs{@mparswitchtrue}.
% See Section~\ref{sec:margin}.
% \item[textwidth] sets \cs{textwidth} directly. See Section~\ref{sec:body}.
@@ -1796,7 +1800,7 @@ the derived files: geometry.{sty,ins,drv}, geometry-samples.tex.
% \end{macrocode}
% \begin{macro}{\Gm@cnth}
% \begin{macro}{\Gm@cntv}
-% Counters for horizontal and vertical partitioning patterns.
+% The counters for horizontal and vertical partitioning patterns.
% \begin{macrocode}
\newcount\Gm@cnth
\newcount\Gm@cntv
@@ -1809,7 +1813,7 @@ the derived files: geometry.{sty,ins,drv}, geometry-samples.tex.
% \end{macrocode}
% \end{macro}
% \begin{macro}{\Gm@bindingoffset}
-% An additional inner offset for binding.
+% The binding offset for the inner margin.
% \begin{macrocode}
\newdimen\Gm@bindingoffset
% \end{macrocode}
@@ -1829,7 +1833,7 @@ the derived files: geometry.{sty,ins,drv}, geometry-samples.tex.
% \begin{macro}{\Gm@layoutheight}
% \begin{macro}{\Gm@layouthoffset}
% \begin{macro}{\Gm@layoutvoffset}
-% The dimensions for the layout.
+% The dimensions for the layout area.
% \begin{macrocode}
\newdimen\Gm@layoutwidth
\newdimen\Gm@layoutheight
@@ -1838,20 +1842,23 @@ the derived files: geometry.{sty,ins,drv}, geometry-samples.tex.
% \end{macrocode}
% \end{macro}\end{macro}\end{macro}\end{macro}
% \begin{macro}{\Gm@dimlist}
-% The token in which \LaTeX{} Native dimensions are stored.
+% The token in which \LaTeX{} native dimensions can be stored.
% \begin{macrocode}
\newtoks\Gm@dimlist
% \end{macrocode}
% \end{macro}
-%
% \begin{macro}{\Gm@warning}
-% Macro for printing warning messages.
+% The macro to print warning messages.
% \begin{macrocode}
\def\Gm@warning#1{\PackageWarningNoLine{geometry}{#1}}%
% \end{macrocode}
% \end{macro}
% \begin{macro}{\ifGm@preamble}
-% process the options only if it's specified in the preamble.
+% The macro executes the option given as an argument
+% only if it's specified in the preamble, as the options of
+% |\usepackage| and/or the argument of |\geometry|. Otherwise,
+% the macro would print the warning message and ignores
+% the option setting.
% \begin{macrocode}
\def\ifGm@preamble#1{%
\ifGm@newgm
@@ -1861,32 +1868,29 @@ the derived files: geometry.{sty,ins,drv}, geometry-samples.tex.
\fi}%
% \end{macrocode}
% \end{macro}
-%
% \begin{macro}{\Gm@Dhratio}
% \begin{macro}{\Gm@Dhratiotwo}
% \begin{macro}{\Gm@Dvratio}
-% The default values for the horizontal and vertical \textsl{marginalratio}
-% are defined. \cs{Gm@Dhratiotwo} denotes the default value of
-% horizonal \textsl{marginratio} for twoside page layout with
-% left and right margins swapped on verso pages, which is
-% set by |twoside|.
+% The default values for the horizontal and vertical
+% \textsl{marginalratio} are defined. \cs{Gm@Dhratiotwo} denotes the
+% default value of horizonal \textsl{marginratio} for twoside
+% page layout with left and right margins swapped on verso pages,
+% which is set by |twoside|.
% \begin{macrocode}
\def\Gm@Dhratio{1:1}% = left:right default for oneside
\def\Gm@Dhratiotwo{2:3}% = inner:outer default for twoside.
\def\Gm@Dvratio{2:3}% = top:bottom default
% \end{macrocode}
% \end{macro}\end{macro}\end{macro}
-%
% \begin{macro}{\Gm@Dhscale}
% \begin{macro}{\Gm@Dvscale}
% The default values for the horizontal and vertical \textsl{scale}
-% are defined.
+% are defined with $0.7$.
% \begin{macrocode}
\def\Gm@Dhscale{0.7}%
\def\Gm@Dvscale{0.7}%
% \end{macrocode}
% \end{macro}\end{macro}
-%
% \begin{macro}{\Gm@dvips}%
% \begin{macro}{\Gm@dvipdfm}%
% \begin{macro}{\Gm@pdftex}%
@@ -1901,15 +1905,14 @@ the derived files: geometry.{sty,ins,drv}, geometry-samples.tex.
\def\Gm@vtex{vtex}%
% \end{macrocode}
% \end{macro}\end{macro}\end{macro}\end{macro}\end{macro}
-%
% \begin{macro}{\Gm@true}%
% \begin{macro}{\Gm@false}%
+% The macros for |true| and |false|.
% \begin{macrocode}
\def\Gm@true{true}%
\def\Gm@false{false}%
% \end{macrocode}
% \end{macro}\end{macro}
-%
% \begin{macro}{\Gm@orgpw}
% \begin{macro}{\Gm@orgph}
% These macros keep original paper (media) size intact.
@@ -1918,16 +1921,16 @@ the derived files: geometry.{sty,ins,drv}, geometry-samples.tex.
\edef\Gm@orgph{\the\paperheight}%
% \end{macrocode}
% \end{macro}\end{macro}
-%
% \begin{macro}{\Gm@savelength}
+% The macro saves the specified length to |\Gm@restore|.
% \begin{macrocode}
\def\Gm@savelength#1{%
- \edef\@@tmp{\expandafter\the\csname #1\endcsname}%
\g@addto@macro\Gm@restore{\expandafter\noexpand\expandafter\csname
#1\endcsname\expandafter=\expandafter\the\csname #1\endcsname\relax}}
% \end{macrocode}
% \end{macro}
% \begin{macro}{\Gm@saveboolean}
+% The macro saves the specified boolean to |\Gm@restore|.
% \begin{macrocode}
\def\Gm@saveboolean#1{%
\csname if#1\endcsname
@@ -1938,11 +1941,14 @@ the derived files: geometry.{sty,ins,drv}, geometry-samples.tex.
% \end{macrocode}
% \end{macro}
% \begin{macro}{\Gm@restore}
+% The initialization for |\Gm@restore|.
% \begin{macrocode}
\def\Gm@restore{}%
% \end{macrocode}
% \end{macro}
% \begin{macro}{\Gm@save}
+% The definition of the macro saving the real lengths
+% \LaTeX\ options.
% \begin{macrocode}
\def\Gm@save{%
\Gm@savelength{paperwidth}%
@@ -1971,6 +1977,8 @@ the derived files: geometry.{sty,ins,drv}, geometry-samples.tex.
% \end{macrocode}
% \end{macro}
% \begin{macro}{\Gm@initnewgm}
+% The macro initializes the parameters for layout
+% in |\newgeometry|.
% \begin{macrocode}
\def\Gm@initnewgm{%
\Gm@dimlist={}
@@ -1998,8 +2006,9 @@ the derived files: geometry.{sty,ins,drv}, geometry-samples.tex.
\Gm@bindingoffset\z@}%
% \end{macrocode}
% \end{macro}
-%
% \begin{macro}{\Gm@initall}
+% This initialization is called as soon as the package is load
+% It's also called as soon as |reset| option is specified.
% \begin{macrocode}
\def\Gm@initall{%
\let\Gm@driver\@empty
@@ -2014,7 +2023,6 @@ the derived files: geometry.{sty,ins,drv}, geometry-samples.tex.
\Gm@initnewgm}%
% \end{macrocode}
% \end{macro}
-%
% \begin{macro}{\Gm@setdriver}
% The macro sets the specified driver.
% \begin{macrocode}
@@ -2029,10 +2037,9 @@ the derived files: geometry.{sty,ins,drv}, geometry-samples.tex.
\expandafter\ifx\csname Gm@#1\endcsname\Gm@driver\let\Gm@driver\@empty\fi}%
% \end{macrocode}
% \end{macro}
-%
% \begin{macro}{\Gm@setbool}
% \begin{macro}{\Gm@setboolrev}
-% The macros set a boolean option.
+% The macros for boolean option processing.
% \begin{macrocode}
\def\Gm@setbool{\@dblarg\Gm@@setbool}%
\def\Gm@setboolrev{\@dblarg\Gm@@setboolrev}%
@@ -2045,7 +2052,7 @@ the derived files: geometry.{sty,ins,drv}, geometry-samples.tex.
% \begin{macro}{\Gm@doifelse}
% \cs{Gm@doif} excutes the third argument |#3| using a boolean value
% |#2| of a option |#1|. \cs{Gm@doifelse} executes the third
-% argument |#3| if a boolean option |#1| with its value |#2| is |true|,
+% argument |#3| if a boolean option |#1| with its value |#2| |true|,
% and executes the fourth argument |#4| if |false|.
% \begin{macrocode}
\def\Gm@doif#1#2#3{%
@@ -2069,7 +2076,6 @@ the derived files: geometry.{sty,ins,drv}, geometry-samples.tex.
\Gm@doif{#1}{#2}{\ifx\Gm@bool\Gm@true #3\else #4\fi}}%
% \end{macrocode}
% \end{macro}\end{macro}
-%
% \begin{macro}{\Gm@reverse}
% The macro reverses a bool value.
% \begin{macrocode}
@@ -2122,7 +2128,6 @@ the derived files: geometry.{sty,ins,drv}, geometry-samples.tex.
\expandafter\edef\csname Gm@#4\endcsname{\the\@tempdimb}}%
% \end{macrocode}
% \end{macro}
-%
% \begin{macro}{\Gm@detiv}
% This macro determines the fourth length(|#4|) from |#1|(\glen{layoutwidth}
% or \glen{layoutheight}), |#2| and |#3|. It is used in
@@ -2813,6 +2818,13 @@ the derived files: geometry.{sty,ins,drv}, geometry-samples.tex.
\Gm@doif{twocolumn}{#1}{\csname @twocolumn\Gm@bool\endcsname}}%
% \end{macrocode}
% \end{key}
+% \begin{key}{Gm}{onecolumn}
+% This option has the reverse effect of |twocolumn| option.
+% \begin{macrocode}
+\define@key{Gm}{onecolumn}[true]{%
+ \Gm@doifelse{onecolumn}{#1}{\@twocolumnfalse}{\@twocolumntrue}}%
+% \end{macrocode}
+% \end{key}
% \begin{key}{Gm}{reversemp}
% \begin{key}{Gm}{reversemarginpar}
% The both options set \cs{reversemargin}.
@@ -2903,13 +2915,14 @@ the derived files: geometry.{sty,ins,drv}, geometry-samples.tex.
% \end{macrocode}
% \end{key}
% \begin{key}{Gm}{showframe}
-% The showframe option.
+% The showframe option prints page frames to help you understand
+% what the resulting layout is like.
% \begin{macrocode}
\define@key{Gm}{showframe}[true]{\Gm@setbool{showframe}{#1}}%
% \end{macrocode}
% \end{key}
% \begin{key}{Gm}{showcrop}
-% The showcrop option.
+% The showcrop option prints cropmarks at the corners.
% \begin{macrocode}
\define@key{Gm}{showcrop}[true]{\Gm@setbool{showcrop}{#1}}%
% \end{macrocode}
@@ -2956,9 +2969,8 @@ the derived files: geometry.{sty,ins,drv}, geometry-samples.tex.
\fi}%
% \end{macrocode}
% \end{macro}
-%
% \begin{macro}{\Gm@checkmp}
-% The macro checks whether or not marginpars overrun the page.
+% The macro checks whether or not the marginpars overrun the page.
% \begin{macrocode}
\def\Gm@checkmp{%
\ifGm@includemp\else
@@ -2978,7 +2990,7 @@ the derived files: geometry.{sty,ins,drv}, geometry-samples.tex.
\advance\@tempdimc-\@tempdimb
\ifdim\@tempdimc>\z@
\Gm@warning{The marginal notes overrun the paper edge.^^J
- \@spaces Add \the\@tempdimc\space and more to the left margin}%
+ \@spaces Add \the\@tempdimc\space and more to the left margin}%
\fi
\fi
\ifnum\@tempcntb=\@ne
@@ -2987,19 +2999,17 @@ the derived files: geometry.{sty,ins,drv}, geometry-samples.tex.
\advance\@tempdimc-\@tempdimb
\ifdim\@tempdimc>\z@
\Gm@warning{The marginal notes overrun the paper.^^J
- \@spaces Add \the\@tempdimc\space and more to the right margin}%
+ \@spaces Add \the\@tempdimc\space and more to the right margin}%
\fi
\fi
\fi}%
% \end{macrocode}
% \end{macro}
-%
% \begin{macro}{\Gm@adjustmp}
% The macro sets marginpar correction when |includemp| is set,
-% which is used in \cs{Gm@process}.
-% Local variables \cs{Gm@wd@mp}, \cs{Gm@odd@mp} and \cs{Gm@even@mp}
-% are set here. Note that \cs{Gm@even@mp} should be used only for twoside
-% layout.
+% which is used in \cs{Gm@process}. The variables \cs{Gm@wd@mp},
+% \cs{Gm@odd@mp} and \cs{Gm@even@mp} are set here.
+% Note that \cs{Gm@even@mp} should be used only for twoside layout.
% \begin{macrocode}
\def\Gm@adjustmp{%
\ifGm@includemp
@@ -3027,7 +3037,6 @@ the derived files: geometry.{sty,ins,drv}, geometry-samples.tex.
\fi}%
% \end{macrocode}
% \end{macro}
-%
% \begin{macro}{\Gm@adjustbody}
% If the horizontal dimension of \gpart{body} is specified by user,
% \cs{Gm@width} is set properly here.
@@ -3050,8 +3059,6 @@ the derived files: geometry.{sty,ins,drv}, geometry-samples.tex.
\fi
\fi
% \end{macrocode}
-% \end{macro}
-%
% If the vertical dimension of \gpart{body} is specified by user,
% \cs{Gm@height} is set properly here.
% \begin{macrocode}
@@ -3096,9 +3103,9 @@ the derived files: geometry.{sty,ins,drv}, geometry-samples.tex.
\fi
\fi}%
% \end{macrocode}
-%
+% \end{macro}
% \begin{macro}{\Gm@process}
-% The main macro processing specified layout dimensions is defined.
+% The main macro processing the specified dimensions is defined.
% \begin{macrocode}
\def\Gm@process{%
% \end{macrocode}
@@ -3261,7 +3268,6 @@ the derived files: geometry.{sty,ins,drv}, geometry-samples.tex.
\fi}%
% \end{macrocode}
% \end{macro}
-%
% \begin{macro}{\Gm@showparams}
% Prints the resulted parammeters and dimensions to STDOUT
% if |verbose| is true.
@@ -3274,8 +3280,8 @@ the derived files: geometry.{sty,ins,drv}, geometry-samples.tex.
\fi
\ifGm@verbose\expandafter\typeout\else\expandafter\wlog\fi
{\Gm@logcontent{#1}}}%
+\def\Gm@showdim#1{* \string#1=\the#1^^J}%
\def\Gm@showbool#1{\@nameuse{ifGm@#1}#1\space\fi}%
-\def\Gm@showdim#1{*gm \string#1=\the#1^^J}%
% \end{macrocode}
% \end{macro}
% \begin{macro}{\Gm@logcontent}
@@ -3283,21 +3289,21 @@ the derived files: geometry.{sty,ins,drv}, geometry-samples.tex.
% page layout.
% \begin{macrocode}
\def\Gm@logcontent#1{%
- *geometry* verbose: parameters #1^^J%
- \ifGm@pass *gm: pass (ignores the geometry layout)^^J%
+ *geometry* verbose mode - [ #1 ] result:^^J%
+ \ifGm@pass * pass (ignores the geometry layout)^^J%
\else
- \if\Gm@driver\relax *gm driver: <none>^^J\else *gm driver: \Gm@driver^^J\fi
- \ifx\Gm@paper\@undefined *gm paper: \the\paperwidth, \the\paperheight^^J%
- \else *gm paper: \Gm@paper^^J\fi
- \ifGm@layout *gm layout: \the\Gm@layoutwidth, \the\Gm@layoutheight^^J%
- \else *gm layout: (same as paper)^^J\fi
- \@ifundefined{Gm@lines}{}{*gm lines: \Gm@lines^^J}%
- \@ifundefined{Gm@hmarginratio}{}{*gm hratio: \Gm@hmarginratio^^J}%
- \@ifundefined{Gm@vmarginratio}{}{*gm vratio: \Gm@vmarginratio^^J}%
- \ifdim\Gm@bindingoffset=\z@\else *gm bindingoffset: \the\Gm@bindingoffset^^J\fi
- *gm L,W,R: \Gm@lmargin, \Gm@width, \Gm@rmargin^^J%
- *gm T,H,B: \Gm@tmargin, \Gm@height, \Gm@bmargin^^J%
- *gm switch-on: %
+ * driver: \if\Gm@driver\relax <none>\else\Gm@driver\fi^^J%
+ * paper: \ifx\Gm@paper\@undefined\the\paperwidth,
+ \the\paperheight\space(class default)\else\Gm@paper\fi^^J%
+ * layout: \ifGm@layout \the\Gm@layoutwidth, \the\Gm@layoutheight
+ \else\ifx\Gm@paper\@undefined\the\paperwidth,
+ \the\paperheight\else\Gm@paper\fi\fi^^J%
+ \@ifundefined{Gm@lines}{}{* lines: \Gm@lines^^J}%
+ \@ifundefined{Gm@hmarginratio}{}{* hratio: \Gm@hmarginratio^^J}%
+ \@ifundefined{Gm@vmarginratio}{}{* vratio: \Gm@vmarginratio^^J}%
+ \ifdim\Gm@bindingoffset=\z@\else
+ * bindingoffset: \the\Gm@bindingoffset^^J\fi
+ * switch(es): %
\Gm@showbool{landscape}%
\Gm@showbool{includehead}%
\Gm@showbool{includefoot}%
@@ -3305,8 +3311,10 @@ the derived files: geometry.{sty,ins,drv}, geometry-samples.tex.
\if@twoside twoside\space\fi%
\if@mparswitch\else\if@twoside asymmetric\space\fi\fi%
\Gm@showbool{heightrounded}%
- \ifx\Gm@truedimen\@empty\else *gm truedimen\space\fi%
+ \ifx\Gm@truedimen\@empty\else truedimen\space\fi%
^^J%
+ * h-part:(L,W,R)=(\Gm@lmargin, \Gm@width, \Gm@rmargin)^^J%
+ * v-part:(T,H,B)=(\Gm@tmargin, \Gm@height, \Gm@bmargin)^^J%
\fi
\Gm@showdim{\paperwidth}%
\Gm@showdim{\paperheight}%
@@ -3321,19 +3329,19 @@ the derived files: geometry.{sty,ins,drv}, geometry-samples.tex.
\Gm@showdim{\marginparwidth}%
\Gm@showdim{\marginparsep}%
\Gm@showdim{\columnsep}%
- *gm \string\skip\string\footins=\the\skip\footins^^J%
+ * \string\skip\string\footins=\the\skip\footins^^J%
\Gm@showdim{\hoffset}%
\Gm@showdim{\voffset}%
\Gm@showdim{\mag}%
- \if@twocolumn *gm\space\string\@twocolumntrue^^J\fi%
- \if@twoside *gm\space\string\@twosidetrue^^J\fi%
- \if@mparswitch *gm\space\string\@mparswitchtrue^^J\fi%
- \if@reversemargin *gm\space\string\@reversemargintrue^^J\fi%
- *gm (1in=72.27pt, 1cm=28.4528pt)}%
+ * \string\@twocolumn\if@twocolumn true\else false\fi^^J%
+ * \string\@twoside\if@twoside true\else false\fi^^J%
+ * \string\@mparswitch\if@mparswitch true\else false\fi^^J%
+ * \string\@reversemargin\if@reversemargin true\else false\fi^^J%
+ * (1in=72.27pt, 1cm=28.453pt)^^J}%
% \end{macrocode}
% \end{macro}
%
-% macros for frames and cropmarks
+% Macros for the page frames and cropmarks.
% \begin{macrocode}
\def\Gm@cropmark(#1,#2,#3,#4){%
\begin{picture}(0,0)
@@ -3413,8 +3421,8 @@ the derived files: geometry.{sty,ins,drv}, geometry-samples.tex.
%
% \begin{macro}{\ProcessOptionsKV}
% This macro can process class and package options using `key=value'
-% scheme. Only class options are processed with an optional argument `|c|',
-% package options with `|p|' , and both of them by default.
+% scheme. Only class options are processed with an optional argument
+% `|c|', package options with `|p|' , and both of them by default.
% \begin{macrocode}
\def\ProcessOptionsKV{\@ifnextchar[%]
{\@ProcessOptionsKV}{\@ProcessOptionsKV[]}}%
@@ -3452,9 +3460,8 @@ the derived files: geometry.{sty,ins,drv}, geometry-samples.tex.
% \end{macrocode}
% \end{macro}
%
-% The original page layout before loading \Gm\ is saved with
-% |\Gm@save| and can be called by |\Gm@restore@org|.
-% which will be used when |reset| or |pass| is specified.
+% The original page layout before loading \Gm\ is saved here.
+% |\Gm@restore@org| is defined here for |reset| option.
% \begin{macrocode}
\Gm@save
\edef\Gm@restore@org{\Gm@restore}%
@@ -3481,13 +3488,20 @@ the derived files: geometry.{sty,ins,drv}, geometry-samples.tex.
\Gm@process
% \end{macrocode}
%
-% |verbose|, |showframe| and driver options are processed
-% at \cs{begin}|{document}|.
+% \begin{macro}{\AtBeginDocument}
+% The processes for |verbose|, |showframe| and drivers are added to
+% |\AtBeginDocument|.
+% |\Gm@restore@org| is redefined here with the paper size specified
+% in the preamble for |\newgeometry| to use it. This should be done
+% before magnifying the paper size with |\mag| because the layout
+% calculation would be affected by changing the paper size.
% \begin{macrocode}
\AtBeginDocument{%
+ \Gm@savelength{paperwidth}%
+ \Gm@savelength{paperheight}%
+ \edef\Gm@restore@org{\Gm@restore}%
% \end{macrocode}
-% Paper size is temporally adjusted according to \cs{mag} for
-% printing devices.
+% The original paper size is used if |resetpaper|.
% \begin{macrocode}
\ifGm@resetpaper
\edef\Gm@pw{\Gm@orgpw}%
@@ -3497,7 +3511,8 @@ the derived files: geometry.{sty,ins,drv}, geometry-samples.tex.
\edef\Gm@ph{\the\paperheight}%
\fi
% \end{macrocode}
-% If |pass| is set to |true|, no adjustment for page dimensions is done.
+% If |pass| is not set, the paper size is multiplied
+% according to the specified |mag|.
% \begin{macrocode}
\ifGm@pass\else
\ifnum\mag=\@m\else
@@ -3513,7 +3528,8 @@ the derived files: geometry.{sty,ins,drv}, geometry-samples.tex.
% \begin{macrocode}
\Gm@detectdriver
% \end{macrocode}
-% |xetex|
+% If |xetex| and |\pdfpagewidth| is defined,
+% |\pdfpagewidth| and |\pdfpageheight| would be set.
% \begin{macrocode}
\ifx\Gm@driver\Gm@xetex
\@ifundefined{pdfpagewidth}{}{%
@@ -3594,28 +3610,34 @@ the derived files: geometry.{sty,ins,drv}, geometry-samples.tex.
\renewcommand*{\shipout}{\afterassignment\gm@shipi\setbox\@cclv=}
\fi\fi
% \end{macrocode}
-% Here the layout dimensions are saved. The layout can be restored
-% by \cs{restoregeometry} command.
+% The layout dimensions for \cs{restoregeometry} are saved
+% at the end of the \cs{AtBeginDocument}.
% \begin{macrocode}
\Gm@save
\edef\Gm@restore@pkg{\Gm@restore}%
% \end{macrocode}
-% If |verbose=true| and |pass=false|, the system checks
-% if marginpars overrun the page.
+% The package checks whether or not the marginpars overrun the page,
+% if |verbose| and unless |pass|.
% \begin{macrocode}
\ifGm@verbose\ifGm@pass\else\Gm@checkmp\fi\fi
% \end{macrocode}
-% |\Gm@showparams| puts the resulted parameters and dimensions
-% into the log file. If |verbose| is true, they are displayed
-% on the terminal as well.
+% |\Gm@showparams| puts the resulting parameters and dimensions
+% into the log file. With |verbose|, they are shown on the terminal
+% as well.
+% \begin{macrocode}
+ \Gm@showparams{preamble}%
+% \end{macrocode}
+% The following lines free the memories no longer needed.
% \begin{macrocode}
- \Gm@showparams{in the preamble}%
+ \let\Gm@pw\relax
+ \let\Gm@ph\relax
}% end of \AtBeginDocument
% \end{macrocode}
+% \end{macro}
%
% \begin{macro}{\geometry}
-% The user-interface macro \cs{geometry} is defined here.
-% This command should be used in the preamble.
+% The macro \cs{geometry} can be called multiple times
+% in the preamble (before |\begin{document}|).
% \begin{macrocode}
\newcommand{\geometry}[1]{%
\Gm@clean
@@ -3624,22 +3646,30 @@ the derived files: geometry.{sty,ins,drv}, geometry-samples.tex.
\@onlypreamble\geometry
% \end{macrocode}
% \end{macro}
-%
% \begin{macro}{\Gm@changelayout}
+% The macro, which can be called from |\newgeometry|,
+% |\restoregeometry| and |\loadgeometry|, changes the layout
+% in the middle of the document.
% \begin{macrocode}
\DeclareRobustCommand\Gm@changelayout{%
- \setlength{\@colht}{\textheight}\setlength{\@colroom}{\textheight}%
- \setlength{\vsize}{\textheight}\setlength{\columnwidth}{\textwidth}%
+ \setlength{\@colht}{\textheight}
+ \setlength{\@colroom}{\textheight}%
+ \setlength{\vsize}{\textheight}
+ \setlength{\columnwidth}{\textwidth}%
\if@twocolumn%
- \advance\columnwidth-\columnsep \divide\columnwidth\tw@%
+ \advance\columnwidth-\columnsep
+ \divide\columnwidth\tw@%
\@firstcolumntrue%
\fi%
\setlength{\hsize}{\columnwidth}%
\setlength{\linewidth}{\hsize}}%
% \end{macrocode}
% \end{macro}
-%
% \begin{macro}{\newgeometry}
+% The macro |\newgeometry|, which changes the layout,
+% can be used only in the document.
+% It would reset the options specified in the preamble except for
+% paper size options and |\mag|.
% \begin{macrocode}
\newcommand\newgeometry[1]{%
\clearpage
@@ -3649,11 +3679,14 @@ the derived files: geometry.{sty,ins,drv}, geometry-samples.tex.
\setkeys{Gm}{#1}%
\Gm@newgmfalse
\Gm@process
+ \ifnum\mag=\@m\else\Gm@magtooffset\fi
\Gm@changelayout
- \Gm@showparams{by \string\newgeometry}}%
+ \Gm@showparams{newgeometry}}%
% \end{macrocode}
% \end{macro}
% \begin{macro}{\restoregeometry}
+% The macro restores the resulting layout specified in the preamble,
+% namely the first-page layout right after |\begin{document}|.
% \begin{macrocode}
\newcommand\restoregeometry{%
\clearpage
@@ -3662,6 +3695,9 @@ the derived files: geometry.{sty,ins,drv}, geometry-samples.tex.
% \end{macrocode}
% \end{macro}
% \begin{macro}{\savegeometry}
+% The macro saves the layout with the name specified
+% with the argument. The saved layout can be loaded
+% with |\loadgeometry{|\meta{name}|}|.
% \begin{macrocode}
\newcommand*\savegeometry[1]{%
\Gm@save
@@ -3669,6 +3705,9 @@ the derived files: geometry.{sty,ins,drv}, geometry-samples.tex.
% \end{macrocode}
% \end{macro}
% \begin{macro}{\loadgeometry}
+% The macro loads the layout saved with |\savegeometry{|\meta{name}|}|.
+% If the name is not found, the macro would warn it and
+% do nothing for the layout.
% \begin{macrocode}
\newcommand*\loadgeometry[1]{%
\clearpage
@@ -3697,12 +3736,12 @@ the derived files: geometry.{sty,ins,drv}, geometry-samples.tex.
% \end{macrocode}
%
% \section{Sample file}
-% Here is an executable sample tex file.
+% Here is a sample document for the \Gm\ package.
% \begin{macrocode}
%<*samples>
%<<SAVE_INTACT
-\documentclass{article}% uses letterpaper by default
-% \documentclass[a4paper]{article}% for A4 paper
+\documentclass[12pt]{article}% uses letterpaper by default
+% \documentclass[12pt,a4paper]{article}% for A4 paper
%---------------------------------------------------------------
% Edit and uncomment one of the settings below
%---------------------------------------------------------------
@@ -3733,18 +3772,16 @@ the derived files: geometry.{sty,ins,drv}, geometry-samples.tex.
%---------------------------------------------------------------
% No need to change below
%---------------------------------------------------------------
-\geometry{verbose,showframe}% options appended.
-\newcommand\mynote{\marginpar%
-[\raggedright\rule{\marginparwidth}{.7pt}\\A left side note.]%
-{\raggedright\rule{\marginparwidth}{.7pt}\\A side note.}}%
-\def\fox{A quick brown fox jumps over the lazy dog. }
-\def\fivefoxes{\fox\fox\fox\fox\fox}
-\def\manyfoxes{\fivefoxes\mynote\fivefoxes\par\fivefoxes\fivefoxes\par}
-% \let\mynote\relax % removes marginal notes.
+\geometry{verbose,showframe}% the options appended.
+\usepackage{lipsum}% for dummy text of 150 paragraphs
+\newcommand\mynote{\marginpar[\raggedright
+A sample margin note in the left side.]%
+{\raggedright A sample margin note.}}%
+\newcommand\myfootnote{\footnote{This is a sample footnote text.}}
\begin{document}
-\manyfoxes\manyfoxes\manyfoxes\manyfoxes
-\manyfoxes\manyfoxes\manyfoxes\manyfoxes
-\manyfoxes\manyfoxes\manyfoxes\manyfoxes
+\lipsum[1-2]\mynote\lipsum[3-4]\mynote
+\lipsum[5-11]\mynote\lipsum[12]\myfootnote
+\lipsum[13-22]\mynote\lipsum[23-32]
\end{document}
%SAVE_INTACT
%</samples>
diff --git a/Master/texmf-dist/source/latex/geometry/geometry.ins b/Master/texmf-dist/source/latex/geometry/geometry.ins
index 4a5da0e4e7e..6a61d98c4ed 100644
--- a/Master/texmf-dist/source/latex/geometry/geometry.ins
+++ b/Master/texmf-dist/source/latex/geometry/geometry.ins
@@ -26,7 +26,7 @@
\input docstrip.tex
\Msg{************************************************************************}
\Msg{* Installation}
-\Msg{* Package: geometry 2010/02/15 v5.1 Page Geometry}
+\Msg{* Package: geometry 2010/03/01 v5.2 Page Geometry}
\Msg{************************************************************************}
\keepsilent