\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}
\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
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)
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",
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()
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
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
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
-- 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
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
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)
%%
\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}
%%
\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}%
%%
\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}%
%%
\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}%
%%
\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}
% \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}
%
%%
\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}
%%
\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}%
%%
\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}%
%%
\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}%
%%
\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)}
%%
\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}%
%%
\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}%
%%
\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}%
%%
\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)}
%%
\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)}
%%
\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}%
%%
\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}%
%%
\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}%
\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
%#!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変化させて利用するのに欠かせない。したがって、酵素は生化学研究における一大分野であり、早い段階から研究対象になっている。
\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
上(\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}
--- /dev/null
+%#!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
--- /dev/null
+#!/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