OSDN Git Service

More LaTeX codes for vertical writing
[luatex-ja/luatexja.git] / src / ltjclasses.dtx
index 723a15d..1cb6205 100644 (file)
@@ -10,7 +10,7 @@
 %
 % \fi
 %
-% \CheckSum{4478}
+% \CheckSum{4515}
 %% \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
@@ -78,6 +78,9 @@
 % \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}{縦組みクラスの時の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を読み込むように修正.}
 % \fi
 %
 % \iffalse
 %<11pt&bk>\ProvidesFile{ltjtbk11.clo}
 %<12pt&bk>\ProvidesFile{ltjtbk12.clo}
 %</tate>
-  [2014/06/08 v1.6-ltj-3
+  [2014/07/28 v1.6-ltj-6
 %<article|report|book> Standard LuaLaTeX-ja class]
 %<10pt|11pt|12pt>  Standard LuaLaTeX-ja file (size option)]
 %<*driver>
 %    \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}}
+    \setlength{\textwidth}{\@tempdima}}}
 %</tate>
 %
 % \subsection{サイズオプション}
 % \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}
 %
 %<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 月