OSDN Git Service

Complete lltjext.sty (and \vcenter)
authorHironori Kitagawa <h_kitagawa2001@yahoo.co.jp>
Mon, 28 Jul 2014 01:08:20 +0000 (10:08 +0900)
committerHironori Kitagawa <h_kitagawa2001@yahoo.co.jp>
Mon, 28 Jul 2014 01:08:20 +0000 (10:08 +0900)
31 files changed:
doc/ltjclasses.pdf
src/lltjext.sty
src/ltj-direction.lua
src/ltj-math.lua
src/ltjarticle.cls
src/ltjbk10.clo
src/ltjbk11.clo
src/ltjbk12.clo
src/ltjbook.cls
src/ltjclasses.dtx
src/ltjreport.cls
src/ltjsize10.clo
src/ltjsize11.clo
src/ltjsize12.clo
src/ltjtarticle.cls
src/ltjtbk10.clo
src/ltjtbk11.clo
src/ltjtbk12.clo
src/ltjtbook.cls
src/ltjtreport.cls
src/ltjtsize10.clo
src/ltjtsize11.clo
src/ltjtsize12.clo
src/luatexja-core.sty
test/test12-ltjtarticle.pdf
test/test12-ltjtarticle.tex
test/test54-lltjext.tex
test/test54-res.pdf
test/test54a-lltjext.tex [new file with mode: 0644]
test/test54a-res.pdf [new file with mode: 0644]
test/test54a.sh [new file with mode: 0755]

index 80a6e57..b48f74f 100644 (file)
Binary files a/doc/ltjclasses.pdf and b/doc/ltjclasses.pdf differ
index 75e0261..58e186f 100644 (file)
@@ -4,8 +4,10 @@
 \NeedsTeXFormat{LaTeX2e}
 \ProvidesPackage{lltjext}
    [2014/07/26 v1.2-ltj-1 ...]
+\RequirePackage{luatexja}
 
 \newif\if@rotsw
+%%% array and tabular
 \def\array{\let\@acol\@arrayacol \let\@classz\@arrayclassz
  \let\@classiv\@arrayclassiv
  \let\\\@arraycr\let\@halignto\@empty\X@tabarray}
@@ -26,7 +28,7 @@
 \def\p@array<#1>[#2]#3{%
   \let\box@dir\relax
   \if #1z\relax
-    \ifnum\ltjgetparameter{direction}=3 \relax
+    \ifnum\ltjgetparameter{direction}=3\relax
       \let\box@dir\utod\@tempcnta=\zstrutbox
     \fi
   \else
   \fi\fi
 \fi\fi%
 }
