OSDN Git Service

lltjp-geometry.sty: fix computation of \topskip
[luatex-ja/luatexja.git] / src / ltjclasses.dtx
index 05cfe8c..0715a48 100644 (file)
@@ -10,7 +10,7 @@
 %
 % \fi
 %
-% \CheckSum{4478}
+% \CheckSum{4533}
 %% \CharacterTable
 %%  {Upper-case    \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
 %%   Lower-case    \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
 % \changes{v1.6}{2006/06/27}{フォントコマンドを修正。ありがとう、ymtさん。}
 % \changes{v1.6-ltj}{2011/09/27}{jclasses.dtx v1.6 をベースにLua\LaTeX-ja用に修正。}
 % \changes{v1.6-ltj-2}{2013/06/06}{luatexja.cfgに対応.}
-% \changes{v1.6-ltj-3}{2014/06/08}{縦çµ\84ã\81¿ã\82¯ã\83©ã\82¹ã\81®æ\99\82ã\81®geometry.styã\81«å¯¾å¿\9cï¼\8e}
+% \changes{v1.6-ltj-3}{2014/06/08}{縦組クラスの時のgeometry.styに対応.}
 % \changes{v1.6-ltj-4}{2014/06/30}{組方向の変更箇所を現行の\LuaTeX-jaの仕様に合うように修正.}
 % \changes{v1.6-ltj-5}{2014/07/02}{\cs{ifydir}, \cs{iftdir}を使わないように修正.}
+% \changes{v1.6-ltj-6}{2014/07/28}{縦組クラスでlltjext.styを読み込むように修正.}
+% \changes{v1.6-ltj-7}{2014/11/15}{縦組クラスとeveryshi.styとの相性が悪い問題を修正.}
+% \changes{v1.6-ltj-8}{2014/11/22}{縦組時のgeometry.styへの対応を別ファイル(lltjp-geometry.sty)に分離.それに伴いv1.6-ltj-3での変更を削除.}
 % \fi
 %
 % \iffalse
 %<11pt&bk>\ProvidesFile{ltjtbk11.clo}
 %<12pt&bk>\ProvidesFile{ltjtbk12.clo}
 %</tate>
-  [2014/07/02 v1.6-ltj-5
+  [2014/11/15 v1.6-ltj-7
 %<article|report|book> Standard LuaLaTeX-ja class]
 %<10pt|11pt|12pt>  Standard LuaLaTeX-ja file (size option)]
 %<*driver>
 % \end{quotation}
 % のエラーが起こった場合は、|lualatex-math|パッケージを読み込んでみて下さい。
 % \item 出力PDFの用紙サイズが自動的に設定されるようにしてあります。
-% \item 縦組みクラスにおいて、|geometry|パッケージを読み込んだときに意図通りにならない問題に対応しました。
+% %%%\item 縦組みクラスにおいて、|geometry|パッケージを読み込んだときに意図通りにならない問題に対応しました。%
 % \end{itemize}
 %
 % \section{Lua\TeX-ja の読み込み}
 %<*article|report|book>
 \RequirePackage{luatexja}
 %    \end{macrocode}
-% 縦組みの場合は|geometry|対応のために|filehook|も読み込んでおきます。
-%    \begin{macrocode}
-%<tate>\RequirePackage{filehook}
-%    \end{macrocode}
 %
 % \section{オプションスイッチ}
 % ここでは、後ほど使用するいくつかのコマンドやスイッチを定義しています。
   \setlength\paperheight {257mm}
   \setlength\paperwidth  {182mm}}
 %    \end{macrocode}
-% 縦組みクラスについて、|geometry|パッケージが読み込まれると|\textwidth|と|\textheight|が
-% ひっくり返ってしまう問題に対処します。
-%    \begin{macrocode}
-%<*tate>
-\AtEndOfPackageFile{geometry}{%
-  \setlength{\@tempdima}{\textheight}%
-  \setlength{\textheight}{\textwidth}%
-  \setlength{\textwidth}{\@tempdima}%
-  \expandafter\def\expandafter\Gm@process\expandafter{\Gm@process
-    \setlength{\@tempdima}{\textheight}%
-    \setlength{\textheight}{\textwidth}%
-    \setlength{\textwidth}{\@tempdima}}}
-%</tate>
 %
 % \subsection{サイズオプション}
 % 基準となるフォントの大きさを指定するオプションです。
 }
 %    \end{macrocode}
 %
