OSDN Git Service

Add lltjp-geometry.sty: Patch to geometry for LuaTeX-ja with vertical writing mode.
[luatex-ja/luatexja.git] / src / ltjclasses.dtx
index 6232f52..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
 %   (ありがとうございます、鈴木た@MILNさん)}
 % \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}{jclasses.dtx luatexja.cfgに対応.}
+% \changes{v1.6-ltj-2}{2013/06/06}{luatexja.cfgに対応.}
+% \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>
-  [2013/06/06 v1.6-ltj-2
+  [2014/11/15 v1.6-ltj-7
 %<article|report|book> Standard LuaLaTeX-ja class]
 %<10pt|11pt|12pt>  Standard LuaLaTeX-ja file (size option)]
 %<*driver>
 % 11pt    & 11ptサイズの設定を生成\\
 % 12pt    & 12ptサイズの設定を生成\\
 % bk      & bookクラス用のサイズの設定を生成\\
-% tate    & 縦組用の設定を生成(現在無効)\\
+% tate    & 縦組用の設定を生成\\
 % yoko    & 横組用の設定を生成\\
 % \end{tabular}
 % \end{center}
 % \end{quotation}
 % のエラーが起こった場合は、|lualatex-math|パッケージを読み込んでみて下さい。
 % \item 出力PDFの用紙サイズが自動的に設定されるようにしてあります。
+% %%%\item 縦組みクラスにおいて、|geometry|パッケージを読み込んだときに意図通りにならない問題に対応しました。%
 % \end{itemize}
 %
 % \section{Lua\TeX-ja の読み込み}
 %
 % \subsection{組方向オプション}
 % このオプションが指定されると、縦組で組版をします。
-% しかしLua\TeX-jaではまだ縦組は未対応なのでコメントアウトします。
 % \changes{v1.0g}{1997/01/25}{Insert \cs{hbox}, to switch tate-mode.}
 % \changes{v1.1d}{1997/02/05}{開始ページがおかしくなるのを修正}
 % \changes{v1.1f}{1997/07/08}{縦組時にベースラインがおかしくなるのを修正}
+%
+% \changes{v1.6-ltj-4}{2014/06/30}{本文の組方向を \cs{AtBeginDocument} で
+%   変更することができなくなったことに対応}
 %    \begin{macrocode}
 \DeclareOption{tate}{%
-  \AtBeginDocument{\tate\message{《縦組モード》}%
-                   \adjustbaseline}%
+  \tate\AtBeginDocument{\message{《縦組モード》}\adjustbaseline}%
 }
 %    \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}
 %
   \newcommand{\maketitle}{\par
   \begingroup
     \renewcommand{\thefootnote}{\fnsymbol{footnote}}%
-    \def\@makefnmark{\hbox{\ifydir $\m@th^{\@thefnmark}$
+    \def\@makefnmark{\hbox{\unless\ifnum\ltjgetparameter{direction}=3 $\m@th^{\@thefnmark}$
       \else\hbox{\yoko$\m@th^{\@thefnmark}$}\fi}}%
 %<*tate>
     \long\def\@makefntext##1{\parindent 1\zw\noindent
    \advance\@enumdepth\@ne
    \edef\@enumctr{enum\romannumeral\the\@enumdepth}%
    \list{\csname label\@enumctr\endcsname}{%
-      \iftdir
+      \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}{%
-  \iftdir
+  \ifnum\ltjgetparameter{direction}=3
      {\textcircled{~}}
   \else
      {\normalfont\bfseries\textendash}
    \edef\@itemitem{labelitem\romannumeral\the\@itemdepth}%
    \expandafter
    \list{\csname \@itemitem\endcsname}{%
-      \iftdir
+      \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
-   \iftdir
+   \ifnum\ltjgetparameter{direction}=3
      \leftmargin\leftskip \advance\leftmargin3\Cwd
      \rightmargin\rightskip
      \labelsep=1\zw \itemsep\z@
 %    \begin{macrocode}
 \long\def\@makecaption#1#2{%
   \vskip\abovecaptionskip
-  \iftdir\sbox\@tempboxa{#1\hskip1\zw#2}%
+  \ifnum\ltjgetparameter{direction}=3 \sbox\@tempboxa{#1\hskip1\zw#2}%
     \else\sbox\@tempboxa{#1: #2}%
   \fi
   \ifdim \wd\@tempboxa >\hsize
-    \iftdir #1\hskip1\zw#2\relax\par
+    \ifnum\ltjgetparameter{direction}=3  #1\hskip1\zw#2\relax\par
       \else #1: #2\relax\par\fi
   \else
     \global \@minipagefalse
 % 縦組の場合は、漢数字で出力します。
 %    \begin{macrocode}
 \def\today{{%
-  \iftdir
+  \ifnum\ltjgetparameter{direction}=3
     \if西暦
       \kansuji\number\year 年
       \kansuji\number\month 月