+
+%%% caption
 \newbox\@floatbox
 \newdimen\floatwidth
 \newdimen\floatheight
   \setbox\z@\hbox{#4}%
   \floatwidth=#1 \floatheight=#2 \edef\float@pos{#3}%
   \ifdim\floatwidth<\z@
-     \floatwidth\wd\z@\floatruletick\z@
+     \floatwidth\ltjgetwd\z@\floatruletick\z@
   \fi
   \ifdim\floatheight<\z@
-     \floatheight\ht\z@\advance\floatheight\dp\z@\relax
+     \floatheight\ltjgetht\z@\advance\floatheight\ltjgetdp\z@\relax
      \floatruletick\z@
   \fi
   \setbox\@floatbox\vbox to\floatheight{\offinterlineskip
   \@tempswafalse
   % tempswa\hline 基本組の組方向とキャプションの組方向が直交するか?
   \if y\caption@dir \let\captiondir\yoko
-    \ifodd\ltjgetparameter{direction}\@tempswatrue\fi
+    \ifodd\ltjgetparameter{direction}\relax\@tempswatrue\fi
   \else\if z\caption@dir \let\captiondir\relax
-    \ifnum\ltjgetparameter{direction}=3 \let\captiondir\utod\fi
+    \ifnum\ltjgetparameter{direction}=3\relax\let\captiondir\utod\fi
   \else\if d\caption@dir \let\captiondir\dtou
-    \ifeven\ltjgetparameter{direction}\@tempswatrue\fi
+    \ifodd\ltjgetparameter{direction}\else\@tempswatrue\fi
   \else\if u\caption@dir \let\captiondir\utod
-    \ifeven\ltjgetparameter{direction}\@tempswatrue\fi
-  \else\let\captiondir\tate
-    \ifeven\ltjgetparameter{direction}\@tempswatrue\fi
-  \fi\fi\fi\fi% t -> tate
+    \ifodd\ltjgetparameter{direction}\else\@tempswatrue\fi
+  \else\if t\caption@dir \let\captiondir\tate
+    \ifodd\ltjgetparameter{direction}\else\@tempswatrue\fi
+  \fi\fi\fi\fi\fi
   \setbox0\hbox{\hbox{\captiondir
      \captionfontsetup\parindent\z@\inhibitglue
-     \csname fnum@\@captype\endcsname\char\euc"A1A1\relax#1}}%
-  \if@tempswa \@tempdima\ltjgetht0 \else\@tempdima\ltjgetwd0 \fi
+     \csname fnum@\@captype\endcsname  #1}}%"
+  \if@tempswa\@tempdima\ltjgetht0\relax\else\@tempdima\ltjgetwd0\relax\fi
   \ifdim\@tempdima>\captionwidth \@tempdima\captionwidth \fi
   \@pboxswfalse
   \setbox0\hbox{%
     {\hsize\@tempdima\kern\z@
     \vbox{\captiondir\hsize\@tempdima
       \captionfontsetup\parindent\z@\inhibitglue
-      \csname fnum@\@captype\endcsname\char\euc"A1A1\relax#1}\kern\z@
+      \csname fnum@\@captype\endcsname  #1}\kern\z@
     }\if@pboxsw \m@th$\fi}%
   \let\to@captionboxwidth\relax
   \if l\caption@posb \else\if r\caption@posb\else
      \if t\caption@posa\else\hss\fi
      \unhbox0\relax
      \if b\caption@posa\else\hss\fi}}
+
+%%% minipage and parbox
 \def\minipage{\@ifnextchar<%>
    {\X@minipage}{\X@minipage<Z>}}
 \def\X@minipage<#1>{\@ifnextchar[%]
   \fi\fi
 \fi\fi%
 }
+
+%%% pbox
 \def\pbox{\leavevmode\@ifnextchar<{\X@makePbox}{\X@makePbox<Z>}}
 \def\X@makePbox<#1>{%
   \@ifnextchar[{\@imakePbox<#1>}{\@imakePbox<#1>[-5\p@]}}
                \if #3l\relax\else\hss\fi
                #4\relax
                \if #3r\relax\else\hss\fi}\fi\egroup}
+
+%%% picture
 \def\picture{\@ifnextchar<%>
    {\X@picture}{\X@picture<Z>}}
 \def\X@picture<#1>(#2,#3){\@ifnextchar(%)
 \def\oval{\ybaselineshift\z@\tbaselineshift\z@\org@oval}
 \let\org@circle\circle
 \def\circle{\ybaselineshift\z@\tbaselineshift\z@\org@circle}
+
+%%% rensuji
 \newif\ifnot@advanceline
 \newskip\rensujiskip
 \rensujiskip=0.25\chs plus.25\zw minus.25\zw
 \DeclareRobustCommand\rensuji{%
   \@ifstar{\not@advancelinetrue\@rensuji}{\@rensuji}}
 \def\@rensuji{\@ifnextchar[{\@@rensuji}{\@@rensuji[c]}}
-\def\@@rensuji[#1]#2{\ifydir\hbox{#2}\else
+\def\@@rensuji[#1]#2{\ifnum\ltjgetparameter{direction}=4\relax%
+  \hbox{#2}\else
   \hskip\rensujiskip
   \ifvmode\leavevmode\fi
   \ifnot@advanceline\not@advancelinefalse\else
     \setbox\z@\hbox{\yoko#2}%
-    \@tempdima\ht\z@ \advance\@tempdima\dp\z@
-    \if #1c\relax\vrule\@width\z@ \@height.5\@tempdima \@depth.5\@tempdima
-    \else\if #1r\relax\vrule\@width\z@\@height\z@ \@depth\@tempdima
-    \else\vrule\@width\z@ \@height\@tempdima \@depth\z@
+    \@tempdima\ltjgetht\z@ \advance\@tempdima\ltjgetdp\z@
+    \ifnum\ltjgetparameter{direction}=1\relax
+      \if #1c\relax\vrule \@width \z@ \@height.5\@tempdima \@depth.5\@tempdima
+      \else\if #1l\relax\vrule\@width \z@\@height\z@ \@depth\@tempdima
+      \else\vrule\@width \z@ \@height\@tempdima \@depth\z@
+      \fi\fi
+    \else
+      \if #1c\relax\vrule \@width \z@ \@height.5\@tempdima \@depth.5\@tempdima
+      \else\if #1r\relax\vrule\@width \z@\@height\z@ \@depth\@tempdima
+      \else\vrule\@width \z@ \@height\@tempdima \@depth\z@
+      \fi\fi
+    \fi
+  \fi
+  \ifnum\ltjgetparameter{direction}=1\relax
+    \if #1c\relax\hbox to\zw{\yoko\hss#2\hss}%
+    \else\if #1r\relax\vbox{\hbox to\zw{\yoko\hss#2}\kern\z@}%
+    \else\vtop{\kern\z@\hbox to\zw{\yoko#2\hss}}%
+    \fi\fi
+  \else
+    \if #1c\relax\hbox to\zw{\yoko\hss#2\hss}%
+    \else\if #1r\relax\vtop{\kern\z@\hbox to\zw{\yoko\hss#2}}%
+    \else\vbox{\hbox to\zw{\yoko #2\hss}\kern\z@}%
     \fi\fi
   \fi
-  \if #1c\relax\hbox to1zw{\yoko\hss#2\hss}%
-  \else\if #1r\relax\vbox{\hbox to1zw{\yoko\hss#2}}%
-  \else\vtop{\hbox to1zw{\yoko#2\hss}}%
-  \fi\fi
   \hskip\rensujiskip
 \fi}
 \let\Rensuji\rensuji
 \let\prensuji\rensuji
+
+%%% kanji
 \def\Kanji#1{\expandafter\@Kanji\csname c@#1\endcsname}
 \def\@Kanji#1{\expandafter\kansuji\number #1}
 \def\kanji{\iftdir\expandafter\kansuji\fi}
+
+%%% bou
+%%% 
 \def\boutenchar{\char\euc"A1A2}
 \def\bou#1{\ifvmode\leavevmode\fi\@bou#1\end}
 \def\@bou#1{%
   \ifx#1\end \let\next=\relax
   \else
-    \iftdir\if@rotsw
+    \ifnum\ltjgetparameter{direction}=3\relax
       \hbox to\z@{\vbox to\z@{\boxmaxdepth\maxdimen
-        \vss\moveleft-0.2zw\hbox{\boutenchar}\nointerlineskip
+        \vss\moveleft0.2\zw\hbox{\yoko\boutenchar}\nointerlineskip
         \hbox{\char\euc"A1A1}}\hss}\nobreak#1\relax
     \else
       \hbox to\z@{\vbox to\z@{\boxmaxdepth\maxdimen
-        \vss\moveleft0.2zw\hbox{\yoko\boutenchar}\nointerlineskip
-        \hbox{\char\euc"A1A1}}\hss}\nobreak#1\relax
-    \fi\else
-      \hbox to\z@{\vbox to\z@{%
-        \vss\moveleft-0.2zw\hbox{\yoko\boutenchar}\nointerlineskip
+        \vss\moveleft-0.2\zw\hbox{\boutenchar}\nointerlineskip
         \hbox{\char\euc"A1A1}}\hss}\nobreak#1\relax
     \fi
     \let\next=\@bou
   \fi\next}
+
+%%% kasen
 \def\kasen#1{%
-  \ifydir\underline{#1}%
-  \else\if@rotsw\underline{#1}\else
-    \setbox\z@\hbox{#1}\leavevmode\raise.7zw
+  \ifnum\ltjgetparameter{direction}=3\relax
+    \setbox\z@\hbox{#1}\leavevmode\raise.7\zw
     \hbox to\z@{\vrule\@width\wd\z@ \@depth\z@ \@height.4\p@\hss}%
     \box\z@
-  \fi\fi}
+  \else\underline{#1}\fi}
+
+%%% references
 \def\@eqnnum{{\reset@font\rmfamily \normalcolor
-  \iftdir\raise.25zh\hbox{\yoko(\theequation)}%
+  \ifnum\ltjgetparameter{direction}=3 \raise.25\zh\hbox{\yoko(\theequation)}%
   \else (\theequation)\fi}}
 \def\@thecounter#1{\noexpand\rensuji{\noexpand\arabic{#1}}}
 \def\@thmcounter#1{\noexpand\rensuji{\noexpand\arabic{#1}}}
-\endinput
-%%
-%% End of file `plext.sty'.
+\endinput
\ No newline at end of file
index 4f9da1b..00fe00d 100644 (file)
@@ -254,7 +254,7 @@ do
       for i=1,#wh do  
         hd = node_remove(hd, wh[i]); node_free(wh[i]); wh[i] = nil 
       end
-      if gc=='fin_row' or gc == 'preamble'  then
+      if gc=='fin_row' then -- gc == 'preamble' case is treated in dir_adjust_vpack
         if hd  then
            set_attr(hd, attr_icflag, PROCESSED_BEGIN_FLAG)
            tex_set_attr('global', attr_icflag, 0)
@@ -449,11 +449,11 @@ do
       if b then
         local box_dir = get_box_dir(to_direct(b), dir_yoko)
         if box_dir%dir_math_mod ~= list_dir then
-           print('NEST', tex_nest.ptr, tex_getcount('ltj@tempcnta'))
-           luatexja.ext_show_node_list(
-               (tex_nest.ptr==0) and tex.lists.page_head or tex_nest[tex_nest.ptr].head,
-               'LIST' .. tostring(list_dir) .. '> ', print)
-          luatexja.ext_show_node_list(b, 'BOX' .. tostring(box_dir) .. '> ', print)
+          --  print('NEST', tex_nest.ptr, tex_getcount('ltj@tempcnta'))
+          --  luatexja.ext_show_node_list(
+           --     (tex_nest.ptr==0) and tex.lists.page_head or tex_nest[tex_nest.ptr].head,
+           --     'LIST' .. tostring(list_dir) .. '> ', print)
+          -- luatexja.ext_show_node_list(b, 'BOX' .. tostring(box_dir) .. '> ', print)
            ltjb.package_error(
               'luatexja',
               "Incompatible direction list can't be unboxed",
@@ -817,9 +817,9 @@ do
    luatexja.direction.get_register_dir = get_register_dir
 end
 
--- raise, lower
 do
    local getbox, setbox, copy_list = tex.getbox, tex.setbox, Dnode.copy_list
+   -- raise, lower
    function luatexja.direction.raise_box()
       start_time_measure('box_primitive_hook')
       local list_dir = get_dir_count()
index 509d0be..15813fc 100644 (file)
@@ -15,6 +15,7 @@ local setfield = (Dnode ~= node) and Dnode.setfield or function(n, i, c) n[i] =
 local getfield = (Dnode ~= node) and Dnode.getfield or function(n, i) return n[i] end
 local getid = (Dnode ~= node) and Dnode.getid or function(n) return n.id end
 local getsubtype = (Dnode ~= node) and Dnode.getsubtype or function(n) return n.subtype end
+local getlist = (Dnode ~= node) and Dnode.getlist or function(n) return n.head end
 -- getlist cannot be used for sub_box nodes. Use instead λp. getfield(p, 'head')
 local getchar = (Dnode ~= node) and Dnode.getchar or function(n) return n.char end
 
@@ -25,6 +26,7 @@ local to_direct = (Dnode ~= node) and Dnode.todirect or nullfunc
 local node_traverse = Dnode.traverse
 local node_new = Dnode.new
 local node_next = (Dnode ~= node) and Dnode.getnext or node.next
+local node_remove = Dnode.remove
 local node_free = Dnode.free
 local has_attr = Dnode.has_attribute
 local set_attr = Dnode.set_attribute
@@ -52,6 +54,7 @@ local id_sub_mlist = node.id('sub_mlist')
 local id_whatsit = node.id('whatsit')
 local sid_user = node.subtype('user_defined')
 local DIR  = luatexja.userid_table.DIR
+local dir_node_auto   = luatexja.dir_table.dir_node_auto
 
 local PROCESSED  = luatexja.icflag_table.PROCESSED
 
@@ -62,6 +65,21 @@ local ltjd_make_dir_whatsit = ltjd.make_dir_whatsit
 
 -- table of mathematical characters
 local is_math_letters = {}
+local list_dir
+
+local function conv_vcenter(sb)
+   local h = getfield(sb, 'head');local hd = getlist(h)
+   if getid(hd)==id_whatsit and 
+   getsubtype(hd)==sid_user and getfield(hd, 'user_id')==DIR then
+      local d = node_next(hd)
+      if getid(d)==id_vlist and has_attr(d, attr_dir)>=dir_node_auto then
+        node_free(hd); setfield(h, 'head', nil); node_free(h)
+        setfield(sb, 'head', d); h = d
+      end
+   end
+   set_attr(h, attr_icflag, PROCESSED)
+   return sb
+end
 
 local conv_jchar_to_hbox_A
 
@@ -70,7 +88,11 @@ local function conv_jchar_to_hbox(head, sty)
    for p in node_traverse(head) do
       local pid = getid(p)
       if pid == id_simple or pid == id_accent then
-        setfield(p, 'nucleus', conv_jchar_to_hbox_A(getfield(p, 'nucleus'), sty))
+        if getsubtype(p)==12 then
+           conv_vcenter(getfield(p, 'nucleus'))
+        else
+           setfield(p, 'nucleus', conv_jchar_to_hbox_A(getfield(p, 'nucleus'), sty))
+        end
         setfield(p, 'sub', conv_jchar_to_hbox_A(getfield(p, 'sub'), sty+1))
         setfield(p, 'sup', conv_jchar_to_hbox_A(getfield(p, 'sup'), sty+1))
       elseif pid == id_choice then
@@ -107,7 +129,6 @@ local MJS  = luatexja.stack_table_index.MJS
 local MJSS = luatexja.stack_table_index.MJSS
 local capsule_glyph_math = ltjw.capsule_glyph_math
 local is_ucs_in_japanese_char = ltjc.is_ucs_in_japanese_char_direct
-local list_dir
 
 conv_jchar_to_hbox_A =
 function (p, sty)
index e16ac3d..05f9d2f 100644 (file)
@@ -39,7 +39,7 @@
 %%
 \NeedsTeXFormat{LaTeX2e}
 \ProvidesClass{ltjarticle}
-  [2014/07/02 v1.6-ltj-5
+  [2014/07/28 v1.6-ltj-6
  Standard LuaLaTeX-ja class]
 \RequirePackage{luatexja}
 \newcounter{@paper}
index 025c878..78b73fe 100644 (file)
@@ -39,7 +39,7 @@
 %%
 \NeedsTeXFormat{LaTeX2e}
 \ProvidesFile{ltjbk10.clo}
-  [2014/07/02 v1.6-ltj-5
+  [2014/07/28 v1.6-ltj-6
   Standard LuaLaTeX-ja file (size option)]
 \renewcommand{\normalsize}{%
     \@setfontsize\normalsize\@xpt{15}%
index 8c67bfc..b1c2364 100644 (file)
@@ -39,7 +39,7 @@
 %%
 \NeedsTeXFormat{LaTeX2e}
 \ProvidesFile{ltjbk11.clo}
-  [2014/07/02 v1.6-ltj-5
+  [2014/07/28 v1.6-ltj-6
   Standard LuaLaTeX-ja file (size option)]
 \renewcommand{\normalsize}{%
     \@setfontsize\normalsize\@xipt{15.5}%
index e674a96..4001bf4 100644 (file)
@@ -39,7 +39,7 @@
 %%
 \NeedsTeXFormat{LaTeX2e}
 \ProvidesFile{ltjbk12.clo}
-  [2014/07/02 v1.6-ltj-5
+  [2014/07/28 v1.6-ltj-6
   Standard LuaLaTeX-ja file (size option)]
 \renewcommand{\normalsize}{%
     \@setfontsize\normalsize\@xiipt{16.5}%
index 0ec87db..5523fc6 100644 (file)
@@ -39,7 +39,7 @@
 %%
 \NeedsTeXFormat{LaTeX2e}
 \ProvidesClass{ltjbook}
-  [2014/07/02 v1.6-ltj-5
+  [2014/07/28 v1.6-ltj-6
  Standard LuaLaTeX-ja class]
 \RequirePackage{luatexja}
 \newcounter{@paper}
index 55c5a43..1cb6205 100644 (file)
@@ -80,6 +80,7 @@
 % \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/07/02 v1.6-ltj-5
+  [2014/07/28 v1.6-ltj-6
 %<article|report|book> Standard LuaLaTeX-ja class]
 %<10pt|11pt|12pt>  Standard LuaLaTeX-ja file (size option)]
 %<*driver>
 %<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}
 %
index 3691442..2559903 100644 (file)
@@ -39,7 +39,7 @@
 %%
 \NeedsTeXFormat{LaTeX2e}
 \ProvidesClass{ltjreport}
-  [2014/07/02 v1.6-ltj-5
+  [2014/07/28 v1.6-ltj-6
  Standard LuaLaTeX-ja class]
 \RequirePackage{luatexja}
 \newcounter{@paper}
index 3b4e07a..f87aaf0 100644 (file)
@@ -39,7 +39,7 @@
 %%
 \NeedsTeXFormat{LaTeX2e}
 \ProvidesFile{ltjsize10.clo}
-  [2014/07/02 v1.6-ltj-5
+  [2014/07/28 v1.6-ltj-6
   Standard LuaLaTeX-ja file (size option)]
 \renewcommand{\normalsize}{%
     \@setfontsize\normalsize\@xpt{15}%
index 5cbbc07..630021b 100644 (file)
@@ -39,7 +39,7 @@
 %%
 \NeedsTeXFormat{LaTeX2e}
 \ProvidesFile{ltjsize11.clo}
-  [2014/07/02 v1.6-ltj-5
+  [2014/07/28 v1.6-ltj-6
   Standard LuaLaTeX-ja file (size option)]
 \renewcommand{\normalsize}{%
     \@setfontsize\normalsize\@xipt{15.5}%
index ce49379..fd84132 100644 (file)
@@ -39,7 +39,7 @@
 %%
 \NeedsTeXFormat{LaTeX2e}
 \ProvidesFile{ltjsize12.clo}
-  [2014/07/02 v1.6-ltj-5
+  [2014/07/28 v1.6-ltj-6
   Standard LuaLaTeX-ja file (size option)]
 \renewcommand{\normalsize}{%
     \@setfontsize\normalsize\@xiipt{16.5}%
index a84b61d..fd0a3bf 100644 (file)
@@ -39,7 +39,7 @@
 %%
 \NeedsTeXFormat{LaTeX2e}
 \ProvidesClass{ltjtarticle}
-  [2014/07/02 v1.6-ltj-5
+  [2014/07/28 v1.6-ltj-6
  Standard LuaLaTeX-ja class]
 \RequirePackage{luatexja}
 \RequirePackage{filehook}
 \ExecuteOptions{a4paper,10pt,oneside,onecolumn,final,tate}
 \ProcessOptions\relax
 \input{ltjtsize1\@ptsize.clo}
-%\RequirePackage{plext}
+\RequirePackage{lltjext}
 \directlua{luatexbase.add_to_callback('luatexja.load_jfm',
   function (ji, jn) ji.chars['parbdd'] = 0; return ji end,
   'ltj.jclasses_load_jfm', 1)}
index 38d9ae5..32d6523 100644 (file)
@@ -39,7 +39,7 @@
 %%
 \NeedsTeXFormat{LaTeX2e}
 \ProvidesFile{ltjtbk10.clo}
-  [2014/07/02 v1.6-ltj-5
+  [2014/07/28 v1.6-ltj-6
   Standard LuaLaTeX-ja file (size option)]
 \renewcommand{\normalsize}{%
     \@setfontsize\normalsize\@xpt{17}%
index 600dd9a..a62d293 100644 (file)
@@ -39,7 +39,7 @@
 %%
 \NeedsTeXFormat{LaTeX2e}
 \ProvidesFile{ltjtbk11.clo}
-  [2014/07/02 v1.6-ltj-5
+  [2014/07/28 v1.6-ltj-6
   Standard LuaLaTeX-ja file (size option)]
 \renewcommand{\normalsize}{%
     \@setfontsize\normalsize\@xipt{17}%
index dcf8c2d..b97e727 100644 (file)
@@ -39,7 +39,7 @@
 %%
 \NeedsTeXFormat{LaTeX2e}
 \ProvidesFile{ltjtbk12.clo}
-  [2014/07/02 v1.6-ltj-5
+  [2014/07/28 v1.6-ltj-6
   Standard LuaLaTeX-ja file (size option)]
 \renewcommand{\normalsize}{%
     \@setfontsize\normalsize\@xiipt{18}%
index f04c4f7..90d8def 100644 (file)
@@ -39,7 +39,7 @@
 %%
 \NeedsTeXFormat{LaTeX2e}
 \ProvidesClass{ltjtbook}
-  [2014/07/02 v1.6-ltj-5
+  [2014/07/28 v1.6-ltj-6
  Standard LuaLaTeX-ja class]
 \RequirePackage{luatexja}
 \RequirePackage{filehook}
 \ExecuteOptions{a4paper,10pt,twoside,onecolumn,final,openright,tate}
 \ProcessOptions\relax
 \input{ltjtbk1\@ptsize.clo}
-%\RequirePackage{plext}
+\RequirePackage{lltjext}
 \directlua{luatexbase.add_to_callback('luatexja.load_jfm',
   function (ji, jn) ji.chars['parbdd'] = 0; return ji end,
   'ltj.jclasses_load_jfm', 1)}
index 1119669..4721318 100644 (file)
@@ -39,7 +39,7 @@
 %%
 \NeedsTeXFormat{LaTeX2e}
 \ProvidesClass{ltjtreport}
-  [2014/07/02 v1.6-ltj-5
+  [2014/07/28 v1.6-ltj-6
  Standard LuaLaTeX-ja class]
 \RequirePackage{luatexja}
 \RequirePackage{filehook}
 \ExecuteOptions{a4paper,10pt,oneside,onecolumn,final,openany,tate}
 \ProcessOptions\relax
 \input{ltjtsize1\@ptsize.clo}
-%\RequirePackage{plext}
+\RequirePackage{lltjext}
 \directlua{luatexbase.add_to_callback('luatexja.load_jfm',
   function (ji, jn) ji.chars['parbdd'] = 0; return ji end,
   'ltj.jclasses_load_jfm', 1)}
index b07672f..8549cb1 100644 (file)
@@ -39,7 +39,7 @@
 %%
 \NeedsTeXFormat{LaTeX2e}
 \ProvidesFile{ltjtsize10.clo}
-  [2014/07/02 v1.6-ltj-5
+  [2014/07/28 v1.6-ltj-6
   Standard LuaLaTeX-ja file (size option)]
 \renewcommand{\normalsize}{%
     \@setfontsize\normalsize\@xpt{17}%
index c60c661..990ab16 100644 (file)
@@ -39,7 +39,7 @@
 %%
 \NeedsTeXFormat{LaTeX2e}
 \ProvidesFile{ltjtsize11.clo}
-  [2014/07/02 v1.6-ltj-5
+  [2014/07/28 v1.6-ltj-6
   Standard LuaLaTeX-ja file (size option)]
 \renewcommand{\normalsize}{%
     \@setfontsize\normalsize\@xipt{17}%
index bbfe22e..a2554f9 100644 (file)
@@ -39,7 +39,7 @@
 %%
 \NeedsTeXFormat{LaTeX2e}
 \ProvidesFile{ltjtsize12.clo}
-  [2014/07/02 v1.6-ltj-5
+  [2014/07/28 v1.6-ltj-6
   Standard LuaLaTeX-ja file (size option)]
 \renewcommand{\normalsize}{%
     \@setfontsize\normalsize\@xiipt{18}%
index fa58cb1..ab446c2 100644 (file)
     \ltj@@orig@moveleft\the\ltj@tempdima\noexpand\box\ltj@afbox
   }\ltj@afterbox\ltj@@moveleft@a}
 
+%%%% \vcenter
+\let\ltj@@orig@vcenter=\vcenter
+\protected\def\vcenter{\ltj@afterbox\ltj@@vcenter\vbox}
+\protected\def\ltj@@vcenter{%
+  \directlua{luatexja.direction.raise_box()}%
+  \ltj@@orig@vcenter{\box\ltj@afbox}%
+}
 
 %%%% \unhbox and \unvbox
 \let\ltj@@orig@unhbox=\unhbox
index a93eee3..ac75892 100644 (file)
Binary files a/test/test12-ltjtarticle.pdf and b/test/test12-ltjtarticle.pdf differ
index dc8eed6..a367353 100644 (file)
@@ -1,35 +1,8 @@
 %#!lualatex
 \documentclass{ltjtarticle}
 \usepackage[b5j,margin=40mm]{geometry}
-
-\makeatletter
-\newif\ifnot@advanceline
-\newskip\rensujiskip
-\rensujiskip=0.25\chs plus.25\zw minus.25\zw
-\DeclareRobustCommand\rensuji{%
-  \@ifstar{\not@advancelinetrue\@rensuji}{\@rensuji}}
-\def\@rensuji{\@ifnextchar[{\@@rensuji}{\@@rensuji[c]}}
-\def\@@rensuji[#1]#2{\ifnum\ltjgetparameter{direction}=3\hbox{#2}\else
-  \hskip\rensujiskip
-  \ifvmode\leavevmode\fi
-  \ifnot@advanceline\not@advancelinefalse\else
-    \setbox\z@\hbox{\yoko#2}%
-    \@tempdima\ht\z@ \advance\@tempdima\dp\z@
-    \if #1c\relax\vrule\@width\z@ \@height.5\@tempdima \@depth.5\@tempdima
-    \else\if #1r\relax\vrule\@width\z@\@height\z@ \@depth\@tempdima
-    \else\vrule\@width\z@ \@height\@tempdima \@depth\z@
-    \fi\fi
-  \fi
-  \if #1c\relax\hbox to1zw{\yoko\hss#2\hss}%
-  \else\if #1r\relax\vbox{\hbox to1zw{\yoko\hss#2}}%
-  \else\vtop{\hbox to1zw{\yoko#2\hss}}%
-  \fi\fi
-  \hskip\rensujiskip
-\fi}
-\let\Rensuji\rensuji
-\let\prensuji\rensuji
-
 \begin{document}
+\ltjgetparameter{talbaselineshift}
 酵素(こうそ)とは、生体で起こる化学反応に対して触媒として機能する分子である。酵素によって触媒される反応を“酵素的”反応という。
 
 酵素は生物が物質を消化する段階から吸収・輸送・代謝・排泄に至るまでのあらゆる過程に関与しており、生体が物質をj変化させて利用するのに欠かせない。したがって、酵素は生化学研究における一大分野であり、早い段階から研究対象になっている。
@@ -47,7 +20,7 @@
 \def\R{01234567890123456789}
 \def\S{\R\R\R\R\R\R\R\R\R\R\R\R\R\R\R\R\R\R\R\R\par}
 
-\S\S
+連数字のテスト\rensuji{42}\S\S
 \leavevmode \leaders\hbox{2}\hskip2pt
 
 \end{document}
\ No newline at end of file
index 81571fa..9d1164f 100644 (file)
 上(\texttt{t} opt),罫あり&T\\
 \hline
 \end{tabular}
-えおabc\hfil\penalty0\hfilneg あいうxyz%
+えおabc\hfil\penalty0\hfilneg あxyz%
 \begin{tabular}<#2>[c]{l}
 \hline
 中央(\texttt{c} opt),罫あり\\
 \hline
 \end{tabular}
-えおabc\hfil\penalty0\hfilneg あいうxyz%
+えabc\hfil\penalty0\hfilneg あxyz%
 \begin{tabular}<#2>[b]{l}
 \hline
 下(\texttt{b} opt),罫あり\\
 \hline
 \end{tabular}
-えおabc\hfil\penalty0\hfilneg あいうxyz
+えabc\hfil\penalty0\hfilneg あxyz
 \begin{tabular}<#2>[t]{l}
 上(\texttt{t} opt),罫なし\\
-\end{tabular}えabc\hfil\penalty0\hfilneg 
-あいうxyz%
+\end{tabular}えabc\hfil\penalty0\hfilneg 
+あxyz%
 \begin{tabular}<#2>[c]{l}
 中央(\texttt{c} opt),罫なし\\
-\end{tabular}えabc\hfil\penalty0\hfilneg 
-あいうxyz%
+\end{tabular}えabc\hfil\penalty0\hfilneg 
+あxyz%
 \begin{tabular}<#2>[b]{l}
 下(\texttt{b} opt),罫なし\\
-\end{tabular}あいうxyz
+\end{tabular}あxyz
 }}
 
 \newpage
 \paragraph{pbox}\
 
 \AX\noindent
-あいうxyz\nobreak\pbox<#2>[20\cwd][l]{\AX%
-  計算機科学(Computer Science)}えおabc\hfil\penalty0\hfilneg
-あいうxyz\nobreak\pbox<#2>[20\cwd][c]{\AX%
-  計算機科学(Computer Science)}えおabc\hfil\penalty0\hfilneg
-あいうxyz\nobreak\pbox<#2>[20\cwd][r]{\AX%
-  計算機科学(Computer Science)}えおabc
+あいうxyz\nobreak\pbox<#2>[10\cwd][l]{\AX%
+  計算機(Computer)}えおabc\hfil\penalty0\hfilneg
+あいうxyz\nobreak\pbox<#2>[10\cwd][c]{\AX%
+  計算機(Computer)}えおabc\hfil\penalty0\hfilneg
+あいうxyz\nobreak\pbox<#2>[10\cwd][r]{\AX%
+  計算機(Computer)}えおabc
+
+\paragraph{rensuji, bou}\ 
+
+aa◆\rensuji[l]{1701}◆\rensuji[c]{1701}◆◆\rensuji[r]{1701}◆aa
+
+◆◆\kasen{◆◆◆◆◆◆◆◆◆◆◆◆}◆◆◆
+
+◆◆\rensuji*[l]{1701}◆\rensuji*[c]{1701}◆◆\rensuji*[r]{1701}◆
+
+◆◆◆\bou{◆◆◆◆◆◆◆◆◆◆◆}◆◆◆◆◆
 
 }}}
 \begin{document}
index 8d9333c..8e39249 100644 (file)
Binary files a/test/test54-res.pdf and b/test/test54-res.pdf differ
diff --git a/test/test54a-lltjext.tex b/test/test54a-lltjext.tex
new file mode 100644 (file)
index 0000000..6e7cd6f
--- /dev/null
@@ -0,0 +1,94 @@
+%#!luajitlatex
+\newif\ifTATE
+\TATEtrue
+\ifdefined\directlua
+  \ifTATE\documentclass{ltjtarticle}\else\documentclass{article}\fi
+  \usepackage{luatexja, lltjext}
+  \pdfpagewidth=105mm\pdfpageheight=74mm
+  \ltjsetparameter{autospacing=false, autoxspacing=false}
+\else
+  \ifTATE\documentclass{tarticle}\else\documentclass{article}\fi
+  \usepackage{plext,otf}
+  \normalsize
+  \newdimen\zw \zw=1zw
+  \AtBeginDvi{\special{pdf:pagesize width 105mm height 74mm}}
+  \noautospacing\noautoxspacing
+\fi
+\topmargin-1in
+\oddsidemargin-1in
+\textwidth105mm
+\textheight74mm
+\headheight0pt
+\headsep0pt
+\topskip0pt
+\baselineskip15pt
+
+\usepackage[T1]{fontenc}
+\usepackage{float}
+\pagestyle{empty}
+\catcode`\_=12
+\makeatletter
+
+\@tfor\dir:=ytzn\do{%
+  \@tfor\posa:=ctb\do{%
+    \@tfor\posb:=udlr\do{%
+      \edef\float_name{tf_\dir\posa\posb}
+      \newfloat{\float_name}{th}{lof}
+      \DeclareLayoutCaption{\float_name}<\dir>(8\zw)[\posa\posb]
+      \floatname{\float_name}{
+       \leavevmode\rensuji{\dir\posa\posb}}
+      \@namedef{the\float_name}{}
+    }
+  }
+}
+\ifdefined\directlua
+\@tfor\dir:=ud\do{%
+  \@tfor\posa:=ctb\do{%
+    \@tfor\posb:=udlr\do{%
+      \edef\float_name{tf_\dir\posa\posb}
+      \newfloat{\float_name}{th}{lof}
+      \DeclareLayoutCaption{\float_name}<\dir>(8\zw)[\posa\posb]
+      \floatname{\float_name}{
+       \leavevmode\rensuji{\dir\posa\posb}}
+      \@namedef{the\float_name}{}
+    }
+  }
+}
+\fi
+\begin{document}
+\makeatletter
+\@tfor\dir:=ytzn\do{%
+  \@tfor\posa:=ctb\do{%
+    \@tfor\posb:=udlr\do{%
+      \clearpage
+      \begin{tf_\dir\posa\posb}[t]
+      \layoutfloat(10\zw, 20mm){%
+        ほげabcdefふが\medskip
+
+        組方向: \texttt{\dir},位置: \texttt{\posa\posb}\medskip
+
+      }
+      \pcaption{文字列testあああああああ\the\hsize}
+      \end{tf_\dir\posa\posb}
+    }
+  }
+}
+\ifdefined\directlua
+\@tfor\dir:=ud\do{%
+  \@tfor\posa:=ctb\do{%
+    \@tfor\posb:=udlr\do{%
+      \clearpage
+      \begin{tf_\dir\posa\posb}[t]
+      \layoutfloat(10\zw, 20mm){%
+        ほげabcdefふが\medskip
+
+        組方向: \texttt{\dir},位置: \texttt{\posa\posb}\medskip
+
+      }
+      \pcaption{文字列testあああああああ\the\hsize}
+      \end{tf_\dir\posa\posb}
+    }
+  }
+}
+\fi
+\end{document}
\ No newline at end of file
diff --git a/test/test54a-res.pdf b/test/test54a-res.pdf
new file mode 100644 (file)
index 0000000..6ce2aa2
Binary files /dev/null and b/test/test54a-res.pdf differ
diff --git a/test/test54a.sh b/test/test54a.sh
new file mode 100755 (executable)
index 0000000..f4ef5bf
--- /dev/null
@@ -0,0 +1,34 @@
+#!/bin/bash
+
+platex -jobname test54a-p test54a-lltjext
+dvipdfmx test54a-p
+luajitlatex -jobname test54a-l test54a-lltjext
+
+cat <<EOF > test54a-res.tex
+\documentclass{article}
+\pdfpageattr {/Group << /S /Transparency /I true /CS /DeviceRGB>>}
+\pdfoptionpdfminorversion 7
+\usepackage[a6paper,landscape,margin=0mm]{geometry}
+\usepackage{xcolor,graphicx}
+\usepackage{transparent}
+
+\def\E#1{\newpage\leavevmode
+\hbox to 0pt{\transparent{0.5}\textcolor{red}{%
+\includegraphics[width=\textwidth,page=#1]{test54a-p.pdf}}\hss}%
+\hbox to 0pt{\transparent{0.5}\textcolor{blue}{%
+\includegraphics[width=\textwidth,page=#1]{test54a-l.pdf}}\hss}%
+}
+
+\begin{document}
+\parindent0pt
+
+\newcount\D
+\D=1
+\loop\ifnum\D<49
+  \E{\the\D}\advance\D1
+ \repeat
+
+\end{document}
+EOF
+
+pdflatex test54a-res