summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/luatex
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2023-02-11 21:18:39 +0000
committerKarl Berry <karl@freefriends.org>2023-02-11 21:18:39 +0000
commitaa4762182a375d21b6c11c1203c3e79ff7ac2d68 (patch)
tree86a6954eba0a3449fd619c0b4fdd2769fd758b7f /Master/texmf-dist/tex/luatex
parentd6f58a4ea9104f708a0cacd12c4cf3fb1735c2c8 (diff)
luatexja (11feb23)
git-svn-id: svn://tug.org/texlive/trunk@65790 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/luatex')
-rw-r--r--Master/texmf-dist/tex/luatex/luatexja/addons/luatexja-preset.sty3
-rw-r--r--Master/texmf-dist/tex/luatex/luatexja/addons/luatexja-ruby.sty62
-rw-r--r--Master/texmf-dist/tex/luatex/luatexja/ltj-direction.lua38
-rw-r--r--Master/texmf-dist/tex/luatex/luatexja/ltj-ruby.lua15
-rw-r--r--Master/texmf-dist/tex/luatex/luatexja/luatexja-core.sty40
-rw-r--r--Master/texmf-dist/tex/luatex/luatexja/luatexja.sty2
-rw-r--r--Master/texmf-dist/tex/luatex/luatexja/patches/lltjp-siunitx.sty22
7 files changed, 115 insertions, 67 deletions
diff --git a/Master/texmf-dist/tex/luatex/luatexja/addons/luatexja-preset.sty b/Master/texmf-dist/tex/luatex/luatexja/addons/luatexja-preset.sty
index b1d5873ab61..ed2a9084e6c 100644
--- a/Master/texmf-dist/tex/luatex/luatexja/addons/luatexja-preset.sty
+++ b/Master/texmf-dist/tex/luatex/luatexja/addons/luatexja-preset.sty
@@ -519,7 +519,8 @@
\group_end:
}
- \msg_warning:nnx { luatexja-preset }{ scale }{ \Cjascale }
+ \fp_compare:nNnF \Cjascale = 1
+ { \msg_warning:nnx { luatexja-preset }{ scale }{ \Cjascale } }
% {1: encoding}{2: family}{3: series}{4: shape}{5: fontname}{6: feature}{7: scale}
\cs_new:Nn \__ltjpreset_declare_font_shape:nnnnnnn {
diff --git a/Master/texmf-dist/tex/luatex/luatexja/addons/luatexja-ruby.sty b/Master/texmf-dist/tex/luatex/luatexja/addons/luatexja-ruby.sty
index 1e50b1f680c..e24164d1b6a 100644
--- a/Master/texmf-dist/tex/luatex/luatexja/addons/luatexja-ruby.sty
+++ b/Master/texmf-dist/tex/luatex/luatexja/addons/luatexja-ruby.sty
@@ -4,7 +4,7 @@
% LaTeX only!
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{luatexja-ruby}[2022-07-03 v0.53]
+\ProvidesPackage{luatexja-ruby}[2023-01-21 v0.61]
\RequirePackage{luatexja}
%%------------------
@@ -32,14 +32,16 @@
%% attr_ruby_mode
%% bit 0: intrusion を有効にするか(1: 有効)
%% bit 1: 前後の intrusion 許容量を小さい方に揃える (1: yes)
-%% bit 2, 3: intrusion をどう使って親文字を配置するか
-%% 00: intrusion なしでとりあえず計算し,左右の突出分を進入に割り当てる
-%% 01: pre-intrusion でまかなえるだけまかない,無理なら post- も使う
-%% 10: post を優先
-%% 11: 2 min (pre,post) までは pre, post に均等配分しようとする
-%% >=01 で,intrusion で賄えきれなかった場合はいつものように伸長する.
-%% bit 4: 熟語ルビの際の処理方法(0: 常にグループ,1: 可能な限りブロックごとに)
-%% ↑bit 4 は今は無効
+%% bit 2--4: intrusion をどう使って親文字を配置するか
+%% 00: intrusion なしでとりあえず計算し,左右の突出分を進入に割り当てる
+%% 01: pre-intrusion でまかなえるだけまかない,無理なら post- も使う
+%% 10: post を優先
+%% 11: 2 min (pre,post) までは pre, post に均等配分しようとする
+%% 100: 2 min (pre,post) までは pre, post に均等配分.
+%% それでだめでも pre, post でまかなえるまでまかなう
+%% ※ 01--100 で,intrusion で賄えきれなかった場合はいつものように伸長する.
+%% bit 5: 熟語ルビの際の処理方法(0: 常にグループ,1: 可能な限りブロックごとに)
+%% ↑bit 5 は今は無効
\ltj@@rkeydef{mode}
%% intrusion 量強制固定(bit 0, bit 1 より優先,負数で「自動」)
%% attr は sp 単位だが,ユーザーはルビ全角単位で指定する
@@ -153,36 +155,36 @@
%%%%%%%% ZR さんの PXrubrica パッケージ中のコードから引用・改変
% \pxrr@decompbar: a|bc -> \ltj@@ruby@mark{a}\ltj@@ruby@mark{bc}
-\let\pxrr@res\empty
-\def\pxrr@ifx#1{%
+\let\ltj@@ruby@res\empty
+\def\ltj@@ruby@ifx#1{%
\ifx#1\expandafter\@firstoftwo
\else\expandafter\@secondoftwo
\fi
}
-\def\pxrr@nil{\noexpand\pxrr@nil}
-\def\pxrr@end{\noexpand\pxrr@end}
-\def\pxrr@appto#1#2{%
+\def\ltj@@ruby@nil{\noexpand\ltj@@ruby@nil}
+\def\ltj@@ruby@end{\noexpand\ltj@@ruby@end}
+\def\ltj@@ruby@appto#1#2{%
\expandafter\def\expandafter#1\expandafter{#1#2}%
}
-\def\pxrr@decompbar#1{%
- \let\pxrr@res\@empty
- \pxrr@decompbar@loopa\pxrr@nil#1|\pxrr@end|%
+\def\ltj@@ruby@decompbar#1{%
+ \let\ltj@@ruby@res\@empty
+ \ltj@@ruby@decompbar@loopa\ltj@@ruby@nil#1|\ltj@@ruby@end|%
}
-\def\pxrr@decompbar@loopa#1|{%
- \expandafter\pxrr@decompbar@loopb\expandafter{\@gobble#1}%
+\def\ltj@@ruby@decompbar@loopa#1|{%
+ \expandafter\ltj@@ruby@decompbar@loopb\expandafter{\@gobble#1}%
}
-\def\pxrr@decompbar@loopb#1{%
- \pxrr@decompbar@loopc#1\relax\pxrr@nil{#1}%
+\def\ltj@@ruby@decompbar@loopb#1{%
+ \ltj@@ruby@decompbar@loopc#1\relax\ltj@@ruby@nil{#1}%
}
-\def\pxrr@decompbar@loopc#1#2\pxrr@nil#3{%
- \pxrr@ifx{#1\pxrr@end}{}{%
- \ifx\pxrr@res\@empty
- \def\pxrr@res{\ltj@@ruby@mark}%
+\def\ltj@@ruby@decompbar@loopc#1#2\ltj@@ruby@nil#3{%
+ \ltj@@ruby@ifx{#1\ltj@@ruby@end}{}{%
+ \ifx\ltj@@ruby@res\@empty
+ \def\ltj@@ruby@res{\ltj@@ruby@mark}%
\else
- \pxrr@appto\pxrr@res{\ltj@@ruby@mark}%
+ \ltj@@ruby@appto\ltj@@ruby@res{\ltj@@ruby@mark}%
\fi
- \pxrr@appto\pxrr@res{{#3}}%
- \pxrr@decompbar@loopa\pxrr@nil
+ \ltj@@ruby@appto\ltj@@ruby@res{{#3}}%
+ \ltj@@ruby@decompbar@loopa\ltj@@ruby@nil
}%
}
%%%%%%%% ここまで
@@ -200,8 +202,8 @@
luatexja.ruby.ruby_tmplist_p = \string{\string}}%
\leavevmode\dimen0=\f@size pt\dimen1=\ltj@@rubyip@size\dimen0%
% 引数展開,テーブルにセット
- \pxrr@decompbar{#2}{\let\ltj@@ruby@mark\ltj@@ruby@sp\pxrr@res}%
- \pxrr@decompbar{#3}{\let\ltj@@ruby@mark\ltj@@ruby@sr\pxrr@res}%
+ \ltj@@ruby@decompbar{#2}{\let\ltj@@ruby@mark\ltj@@ruby@sp\ltj@@ruby@res}%
+ \ltj@@ruby@decompbar{#3}{\let\ltj@@ruby@mark\ltj@@ruby@sr\ltj@@ruby@res}%
{\fontsize{\ltj@@rubyip@size\dimen0}\z@\selectfont\ltj@@rubyip@fontcmd
\global\dimen1=\zw\global\dimen2=\zh}%
\directlua{%
diff --git a/Master/texmf-dist/tex/luatex/luatexja/ltj-direction.lua b/Master/texmf-dist/tex/luatex/luatexja/ltj-direction.lua
index 5321f232f45..0fbe0c664cb 100644
--- a/Master/texmf-dist/tex/luatex/luatexja/ltj-direction.lua
+++ b/Master/texmf-dist/tex/luatex/luatexja/ltj-direction.lua
@@ -550,7 +550,41 @@ do
local ltj_tempcnta = luatexbase.registernumber 'ltj@tempcnta'
local getbox = tex.getbox
local dir_backup
- function luatexja.direction.unbox_check_dir(is_copy)
+ function luatexja.direction.unbox_check_dir()
+ start_time_measure 'box_primitive_hook'
+ local list_dir = get_dir_count()%dir_math_mod
+ local b = getbox(getcount(ltj_tempcnta))
+ if b and getlist(to_direct(b)) then
+ local box_dir = get_box_dir(to_direct(b), dir_yoko)
+ if box_dir%dir_math_mod ~= list_dir then
+ ltjb.package_error(
+ 'luatexja',
+ "Incompatible direction list can't be unboxed",
+ 'I refuse to unbox a box in differrent direction.')
+ tex.sprint(cat_lp, '\\@gobbletwo')
+ else
+ dir_backup = nil
+ local bd = to_direct(b)
+ local hd = getlist(bd)
+ local nh = hd
+ while hd do
+ if getid(hd)==id_whatsit and getsubtype(hd)==sid_user
+ and getfield(hd, 'user_id')==DIR then
+ local d = hd
+ nh, hd = node_remove(nh, hd); node_free(d)
+ else
+ hd = node_next(hd)
+ end
+ end
+ setlist(bd, nh)
+ end
+ end
+ if luatexja.global_temp and tex.globaldefs~=luatexja.global_temp then
+ tex.globaldefs = luatexja.global_temp
+ end
+ stop_time_measure 'box_primitive_hook'
+ end
+ function luatexja.direction.uncopy_check_dir()
start_time_measure 'box_primitive_hook'
local list_dir = get_dir_count()%dir_math_mod
local b = getbox(getcount(ltj_tempcnta))
@@ -572,7 +606,7 @@ do
and getfield(hd, 'user_id')==DIR then
local d = hd
nh, hd = node_remove(nh, hd)
- if is_copy==true and (not dir_backup) then
+ if not dir_backup then
dir_backup = d; setnext(dir_backup, nil)
else
node_free(d)
diff --git a/Master/texmf-dist/tex/luatex/luatexja/ltj-ruby.lua b/Master/texmf-dist/tex/luatex/luatexja/ltj-ruby.lua
index 047b53ab58c..29b6fe19988 100644
--- a/Master/texmf-dist/tex/luatex/luatexja/ltj-ruby.lua
+++ b/Master/texmf-dist/tex/luatex/luatexja/ltj-ruby.lua
@@ -3,7 +3,7 @@
--
luatexbase.provides_module({
name = 'luatexja.ruby',
- date = '2022-08-29',
+ date = '2022-12-31',
description = 'Ruby annotation',
})
luatexja.ruby = {}
@@ -318,7 +318,7 @@ local function enlarge_parent(r, p, tmp_tbl, no_begin, no_end)
local pre_intrusion, post_intrusion
local ppre, pmid, ppost = tmp_tbl.ppre, tmp_tbl.pmid, tmp_tbl.ppost
local mapre, mapost = tmp_tbl.mapre, tmp_tbl.mapost
- local intmode = (tmp_tbl.mode//4)%4
+ local intmode = (tmp_tbl.mode//4)%8
if no_begin then mapre = mapre + tmp_tbl.before_jfmgk end
if no_end then mapost = mapost + tmp_tbl.after_jfmgk end
if (tmp_tbl.mode%4 >=2) and (tmp_tbl.pre<0) and (tmp_tbl.post<0) then
@@ -336,7 +336,7 @@ local function enlarge_parent(r, p, tmp_tbl, no_begin, no_end)
post_intrusion = min(mapost, sumprot);
pre_intrusion = min(mapre, max(sumprot-post_intrusion, 0))
p = enlarge(p, rwidth, ppre, pmid, ppost, pre_intrusion, post_intrusion)
- else -- intmode == 3
+ elseif intmode==3 then
local n = min(mapre, mapost)*2
if n < sumprot then
pre_intrusion = n/2; post_intrusion = n/2
@@ -346,6 +346,15 @@ local function enlarge_parent(r, p, tmp_tbl, no_begin, no_end)
p = enlarge(p, rwidth, ppre, pmid, ppost, pre_intrusion, post_intrusion)
pre_intrusion = min(mapre, pre_intrusion + round(ppre*getfield(p, 'glue_set')*65536))
post_intrusion = min(mapost, post_intrusion + round(ppost*getfield(p, 'glue_set')*65536))
+ else -- intmode == 4
+ if 2*min(mapre, mapost) > sumprot then
+ pre_intrusion = sumprot//2; post_intrusion = sumprot/2
+ elseif mapre>=mapost then
+ pre_intrusion, post_intrusion = min(mapre, sumprot-mapost), mapost
+ else
+ pre_intrusion, post_intrusion = mapre, min(mapost, sumprot-mapre)
+ end
+ p = enlarge(p, rwidth, ppre, pmid, ppost, pre_intrusion, post_intrusion)
end
setshift(r, -pre_intrusion)
local rwidth = rwidth - pre_intrusion - post_intrusion
diff --git a/Master/texmf-dist/tex/luatex/luatexja/luatexja-core.sty b/Master/texmf-dist/tex/luatex/luatexja/luatexja-core.sty
index c1f8c2c622e..15d02be31b7 100644
--- a/Master/texmf-dist/tex/luatex/luatexja/luatexja-core.sty
+++ b/Master/texmf-dist/tex/luatex/luatexja/luatexja-core.sty
@@ -65,7 +65,7 @@
\expandafter\let\csname ifltj@in@latex\expandafter\endcsname
\csname iftrue\endcsname
\NeedsTeXFormat{LaTeX2e}
- \ProvidesPackage{luatexja-core}[2022-08-24 Core of LuaTeX-ja]
+ \ProvidesPackage{luatexja-core}[2023-02-11 Core of LuaTeX-ja]
\fi %</LaTeX>
%% Load prerequisite packages.
@@ -228,8 +228,7 @@
\def\ltj@temp{#1}\afterassignment\ltj@@jfont\directlua{luatexja.jfont.jfontdefX(true, 'yoko')}}
\newluafunction\ltj@@jfont@inner
\directlua{
- local t = lua.get_functions_table()
- t[\the\ltj@@jfont@inner] = luatexja.jfont.jfontdefY
+ (lua.get_functions_table())[\the\ltj@@jfont@inner] = luatexja.jfont.jfontdefY
}
\def\ltj@@jfont{\expandafter\expandafter\expandafter\luafunction\expandafter\ltj@@jfont@inner\ltj@temp}
@@ -487,8 +486,7 @@
}
\newluafunction\ltj@@getparam@one@inner
\directlua{
- local t = lua.get_functions_table()
- t[\the\ltj@@getparam@one@inner] = luatexja.ext_get_parameter_unary
+ (lua.get_functions_table())[\the\ltj@@getparam@one@inner] = luatexja.ext_get_parameter_unary
}
\luadef\ltj@@getparam@one\ltj@@getparam@one@inner
\def\ltj@@getparam@two#1#2{%
@@ -600,8 +598,7 @@
\let\ltj@@orig@insert\insert
\newluafunction\ltj@@lua@populate@insertwhatsit@inner
\directlua{
- local t = lua.get_functions_table()
- t[\the\ltj@@lua@populate@insertwhatsit@inner]
+ (lua.get_functions_table())[\the\ltj@@lua@populate@insertwhatsit@inner]
= luatexja.direction.populate_insertion_dir_whatsit
}
\luadef\ltj@@lua@populate@insertwhatsit\ltj@@lua@populate@insertwhatsit@inner
@@ -673,8 +670,7 @@
%%%% \raise, \lower, \moveleft, \moveright
\newluafunction\ltj@@lua@raisebox@inner
\directlua{
- local t = lua.get_functions_table()
- t[\the\ltj@@lua@raisebox@inner]=luatexja.direction.raise_box
+ (lua.get_functions_table())[\the\ltj@@lua@raisebox@inner]=luatexja.direction.raise_box
}
\protected\luadef\ltj@@lua@raisebox\ltj@@lua@raisebox@inner
\let\ltj@@orig@raise\raise
@@ -701,8 +697,12 @@
\let\moveright\ltj@@moveright %% PRIMITIVE
%%%%\vsplit
+\newluafunction\ltj@@vsplit@inner
+\directlua{
+ (lua.get_functions_table())[\the\ltj@@vsplit@inner]=luatexja.direction.vsplit
+}
\let\ltj@@orig@vsplit\vsplit
-\protected\def\ltj@@vsplit{\directlua{luatexja.direction.vsplit()}}
+\protected\def\ltj@@vsplit{\luafunction\ltj@@vsplit@inner}
\let\vsplit\ltj@@vsplit %% PRIMITIVE
%%%% \vcenter
@@ -715,30 +715,34 @@
%%%% \unhbox and \unvbox
\newluafunction\ltj@@lua@unboxcheckdir@inner
+\newluafunction\ltj@@lua@uncopycheckdir@inner
+\newluafunction\ltj@@lua@uncopy@restore@whatsit@inner
\directlua{
local t = lua.get_functions_table()
t[\the\ltj@@lua@unboxcheckdir@inner]=luatexja.direction.unbox_check_dir
+ t[\the\ltj@@lua@uncopycheckdir@inner]=luatexja.direction.uncopy_check_dir
+ t[\the\ltj@@lua@uncopy@restore@whatsit@inner]=luatexja.direction.uncopy_restore_whatsit
}
\luadef\ltj@@lua@unboxcheckdir\ltj@@lua@unboxcheckdir@inner
+\luadef\ltj@@lua@uncopycheckdir\ltj@@lua@uncopycheckdir@inner
+\luadef\ltj@@lua@uncopy@restore@whatsit\ltj@@lua@uncopy@restore@whatsit@inner
\long\def \@gobbletwo #1#2{}
\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}
+\protected\def\ltj@@unhbox@{\ltj@@lua@unboxcheckdir\expandafter\ltj@@orig@unhbox\the\ltj@tempcnta\relax}
+\protected\def\ltj@@unvbox@{\ltj@@lua@unboxcheckdir\expandafter\ltj@@orig@unvbox\the\ltj@tempcnta\relax}
\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()}}
+ \ltj@@lua@uncopycheckdir\expandafter\ltj@@orig@unhcopy\the\ltj@tempcnta\relax
+ \ltj@@lua@uncopy@restore@whatsit}%
\protected\def\ltj@@unvcopy@{%
- \directlua{luatexja.direction.unbox_check_dir(true)}%
- \ltj@@orig@unvcopy\ltj@tempcnta
- \directlua{luatexja.direction.uncopy_restore_whatsit()}}
+ \ltj@@lua@uncopycheckdir\expandafter\ltj@@orig@unvcopy\the\ltj@tempcnta\relax
+ \ltj@@lua@uncopy@restore@whatsit}%
\let\unhbox\ltj@@unhbox %% PRIMITIVE
\let\unvbox\ltj@@unvbox %% PRIMITIVE
\let\unhcopy\ltj@@unhcopy %% PRIMITIVE
diff --git a/Master/texmf-dist/tex/luatex/luatexja/luatexja.sty b/Master/texmf-dist/tex/luatex/luatexja/luatexja.sty
index 00c37876845..d355b390035 100644
--- a/Master/texmf-dist/tex/luatex/luatexja/luatexja.sty
+++ b/Master/texmf-dist/tex/luatex/luatexja/luatexja.sty
@@ -27,7 +27,7 @@
\newif\ifltj@disablejfam
%%%% VERSION
-\def\LuaTeXjaversion{20221213.0}
+\def\LuaTeXjaversion{20230211.0}
%% Check if LaTeX is used.
\begingroup\expandafter\expandafter\expandafter\endgroup
diff --git a/Master/texmf-dist/tex/luatex/luatexja/patches/lltjp-siunitx.sty b/Master/texmf-dist/tex/luatex/luatexja/patches/lltjp-siunitx.sty
index 16c13cd7ae4..9c4526c3fdb 100644
--- a/Master/texmf-dist/tex/luatex/luatexja/patches/lltjp-siunitx.sty
+++ b/Master/texmf-dist/tex/luatex/luatexja/patches/lltjp-siunitx.sty
@@ -1,5 +1,5 @@
%
-% lltjp-siunitx.sty 2022-12-12
+% lltjp-siunitx.sty 2022-12-14
%
\NeedsTeXFormat{LaTeX2e}
@@ -34,17 +34,15 @@
\cs_set_eq:NN \ltj_orig__siunitx_table_collect_begin:w \__siunitx_table_collect_begin:w
\cs_set_protected:Npn \__siunitx_table_collect_begin:w #1 \relax
{ \ltj_orig__siunitx_table_collect_begin:w }
-\AtBeginDocument{
- \cs_if_exist:NT \TblrNum
- { \RenewDocumentCommand \TblrNum { m }
- {
- \__tblr_siunitx_process:Nn
- { \cs_set_eq:NN \__siunitx_table_collect_begin:w
- \ltj_orig__siunitx_table_collect_begin:w
- \tablenum}
- {#1}
- }
- }
+\RenewDocumentCommand \tablenum { O { } m }
+ {
+ \mode_leave_vertical:
+ \group_begin:
+ \keys_set:nn { siunitx } {#1}
+ \siunitx_cell_begin:w
+ \relax \ignorespaces #2
+ \siunitx_cell_end:
+ \group_end:
}
}% siunitx v3.00 end
{% siunitx v2.xx