OSDN Git Service

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