OSDN Git Service

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