+% 縦組クラスと|everyshi|パッケージの相性が悪い問題に対処します。
+% この処理は、ZRさんの|pxeveryshi|パッケージと実質的に同じ内容です。
+%    \begin{macrocode}
+%<*tate>
+\AtEndOfPackageFile{everyshi}{%
+  \def\@EveryShipout@Output{%
+    \setbox8\vbox{%
+      \yoko
+      \@EveryShipout@Hook
+      \@EveryShipout@AtNextHook
+      \global\setbox\luatexoutputbox=\box\luatexoutputbox
+    }%
+    \gdef\@EveryShipout@AtNextHook{}%
+    \@EveryShipout@Org@Shipout\box\luatexoutputbox
+  }}
+%</tate>
+%    \end{macrocode}
+%
 % \subsection{両面、片面オプション}
 % twosideオプションが指定されると、両面印字出力に適した整形を行ないます。
 %    \begin{macrocode}
 %<book&yoko>\input{ltjbk1\@ptsize.clo}
 %<!book&yoko>\input{ltjsize1\@ptsize.clo}
 %    \end{macrocode}
-% 縦組用クラスファイルの場合は、ここで\file{plext.sty}が読み込まれていました。
-% Lua\TeX-jaでどうなるかは未定です。
+% 縦組用クラスファイルの場合は、ここで\file{plext.sty}も読み込みます。
 % \changes{v1.0e}{1996/03/21}{\cs{usepackage} to \cs{RequirePackage}}
+% \changes{v1.6-ltj-6}{2014/07/28}{Lua\TeX-jaでは,代わりに\file{lltjext.sty}を読み込みま
+% す.これは\file{plext.sty}をLua\TeX-ja用に書きなおしたものです.}
 %    \begin{macrocode}
-%<tate>%\RequirePackage{plext}
+%<tate>\RequirePackage{lltjext}
 %</article|report|book>
 %    \end{macrocode}
 %
    \advance\@enumdepth\@ne
    \edef\@enumctr{enum\romannumeral\the\@enumdepth}%
    \list{\csname label\@enumctr\endcsname}{%
-      \ifnum\ltjgetparameter{direction}=3 
+      \ifnum\ltjgetparameter{direction}=3
          \ifnum \@listdepth=\@ne \topsep.5\normalbaselineskip
            \else\topsep\z@\fi
          \parskip\z@ \itemsep\z@ \parsep\z@
 %    \begin{macrocode}
 \newcommand{\labelitemi}{\textbullet}
 \newcommand{\labelitemii}{%
-  \ifnum\ltjgetparameter{direction}=3 
+  \ifnum\ltjgetparameter{direction}=3
      {\textcircled{~}}
   \else
      {\normalfont\bfseries\textendash}
    \edef\@itemitem{labelitem\romannumeral\the\@itemdepth}%
    \expandafter
    \list{\csname \@itemitem\endcsname}{%
-      \ifnum\ltjgetparameter{direction}=3 
+      \ifnum\ltjgetparameter{direction}=3
          \ifnum \@listdepth=\@ne \topsep.5\normalbaselineskip
            \else\topsep\z@\fi
          \parskip\z@ \itemsep\z@ \parsep\z@
 %    \begin{macrocode}
 \newenvironment{description}
   {\list{}{\labelwidth\z@ \itemindent-\leftmargin
-   \ifnum\ltjgetparameter{direction}=3 
+   \ifnum\ltjgetparameter{direction}=3
      \leftmargin\leftskip \advance\leftmargin3\Cwd
      \rightmargin\rightskip
      \labelsep=1\zw \itemsep\z@