OSDN Git Service

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