OSDN Git Service

2020->2021; also regenerated luatexja-{ja,en}.pdf
[luatex-ja/luatexja.git] / src / patches / lltjp-geometry.sty
1 %
2 % lltjp-geometry.sty
3 %
4
5 \NeedsTeXFormat{LaTeX2e}
6 \ProvidesPackage{lltjp-geometry}[2020-12-29 Patch to geometry for LuaTeX-ja with vertical writing mode]
7 \RequirePackage{expl3}
8 \ifdefined\if@ltj@@geometry@tate\expandafter\endinput\fi
9 \newif\if@ltj@@geometry@tate
10 \newif\if@ltj@@geometry@forceoff
11 \@ltj@@geometry@tatefalse
12 \@ltj@@geometry@forceofffalse
13 \DeclareOption{force}{\@ltj@@geometry@tatetrue}
14 \DeclareOption{disable}{\@ltj@@geometry@forceofftrue}
15
16 \ProcessOptions\relax
17
18 \RequirePackage{ifluatex}
19 \ifluatex
20   \ifdefined\luatexjaLoaded\else
21     \PackageError{lltjp-geometry}{%
22           lltjp-geometry does not work without luatexja.
23         }{}
24 \fi
25 \else % pTeX
26 \def \AtBeginDvi #1{%
27   \global \setbox \@begindvibox
28     \vbox{\yoko\unvbox \@begindvibox #1}%
29 }
30 \fi
31
32 %============================================
33 \unless\ifdefined\ltj@ExecuteAfterPackage
34 \expandafter\newif\csname ifltj@ltfilehook@avail\endcsname
35 \@ifl@t@r\fmtversion{2020-10-01}{%
36   \@ifl@t@r\fmtversion{2020-10-02}{\ltj@ltfilehook@availtrue}
37     {%
38       \ifnum\patch@level<0\relax \ifnum\patch@level<-6 \ltj@ltfilehook@availtrue\fi
39       \else\ltj@ltfilehook@availtrue\fi
40     }%
41 }{}
42 \ifltj@ltfilehook@avail
43   \def\@@ltj@ExecuteAfterPackage#1{\AddToHook{package/after/#1}}
44   \def\@@ltj@ExecuteBeforePackage#1{\AddToHook{package/before/#1}}
45   \def\ltj@ExecuteAfterPackage{\@ifstar\@@ltj@ExecuteAfterPackage@star\@@ltj@ExecuteAfterPackage}
46   \def\@@ltj@ExecuteAfterPackage@star#1#2{%
47     \@ifpackageloaded{#1}{#2}{\@@ltj@ExecuteAfterPackage{#1}{#2}}%
48   }
49   \def\ltj@ExecuteBeforePackage{\@ifstar\@@ltj@ExecuteBeforePackage@star\@@ltj@ExecuteBeforePackage}
50   \def\@@ltj@ExecuteBeforePackage@star#1#2{%
51     \@ifpackageloaded{#1}{#2}{\@@ltj@ExecuteBeforePackage{#1}{#2}}%
52   }
53 \else
54   \RequirePackage{filehook}
55   \let\ltj@ExecuteAfterPackage=\AtEndOfPackageFile
56   \let\ltj@ExecuteBeforePackage=\AtBeginOfPackageFile
57 \fi
58 \fi
59 %============================================
60
61 \RequirePackage{etoolbox}
62 \newif\ifGm@ltj@layoutswitch
63 \let\orig@PackageWarningNoLine=\PackageWarningNoLine
64 % define ifGm@swap@papersize if it is undefined
65 \expandafter\newif\csname ifGm@swap@papersize\endcsname
66
67 \ExplSyntaxOn
68 \ltj@ExecuteBeforePackage{geometry}{%
69   \edef\Gm@ltj@topskip{\the\topskip}
70   \edef\Gm@ltj@headsep{\the\headsep}
71   \edef\Gm@ltj@footskip{\the\footskip}
72 \bool_set_false:N \l_tmpa_bool
73 \ifluatex
74   \ifnum\ltjgetparameter{direction}=3 \bool_set_true:N \l_tmpa_bool \fi
75 \else
76   \@gobble\iftrue\csname iftdir\endcsname \bool_set_true:N \l_tmpa_bool \fi
77 \fi
78 \ifltj@ltfilehook@avail
79   \prop_map_inline:Nn \g__hook_begindocument_code_prop
80     { \tl_if_in:nnT {#2} {\tate} {\bool_set_true:N \l_tmpa_bool} }
81 \else
82   \tl_if_in:NnT \@begindocumenthook {\tate} {\bool_set_true:N \l_tmpa_bool}
83 \fi
84 \bool_if:NT \l_tmpa_bool {
85   \if@ltj@@geometry@forceoff
86     \@ltj@@geometry@tatefalse
87   \else
88     \@ltj@@geometry@tatetrue
89     \let\PackageWarningNoLine\@gobbletwo% 警告抑止
90   \fi
91 }
92 }
93 \ExplSyntaxOff
94 \ltj@ExecuteAfterPackage{geometry}{%
95 \let\PackageWarningNoLine=\orig@PackageWarningNoLine
96 \if@ltj@@geometry@tate
97   \let\PackageWarningNoLine=\orig@PackageWarningNoLine
98 %%% ここからパッチ開始
99
100 % TODO: 
101 %  * pTeX, LuaTeX ともに truedimen が正しく動作しない
102 %  * pTeX  resetpaper が正しく動作しない
103
104 % `h', `v' は「水平」「垂直」を意味するが:
105 % ユーザー側では「紙の物理的な水平方向」「物理的な垂直方向」を,
106 % しかしパッケージ内部処理では「字送り方向」「行送り方向」を表す.
107 % そのため,key-value interface 内で h, v の交換を行う必要がある.
108
109 % twoside 指定時は,lmargin は小口側,rmargin はノド側の余白を指す.
110 % また,bindingoffset 偶数ページを右に,奇数ページを左にずらす.
111 \define@key{Gm}{hdivide}{\Gm@parse@divide{#1}{lmargin}{height}{rmargin}}%
112
113 \define@key{Gm}{vscale}{\Gm@hbodytrue\edef\Gm@hscale{#1}}%
114 \define@key{Gm}{hscale}{\Gm@vbodytrue\edef\Gm@vscale{#1}}%
115 \define@key{Gm}{vdivide}{\Gm@parse@divide{#1}{tmargin}{width}{bmargin}}%
116 \define@key{Gm}{divide}{\Gm@parse@divide{#1}{tmargin}{width}{bmargin}%
117   \Gm@parse@divide{#1}{lmargin}{height}{rmargin}}%
118 \define@key{Gm}{vmargin}{\Gm@branch{#1}{tmargin}{bmargin}}%
119 \define@key{Gm}{hmargin}{\Gm@branch{#1}{lmargin}{rmargin}}%
120 \define@key{Gm}{margin}{\Gm@branch{#1}{tmargin}{lmargin}%
121   \Gm@branch{#1}{bmargin}{rmargin}}%
122 \define@key{Gm}{headsep}{\Gm@defbylen{ltj@headsep}{#1}}%
123 \define@key{Gm}{footskip}{\Gm@defbylen{ltj@footskip}{#1}}%
124 \let\KV@Gm@foot\KV@Gm@footskip
125 \define@key{Gm}{vmarginratio}{\edef\Gm@hmarginratio{#1}}%
126 \define@key{Gm}{hmarginratio}{\edef\Gm@vmarginratio{#1}}%
127 \define@key{Gm}{nohead}[true]{\Gm@doifelse{nohead}{#1}%
128   {\Gm@setlength\headheight\z@\Gm@defbylen{ltj@headsep}\z@}{}}%
129 \define@key{Gm}{nofoot}[true]{\Gm@doifelse{nofoot}{#1}%
130   {\Gm@defbylen{ltj@footskip}\z@}{}}%
131 \define@key{Gm}{noheadfoot}[true]{\Gm@doifelse{noheadfoot}{#1}%
132   {\Gm@setlength\headheight\z@\Gm@defbylen{ltj@headsep}\z@
133   \Gm@defbylen{ltj@footskip}\z@}{}}%
134 \define@key{Gm}{layoutwidth}{\Gm@layouttrue\Gm@setlength\Gm@layoutheight{#1}}%
135 \define@key{Gm}{layoutheight}{\Gm@layouttrue\Gm@setlength\Gm@layoutwidth{#1}}%
136 \define@key{Gm}{layoutsize}{\Gm@branch{#1}{layoutwidth}{layoutheight}}%
137 \define@key{Gm}{layout}{\Gm@layouttrue\@nameuse{Gm@#1}{Gm@layout}%
138   \Gm@setlength\@tempdima{\Gm@layoutheight}%
139   \Gm@setlength\Gm@layoutheight{\Gm@layoutwidth}%
140   \Gm@setlength\Gm@layoutwidth{\@tempdima}%
141 }%
142
143 % \@mparswitch は傍注の出力位置を左右ページで変えるスイッチだが,
144 % geometry.sty はこれを左右ページのレイアウトを変えるか否かの判定にも使っている.
145 % 縦組クラスの場合は \@mparswitch は常に偽でないとおかしなことになるので
146 % \@mparswitch -> \Gm@ltj@layoutswitch と名称変更する.
147
148 \let\Gm@ltj@layoutswitch\@mparswitch
149 \@mparswitchfalse
150 \define@key{Gm}{twoside}[true]{\Gm@doifelse{twoside}{#1}%
151   {\@twosidetrue\Gm@ltj@layoutswitchtrue}{\@twosidefalse\Gm@ltj@layoutswitchfalse}}%
152 \define@key{Gm}{asymmetric}[true]{\Gm@doifelse{asymmetric}{#1}%
153   {\@twosidetrue\Gm@ltj@layoutswitchfalse}{}}%
154
155 % includemp 指定時は,\headsep (if reversemp || twocolumn) や,
156 % \footskip (if !reversemp || twocolumn) を傍注幅だけ増加させる.
157
158 % h <-> v
159 \def\Gm@Dhratio{2:3}% = top:bottom default
160 \def\Gm@Dvratio{1:1}% = left:right default for oneside
161 \def\Gm@Dvratiotwo{3:2}% = inner:outer default for twoside.
162 \ifGm@swap@papersize
163   % geometry.sty ロード時に landscape オプションが指定されていた場合,
164   % それによって用紙サイズの縦横が入れ替わってしまっているので補正する.
165   \setlength\@tempdima{\paperwidth}%
166   \setlength\paperwidth{\paperheight}%
167   \setlength\paperheight{\@tempdima}%
168 \fi
169
170 % save length
171 \def\Gm@save{%
172   \Gm@savelength{paperwidth}%
173   \Gm@savelength{paperheight}%
174   \Gm@savelength{textwidth}%
175   \Gm@savelength{textheight}%
176   \Gm@savelength{evensidemargin}%
177   \Gm@savelength{oddsidemargin}%
178   \Gm@savelength{topmargin}%
179   \Gm@savelength{headheight}%
180   %\Gm@savelength{headsep}%
181   \Gm@savelength{topskip}%
182   %\Gm@savelength{footskip}%
183   \Gm@savelength{baselineskip}%
184   \Gm@savelength{marginparwidth}%
185   \Gm@savelength{marginparsep}%
186   \Gm@savelength{columnsep}%
187   \Gm@savelength{hoffset}%
188   \Gm@savelength{voffset}
189   \Gm@savelength{Gm@layoutwidth}%
190   \Gm@savelength{Gm@layoutheight}%
191   \Gm@savelength{Gm@layouthoffset}%
192   \Gm@savelength{Gm@layoutvoffset}%
193   \Gm@saveboolean{@twocolumn}%
194   \Gm@saveboolean{@twoside}%
195   \Gm@saveboolean{Gm@ltj@layoutswitch}%
196   \Gm@saveboolean{@reversemargin}}%
197
198 % frame
199 \ifluatex
200   \def\Gm@pageframe@cmd{\vb@xt@\z@}
201 \else
202   \def\Gm@pageframe@cmd{\vb@xt@\z@\bgroup\yoko\aftergroup\egroup}
203 \fi
204 \renewcommand*{\Gm@pageframes}{%
205   \Gm@pageframe@cmd{%
206    \ifGm@showcrop
207     \vb@xt@\z@{\vskip-1\Gm@truedimen in\vskip\Gm@layoutvoffset%
208      \hb@xt@\z@{\hskip-1\Gm@truedimen in\hskip\Gm@layouthoffset%
209       \vb@xt@\Gm@layoutwidth{%
210        \let\protect\relax
211        \hb@xt@\Gm@layoutheight{\Gm@cropmark(-1,1,-3,3)\hfil\Gm@cropmark(1,1,3,3)}%
212        \vfil
213        \hb@xt@\Gm@layoutheight{\Gm@cropmark(-1,-1,-3,-3)\hfil\Gm@cropmark(1,-1,3,-3)}}%
214      \hss}%
215     \vss}%
216    \fi%
217    \ifGm@showframe
218     \if@twoside
219      \ifodd\count\z@
220        \let\@themargin\oddsidemargin
221      \else
222        \let\@themargin\evensidemargin
223      \fi
224     \fi
225     \moveright\@themargin%
226     \vb@xt@\z@{%
227      \vskip\topmargin\vb@xt@\z@{\vss\Gm@hrule}%
228      \vskip\headheight\vb@xt@\z@{\vss\Gm@hruled}%
229      \vskip\headsep\vb@xt@\z@{\vss\Gm@hrule}%
230      \if@reversemargin\vb@xt@\z@{%
231        \vss\vb@xt@\z@{\vss\Gm@hrule}%
232        \vskip\marginparwidth\vb@xt@\z@{\vss\Gm@hrule}%
233        \vskip\marginparsep
234      }\fi
235      \hb@xt@\textwidth{\llap{\Gm@vrule}\hfil\Gm@vrule}%
236      \vb@xt@\z@{\vss\Gm@hruled}%
237      \unless\if@reversemargin\vb@xt@\z@{%
238        \vskip\marginparsep\vb@xt@\z@{\vss\Gm@hrule}%
239        \vskip\marginparwidth\vb@xt@\z@{\vss\Gm@hruled}\vss%
240      }\fi%
241      \vskip\footskip\vb@xt@\z@{\vss\Gm@hruled}%
242      \vss}%
243     \fi%
244   }}
245 \def\Gm@detall#1#2#3#4{%
246   \@tempcnta\z@
247   \if#1h
248     \let\Gm@mratio\Gm@hmarginratio
249     \edef\Gm@Dmratio{\Gm@Dhratio}%
250   \else
251     \let\Gm@mratio\Gm@vmarginratio
252     \edef\Gm@Dmratio{\if@twoside\Gm@Dvratiotwo\else\Gm@Dvratio\fi}%
253   \fi
254   \if#1h
255     \ifx\Gm@tmargin\@undefined\else\advance\@tempcnta4\relax\fi
256     \ifGm@hbody\advance\@tempcnta2\relax\fi
257     \ifx\Gm@bmargin\@undefined\else\advance\@tempcnta1\relax\fi
258     \Gm@cnth\@tempcnta
259   \else
260     \ifx\Gm@lmargin\@undefined\else\advance\@tempcnta4\relax\fi
261     \ifGm@vbody\advance\@tempcnta2\relax\fi
262     \ifx\Gm@rmargin\@undefined\else\advance\@tempcnta1\relax\fi
263     \Gm@cntv\@tempcnta
264   \fi
265   \ifcase\@tempcnta
266     \if#1h
267       \Gm@defbylen{width}{\Gm@Dhscale\Gm@layoutwidth}%
268     \else
269       \Gm@defbylen{height}{\Gm@Dvscale\Gm@layoutheight}%
270     \fi
271     \Gm@detiiandiii{#2}{#3}{#4}%
272   \or
273     \ifx\Gm@mratio\@undefined
274       \if#1h
275         \Gm@defbylen{width}{\Gm@Dhscale\Gm@layoutwidth}%
276       \else
277         \Gm@defbylen{height}{\Gm@Dvscale\Gm@layoutheight}%
278       \fi
279       \setlength\@tempdimc{\@nameuse{Gm@#4}}%
280       \Gm@detiiandiii{#2}{#3}{#4}%
281       \expandafter\let\csname Gm@#2\endcsname\@undefined
282       \Gm@defbylen{#4}{\@tempdimc}%
283     \else
284       \Gm@setbyratio[f]{#1}{#4}{#3}%
285     \fi
286     \Gm@detiv{#2}{#3}{#4}{#2}%
287   \or\Gm@detiiandiii{#2}{#3}{#4}%
288   \or\Gm@detiv{#2}{#2}{#4}{#3}%
289   \or
290     \ifx\Gm@mratio\@undefined
291       \if#1h
292         \Gm@defbylen{width}{\Gm@Dhscale\Gm@layoutwidth}%
293       \else
294         \Gm@defbylen{height}{\Gm@Dvscale\Gm@layoutheight}%
295       \fi
296       \setlength\@tempdimc{\@nameuse{Gm@#3}}%
297       \Gm@detiiandiii{#2}{#4}{#3}%
298       \expandafter\let\csname Gm@#2\endcsname\@undefined
299       \Gm@defbylen{#3}{\@tempdimc}%
300     \else
301       \Gm@setbyratio[b]{#1}{#3}{#4}%
302     \fi
303     \Gm@detiv{#2}{#3}{#4}{#2}%
304   \or\Gm@detiv{#2}{#3}{#4}{#2}%
305   \or\Gm@detiv{#2}{#2}{#3}{#4}%
306   \or\Gm@warning{Over-specification in `#1'-direction.%
307                   ^^J\@spaces `#2' (\@nameuse{Gm@#2}) is ignored}%
308     \Gm@detiv{#2}{#3}{#4}{#2}%
309   \else\fi}%
310 \def\Gm@clean{%
311   \ifnum\Gm@cnth<4\let\Gm@tmargin\@undefined\fi
312   \ifodd\Gm@cnth\else\let\Gm@bmargin\@undefined\fi
313   \ifnum\Gm@cntv<4\let\Gm@lmargin\@undefined\fi
314   \ifodd\Gm@cntv\else\let\Gm@rmargin\@undefined\fi
315   \ifGm@hbody\else
316     \let\Gm@hscale\@undefined
317     \let\Gm@width\@undefined
318     \let\Gm@textwidth\@undefined
319   \fi
320   \ifGm@vbody\else
321     \let\Gm@vscale\@undefined
322     \let\Gm@height\@undefined
323     \let\Gm@textheight\@undefined
324   \fi
325   }%
326 \def\Gm@adjustpaper{%
327   \ifdim\paperwidth>\p@\else
328     \PackageError{geometry}{%
329     \string\paperwidth\space(\the\paperwidth) too short}{%
330     Set a paper type (e.g., `a4paper').}%
331   \fi
332   \ifdim\paperheight>\p@\else
333     \PackageError{geometry}{%
334     \string\paperheight\space(\the\paperheight) too short}{%
335     Set a paper type (e.g., `a4paper').}%
336   \fi
337   \ifGm@swap@papersize
338     \setlength\@tempdima{\paperwidth}%
339     \setlength\paperwidth{\paperheight}%
340     \setlength\paperheight{\@tempdima}%
341   \fi
342   \ifGm@layout\else
343     \setlength\Gm@layoutwidth{\paperheight}%
344     \setlength\Gm@layoutheight{\paperwidth}%
345   \fi}%
346 \def\Gm@adjustbody{
347   \ifGm@hbody
348     \ifx\Gm@width\@undefined
349       \ifx\Gm@hscale\@undefined
350         \Gm@defbylen{width}{\Gm@Dhscale\Gm@layoutwidth}%
351       \else
352         \Gm@defbylen{width}{\Gm@hscale\Gm@layoutwidth}%
353       \fi
354     \fi
355     \ifx\Gm@textwidth\@undefined\else
356       \setlength\@tempdima{\Gm@textwidth}%
357       \ifGm@includemp
358         \advance\@tempdima\Gm@wd@mp
359       \fi
360       \ifGm@includehead
361         \addtolength\@tempdima{\headheight}%
362         \addtolength\@tempdima{\headsep}%
363       \fi
364       \ifGm@includefoot
365         \addtolength\@tempdima{\footskip}%
366       \fi
367       \edef\Gm@width{\the\@tempdima}%
368     \fi
369   \fi
370   \ifGm@vbody
371     \ifx\Gm@height\@undefined
372       \ifx\Gm@vscale\@undefined
373         \Gm@defbylen{height}{\Gm@Dvscale\Gm@layoutheight}%
374       \else
375         \Gm@defbylen{height}{\Gm@vscale\Gm@layoutheight}%
376       \fi
377     \fi
378     \setlength\topskip\Gm@ltj@topskip
379     \ifx\Gm@lines\@undefined\else
380       \@tempdima=\f@size\p@ \@tempdima=.5\@tempdima
381       \ifluatex
382         \advance\@tempdima\ltjgetparameter{talbaselineshift}%
383       \else
384         \advance\@tempdima\tbaselineshift
385       \fi
386       \ifdim\maxdepth<\@tempdima
387         \PackageWarningNoLine{lltjp-geometry}%
388           {\noexpand\maxdepth was changed from \the\maxdepth\space
389             to \the\@tempdima}
390         \maxdepth\@tempdima
391       \fi
392       \setbox\z@=\hbox{\tate% next \ifdim must be executed in tate dir.
393         \ifdim\topskip<\ht\tstrutbox
394           \@tempdima\topskip
395           \global\topskip\ht\tstrutbox
396           \PackageWarningNoLine{lltjp-geometry}%
397             {\noexpand\topskip was changed from \the\@tempdima\space
398               to \the\topskip}
399         \fi}%
400       \setlength\@tempdima{\baselineskip}%
401       \multiply\@tempdima\Gm@lines
402       \addtolength\@tempdima{\topskip}%
403       \addtolength\@tempdima{-\baselineskip}%
404       \edef\Gm@textheight{\the\@tempdima}%
405     \fi
406     \ifx\Gm@textheight\@undefined\else
407       \edef\Gm@height{\Gm@textheight}%
408     \fi
409   \fi}%
410
411 \def\Gm@adjustmp{%
412   \ifGm@includemp
413     \@tempdimb\marginparwidth
414     \advance\@tempdimb\marginparsep
415     \Gm@wd@mp\@tempdimb
416     \if@twocolumn
417       \Gm@wd@mp2\@tempdimb
418     \fi
419   \fi}%
420 \def\Gm@@process{%
421   \Gm@expandlengths
422   \Gm@adjustpaper
423   \addtolength\Gm@layoutheight{-\Gm@bindingoffset}%
424   \Gm@adjustmp
425   \Gm@adjustbody
426   \Gm@detall{h}{width}{tmargin}{bmargin}%
427   \Gm@detall{v}{height}{lmargin}{rmargin}%
428   \setlength\textwidth{\Gm@width}%
429   \setlength\textheight{\Gm@height}%
430   \setlength\headsep{\Gm@ltj@headsep}%
431   \setlength\footskip{\Gm@ltj@footskip}%
432   \setlength\topmargin{\Gm@tmargin}%
433   \setlength\oddsidemargin{\Gm@lmargin}%
434   \addtolength\oddsidemargin{-1\Gm@truedimen in}%
435   \ifGm@ltj@layoutswitch
436     \setlength\evensidemargin{\Gm@rmargin}%
437     \addtolength\evensidemargin{-1\Gm@truedimen in}%
438   \else
439     \evensidemargin\oddsidemargin
440   \fi
441   \advance\evensidemargin\Gm@bindingoffset
442   \addtolength\topmargin{-1\Gm@truedimen in}%
443   \ifGm@includehead
444     \addtolength\textwidth{-\headheight}%
445     \addtolength\textwidth{-\headsep}%
446   \else
447     \addtolength\topmargin{-\headheight}%
448     \addtolength\topmargin{-\headsep}%
449   \fi
450   \ifGm@includefoot
451     \addtolength\textwidth{-\footskip}%
452   \fi
453   \ifGm@includemp
454     \advance\textwidth-\Gm@wd@mp
455     \if@twocolumn
456       \advance\headsep.5\Gm@wd@mp
457       \advance\footskip.5\Gm@wd@mp
458     \else\if@reversemargin
459       \advance\headsep\Gm@wd@mp
460     \else
461       \advance\footskip\Gm@wd@mp
462     \fi\fi
463   \fi
464   \ifGm@heightrounded
465     \setlength\@tempdima{\textheight}%
466     \addtolength\@tempdima{-\topskip}%
467     \@tempcnta\@tempdima
468     \@tempcntb\baselineskip
469     \divide\@tempcnta\@tempcntb
470     \setlength\@tempdimb{\baselineskip}%
471     \multiply\@tempdimb\@tempcnta
472     \advance\@tempdima-\@tempdimb
473     \multiply\@tempdima\tw@
474     \ifdim\@tempdima>\baselineskip
475       \addtolength\@tempdimb{\baselineskip}%
476     \fi
477     \addtolength\@tempdimb{\topskip}%
478     \textheight\@tempdimb
479   \fi
480   \advance\oddsidemargin\Gm@layouthoffset%
481   \advance\evensidemargin\Gm@layouthoffset%
482   \advance\topmargin\Gm@layoutvoffset%
483   \addtolength\Gm@layoutheight{\Gm@bindingoffset}%
484 }% end of \Gm@@process
485 % log
486 \def\Gm@logcontent#1{%
487   *geometry* verbose mode - [ #1 ] result:^^J%
488   \ifGm@pass * pass: disregarded the geometry package!^^J%
489   \else
490   * driver: \if\Gm@driver<none>\else\Gm@driver\fi^^J%
491   * paper: \ifx\Gm@paper\@undefined<default>\else\Gm@paper\fi^^J%
492   * layout: \ifGm@layout<custom>\else<same size as paper>\fi^^J%
493   \ifGm@layout
494   * layout(width,height): (\the\Gm@layoutwidth,\the\Gm@layoutheight)^^J%
495   \fi
496   * layoutoffset:(h,v)=(\the\Gm@layouthoffset,\the\Gm@layoutvoffset)^^J%
497   \@ifundefined{Gm@lines}{}{* lines: \Gm@lines^^J}%
498   \@ifundefined{Gm@hmarginratio}{}{* hratio: \Gm@hmarginratio^^J}%
499   \@ifundefined{Gm@vmarginratio}{}{* vratio: \Gm@vmarginratio^^J}%
500   \ifdim\Gm@bindingoffset=\z@\else
501   * bindingoffset: \the\Gm@bindingoffset^^J\fi
502   * modes: %
503    \Gm@showbool{landscape}%
504    \Gm@showbool{includehead}%
505    \Gm@showbool{includefoot}%
506    \Gm@showbool{includemp}%
507    \if@twoside twoside\space\fi%
508    \ifGm@ltj@layoutswitch\else\if@twoside asymmetric\space\fi\fi%
509    \Gm@showbool{heightrounded}%
510    \ifx\Gm@truedimen\@empty\else truedimen\space\fi%
511    \Gm@showbool{showframe}%
512    \Gm@showbool{showcrop}%
513   ^^J%
514   * h-part:(L,W,R)=(\Gm@lmargin, \Gm@height, \Gm@rmargin)^^J%
515   * v-part:(T,H,B)=(\Gm@tmargin, \Gm@width, \Gm@bmargin)^^J%
516   \fi
517   \Gm@showdim{\paperwidth}%
518   \Gm@showdim{\paperheight}%
519   \Gm@showdim{\textwidth}%
520   \Gm@showdim{\textheight}%
521   \Gm@showdim{\oddsidemargin}%
522   \Gm@showdim{\evensidemargin}%
523   \Gm@showdim{\topmargin}%
524   \Gm@showdim{\headheight}%
525   \Gm@showdim{\headsep}%
526   \Gm@showdim{\topskip}%
527   \Gm@showdim{\footskip}%
528   \Gm@showdim{\marginparwidth}%
529   \Gm@showdim{\marginparsep}%
530   \Gm@showdim{\columnsep}%
531   * \string\skip\string\footins=\the\skip\footins^^J%
532   \Gm@showdim{\hoffset}%
533   \Gm@showdim{\voffset}%
534   \Gm@showdim{\mag}%
535   * \string\@twocolumn\if@twocolumn true\else false\fi^^J%
536   * \string\@twoside\if@twoside true\else false\fi^^J%
537   * \string\@mparswitch\if@mparswitch true\else false\fi^^J%
538   * \string\@reversemargin\if@reversemargin true\else false\fi^^J%
539   * (1in=72.27pt=25.4mm, 1cm=28.453pt)^^J}%
540
541
542 \Gm@initall
543 \Gm@processconfig
544 \ProcessOptionsKV[c]{Gm}%
545 \Gm@setdefaultpaper
546 \ProcessOptionsKV[p]{Gm}%
547 \Gm@process
548
549 %%% 終了
550 \fi}
551 \endinput