diff options
Diffstat (limited to 'macros/luatex/generic/luatexja')
15 files changed, 68 insertions, 37 deletions
diff --git a/macros/luatex/generic/luatexja/README b/macros/luatex/generic/luatexja/README index 3a23ede8a4..e6c21ab100 100644 --- a/macros/luatex/generic/luatexja/README +++ b/macros/luatex/generic/luatexja/README @@ -1,6 +1,6 @@ -The LuaTeX-ja Package 20201224.0 +The LuaTeX-ja Package 20210103.0 -------------------------------- -Copyright (c) 2011--2020 The LuaTeX-ja project +Copyright (c) 2011--2021 The LuaTeX-ja project License: modified BSD (see COPYING) LuaTeX-ja is a macro package for typesetting Japanese documents with LuaTeX. @@ -45,9 +45,9 @@ Installation 2. If you must/want to install manually: a. Download the source archive from CTAN, - or tagged as 20201224.0 in the Git repository by + or tagged as 20210103.0 in the Git repository by <http://git.osdn.jp/view?p=luatex-ja/luatexja.git - ;a=snapshot;h=refs/tags/20201224.0;sf=tgz> + ;a=snapshot;h=refs/tags/20210103.0;sf=tgz> b. Extract the archive and process following three files by LuaLaTeX to generate classes for Japanese typesetting: @@ -96,4 +96,4 @@ Notes This file and ltj-kinsoku.lua are not used anymore. (Do not remove ltj-kinsoku.tex.) -Last commit date: Thu Dec 24 05:08:02 2020 +0900 +Last commit date: Sun Jan 3 09:48:34 2021 +0900 diff --git a/macros/luatex/generic/luatexja/doc/luatexja-en.pdf b/macros/luatex/generic/luatexja/doc/luatexja-en.pdf Binary files differindex 7c0497cdbe..41fd1bd246 100644 --- a/macros/luatex/generic/luatexja/doc/luatexja-en.pdf +++ b/macros/luatex/generic/luatexja/doc/luatexja-en.pdf diff --git a/macros/luatex/generic/luatexja/doc/luatexja-ja.pdf b/macros/luatex/generic/luatexja/doc/luatexja-ja.pdf Binary files differindex b06dc04aff..ea0025d79d 100644 --- a/macros/luatex/generic/luatexja/doc/luatexja-ja.pdf +++ b/macros/luatex/generic/luatexja/doc/luatexja-ja.pdf diff --git a/macros/luatex/generic/luatexja/doc/luatexja-ruby.pdf b/macros/luatex/generic/luatexja/doc/luatexja-ruby.pdf Binary files differindex 5365af4335..31dc6d4270 100644 --- a/macros/luatex/generic/luatexja/doc/luatexja-ruby.pdf +++ b/macros/luatex/generic/luatexja/doc/luatexja-ruby.pdf diff --git a/macros/luatex/generic/luatexja/doc/luatexja-ruby.tex b/macros/luatex/generic/luatexja/doc/luatexja-ruby.tex index 7d5226e47c..08bb579204 100644 --- a/macros/luatex/generic/luatexja/doc/luatexja-ruby.tex +++ b/macros/luatex/generic/luatexja/doc/luatexja-ruby.tex @@ -221,7 +221,6 @@ plain \LuaTeX でのロードはまだサポートしておらず, \end{lstlisting} のようにしてルビ用字形を用いることが可能だが,現在の実装ではタイプセットに時間がかかるようになる. - \end{description} \medskip @@ -325,8 +324,13 @@ mode=9, stretch={1}{2}{1}, stretchruby={0}{0}{1} の\ltjruby{紋}{もん}\ltjruby{章}{しよう}が \end{LTXexample} のように,複数回使用すること. -また,全てのグループにおいて「ルビ文字列の長さは親文字列以下」であれば, -単純グループルビの並びとして扱われる.すなわち,次の2行は全くの等価となる. +また,全てのグループにおいて「ルビ文字列の長さは親文字列以下」 +\footnote{% + 実際には\TeX での長さの計算誤差($2^{-16}$~ptの整数倍として計算していることによる)を考慮し, + 親文字全角の$1/1000$だけルビ文字列が長くなることを許容している. +}であれば, +単純グループルビの並びとして扱われる.すなわち,次ページ冒頭の2行は全くの等価となる. +\newpage \begin{verbatim} \ltjruby{普|通|車}{ふ|つう|しや} \ltjruby{普}{ふ}\ltjruby{通}{つう}\ltjruby{車}{しや} @@ -378,7 +382,6 @@ mode=9, stretch={1}{2}{1}, stretchruby={0}{0}{1} \paragraph{前後からのルビ文字のはみ出し1} 「日本語組版処理の要件」の図117\footnote{2020-08-11版での番号.2012-04-03版では図3.82.}のように, 前後からのルビ文字のはみ出しが繋がらないようにする処理が組み込まれている. - 例えば, \begin{LTXexample}[preset=\Large,width=0.3\textwidth] \ltjruby{陵}{りよう}と\ltjruby{陵}{みささぎ}\\ diff --git a/macros/luatex/generic/luatexja/src/addons/luatexja-ruby.sty b/macros/luatex/generic/luatexja/src/addons/luatexja-ruby.sty index 90dfece2b9..0dacf32bf8 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-24 v0.5] +\ProvidesPackage{luatexja-ruby}[2020-12-25 v0.51] \RequirePackage{luatexja} %%------------------ @@ -63,6 +63,10 @@ %% attr は sp 単位だが,ユーザーは親文字全角単位で指定 \ltj@@rkeydef{intergap} +%% epsilon: モノルビ * n にする際に,ルビの方がどれだけ親文字より長い +%% 状況を許容するか.親文字全角単位.計算誤差を想定. +\ltj@@rkeydef{epsilon} + \ltj@@rkeydef{kenten}%% 圏点文字 \ltj@@rkeydef{fontcmd}%% フォント \define@boolkey[ltj]{ruby}{rubysmash}[true]{} @@ -98,6 +102,7 @@ \catcode`\_=11 \gdef\ltj@@ruby@create@table#1{% #1: ルビ全角 \string{ + eps = \ltj@safe@dimen{\ltj@@rubyip@epsilon\zw}, before_jfmgk = 0, after_jfmgk = 0, rubyzw = \ltj@safe@dimen{#1}, maxmargin = \ltj@safe@dimen{\ltj@@rubyip@maxmargin\zw}, @@ -244,7 +249,8 @@ stretchbol={0}{1}{1}, stretcheol={1}{1}{0}, maxmargin=0.5, size=0.5, intergap=0, rubysmash=false, kenten=\textbullet, fontcmd=\relax, ybaseheight=0.88, tbaseheight=0.5, - intrude_jfmgk, intrude_kanjiskip, intrude_xkanjiskip + intrude_jfmgk, intrude_kanjiskip, intrude_xkanjiskip, + epsilon=0.0001, } \endinput diff --git a/macros/luatex/generic/luatexja/src/ltj-latex.sty b/macros/luatex/generic/luatexja/src/ltj-latex.sty index 506adea2e7..213f2f7109 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}[2020-10-09 LaTeX support of LuaTeX-ja] +\ProvidesPackage{ltj-latex}[2020-12-29 LaTeX support of LuaTeX-ja] % cleanup at end of the document %\let\ltj@@orig@end=\@@end @@ -27,8 +27,12 @@ \fi \newif\ifltj@ltfilehook@avail \@ifl@t@r\fmtversion{2020-10-01}{% - \ifnum\patch@level<0\relax \ifnum\patch@level<-6 \ltj@ltfilehook@availtrue\fi - \else\ltj@ltfilehook@availtrue\fi + \@ifl@t@r\fmtversion{2020-10-02}% + {\ltj@ltfilehook@availtrue} + {% + \ifnum\patch@level<0\relax \ifnum\patch@level<-6 \ltj@ltfilehook@availtrue\fi + \else\ltj@ltfilehook@availtrue\fi + }% }{} %%% patch for LaTeX diff --git a/macros/luatex/generic/luatexja/src/ltj-otf.lua b/macros/luatex/generic/luatexja/src/ltj-otf.lua index 42792769d7..770749f9ea 100644 --- a/macros/luatex/generic/luatexja/src/ltj-otf.lua +++ b/macros/luatex/generic/luatexja/src/ltj-otf.lua @@ -1,7 +1,6 @@ -- -- ltj-otf.lua -- -require 'unicode' require 'lualibs' luatexja.load_module 'base'; local ltjb = luatexja.base @@ -120,9 +119,9 @@ local function append_jglyph(char) setfield(p, 'value', char); node_write(p) end -local utf +local myutf do - utf = function (ucs) + myutf = function (ucs) if ltjd_get_dir_count()==dir_tate then ucs = ltju.replace_vert_variant( tex_get_attr((ltjd_get_dir_count()==dir_tate) and attr_curtfnt or attr_curjfnt), @@ -235,7 +234,7 @@ local disable_ivs = enable_ivs luatexja.otf = { append_jglyph = append_jglyph, enable_ivs = enable_ivs, disable_ivs = disable_ivs, - cid = cid, utf = utf, + cid = cid, utf = myutf, } diff --git a/macros/luatex/generic/luatexja/src/ltj-ruby.lua b/macros/luatex/generic/luatexja/src/ltj-ruby.lua index 34cdc8c7fc..9824ff155a 100644 --- a/macros/luatex/generic/luatexja/src/ltj-ruby.lua +++ b/macros/luatex/generic/luatexja/src/ltj-ruby.lua @@ -278,9 +278,9 @@ function luatexja.ruby.texiface(rst, rtlr, rtlp) 'the body (' .. #rtlr .. ' != ' .. #rtlp .. ').', '') else - local f = true + local f, eps = true, rst.eps for i = 1,#rtlr do - if getfield(rtlr[i], 'width') > getfield(rtlp[i], 'width') then + if getfield(rtlr[i], 'width') > getfield(rtlp[i], 'width') + eps then f = false; break end end diff --git a/macros/luatex/generic/luatexja/src/luatexja-core.sty b/macros/luatex/generic/luatexja/src/luatexja-core.sty index 3ad5657432..e1baefbf19 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}[2020-12-22 Core of LuaTeX-ja] + \ProvidesPackage{luatexja-core}[2021-01-02 Core of LuaTeX-ja] \fi %</LaTeX> %% Load prerequisite packages. @@ -526,9 +526,9 @@ \csname ltj@kcat5\endcsname="7FFFFFFF %" \csname ltj@kcat6\endcsname="7FFFFFFF }%" -\protected\def\ltjjachar{\afterassignment\ltj@@jachar\ltj@tempcnta} +\protected\def\ltjjachar{\leavevmode\afterassignment\ltj@@jachar\ltj@tempcnta} \def\ltj@@jachar{{\directlua{tex.globaldefs=0}\ltj@alljachar\ltj@@origchar\ltj@tempcnta}} -\protected\def\ltjalchar{\afterassignment\ltj@@alchar\ltj@tempcnta} +\protected\def\ltjalchar{\leavevmode\afterassignment\ltj@@alchar\ltj@tempcnta} \def\ltj@@alchar{{\directlua{tex.globaldefs=0}\ltj@allalchar\ltj@@origchar\ltj@tempcnta}} %%%%%%%% \ltjsetmathletter<number>, \ltjunsetmathletter<number> diff --git a/macros/luatex/generic/luatexja/src/luatexja.sty b/macros/luatex/generic/luatexja/src/luatexja.sty index 4d749c40ef..3448634592 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}[2020-12-24 Japanese Typesetting with Lua(La)TeX] + \ProvidesPackage{luatexja}[2021-01-03 Japanese Typesetting with Lua(La)TeX] \DeclareOption{disablejfam}{\ltj@disablejfamtrue} \DeclareOption*{} \ProcessOptions\relax \fi %</LaTeX> %%%% VERSION -\def\LuaTeXjaversion{20201224.0} +\def\LuaTeXjaversion{20210103.0} \directlua{require('ltj-unicode-ccfix.lua')}% catcode of ideographs diff --git a/macros/luatex/generic/luatexja/src/patches/lltjfont.sty b/macros/luatex/generic/luatexja/src/patches/lltjfont.sty index bad7e6c7bc..287a3968f5 100644 --- a/macros/luatex/generic/luatexja/src/patches/lltjfont.sty +++ b/macros/luatex/generic/luatexja/src/patches/lltjfont.sty @@ -3,7 +3,7 @@ % \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{lltjfont}[2020-10-05 Patch to NFSS2 for LuaTeX-ja] +\ProvidesPackage{lltjfont}[2020-12-29 Patch to NFSS2 for LuaTeX-ja] %% patching \DeclareTextComposite \def\ltj@chardef@text@cmd#1{% @@ -634,7 +634,8 @@ \newcount\ltj@@latex@plv \ltj@@latex@plv=-1 \ifltj@ltfilehook@avail % 2020-10-01 - \ltj@@latex@plv=1000 + \@ifl@t@r\fmtversion{2020-10-02}{\ltj@@latex@plv=1300}% + {\ifnum\patch@level>2 \ltj@@latex@plv=1300\else \ltj@@latex@plv=1000\fi} \else\ifdefined\@rmfamilyhook % 2020-02-02 \ifx\@forced@seriestrue\@undefined % 2020-02-02 pl0--2 \@latex@error @@ -768,12 +769,25 @@ \DeclareRobustCommand\romanshapeforce[1]{\edef\f@shape{#1}} \DeclareRobustCommand\kanjishapeforce[1]{\edef\k@shape{#1}} \DeclareRobustCommand\fontshapeforce[1]{\set@safe@kanji@shape{#1}{}\romanshapeforce{#1}} +\ifnum\ltj@@latex@plv>1000 +%%%% LaTeX >= 2020-10-01 PL3 +\DeclareRobustCommand\usekanji[4]{% + \kanjiencoding{#1}\edef\k@family{#2}% + \set@target@series@kanji{#3}\edef\k@shape{#4}% + \selectfont\ignorespaces} +\DeclareRobustCommand\useroman[4]{% + \romanencoding{#1}\edef\f@family{#2}% + \set@target@series{#3}\edef\f@shape{#4}% + \selectfont\ignorespaces} +\else +%%%% 2020-10-01 <= LaTeX < 2020-10-01 PL3 \DeclareRobustCommand\usekanji[4]{% \kanjiencoding{#1}\edef\k@family{#2}\edef\k@series{#3}\edef\k@shape{#4}% \selectfont\ignorespaces} \DeclareRobustCommand\useroman[4]{% \romanencoding{#1}\edef\f@family{#2}\edef\f@series{#3}\edef\f@shape{#4}% \selectfont\ignorespaces} +\fi %%%% LaTeX >= 2020-02-02 END \else %%%% LaTeX 2019-10-01 diff --git a/macros/luatex/generic/luatexja/src/patches/lltjp-geometry.sty b/macros/luatex/generic/luatexja/src/patches/lltjp-geometry.sty index 161029bd05..0be092eaaa 100644 --- a/macros/luatex/generic/luatexja/src/patches/lltjp-geometry.sty +++ b/macros/luatex/generic/luatexja/src/patches/lltjp-geometry.sty @@ -3,7 +3,7 @@ % \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{lltjp-geometry}[2020-09-18 Patch to geometry for LuaTeX-ja with vertical writing mode] +\ProvidesPackage{lltjp-geometry}[2020-12-29 Patch to geometry for LuaTeX-ja with vertical writing mode] \RequirePackage{expl3} \ifdefined\if@ltj@@geometry@tate\expandafter\endinput\fi \newif\if@ltj@@geometry@tate @@ -33,8 +33,11 @@ \unless\ifdefined\ltj@ExecuteAfterPackage \expandafter\newif\csname ifltj@ltfilehook@avail\endcsname \@ifl@t@r\fmtversion{2020-10-01}{% - \ifnum\patch@level<0\relax \ifnum\patch@level<-6 \ltj@ltfilehook@availtrue\fi - \else\ltj@ltfilehook@availtrue\fi + \@ifl@t@r\fmtversion{2020-10-02}{\ltj@ltfilehook@availtrue} + {% + \ifnum\patch@level<0\relax \ifnum\patch@level<-6 \ltj@ltfilehook@availtrue\fi + \else\ltj@ltfilehook@availtrue\fi + }% }{} \ifltj@ltfilehook@avail \def\@@ltj@ExecuteAfterPackage#1{\AddToHook{package/after/#1}} diff --git a/macros/luatex/generic/luatexja/src/patches/lltjp-listings.sty b/macros/luatex/generic/luatexja/src/patches/lltjp-listings.sty index ee3c3aa14b..173b1ed94b 100644 --- a/macros/luatex/generic/luatexja/src/patches/lltjp-listings.sty +++ b/macros/luatex/generic/luatexja/src/patches/lltjp-listings.sty @@ -43,7 +43,7 @@ \directlua{ local cat_str = luatexbase.catcodetables['string'] local cat_lp = luatexbase.catcodetables['latex-package'] - local ubyte = unicode.utf8.byte + local ubyte = utf.byte local spccmd = string.char(0x5C) .. 'ltj@lst@hss@normal' luatexja.listings = {} function luatexja.listings.althss(t) @@ -229,7 +229,7 @@ }} \directlua{ - local utfchar, getcount = unicode.utf8.char, tex.getcount + local utfchar, getcount = utf.char, tex.getcount luatexja.listings.insert_cb = function() if not luatexja.listings.patched then luatexja.listings.patched = 1 diff --git a/macros/luatex/generic/luatexja/tool/jfm-convert.lua b/macros/luatex/generic/luatexja/tool/jfm-convert.lua index 66b73a02cd..5f2baa8d8e 100755 --- a/macros/luatex/generic/luatexja/tool/jfm-convert.lua +++ b/macros/luatex/generic/luatexja/tool/jfm-convert.lua @@ -3,7 +3,7 @@ local stderr = io.stderr local function show_usage(s) stderr:write('Error: ' .. s .. '\n'); - stderr:write('Usage: jfm-convert [-J|-U] <ptex_jfm>\n'); + stderr:write('Usage: texlua jfm-convert [-J|-U] <ptex_jfm>\n'); stderr:write('-J: JIS mode, -U: UCS mode \n'); stderr:write(' * The output will be written to stdout.\n'); stderr:write(' * I do not read virtual fonts which corresponded to <ptex_jfm>.\n'); @@ -13,20 +13,21 @@ local function show_usage(s) os.exit(1) end -require('unicode'); local uchar = unicode.utf8.char kpse.set_program_name('luatex') +require('lualibs'); local uchar = utf.char jisx0208 = require('ltj-jisx0208.lua').table_jisx0208_uptex local function pass_ucs(s) return "'" .. uchar(s) .. "'" end local function jis_to_ucs(s) - local a = jisx0208[s-0x2020] + local i = s - 0x2020 + local a = jisx0208[math.floor(i/256)*94+(i%256)-94] or 0 return a and pass_ucs(a) or string.format('0x%X',s+0x200000) end -------- 引数解釈 -------- -require('unicode') + local filename local mode @@ -207,7 +208,8 @@ jfm_ptex:close() if not mode then mode = jis_to_ucs for i=1, #all_ctype do - if not jisx0208[all_ctype[i]-0x2020] then + local i = all_ctype[i]-0x2020 + if not jisx0208[math.floor(i/256)*94+(i%256)-94] then mode = pass_ucs; break end end |