OSDN Git Service

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