summaryrefslogtreecommitdiff
path: root/macros/luatex/generic/luatexja/src
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2021-05-18 03:01:12 +0000
committerNorbert Preining <norbert@preining.info>2021-05-18 03:01:12 +0000
commit97eca13a92a0b8ad423b606c8970c9ce64d9b2bf (patch)
tree7275ec8351efb8f8108d65ec87d4cc81512a295a /macros/luatex/generic/luatexja/src
parentd999da47ff375df843c0c9bbfd5911236dd9d40a (diff)
CTAN sync 202105180301
Diffstat (limited to 'macros/luatex/generic/luatexja/src')
-rw-r--r--macros/luatex/generic/luatexja/src/addons/luatexja-ruby.sty2
-rw-r--r--macros/luatex/generic/luatexja/src/lltjext.sty10
-rw-r--r--macros/luatex/generic/luatexja/src/ltj-latex.sty47
-rw-r--r--macros/luatex/generic/luatexja/src/ltj-ruby.lua7
-rw-r--r--macros/luatex/generic/luatexja/src/luatexja-core.sty121
-rw-r--r--macros/luatex/generic/luatexja/src/luatexja.lua2
-rw-r--r--macros/luatex/generic/luatexja/src/luatexja.sty4
-rw-r--r--macros/luatex/generic/luatexja/src/patches/lltjcore.sty51
-rw-r--r--macros/luatex/generic/luatexja/src/patches/lltjdefs.sty2
-rw-r--r--macros/luatex/generic/luatexja/src/patches/lltjfont.sty52
-rw-r--r--macros/luatex/generic/luatexja/src/patches/lltjp-atbegshi.sty2
-rw-r--r--macros/luatex/generic/luatexja/src/patches/lltjp-footmisc.sty6
-rw-r--r--macros/luatex/generic/luatexja/src/patches/lltjp-siunitx.sty30
-rw-r--r--macros/luatex/generic/luatexja/src/patches/lltjp-stfloats.sty6
14 files changed, 213 insertions, 129 deletions
diff --git a/macros/luatex/generic/luatexja/src/addons/luatexja-ruby.sty b/macros/luatex/generic/luatexja/src/addons/luatexja-ruby.sty
index 0dacf32bf8..c8f933ec92 100644
--- a/macros/luatex/generic/luatexja/src/addons/luatexja-ruby.sty
+++ b/macros/luatex/generic/luatexja/src/addons/luatexja-ruby.sty
@@ -4,7 +4,7 @@
% LaTeX only!
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{luatexja-ruby}[2020-12-25 v0.51]
+\ProvidesPackage{luatexja-ruby}[2021-05-04 v0.52]
\RequirePackage{luatexja}
%%------------------
diff --git a/macros/luatex/generic/luatexja/src/lltjext.sty b/macros/luatex/generic/luatexja/src/lltjext.sty
index 9fe18f4f01..532e7a2934 100644
--- a/macros/luatex/generic/luatexja/src/lltjext.sty
+++ b/macros/luatex/generic/luatexja/src/lltjext.sty
@@ -3,7 +3,7 @@
%
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{lltjext}[2020-09-30 v1.2k-ltj-12 Macros for vertical writing]
+\ProvidesPackage{lltjext}[2021-04-20 v1.2k-ltj-13 Macros for vertical writing]
\RequirePackage{luatexja}
\newcount\ltj@ext@dir
\let\ltj@lltjext@orig@tabular=\tabular
@@ -28,7 +28,7 @@
\setlength\dimen@{#2}%
\edef\@halignto{to\the\dimen@}\p@tabular<#1>}
\def\p@tabular<#1>{\leavevmode \hbox \bgroup
- \ltj@ext@dir=\ltjgetparameter{direction}
+ \ltj@ext@dir=\ltjgetparameter{direction}\relax
$\let\@acol\@tabacol
\let\@classz\@tabclassz
\let\@classiv\@tabclassiv \let\\\@tabularcr\p@tabarray<#1>}
@@ -36,6 +36,7 @@
{\p@array<#1>}{\p@array<#1>[c]}}
\def\p@array<#1>[#2]#3{%
+ \ifnum\ltj@ext@dir=0 \ltj@ext@dir=\ltjgetparameter{direction}\relax\fi
\let\box@dir\relax
\if #1z\relax
\ifnum\ltj@ext@dir=3\relax
@@ -674,7 +675,7 @@
\def\ltj@lltjext@patch@array{%
\patchcmd{\@tabular}{\hbox\bgroup}{%
- \hbox\bgroup\ltj@ext@dir=\ltjgetparameter{direction}}{}{}
+ \hbox\bgroup\ltj@ext@dir=\ltjgetparameter{direction}\relax}{}{}
\pretocmd{\array}%
{\ltj@ext@dir=\ltjgetparameter{direction}\relax}{}{}
\expandafter\let\csname tabular*\endcsname=\ltj@lltjext@orig@tabularS
@@ -702,6 +703,7 @@
}%
\def\@tabarray{\@ifnextchar<\p@tabarray{\p@tabarray<Z>}}
\def\p@array<##1>[##2]##3{%
+ \ifnum\ltj@ext@dir=0 \ltj@ext@dir=\ltjgetparameter{direction}\relax\fi
\let\box@dir\relax
\if ##1z\relax
\ifnum\ltj@ext@dir=3\relax
@@ -734,7 +736,7 @@
\fork@array@option<##1>[##2]%
\begingroup
\@mkpream{##3}%
- \xdef\@preamble{\ialign \noexpand \@halignto
+ \xdef\@preamble{\noexpand\ialign \noexpand \@halignto
\bgroup \tabskip \z@skip \@arstrut \@preamble
\tabskip \z@ \cr}%
\endgroup
diff --git a/macros/luatex/generic/luatexja/src/ltj-latex.sty b/macros/luatex/generic/luatexja/src/ltj-latex.sty
index 6517262f56..7e4ec507c6 100644
--- a/macros/luatex/generic/luatexja/src/ltj-latex.sty
+++ b/macros/luatex/generic/luatexja/src/ltj-latex.sty
@@ -12,7 +12,7 @@
\def\luatexjalatexLoaded{\endinput}
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{ltj-latex}[2021-03-18 LaTeX support of LuaTeX-ja]
+\ProvidesPackage{ltj-latex}[2021-05-17 LaTeX support of LuaTeX-ja]
\endlinechar=13
@@ -46,7 +46,6 @@
\ifcsname tex_shipout:D\endcsname
\expandafter\let\csname tex_shipout:D\endcsname\ltj@shipout
\fi
- \directlua{luatexja.direction.shipout_lthook = nil}
\else
\directlua{%
luatexbase.add_to_callback('pre_shipout_filter',luatexja.direction.shipout_lthook, 'ltj.direction', 1)
@@ -122,6 +121,50 @@
\RequirePackage{lltjp-geometry}
+\def\ltj@@q@stop{\ltj@@q@stop}
+\ifdefined\ltj@stop@overwrite@primitive
+ \begingroup
+ \def\ltj@loop#1{%
+ \unless\ifx#1\ltj@@q@stop
+ \escapechar-1
+ \ifcsname ltj@@orig@\string#1\endcsname
+ \ifcsname ltj@@\string#1\endcsname
+ \edef\ltj@@next{\unexpanded{\global\let#1}\csname ltj@@orig@\string#1\endcsname}%
+ \edef\ltj@@temp{ltj@@orig@\string#1}%
+ \escapechar92
+ \PackageInfo{luatexja}{%
+ Restoring \string#1\space into its orignal meaning\MessageBreak
+ (\expandafter\meaning\csname\ltj@@temp\endcsname)}%
+ \ltj@@next%
+ \fi
+ \fi
+ \let\ltj@@next\ltj@loop
+ \else\let\ltj@@next\relax\fi\ltj@@next
+ }%
+ \expandafter\ltj@loop\ltj@stop@overwrite@primitive\ltj@@q@stop
+ \endgroup
+\fi
+\def\ltj@overwrite@primitive#1{%
+ \begingroup
+ \def\ltj@loop##1{%
+ \unless\ifx##1\ltj@@q@stop
+ \escapechar-1
+ \edef\ltj@@next{\unexpanded{\let\ltj@@temp}\csname ltj@@\string##1\endcsname}\ltj@@next
+ \ifx\ltj@@temp\relax
+ \else\ifx\ltj@@temp##1
+ \escapechar92
+ \PackageInfo{luatexja}{No need to redefine \string##1}%
+ \else
+ \edef\ltj@@next{\unexpanded{\global\let##1}\csname ltj@@\string##1\endcsname}%
+ \escapechar92\PackageInfo{luatexja}{Redefining \string##1}\ltj@@next%
+ \fi\fi
+ \let\ltj@@next\ltj@loop
+ \else\let\ltj@@next\relax\fi\ltj@@next
+ }%
+ \ltj@loop#1\ltj@@q@stop
+ \endgroup
+}
+
%%------------------ all done
\ltj@latex@AtEnd
\endinput
diff --git a/macros/luatex/generic/luatexja/src/ltj-ruby.lua b/macros/luatex/generic/luatexja/src/ltj-ruby.lua
index cd8b98aa27..d5bc393963 100644
--- a/macros/luatex/generic/luatexja/src/ltj-ruby.lua
+++ b/macros/luatex/generic/luatexja/src/ltj-ruby.lua
@@ -3,7 +3,7 @@
--
luatexbase.provides_module({
name = 'luatexja.ruby',
- date = '2020-10-30',
+ date = '2021-05-04',
description = 'Ruby annotation',
})
luatexja.ruby = {}
@@ -544,12 +544,13 @@ local function pre_high(ahead)
local op = (atr>0) and (old_break_info[atr] or post_intrusion_backup) or 0
max_allow_pre = max(0, -max_allow_pre - op)
end
- if rst.exclude_pre_from_prev_ruby and ((atr>0) and (old_break_info[-atr]>0) or post_jfmgk_backup) then
+ if rst.exclude_pre_from_prev_ruby and atr>0 and old_break_info[-atr]
+ and (old_break_info[-atr]>0 or post_jfmgk_backup) then
-- 「直前のルビが JFM グルーに進入→現在のルビの前文字進入はなし」という状況
max_allow_pre = 0; rst.exclude_pre_from_prev_ruby=false
end
if rst.exclude_pre_jfmgk_from_prev_ruby
- and (atr>0) and ((old_break_info[atr] or post_intrusion_backup) > 0) then
+ and atr>0 and ((old_break_info[atr] or post_intrusion_backup) > 0) then
-- 「直前のルビが文字に進入→現在のルビの和文処理グルーへの進入はなし」という状況
rst.before_jfmgk = 0
end
diff --git a/macros/luatex/generic/luatexja/src/luatexja-core.sty b/macros/luatex/generic/luatexja/src/luatexja-core.sty
index 3f3f102191..5f596574e2 100644
--- a/macros/luatex/generic/luatexja/src/luatexja-core.sty
+++ b/macros/luatex/generic/luatexja/src/luatexja-core.sty
@@ -65,7 +65,7 @@
\expandafter\let\csname ifltj@in@latex\expandafter\endcsname
\csname iftrue\endcsname
\NeedsTeXFormat{LaTeX2e}
- \ProvidesPackage{luatexja-core}[2021-03-16 Core of LuaTeX-ja]
+ \ProvidesPackage{luatexja-core}[2021-05-11 Core of LuaTeX-ja]
\fi %</LaTeX>
%% Load prerequisite packages.
@@ -215,7 +215,11 @@
stop_time_measure(scan_arg())
end
}
-\protected\def\/{\relax\luafunction\ltj@@italic@inner}
+\begingroup\catcode`\/=11
+\global\let\ltj@@orig@/=\/
+\protected\gdef\ltj@@/{\relax\luafunction\ltj@@italic@inner}
+\global\let\/\ltj@@/ %% PRIMITIVE
+\endgroup
\luadef\ltj@@start@time@measure\ltj@@start@time@measure@inner
\luadef\ltj@@stop@time@measure\ltj@@stop@time@measure@inner
@@ -603,7 +607,7 @@
\yoko
%%%% insert
-\let\orig@insert=\insert
+\let\ltj@@orig@insert\insert
\newluafunction\ltj@@lua@populate@insertwhatsit@inner
\directlua{
local t = lua.get_functions_table()
@@ -611,20 +615,29 @@
= luatexja.direction.populate_insertion_dir_whatsit
}
\luadef\ltj@@lua@populate@insertwhatsit\ltj@@lua@populate@insertwhatsit@inner
-\protected\def\insert{\begingroup\afterassignment\ltj@@insert@A\ltj@tempcnta}
-\protected\def\ltj@@insert@A{\orig@insert\ltj@tempcnta\bgroup
+\protected\def\ltj@@insert{\begingroup\afterassignment\ltj@@insert@A\ltj@tempcnta}
+\let\insert\ltj@@insert %% PRIMITIVE
+\protected\def\ltj@@insert@A{\ltj@@orig@insert\ltj@tempcnta\bgroup
\aftergroup\ltj@@insert@B\let\ltj@@next}
\protected\def\ltj@@insert@B{\ltj@@lua@populate@insertwhatsit\endgroup}
%%%% vadjust
-\let\ltj@@orig@vadjust=\vadjust
-\protected\def\vadjust{%
- \ltj@@orig@vadjust\bgroup
- \directlua{luatexja.direction.set_list_direction_hook('adj')}%
- \aftergroup\ltj@@vadjust@check@dir\let\ltj@@next}
-\protected\def\ltj@@vadjust@check@dir{%
- \directlua{luatexja.direction.check_adjust_direction()}%
+\let\ltj@@orig@vadjust\vadjust
+\newluafunction\ltj@@vadjust@dirhook@inner
+\newluafunction\ltj@@vadjust@check@dir@inner
+\directlua{
+ local t = lua.get_functions_table()
+ t[\the\ltj@@vadjust@dirhook@inner]
+ = function () luatexja.direction.set_list_direction_hook('adj') end
+ t[\the\ltj@@vadjust@check@dir@inner]
+ = luatexja.direction.check_adjust_direction()
}
+\luadef\ltj@@vadjust@dirhook\ltj@@vadjust@dirhook@inner
+\protected\luadef\ltj@@vadjust@check@dir\ltj@@vadjust@check@dir@inner
+\protected\def\ltj@@vadjust{%
+ \ltj@@orig@vadjust\bgroup\ltj@@vadjust@dirhook
+ \aftergroup\ltj@@vadjust@check@dir\let\ltj@@next}
+\let\vadjust\ltj@@vadjust %% PRIMITIVE
%%%% \hbox, \vbox, \vtop
\setbox\z@\hbox{%
@@ -653,9 +666,9 @@
\PushPreHook{hbox}{\ltj@@box@dirhook\aftergroup\ltj@@reset@badness}
\PushPreHook{vbox}{\ltj@@box@dirhook\aftergroup\ltj@@reset@badness}
\else
- \let\ltj@@everyhbox=\everyhbox\let\ltj@@everyvbox=\everyvbox
+ \let\ltj@@everyhbox\everyhbox\let\ltj@@everyvbox\everyvbox
\newtoks\ltj@@i@everyhbox\newtoks\ltj@@i@everyvbox
- \let\everyhbox=\ltj@@i@everyhbox\let\everyvbox=\ltj@@i@everyvbox
+ \let\everyhbox\ltj@@i@everyhbox\let\everyvbox\ltj@@i@everyvbox
\ltj@@everyhbox{\ltj@@box@dirhook
\aftergroup\ltj@@reset@badness\the\ltj@@i@everyhbox}
\ltj@@everyvbox{\ltj@@box@dirhook
@@ -671,35 +684,41 @@
t[\the\ltj@@lua@raisebox@inner]=luatexja.direction.raise_box
}
\protected\luadef\ltj@@lua@raisebox\ltj@@lua@raisebox@inner
-\let\ltj@@orig@raise=\raise
-\let\ltj@@orig@lower=\lower
-\protected\def\raise{\ltj@reset@globaldefs\afterassignment\ltj@@raise\ltj@tempdima}
-\protected\def\lower{\ltj@reset@globaldefs\afterassignment\ltj@@raise\ltj@tempdima-}
-\protected\def\ltj@@raise{%
+\let\ltj@@orig@raise\raise
+\let\ltj@@orig@lower\lower
+\protected\def\ltj@@raise{\ltj@reset@globaldefs\afterassignment\ltj@@raise@\ltj@tempdima}
+\protected\def\ltj@@lower{\ltj@reset@globaldefs\afterassignment\ltj@@raise@\ltj@tempdima-}
+\protected\def\ltj@@raise@{%
\ltj@restore@globaldefs
\edef\ltj@@raise@a{%
\ltj@@lua@raisebox\ltj@@orig@raise\the\ltj@tempdima\noexpand\box\ltj@afbox
}\ltj@afterbox\ltj@@raise@a}
-\let\ltj@@orig@moveleft=\moveleft
-\let\ltj@@orig@moveright=\moveright
-\protected\def\moveleft{\ltj@reset@globaldefs\afterassignment\ltj@@moveleft\ltj@tempdima}
-\protected\def\moveright{\ltj@reset@globaldefs\afterassignment\ltj@@moveleft\ltj@tempdima-}
-\protected\def\ltj@@moveleft{%
+\let\ltj@@orig@moveleft\moveleft
+\let\ltj@@orig@moveright\moveright
+\protected\def\ltj@@moveleft{\ltj@reset@globaldefs\afterassignment\ltj@@moveleft@\ltj@tempdima}
+\protected\def\ltj@@moveright{\ltj@reset@globaldefs\afterassignment\ltj@@moveleft@\ltj@tempdima-}
+\protected\def\ltj@@moveleft@{%
\ltj@restore@globaldefs
\edef\ltj@@moveleft@a{%
\ltj@@lua@raisebox\ltj@@orig@moveleft\the\ltj@tempdima\noexpand\box\ltj@afbox
}\ltj@afterbox\ltj@@moveleft@a}
+\let\raise\ltj@@raise %% PRIMITIVE
+\let\lower\ltj@@lower %% PRIMITIVE
+\let\moveleft\ltj@@moveleft %% PRIMITIVE
+\let\moveright\ltj@@moveright %% PRIMITIVE
%%%%\vsplit
-\let\ltj@@orig@vsplit=\vsplit
-\protected\def\vsplit{\directlua{luatexja.direction.vsplit()}}
+\let\ltj@@orig@vsplit\vsplit
+\protected\def\ltj@@vsplit{\directlua{luatexja.direction.vsplit()}}
+\let\vsplit\ltj@@vsplit %% PRIMITIVE
%%%% \vcenter
-\let\ltj@@orig@vcenter=\vcenter
-\protected\def\vcenter{\ltj@afterbox\ltj@@vcenter\vbox}
-\protected\def\ltj@@vcenter{%
+\let\ltj@@orig@vcenter\vcenter
+\protected\def\ltj@@vcenter{\ltj@afterbox\ltj@@vcenter@\vbox}
+\protected\def\ltj@@vcenter@{%
\ltj@@lua@raisebox\ltj@@orig@vcenter{\box\ltj@afbox}%
}
+\let\vcenter\ltj@@vcenter %% PRIMITIVE
%%%% \unhbox and \unvbox
\newluafunction\ltj@@lua@unboxcheckdir@inner
@@ -709,40 +728,38 @@
}
\luadef\ltj@@lua@unboxcheckdir\ltj@@lua@unboxcheckdir@inner
\long\def \@gobbletwo #1#2{}
-\let\ltj@@orig@unhbox=\unhbox
-\let\ltj@@orig@unvbox=\unvbox
-\protected\def\unhbox{\ltj@reset@globaldefs\afterassignment\ltj@@unhbox\ltj@tempcnta}
-\protected\def\unvbox{\ltj@reset@globaldefs\afterassignment\ltj@@unvbox\ltj@tempcnta}
-\protected\def\ltj@@unhbox{%
- \ltj@@lua@unboxcheckdir\ltj@@orig@unhbox\ltj@tempcnta}
-\protected\def\ltj@@unvbox{%
- \ltj@@lua@unboxcheckdir\ltj@@orig@unvbox\ltj@tempcnta}
-\let\ltj@@orig@unhcopy=\unhcopy
-\let\ltj@@orig@unvcopy=\unvcopy
-\protected\def\unhcopy{\ltj@reset@globaldefs\afterassignment\ltj@@unhcopy\ltj@tempcnta}
-\protected\def\unvcopy{\ltj@reset@globaldefs\afterassignment\ltj@@unvcopy\ltj@tempcnta}
-\protected\def\ltj@@unhcopy{%
+\let\ltj@@orig@unhbox\unhbox
+\let\ltj@@orig@unvbox\unvbox
+\protected\def\ltj@@unhbox{\ltj@reset@globaldefs\afterassignment\ltj@@unhbox@\ltj@tempcnta}
+\protected\def\ltj@@unvbox{\ltj@reset@globaldefs\afterassignment\ltj@@unvbox@\ltj@tempcnta}
+\protected\def\ltj@@unhbox@{\ltj@@lua@unboxcheckdir\ltj@@orig@unhbox\ltj@tempcnta}
+\protected\def\ltj@@unvbox@{\ltj@@lua@unboxcheckdir\ltj@@orig@unvbox\ltj@tempcnta}
+\let\ltj@@orig@unhcopy\unhcopy
+\let\ltj@@orig@unvcopy\unvcopy
+\protected\def\ltj@@unhcopy{\ltj@reset@globaldefs\afterassignment\ltj@@unhcopy@\ltj@tempcnta}
+\protected\def\ltj@@unvcopy{\ltj@reset@globaldefs\afterassignment\ltj@@unvcopy@\ltj@tempcnta}
+\protected\def\ltj@@unhcopy@{%
\directlua{luatexja.direction.unbox_check_dir(true)}%
\ltj@@orig@unhcopy\ltj@tempcnta
\directlua{luatexja.direction.uncopy_restore_whatsit()}}
-\protected\def\ltj@@unvcopy{%
+\protected\def\ltj@@unvcopy@{%
\directlua{luatexja.direction.unbox_check_dir(true)}%
\ltj@@orig@unvcopy\ltj@tempcnta
\directlua{luatexja.direction.uncopy_restore_whatsit()}}
+\let\unhbox\ltj@@unhbox %% PRIMITIVE
+\let\unvbox\ltj@@unvbox %% PRIMITIVE
+\let\unhcopy\ltj@@unhcopy %% PRIMITIVE
+\let\unvcopy\ltj@@unvcopy %% PRIMITIVE
%%%% lastbox
\let\ltj@@orig@lastbox=\lastbox
-\protected\def\lastbox{%
- \directlua{luatexja.direction.lastbox_hook()}\ltj@@orig@lastbox
-}
+\protected\def\ltj@@lastbox{\directlua{luatexja.direction.lastbox_hook()}\ltj@@orig@lastbox}
+\let\lastbox\ltj@@lastbox %% PRIMITIVE
%%%%%%%% \ltjgetwd<box_num> etc.
-\def\ltj@@getwd{%
- \directlua{luatexja.direction.get_box_dim('width', token.scan_int())}}
-\def\ltj@@getht{%
- \directlua{luatexja.direction.get_box_dim('height', token.scan_int())}}
-\def\ltj@@getdp{%
- \directlua{luatexja.direction.get_box_dim('depth', token.scan_int())}}
+\def\ltj@@getwd{\directlua{luatexja.direction.get_box_dim('width', token.scan_int())}}
+\def\ltj@@getht{\directlua{luatexja.direction.get_box_dim('height', token.scan_int())}}
+\def\ltj@@getdp{\directlua{luatexja.direction.get_box_dim('depth', token.scan_int())}}
\let\ltjgetwd=\ltj@@getwd\let\ltjgetht=\ltj@@getht\let\ltjgetdp=\ltj@@getdp
%%%%%%%% \ltjsetwd<box_num>=<dimen> etc.
diff --git a/macros/luatex/generic/luatexja/src/luatexja.lua b/macros/luatex/generic/luatexja/src/luatexja.lua
index 8c01db173b..878f791181 100644
--- a/macros/luatex/generic/luatexja/src/luatexja.lua
+++ b/macros/luatex/generic/luatexja/src/luatexja.lua
@@ -521,7 +521,7 @@ local function debug_show_node_X(p,print_fn, limit, inner_depth)
s = s .. ' stream=' .. p.stream
print_fn(s)
for i=1,#p.data do
- print_fn(s .. ' [' .. i .. '] = ' .. tostring(p.data[i].csname))
+ print_fn(s .. ' [' .. i .. '] = ' .. tostring(p.data[i] and p.date[i].csname))
end
elseif p.subtype==16 then
s = s .. ' mode=' .. p.mode .. ', literal="' .. p.data .. '"'
diff --git a/macros/luatex/generic/luatexja/src/luatexja.sty b/macros/luatex/generic/luatexja/src/luatexja.sty
index 13e67dc392..28b139d95e 100644
--- a/macros/luatex/generic/luatexja/src/luatexja.sty
+++ b/macros/luatex/generic/luatexja/src/luatexja.sty
@@ -35,13 +35,13 @@
\expandafter\let\csname ifltj@in@latex\expandafter\endcsname
\csname iftrue\endcsname
\NeedsTeXFormat{LaTeX2e}
- \ProvidesPackage{luatexja}[2021-03-19 Japanese Typesetting with Lua(La)TeX]
+ \ProvidesPackage{luatexja}[2021-05-17 Japanese Typesetting with Lua(La)TeX]
\DeclareOption{disablejfam}{\ltj@disablejfamtrue}
\DeclareOption*{}
\ProcessOptions\relax
\fi %</LaTeX>
%%%% VERSION
-\def\LuaTeXjaversion{20210319.0}
+\def\LuaTeXjaversion{20210517.0}
\directlua{require('ltj-unicode-ccfix.lua')}% catcode of ideographs
diff --git a/macros/luatex/generic/luatexja/src/patches/lltjcore.sty b/macros/luatex/generic/luatexja/src/patches/lltjcore.sty
index 19fe320fad..19b365ad48 100644
--- a/macros/luatex/generic/luatexja/src/patches/lltjcore.sty
+++ b/macros/luatex/generic/luatexja/src/patches/lltjcore.sty
@@ -3,7 +3,7 @@
%
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{lltjcore}[2021-03-19 Patch to LaTeX2e Kernel for LuaTeX-ja]
+\ProvidesPackage{lltjcore}[2021-03-25 Patch to LaTeX2e Kernel for LuaTeX-ja]
\RequirePackage{etoolbox}
%%% expl3
@@ -266,44 +266,17 @@
\newif\iffnfixbottom
\newif\ifltj@ftn@unvboxed
%%% @makecol
-\gdef \@makecol {%
- \ifvoid\footins
- \ltj@ftn@unvboxedfalse
- \setbox\@outputbox \box\@cclv
- \else
- \ltj@ftn@unvboxedtrue
- \setbox\@outputbox \vbox {%
- \boxmaxdepth \@maxdepth
- \unvbox \@cclv
- \iffnfixbottom\vskip\z@ \@plus.0001fil\fi
- \vskip \skip\footins
- \color@begingroup
- \normalcolor
- \footnoterule
- \unvbox \footins
- \color@endgroup
- }%
- \fi
- \let\@elt\relax
- \xdef\@freelist{\@freelist\@midlist}%
- \global \let \@midlist \@empty
- \@combinefloats
- \ifvbox\@kludgeins
- \@makespecialcolbox
- \else
- \setbox\@outputbox \vbox to\@colht {%
- \@texttop
- \dimen@ \dp\@outputbox
- \unvbox \@outputbox
- \unless\ifnum\ltjgetparameter{direction}=4
- \vbox{\primitive\everypar{}\hskip\z@}%
- \fi %%% LuaTeX-ja
- \vskip -\dimen@
- \ifltj@ftn@unvboxed\iffnfixbottom\else\@textbottom\fi\else\@textbottom\fi
- }%
- \fi
- \global \maxdepth \@maxdepth
-}
+\def\pltx@adjust@wd@outputbox{%
+ \unless\ifnum\ltjgetparameter{direction}=4
+ \vbox{\primitive\everypar{}\hskip\z@}%
+ \fi}
+\patchcmd\@makecol{\vskip -\dimen@\@textbottom}%
+ {\pltx@adjust@wd@outputbox
+ \vskip -\dimen@
+ \ifltj@ftn@unvboxed\iffnfixbottom\else\@textbottom\fi\else\@textbottom\fi}{}{}
+\patchcmd\@makecol{\vskip\skip\footins}{\iffnfixbottom\vskip\z@\@plus.0001fil\fi\vskip\skip\footins}{}{}
+\patchcmd\@makecol{\ifvoid\footins}{\ifvoid\footins\ltj@ftn@unvboxedfalse}{}{}
+\patchcmd\@makecol{\setbox\@outputbox \vbox}{\ltj@ftn@unvboxedtrue\setbox\@outputbox \vbox}{}{}
\let\ltj@orig@makecol=\@makecol
\patchcmd\@makespecialcolbox{\@textbottom}{\ifltj@ftn@unvboxed\iffnfixbottom\else\@textbottom\fi\else\@textbottom\fi}{}{}
diff --git a/macros/luatex/generic/luatexja/src/patches/lltjdefs.sty b/macros/luatex/generic/luatexja/src/patches/lltjdefs.sty
index 07b2c0d58b..8bf6bac9f3 100644
--- a/macros/luatex/generic/luatexja/src/patches/lltjdefs.sty
+++ b/macros/luatex/generic/luatexja/src/patches/lltjdefs.sty
@@ -21,7 +21,7 @@
\ifnum\ltj@@latex@plv<1500 % <=2020-10-01
\kanjiseries{m}
\kanjishape{n}
-\else % >=2021-05-01
+\else % >=2021-06-01
\def\k@series{m}
\def\k@shape{n}
\fi
diff --git a/macros/luatex/generic/luatexja/src/patches/lltjfont.sty b/macros/luatex/generic/luatexja/src/patches/lltjfont.sty
index 4932e07480..31f0f645d8 100644
--- a/macros/luatex/generic/luatexja/src/patches/lltjfont.sty
+++ b/macros/luatex/generic/luatexja/src/patches/lltjfont.sty
@@ -3,13 +3,13 @@
%
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{lltjfont}[2021-02-14 Patch to NFSS2 for LuaTeX-ja]
+\ProvidesPackage{lltjfont}[2021-04-29 Patch to NFSS2 for LuaTeX-ja]
%%%%%%%% LaTeX2e version detection
\newcount\ltj@@latex@plv \ltj@@latex@plv=-1
\ifltj@ltfilehook@avail
\IfHookExistsTF{selectfont}%
- {\ltj@@latex@plv=1500}% 2021-05-01
+ {\ltj@@latex@plv=1500}% 2021-06-01
{\ifnum\patch@level>2 \ltj@@latex@plv=1300\else \ltj@@latex@plv=1000\fi}% 2020-10-01
\else\ifdefined\@rmfamilyhook % 2020-02-02
\ifx\@forced@seriestrue\@undefined % 2020-02-02 pl0--2
@@ -451,7 +451,7 @@
\ltj@@EverySelectfont@Init
}
\EverySelectfont{\ltj@selectfont@patch}
-\else % LaTeX2e >=2021-05-01
+\else % LaTeX2e >=2021-06-01
\AddToHook{selectfont}[luatexja]{%
\ltj@@start@time@measure{selectfont}%
\ifx\delayed@k@adjustment\@empty
@@ -473,6 +473,7 @@
\fi
\let\delayed@k@adjustment\@empty
\fi
+ \@forced@series@kanjifalse
\let\tmp@error@fontshape\error@fontshape
\let\error@fontshape\error@kfontshape
\ltj@@is@kyenc{\k@encoding}\ifin@%
@@ -806,7 +807,7 @@
\fi
\fi
}
-\else % >=2021-05-01
+\else % >=2021-06-01
\def\merge@kanji@series@#1#2#3\@nil{%
\def\reserved@a{#3}%
\ifx\reserved@a\@empty
@@ -891,6 +892,7 @@
\let\delayed@merge@kanji@shape\merge@kanji@shape@without@substitution
\fi
+\newif\if@forced@series@kanji
\ifnum\ltj@@latex@plv=300 % 2020-02-02 pl3, 4
\DeclareRobustCommand\romanseries[1]{\merge@font@series{#1}}
\DeclareRobustCommand\kanjiseries[1]{\merge@kanji@series{#1}}
@@ -898,20 +900,20 @@
\DeclareRobustCommand\kanjiseriesforce[1]{\edef\k@series{#1}}
\else\ifnum\ltj@@latex@plv<1500% >=2020-02-02 pl5 and <=2020-10-01
\DeclareRobustCommand\romanseries[1]{\@forced@seriesfalse\merge@font@series{#1}}
- \DeclareRobustCommand\kanjiseries[1]{\@forced@seriesfalse\merge@kanji@series{#1}}
+ \DeclareRobustCommand\kanjiseries[1]{\@forced@series@kanjifalse\merge@kanji@series{#1}}
\DeclareRobustCommand\romanseriesforce[1]{\@forced@seriestrue\edef\f@series{#1}}
- \DeclareRobustCommand\kanjiseriesforce[1]{\@forced@seriestrue\edef\k@series{#1}}
-\else% >=2021-05-01
+ \DeclareRobustCommand\kanjiseriesforce[1]{\@forced@series@kanjitrue\edef\k@series{#1}}
+\else% >=2021-06-01
\DeclareRobustCommand\romanseries[1]{\@forced@seriesfalse
\expandafter\def\expandafter\delayed@f@adjustment\expandafter
{\delayed@f@adjustment\delayed@merge@font@series{#1}}}
- \DeclareRobustCommand\kanjiseries[1]{\@forced@seriesfalse
+ \DeclareRobustCommand\kanjiseries[1]{\@forced@series@kanjifalse
\expandafter\def\expandafter\delayed@k@adjustment\expandafter
{\delayed@k@adjustment\delayed@merge@kanji@series{#1}}}
\DeclareRobustCommand\romanseriesforce[1]{\@forced@seriestrue
\expandafter\def\expandafter\delayed@f@adjustment\expandafter
{\delayed@f@adjustment\edef\f@series{#1}}}
- \DeclareRobustCommand\kanjiseriesforce[1]{\@forced@seriestrue
+ \DeclareRobustCommand\kanjiseriesforce[1]{\@forced@series@kanjitrue
\expandafter\def\expandafter\delayed@k@adjustment\expandafter
{\delayed@k@adjustment\edef\k@series{#1}}}
\let\delayed@k@adjustment\@empty
@@ -930,7 +932,7 @@
\DeclareRobustCommand\romanshapeforce[1]{\edef\f@shape{#1}}
\DeclareRobustCommand\kanjishapeforce[1]{\edef\k@shape{#1}}
\DeclareRobustCommand\fontshapeforce[1]{\set@safe@kanji@shape{#1}{}\romanshapeforce{#1}}
-\else% >=2021-05-01
+\else% >=2021-06-01
\DeclareRobustCommand\romanshape[1]{%
\expandafter\def\expandafter\delayed@f@adjustment\expandafter
{\delayed@f@adjustment\delayed@merge@font@shape{#1}}}
@@ -953,8 +955,20 @@
\expandafter\def\expandafter\delayed@k@adjustment\expandafter
{\delayed@k@adjustment\set@safe@kanji@shape{#1}{}}}
\fi
-\ifnum\ltj@@latex@plv>1000
-%%%% LaTeX >= 2020-10-01 PL3
+\ifnum\ltj@@latex@plv>1499
+%%%% LaTeX >= 2021-06-01
+\DeclareRobustCommand\usekanji[4]{%
+ \kanjiencoding{#1}\edef\k@family{#2}%
+ \set@target@series@kanji{#3}\edef\k@shape{#4}%
+ \let\delayed@k@adjustment\@empty
+ \selectfont\ignorespaces}
+\DeclareRobustCommand\useroman[4]{%
+ \romanencoding{#1}\edef\f@family{#2}%
+ \set@target@series{#3}\edef\f@shape{#4}%
+ \let\delayed@f@adjustment\@empty
+ \selectfont\ignorespaces}
+\else\ifnum\ltj@@latex@plv>1000
+%%%% 2021-10-01 PL3 <= LaTeX < 2021-06-01
\DeclareRobustCommand\usekanji[4]{%
\kanjiencoding{#1}\edef\k@family{#2}%
\set@target@series@kanji{#3}\edef\k@shape{#4}%
@@ -971,7 +985,7 @@
\DeclareRobustCommand\useroman[4]{%
\romanencoding{#1}\edef\f@family{#2}\edef\f@series{#3}\edef\f@shape{#4}%
\selectfont\ignorespaces}
-\fi
+\fi\fi
%%%% LaTeX >= 2020-02-02 END
\else
%%%% LaTeX 2019-10-01
@@ -1014,6 +1028,7 @@
%%%% LaTeX >= 2020-02-02
\let\prepare@family@series@update@kanji=\prepare@family@series@update
\patchcmd\prepare@family@series@update{\fontfamily}{\romanfamily}{}{}
+\patchcmd\prepare@family@series@update@kanji{\if@forced@series}{\if@forced@series@kanji}{}{}
\patchcmd\prepare@family@series@update@kanji{\fontfamily}{\kanjifamily}{}{}
\patchcmd\prepare@family@series@update@kanji{\update@series@target@value}{\update@series@target@value@kanji}{}{}
\patchcmd\prepare@family@series@update@kanji{\f@family}{\k@family}{}{}
@@ -1153,12 +1168,23 @@
\let\reset@font\normalfont
\fi\fi
}
+
+\ifnum\ltj@@latex@plv>1499
+\@ltj@hook@dfh{%
+ \kanjiencoding{\kanjiencodingdefault}%
+ \edef\k@family{\kanjifamilydefault}%
+ \edef\k@series{\kanjiseriesdefault}%
+ \edef\k@shape{\kanjishapedefault}%
+ \let\delayed@k@adjustment\empty
+}
+\else
\@ltj@hook@dfh{%
\kanjiencoding{\kanjiencodingdefault}%
\edef\k@family{\kanjifamilydefault}%
\edef\k@series{\kanjiseriesdefault}%
\edef\k@shape{\kanjishapedefault}%
}
+\fi
\let\@ltj@hook@dfh\@undefined
%%%% LaTeX >= 2020-02-02 END
\else
diff --git a/macros/luatex/generic/luatexja/src/patches/lltjp-atbegshi.sty b/macros/luatex/generic/luatexja/src/patches/lltjp-atbegshi.sty
index d1a21a0e5c..27680205f6 100644
--- a/macros/luatex/generic/luatexja/src/patches/lltjp-atbegshi.sty
+++ b/macros/luatex/generic/luatexja/src/patches/lltjp-atbegshi.sty
@@ -13,7 +13,7 @@
\RequirePackage{expl3}
\ExplSyntaxOn\makeatletter
\box_new:N \l__platex_shipout_dummy_box
-\if_cs_exist:N \__shipout_execute_main_cont:Nnnn %% 2021-05-01
+\if_cs_exist:N \__shipout_execute_main_cont:Nnnn %% 2021-06-01
\cs_new_eq:NN \__platex_original_shipout_execute_main_cont:Nnnn
\__shipout_execute_main_cont:Nnnn
\cs_set:Npn \__shipout_execute_main_cont:Nnnn #1#2#3#4 {
diff --git a/macros/luatex/generic/luatexja/src/patches/lltjp-footmisc.sty b/macros/luatex/generic/luatexja/src/patches/lltjp-footmisc.sty
index 99ed190631..b838fd92fe 100644
--- a/macros/luatex/generic/luatexja/src/patches/lltjp-footmisc.sty
+++ b/macros/luatex/generic/luatexja/src/patches/lltjp-footmisc.sty
@@ -3,7 +3,7 @@
%
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{lltjp-footmisc}[2021-03-17 Patch to footmisc for LuaTeX-ja]
+\ProvidesPackage{lltjp-footmisc}[2021-03-25 Patch to footmisc for LuaTeX-ja]
\RequirePackage{footmisc}
\let \if@tempswa \ifFN@bottom
@@ -47,9 +47,7 @@
\setbox\@outputbox \vbox to\@colht{%
\@texttop \dimen@\dp\@outputbox
\unvbox\@outputbox
- \unless\ifnum\ltjgetparameter{direction}=4
- \vbox{\primitive\everypar{}\hskip\z@}%
- \fi %%% LuaTeX-ja
+ \pltx@adjust@wd@outputbox
\vskip -\dimen@\@textbottom
}%
\fi
diff --git a/macros/luatex/generic/luatexja/src/patches/lltjp-siunitx.sty b/macros/luatex/generic/luatexja/src/patches/lltjp-siunitx.sty
index c6bebc36cd..db444aecb7 100644
--- a/macros/luatex/generic/luatexja/src/patches/lltjp-siunitx.sty
+++ b/macros/luatex/generic/luatexja/src/patches/lltjp-siunitx.sty
@@ -1,5 +1,5 @@
%
-% lltjp-siunitx.sty 2019-06-06
+% lltjp-siunitx.sty 2021-04-19
%
\NeedsTeXFormat{LaTeX2e}
@@ -7,6 +7,32 @@
\RequirePackage{siunitx}
\makeatletter
\ExplSyntaxOn
+\cs_if_exist:NTF \siunitx_print_text:n {% siunitx v3.00
+\cs_set_protected:Npn \siunitx_print_text:n #1
+ {
+ \text
+ {
+ \ltj@allalchar % <--- LuaTeX-ja
+ \bool_if:NT \l__siunitx_print_text_family_bool
+ {
+ \fontfamily { \familydefault }
+ \selectfont
+ }
+ \bool_if:NT \l__siunitx_print_text_series_bool
+ {
+ \fontseries { \seriesdefault }
+ \selectfont
+ }
+ \bool_if:NT \l__siunitx_print_text_shape_bool
+ {
+ \fontshape { \shapedefault }
+ \selectfont
+ }
+ \__siunitx_print_text_replace:n {#1}
+ }
+ }
+}% siunitx v3.00 end
+{% siunitx v2.xx
\cs_generate_variant:Nn \tl_if_in:NnT { coT }
\cs_new:Nn \__ltj_siunix_patch_inner:n {
\cs_if_exist:cT { #1_tl } {
@@ -91,6 +117,6 @@
}
{ }
}
-
+}
\ExplSyntaxOff
\endinput
diff --git a/macros/luatex/generic/luatexja/src/patches/lltjp-stfloats.sty b/macros/luatex/generic/luatexja/src/patches/lltjp-stfloats.sty
index 6ce9528d72..c4cd3ca53e 100644
--- a/macros/luatex/generic/luatexja/src/patches/lltjp-stfloats.sty
+++ b/macros/luatex/generic/luatexja/src/patches/lltjp-stfloats.sty
@@ -1,5 +1,5 @@
%
-% lltjp-stfloats.sty 2021-03-17
+% lltjp-stfloats.sty 2021-03-25
%
\NeedsTeXFormat{LaTeX2e}
@@ -14,9 +14,7 @@
\global\let\org@makecol\ltj@orig@makecol
\patchcmd\fn@makecol{\vskip -\dimen@\@textbottom}%
- {\unless\ifnum\ltjgetparameter{direction}=4
- \vbox{\primitive\everypar{}\hskip\z@}%
- \fi %%% LuaTeX-ja
+ {\pltx@adjust@wd@outputbox
\vskip -\dimen@
\ifltj@ftn@unvboxed\iffnfixbottom\else\@textbottom\fi\else\@textbottom\fi}{}{}
\patchcmd\fn@makecol{\vskip\skip\footins}{\iffnfixbottom\vskip\z@\@plus.0001fil\fi\vskip\skip\footins}{}{}