ソースコードの管理場所
Revisão | 01421fd75f2315990922b24158d5830d245da053 (tree) |
---|---|
Hora | 2014-11-22 21:27:01 |
Autor | Kazuki Maeda <kmaeda@kmae...> |
Commiter | Kazuki Maeda |
Add lltjp-geometry.sty: Patch to geometry for LuaTeX-ja with vertical writing mode.
@@ -63,6 +63,7 @@ | ||
63 | 63 | \ltj@pkgpatch{xunicode} |
64 | 64 | \ltj@pkgpatch{fontspec} |
65 | 65 | \ltj@pkgpatch{stfloats} |
66 | +\RequirePackage{lltjp-geometry} | |
66 | 67 | |
67 | 68 | |
68 | 69 | %%------------------ all done |
@@ -82,6 +82,7 @@ | ||
82 | 82 | % \changes{v1.6-ltj-5}{2014/07/02}{\cs{ifydir}, \cs{iftdir}を使わないように修正.} |
83 | 83 | % \changes{v1.6-ltj-6}{2014/07/28}{縦組クラスでlltjext.styを読み込むように修正.} |
84 | 84 | % \changes{v1.6-ltj-7}{2014/11/15}{縦組クラスとeveryshi.styとの相性が悪い問題を修正.} |
85 | +% \changes{v1.6-ltj-8}{2014/11/22}{縦組時のgeometry.styへの対応を別ファイル(lltjp-geometry.sty)に分離.それに伴いv1.6-ltj-3での変更を削除.} | |
85 | 86 | % \fi |
86 | 87 | % |
87 | 88 | % \iffalse |
@@ -177,10 +178,6 @@ | ||
177 | 178 | %<*article|report|book> |
178 | 179 | \RequirePackage{luatexja} |
179 | 180 | % \end{macrocode} |
180 | -% 縦組みの場合は|geometry|対応のために|filehook|も読み込んでおきます。 | |
181 | -% \begin{macrocode} | |
182 | -%<tate>\RequirePackage{filehook} | |
183 | -% \end{macrocode} | |
184 | 181 | % |
185 | 182 | % \section{オプションスイッチ} |
186 | 183 | % ここでは、後ほど使用するいくつかのコマンドやスイッチを定義しています。 |
@@ -324,19 +321,6 @@ | ||
324 | 321 | \setlength\paperheight {257mm} |
325 | 322 | \setlength\paperwidth {182mm}} |
326 | 323 | % \end{macrocode} |
327 | -% 縦組クラスについて、|geometry|パッケージが読み込まれると|\textwidth|と|\textheight|が | |
328 | -% ひっくり返ってしまう問題に対処します。 | |
329 | -% \begin{macrocode} | |
330 | -%<*tate> | |
331 | -\AtEndOfPackageFile{geometry}{% | |
332 | - \setlength{\@tempdima}{\textheight}% | |
333 | - \setlength{\textheight}{\textwidth}% | |
334 | - \setlength{\textwidth}{\@tempdima}% | |
335 | - \expandafter\def\expandafter\Gm@process\expandafter{\Gm@process | |
336 | - \setlength{\@tempdima}{\textheight}% | |
337 | - \setlength{\textheight}{\textwidth}% | |
338 | - \setlength{\textwidth}{\@tempdima}}} | |
339 | -%</tate> | |
340 | 324 | % |
341 | 325 | % \subsection{サイズオプション} |
342 | 326 | % 基準となるフォントの大きさを指定するオプションです。 |
@@ -3083,7 +3067,7 @@ | ||
3083 | 3067 | \advance\@enumdepth\@ne |
3084 | 3068 | \edef\@enumctr{enum\romannumeral\the\@enumdepth}% |
3085 | 3069 | \list{\csname label\@enumctr\endcsname}{% |
3086 | - \ifnum\ltjgetparameter{direction}=3 | |
3070 | + \ifnum\ltjgetparameter{direction}=3 | |
3087 | 3071 | \ifnum \@listdepth=\@ne \topsep.5\normalbaselineskip |
3088 | 3072 | \else\topsep\z@\fi |
3089 | 3073 | \parskip\z@ \itemsep\z@ \parsep\z@ |
@@ -3111,7 +3095,7 @@ | ||
3111 | 3095 | % \begin{macrocode} |
3112 | 3096 | \newcommand{\labelitemi}{\textbullet} |
3113 | 3097 | \newcommand{\labelitemii}{% |
3114 | - \ifnum\ltjgetparameter{direction}=3 | |
3098 | + \ifnum\ltjgetparameter{direction}=3 | |
3115 | 3099 | {\textcircled{~}} |
3116 | 3100 | \else |
3117 | 3101 | {\normalfont\bfseries\textendash} |
@@ -3136,7 +3120,7 @@ | ||
3136 | 3120 | \edef\@itemitem{labelitem\romannumeral\the\@itemdepth}% |
3137 | 3121 | \expandafter |
3138 | 3122 | \list{\csname \@itemitem\endcsname}{% |
3139 | - \ifnum\ltjgetparameter{direction}=3 | |
3123 | + \ifnum\ltjgetparameter{direction}=3 | |
3140 | 3124 | \ifnum \@listdepth=\@ne \topsep.5\normalbaselineskip |
3141 | 3125 | \else\topsep\z@\fi |
3142 | 3126 | \parskip\z@ \itemsep\z@ \parsep\z@ |
@@ -3161,7 +3145,7 @@ | ||
3161 | 3145 | % \begin{macrocode} |
3162 | 3146 | \newenvironment{description} |
3163 | 3147 | {\list{}{\labelwidth\z@ \itemindent-\leftmargin |
3164 | - \ifnum\ltjgetparameter{direction}=3 | |
3148 | + \ifnum\ltjgetparameter{direction}=3 | |
3165 | 3149 | \leftmargin\leftskip \advance\leftmargin3\Cwd |
3166 | 3150 | \rightmargin\rightskip |
3167 | 3151 | \labelsep=1\zw \itemsep\z@ |
@@ -42,7 +42,6 @@ | ||
42 | 42 | [2014/11/15 v1.6-ltj-7 |
43 | 43 | Standard LuaLaTeX-ja class] |
44 | 44 | \RequirePackage{luatexja} |
45 | -\RequirePackage{filehook} | |
46 | 45 | \newcounter{@paper} |
47 | 46 | \newif\if@landscape \@landscapefalse |
48 | 47 | \newcommand{\@ptsize}{} |
@@ -90,14 +89,6 @@ | ||
90 | 89 | \DeclareOption{b5p}{\setcounter{@paper}{4}\@stysizetrue |
91 | 90 | \setlength\paperheight {257mm} |
92 | 91 | \setlength\paperwidth {182mm}} |
93 | -\AtEndOfPackageFile{geometry}{% | |
94 | - \setlength{\@tempdima}{\textheight}% | |
95 | - \setlength{\textheight}{\textwidth}% | |
96 | - \setlength{\textwidth}{\@tempdima}% | |
97 | - \expandafter\def\expandafter\Gm@process\expandafter{\Gm@process | |
98 | - \setlength{\@tempdima}{\textheight}% | |
99 | - \setlength{\textheight}{\textwidth}% | |
100 | - \setlength{\textwidth}{\@tempdima}}} | |
101 | 92 | \if@compatibility |
102 | 93 | \renewcommand{\@ptsize}{0} |
103 | 94 | \else |
@@ -42,7 +42,6 @@ | ||
42 | 42 | [2014/11/15 v1.6-ltj-7 |
43 | 43 | Standard LuaLaTeX-ja class] |
44 | 44 | \RequirePackage{luatexja} |
45 | -\RequirePackage{filehook} | |
46 | 45 | \newcounter{@paper} |
47 | 46 | \newif\if@landscape \@landscapefalse |
48 | 47 | \newcommand{\@ptsize}{} |
@@ -92,14 +91,6 @@ | ||
92 | 91 | \DeclareOption{b5p}{\setcounter{@paper}{4}\@stysizetrue |
93 | 92 | \setlength\paperheight {257mm} |
94 | 93 | \setlength\paperwidth {182mm}} |
95 | -\AtEndOfPackageFile{geometry}{% | |
96 | - \setlength{\@tempdima}{\textheight}% | |
97 | - \setlength{\textheight}{\textwidth}% | |
98 | - \setlength{\textwidth}{\@tempdima}% | |
99 | - \expandafter\def\expandafter\Gm@process\expandafter{\Gm@process | |
100 | - \setlength{\@tempdima}{\textheight}% | |
101 | - \setlength{\textheight}{\textwidth}% | |
102 | - \setlength{\textwidth}{\@tempdima}}} | |
103 | 94 | \if@compatibility |
104 | 95 | \renewcommand{\@ptsize}{0} |
105 | 96 | \else |
@@ -42,7 +42,6 @@ | ||
42 | 42 | [2014/11/15 v1.6-ltj-7 |
43 | 43 | Standard LuaLaTeX-ja class] |
44 | 44 | \RequirePackage{luatexja} |
45 | -\RequirePackage{filehook} | |
46 | 45 | \newcounter{@paper} |
47 | 46 | \newif\if@landscape \@landscapefalse |
48 | 47 | \newcommand{\@ptsize}{} |
@@ -91,14 +90,6 @@ | ||
91 | 90 | \DeclareOption{b5p}{\setcounter{@paper}{4}\@stysizetrue |
92 | 91 | \setlength\paperheight {257mm} |
93 | 92 | \setlength\paperwidth {182mm}} |
94 | -\AtEndOfPackageFile{geometry}{% | |
95 | - \setlength{\@tempdima}{\textheight}% | |
96 | - \setlength{\textheight}{\textwidth}% | |
97 | - \setlength{\textwidth}{\@tempdima}% | |
98 | - \expandafter\def\expandafter\Gm@process\expandafter{\Gm@process | |
99 | - \setlength{\@tempdima}{\textheight}% | |
100 | - \setlength{\textheight}{\textwidth}% | |
101 | - \setlength{\textwidth}{\@tempdima}}} | |
102 | 93 | \if@compatibility |
103 | 94 | \renewcommand{\@ptsize}{0} |
104 | 95 | \else |
@@ -0,0 +1,171 @@ | ||
1 | +% | |
2 | +% lltjp-geometry.sty | |
3 | +% | |
4 | + | |
5 | +\NeedsTeXFormat{LaTeX2e} | |
6 | +\ProvidesPackage{lltjp-geometry}[2014/11/22 Patch to geometry for LuaTeX-ja with vertical writing mode] | |
7 | +\RequirePackage{luatexja} | |
8 | +\RequirePackage{filehook} | |
9 | + | |
10 | +\AtEndOfPackageFile{geometry}{% | |
11 | +\ifnum\ltjgetparameter{direction}=3% | |
12 | +\define@key{Gm}{hdivide}{\Gm@parse@divide{#1}{tmargin}{width}{bmargin}}% | |
13 | +\define@key{Gm}{vdivide}{\Gm@parse@divide{#1}{rmargin}{height}{lmargin}}% | |
14 | +\define@key{Gm}{divide}{\Gm@parse@divide{#1}{lmargin}{width}{rmargin}% | |
15 | + \Gm@parse@divide{#1}{rmargin}{height}{lmargin}}% | |
16 | +\define@key{Gm}{hmargin}{\Gm@branch{#1}{tmargin}{bmargin}}% | |
17 | +\define@key{Gm}{vmargin}{\Gm@branch{#1}{rmargin}{lmargin}}% | |
18 | +\define@key{Gm}{margin}{\Gm@branch{#1}{tmargin}{rmargin}% | |
19 | + \Gm@branch{#1}{bmargin}{lmargin}}% | |
20 | +\def\Gm@detall#1#2#3#4{% | |
21 | + \@tempcnta\z@ | |
22 | + \if#1h | |
23 | + \let\Gm@mratio\Gm@hmarginratio | |
24 | + \edef\Gm@Dmratio{\if@twoside\Gm@Dhratiotwo\else\Gm@Dhratio\fi}% | |
25 | + \else | |
26 | + \let\Gm@mratio\Gm@vmarginratio | |
27 | + \edef\Gm@Dmratio{\Gm@Dvratio}% | |
28 | + \fi | |
29 | + \if#1h | |
30 | + \ifx\Gm@tmargin\@undefined\else\advance\@tempcnta4\relax\fi | |
31 | + \ifGm@hbody\advance\@tempcnta2\relax\fi | |
32 | + \ifx\Gm@bmargin\@undefined\else\advance\@tempcnta1\relax\fi | |
33 | + \Gm@cnth\@tempcnta | |
34 | + \else | |
35 | + \ifx\Gm@lmargin\@undefined\else\advance\@tempcnta4\relax\fi | |
36 | + \ifGm@vbody\advance\@tempcnta2\relax\fi | |
37 | + \ifx\Gm@rmargin\@undefined\else\advance\@tempcnta1\relax\fi | |
38 | + \Gm@cntv\@tempcnta | |
39 | + \fi | |
40 | + \ifcase\@tempcnta | |
41 | + \if#1h | |
42 | + \Gm@defbylen{width}{\Gm@Dhscale\Gm@layoutwidth}% | |
43 | + \else | |
44 | + \Gm@defbylen{height}{\Gm@Dvscale\Gm@layoutheight}% | |
45 | + \fi | |
46 | + \Gm@detiiandiii{#2}{#3}{#4}% | |
47 | + \or | |
48 | + \ifx\Gm@mratio\@undefined | |
49 | + \if#1h | |
50 | + \Gm@defbylen{width}{\Gm@Dhscale\Gm@layoutwidth}% | |
51 | + \else | |
52 | + \Gm@defbylen{height}{\Gm@Dvscale\Gm@layoutheight}% | |
53 | + \fi | |
54 | + \setlength\@tempdimc{\@nameuse{Gm@#4}}% | |
55 | + \Gm@detiiandiii{#2}{#3}{#4}% | |
56 | + \expandafter\let\csname Gm@#2\endcsname\@undefined | |
57 | + \Gm@defbylen{#4}{\@tempdimc}% | |
58 | + \else | |
59 | + \Gm@setbyratio[f]{#1}{#4}{#3}% | |
60 | + \fi | |
61 | + \Gm@detiv{#2}{#3}{#4}{#2}% | |
62 | + \or\Gm@detiiandiii{#2}{#3}{#4}% | |
63 | + \or\Gm@detiv{#2}{#2}{#4}{#3}% | |
64 | + \or | |
65 | + \ifx\Gm@mratio\@undefined | |
66 | + \if#1h | |
67 | + \Gm@defbylen{width}{\Gm@Dhscale\Gm@layoutwidth}% | |
68 | + \else | |
69 | + \Gm@defbylen{height}{\Gm@Dvscale\Gm@layoutheight}% | |
70 | + \fi | |
71 | + \setlength\@tempdimc{\@nameuse{Gm@#3}}% | |
72 | + \Gm@detiiandiii{#2}{#4}{#3}% | |
73 | + \expandafter\let\csname Gm@#2\endcsname\@undefined | |
74 | + \Gm@defbylen{#3}{\@tempdimc}% | |
75 | + \else | |
76 | + \Gm@setbyratio[b]{#1}{#3}{#4}% | |
77 | + \fi | |
78 | + \Gm@detiv{#2}{#3}{#4}{#2}% | |
79 | + \or\Gm@detiv{#2}{#3}{#4}{#2}% | |
80 | + \or\Gm@detiv{#2}{#2}{#3}{#4}% | |
81 | + \or\Gm@warning{Over-specification in `#1'-direction.% | |
82 | + ^^J\@spaces `#2' (\@nameuse{Gm@#2}) is ignored}% | |
83 | + \Gm@detiv{#2}{#3}{#4}{#2}% | |
84 | + \else\fi}% | |
85 | +\def\Gm@adjustpaper{% | |
86 | + \ifdim\paperwidth>\p@\else | |
87 | + \PackageError{geometry}{% | |
88 | + \string\paperwidth\space(\the\paperwidth) too short}{% | |
89 | + Set a paper type (e.g., `a4paper').}% | |
90 | + \fi | |
91 | + \ifdim\paperheight>\p@\else | |
92 | + \PackageError{geometry}{% | |
93 | + \string\paperheight\space(\the\paperheight) too short}{% | |
94 | + Set a paper type (e.g., `a4paper').}% | |
95 | + \fi | |
96 | + \ifGm@swap@papersize | |
97 | + \setlength\@tempdima{\paperwidth}% | |
98 | + \setlength\paperwidth{\paperheight}% | |
99 | + \setlength\paperheight{\@tempdima}% | |
100 | + \fi | |
101 | + \ifGm@layout\else | |
102 | + \setlength\Gm@layoutwidth{\paperheight}% | |
103 | + \setlength\Gm@layoutheight{\paperwidth}% | |
104 | + \fi}% | |
105 | +\def\Gm@@process{% | |
106 | + \Gm@expandlengths | |
107 | + \Gm@adjustpaper | |
108 | + \addtolength\Gm@layoutwidth{-\Gm@bindingoffset}% | |
109 | + \Gm@adjustmp | |
110 | + \Gm@adjustbody | |
111 | + \Gm@detall{h}{width}{tmargin}{bmargin}% | |
112 | + \Gm@detall{v}{height}{lmargin}{rmargin}% | |
113 | + \setlength\textwidth{\Gm@width}% | |
114 | + \setlength\textheight{\Gm@height}% | |
115 | + \setlength\topmargin{\Gm@tmargin}% | |
116 | + \setlength\oddsidemargin{\Gm@lmargin}% | |
117 | + \addtolength\oddsidemargin{-1\Gm@truedimen in}% | |
118 | + \ifGm@includemp | |
119 | + \advance\textheight-\Gm@wd@mp | |
120 | + \advance\oddsidemargin\Gm@odd@mp | |
121 | + \fi | |
122 | + \if@mparswitch | |
123 | + \setlength\evensidemargin{\Gm@rmargin}% | |
124 | + \addtolength\evensidemargin{-1\Gm@truedimen in}% | |
125 | + \ifGm@includemp | |
126 | + \advance\evensidemargin\Gm@even@mp | |
127 | + \fi | |
128 | + \else | |
129 | + \evensidemargin\oddsidemargin | |
130 | + \fi | |
131 | + \advance\oddsidemargin\Gm@bindingoffset | |
132 | + \addtolength\topmargin{-1\Gm@truedimen in}% | |
133 | + \ifGm@includehead | |
134 | + \addtolength\textwidth{-\headheight}% | |
135 | + \addtolength\textwidth{-\headsep}% | |
136 | + \else | |
137 | + \addtolength\topmargin{-\headheight}% | |
138 | + \addtolength\topmargin{-\headsep}% | |
139 | + \fi | |
140 | + \ifGm@includefoot | |
141 | + \addtolength\textwidth{-\footskip}% | |
142 | + \fi | |
143 | + \ifGm@heightrounded | |
144 | + \setlength\@tempdima{\textheight}% | |
145 | + \addtolength\@tempdima{-\topskip}% | |
146 | + \@tempcnta\@tempdima | |
147 | + \@tempcntb\baselineskip | |
148 | + \divide\@tempcnta\@tempcntb | |
149 | + \setlength\@tempdimb{\baselineskip}% | |
150 | + \multiply\@tempdimb\@tempcnta | |
151 | + \advance\@tempdima-\@tempdimb | |
152 | + \multiply\@tempdima\tw@ | |
153 | + \ifdim\@tempdima>\baselineskip | |
154 | + \addtolength\@tempdimb{\baselineskip}% | |
155 | + \fi | |
156 | + \addtolength\@tempdimb{\topskip}% | |
157 | + \textheight\@tempdimb | |
158 | + \fi | |
159 | + \advance\oddsidemargin\Gm@layoutvoffset% | |
160 | + \advance\evensidemargin\Gm@layoutvoffset% | |
161 | + \advance\topmargin\Gm@layouthoffset% | |
162 | + \addtolength\Gm@layoutheight{\Gm@bindingoffset}% | |
163 | +}% end of \Gm@@process | |
164 | +\Gm@initall | |
165 | +\Gm@processconfig | |
166 | +\ProcessOptionsKV[c]{Gm}% | |
167 | +\Gm@setdefaultpaper | |
168 | +\ProcessOptionsKV[p]{Gm}% | |
169 | +\Gm@process | |
170 | +\fi} | |
171 | +\endinput |