From e08b2c1f89e1eb5123b62d01b4932f5dad1a4305 Mon Sep 17 00:00:00 2001 From: Norbert Preining Date: Wed, 30 Dec 2020 03:01:29 +0000 Subject: CTAN sync 202012300301 --- language/japanese/jlreq/Makefile | 83 +++++++++- language/japanese/jlreq/README-ja.md | 23 ++- language/japanese/jlreq/README.md | 6 +- language/japanese/jlreq/jfm-jlreq-jidori.lua | 190 +++++++++++++++++++++ language/japanese/jlreq/jlreq-ja.pdf | Bin 359921 -> 359556 bytes language/japanese/jlreq/jlreq.cls | 239 +++++++++++++++++++-------- language/japanese/jlreq/jlreq.pdf | Bin 116789 -> 116684 bytes language/japanese/jlreq/make_variant_jfm.lua | 33 ++++ 8 files changed, 490 insertions(+), 84 deletions(-) create mode 100644 language/japanese/jlreq/jfm-jlreq-jidori.lua (limited to 'language') diff --git a/language/japanese/jlreq/Makefile b/language/japanese/jlreq/Makefile index 06bcae1994..b9b9eca5d2 100644 --- a/language/japanese/jlreq/Makefile +++ b/language/japanese/jlreq/Makefile @@ -6,7 +6,7 @@ MAKEJVFCNF:=$(shell ls -R $(shell kpsewhich --var-value=TEXMFDIST)/fonts/source all: jfm jfm: \ - jfm-jlreqv.lua \ + jfm-jlreqv.lua jfm-jlreqv-jidori.lua \ jlreq.tfm bjlreq.tfm zjlreq.tfm bzjlreq.tfm \ jlreq.vf bjlreq.vf zjlreq.vf bzjlreq.vf \ ujlreq.tfm ubjlreq.tfm uzjlreq.tfm ubzjlreq.tfm \ @@ -27,6 +27,11 @@ jfm: \ jlreqg-v.vf bjlreqg-v.vf zjlreqg-v.vf bzjlreqg-v.vf \ ujlreqg-v.tfm ubjlreqg-v.tfm uzjlreqg-v.tfm ubzjlreqg-v.tfm \ ujlreqg-v.vf ubjlreqg-v.vf uzjlreqg-v.vf ubzjlreqg-v.vf \ + jlreq-jidori.tfm jlreq-jidori.vf jlreqg-jidori.tfm jlreqg-jidori.vf \ + jlreq-v-jidori.tfm jlreq-v-jidori.vf jlreqg-v-jidori.tfm jlreqg-v-jidori.vf \ + ujlreq-jidori.tfm ujlreq-jidori.vf ujlreqg-jidori.tfm ujlreqg-jidori.vf \ + ujlreq-jidori-q.tfm ujlreq-jidori-q.vf ujlreqg-jidori-q.tfm ujlreqg-jidori-q.vf \ + ujlreq-v-jidori.tfm ujlreq-v-jidori.vf ujlreqg-v-jidori.tfm ujlreqg-v-jidori.vf rm -f rml.tfm rmlv.tfm gbm.tfm gbmv.tfm uprml-h.tfm uprml-hq.tfm upgbm-h.tfm upgbm-hq.tfm uprml-v.tfm uprml-vq.tfm upgbm-v.tfm upgbm-vq.tfm @@ -43,6 +48,19 @@ u%.pl: jfm-%-pl.lua luajfm2pl.lua %.pl: jfm-%-pl.lua luajfm2pl.lua texlua luajfm2pl.lua --noutf $*-pl $@ +jlreq-jidori.pl: jfm-jlreq-jidori-pl.lua + texlua luajfm2pl.lua --noutf jlreq-jidori-pl $@ + +jlreq-v-jidori.pl: jfm-jlreqv-jidori-pl.lua + texlua luajfm2pl.lua --noutf jlreqv-jidori-pl $@ + +ujlreq-jidori.pl: jfm-jlreq-jidori-pl.lua + texlua luajfm2pl.lua jlreq-jidori-pl $@ + +ujlreq-v-jidori.pl: jfm-jlreqv-jidori-pl.lua + texlua luajfm2pl.lua jlreqv-jidori-pl $@ + + # .vf u%g-q.vf: u%g-q.tfm makejvf -i -u jisq $< upgbm-hq.tfm @@ -74,6 +92,37 @@ u%.vf: u%.tfm u%-q.tfm %.vf: %.tfm makejvf -i $< rml.tfm +jlreq-jidori.vf: jlreq-jidori.tfm + makejvf -i $< rml.tfm + +jlreq-v-jidori.vf: jlreq-v-jidori.tfm + makejvf -i $< rmlv.tfm + +jlreqg-jidori.vf: jlreqg-jidori.tfm + makejvf -i $< gbm.tfm + +jlreqg-v-jidori.vf: jlreqg-v-jidori.tfm + makejvf -i $< gbmv.tfm + +ujlreq-jidori-q.vf: ujlreq-jidori-q.tfm + makejvf -i -u jisq $< uprml-hq.tfm + +ujlreqg-jidori-q.vf: ujlreqg-jidori-q.tfm + makejvf -i -u jisq $< upgbm-hq.tfm + +ujlreq-jidori.vf: ujlreq-jidori.tfm ujlreq-jidori-q.tfm + makejvf -i -u custom -t ${MAKEJVFCNF} -H -U ujlreq-jidori-q $< uprml-h.tfm + +ujlreq-v-jidori.vf: ujlreq-v-jidori.tfm + makejvf -i -u custom -t ${MAKEJVFCNF} -H $< uprml-v.tfm + +ujlreqg-jidori.vf: ujlreqg-jidori.tfm ujlreqg-jidori-q.tfm + makejvf -i -u custom -t ${MAKEJVFCNF} -H -U ujlreqg-jidori-q $< upgbm-h.tfm + +ujlreqg-v-jidori.vf: ujlreqg-v-jidori.tfm + makejvf -i -u custom -t ${MAKEJVFCNF} -H $< upgbm-v.tfm + + # .tfm u%-q.tfm: u%.pl uppltotf -kanji=uptex $< $@ @@ -93,7 +142,32 @@ u%.tfm: u%.pl %.tfm: %.pl ppltotf -kanji=utf8 $< $@ -jfm-jlreqv.lua jfm-jlreq-pl.lua jfm-bjlreq-pl.lua jfm-zjlreq-pl.lua jfm-bzjlreq-pl.lua jfm-jlreqv-pl.lua jfm-bjlreqv-pl.lua jfm-zjlreqv-pl.lua jfm-bzjlreqv-pl.lua: make_variant_jfm.lua jfm-jlreq.lua +ujlreq%-jidori.tfm: ujlreq%-jidori.pl + uppltotf -kanji=uptex $< $@ + +jlreq%-jidori.tfm: jlreq%-jidori.pl + ppltotf -kanji=utf8 $< $@ + +ujlreqg-jidori.tfm: ujlreq-jidori.tfm + cp $< $@ + +ujlreqg-v-jidori.tfm: ujlreq-v-jidori.tfm + cp $< $@ + +jlreqg-jidori.tfm: jlreq-jidori.tfm + cp $< $@ + +jlreqg-v-jidori.tfm: jlreq-v-jidori.tfm + cp $< $@ + +ujlreq-jidori-q.tfm: ujlreq-jidori.pl + uppltotf -kanji=uptex $< $@ + +ujlreqg-jidori-q.tfm: ujlreq-jidori-q.tfm + cp $< $@ + + +jfm-jlreqv.lua jfm-jlreq-pl.lua jfm-bjlreq-pl.lua jfm-zjlreq-pl.lua jfm-bzjlreq-pl.lua jfm-jlreqv-pl.lua jfm-bjlreqv-pl.lua jfm-zjlreqv-pl.lua jfm-bzjlreqv-pl.lua jfm-jlreqv-jidori.lua jfm-jlreq-jidori-pl.lua jfm-jlreqv-jidori-pl.lua: make_variant_jfm.lua jfm-jlreq.lua jfm-jlreq-jidori.lua texlua make_variant_jfm.lua doc: pdfdoc htmldoc @@ -132,7 +206,7 @@ jfm-install: jfm mkdir -p ${TEXMF}/fonts/vf/public/jlreq install *.vf ${TEXMF}/fonts/vf/public/jlreq mkdir -p ${TEXMF}/tex/luatex/jlreq - install jfm-jlreqv.lua jfm-jlreq.lua ${TEXMF}/tex/luatex/jlreq + install jfm-jlreqv.lua jfm-jlreq.lua jfm-jlreq-jidori.lua jfm-jlreqv-jidori.lua ${TEXMF}/tex/luatex/jlreq cls-install: mkdir -p ${TEXMF}/tex/latex/jlreq @@ -153,6 +227,8 @@ tds: jfm jlreq.cls README.md README-ja.md LICENSE jlreq.html jlreq-ja.html jlreq mkdir -p ./tds/tex/luatex/jlreq cp jfm-jlreq.lua ./tds/tex/luatex/jlreq cp jfm-jlreqv.lua ./tds/tex/luatex/jlreq + cp jfm-jlreq-jidori.lua ./tds/tex/luatex/jlreq + cp jfm-jlreqv-jidori.lua ./tds/tex/luatex/jlreq mkdir -p ./tds/tex/latex/jlreq cp jlreq.cls ./tds/tex/latex/jlreq cp jlreq-helpers.sty ./tds/tex/latex/jlreq @@ -186,6 +262,7 @@ jfmclean: rm -f *jlreq*.tfm *jlreq*.pl *jlreq*.vf rm -f jfm-jlreqv.lua rm -f jfm-*jlreq*-pl.lua + rm -f jfm-jlreqv-jidori.lua docclean: rm -f jlreq.tex jlreq.pdf jlreq.html jlreq-ja.tex jlreq-ja.pdf jlreq-ja.html jlreq-trimmarks.html jlreq-trimmarks-ja.html diff --git a/language/japanese/jlreq/README-ja.md b/language/japanese/jlreq/README-ja.md index 5f429b501b..ca32851349 100644 --- a/language/japanese/jlreq/README-ja.md +++ b/language/japanese/jlreq/README-ja.md @@ -11,7 +11,7 @@ * *.tfm -> $TEXMF/fonts/tfm/public/jlreq * *.vf -> $TEXMF/fonts/vf/public/jlreq -* jfm-jlreq.lua, jfm-jlreqv.lua -> $TEXMF/tex/luatex/jlreq +* jfm-jlreq.lua, jfm-jlreqv.lua, jfm-jlreq-jidori.lua jfm-jlreqv-jidori.lua -> $TEXMF/tex/luatex/jlreq * jlreq.cls, jlreq-helpers.sty -> $TEXMF/tex/latex/jlreq と配置します.`make install`とすると,$TEXMF=$TEXMFHOMEとしてこのコピーを行います. @@ -19,7 +19,7 @@ ## 動作環境 pLaTeX / upLaTeX / LuaLaTeX上で動きます.以下のパッケージを内部で読み込みます. -* (常時):xkeyval,everyhook,filehook,etoolbox,ifthen,lmodern +* (常時):xkeyval,everyhook,etoolbox,ifthen,lmodern * (LuaLaTeX利用時):luatexja,luatexja-adjust リリース時点での最新版での動作を確認しています. @@ -72,6 +72,9 @@ pLaTeX / upLaTeX / LuaLaTeX上で動きます.以下のパッケージを内 ### `\tatechuyoko` 縦中横を出力します.`\tatechuyoko{<中身>}`とします.`\tatechuyoko`は縦書きでない場所で使うとエラーになりますが,`\tatechuyoko*`は縦書きでない場所ではそのまま出力されます. +### `\jidori` +`\jidori{<寸法>}{<中身>}`により,中身を寸法の長さに字取りしたものを出力することができます. + ### `\jafontsize` 和文フォントサイズを指定する`\fontsize`です.クラスオプションで`jafontscale=0.9`とされている場合,`\fontsize{9pt}{15pt}`とすると和文フォントのサイズは`8.1pt`となりますが,`\jafontsize{9pt}{15pt}`とすると`9pt`となります.(欧文フォントサイズは`10pt`となる.)なお,第二引数は`\fontsize`の第二引数と全く同じです. @@ -107,8 +110,8 @@ pLaTeX / upLaTeX / LuaLaTeX上で動きます.以下のパッケージを内 以下では次の用法を使います. * `[A/B]`:AまたはBです.`[A/B/C]`等も同様. -* `<寸法>`:TeXが認識する寸法です.簡単な式(`10pt+10pt`のような)を使うこともできます.また,クラスオプションでは,場合によっては次のような特殊な値を使うこともできます.(これらはpLaTeX / upLaTeXではもとから利用可能ですが,LuaLaTeXでも利用可能なように処理されています.)`\jlreqsetup`内のような場所では,常に`\zw`や`\zh`により全角幅が記述できます.以下,たとえば`Q`が利用可能な場合は`<寸法;Q>`のように記述します. - - `Q`:0.25mmと解釈されます. +* `<寸法>`:TeXが認識する寸法です.簡単な式(`10pt+10pt`のような)を使うこともできます.また,クラスオプションでは,場合によっては次のような特殊な値を使うこともできます.(これらはpLaTeX / upLaTeXではもとから利用可能ですが,LuaLaTeXでも利用可能なように処理されています.)`\jlreqsetup`内のような場所では,常に`\zw`や`\zh`により全角幅が記述できます.以下,たとえば`Q`,`H`が利用可能な場合は`<寸法;Q,H>`のように記述します. + - `Q`,`H`:0.25mmと解釈されます. - `zw`, `zh`:全角幅として解釈されます. * `<コード>`:LaTeXのコードです. * `<フォント設定コード>`:`\Large`や`\bfseries`のようなフォント設定の命令です.`\Large\bfseries`のように複数指定することもできます. @@ -118,8 +121,8 @@ pLaTeX / upLaTeX / LuaLaTeX上で動きます.以下のパッケージを内 クラスオプションです. * `paper=[<紙サイズ名>/{<寸法>,<寸法>}]`:紙サイズです.紙サイズ名はa0からa10,b0からb10,c2からc8を指定できます.B列はJIS B列です.また,`{<横>,<縦>}`と直接寸法を指定することもできます. -* `fontsize=<寸法;Q>`:欧文フォントサイズ.デフォルトは10pt. -* `jafontsize=<寸法;Q>`:和文フォントサイズ. +* `fontsize=<寸法;Q,H>`:欧文フォントサイズ.デフォルトは10pt. +* `jafontsize=<寸法;Q,H>`:和文フォントサイズ. * `jafontscale=<実数値>`:欧文フォントと和文フォントの比(和文 / 欧文).`fontsize`と`jafontsize`が両方指定されている場合は無視される.デフォルトは1. * `line_length=<寸法;zw,zh>`:一行の長さ.デフォルトは字送り方向の紙幅の0.75倍.実際の値は一文字の長さの整数倍になるように補正されます. * `number_of_lines=<自然数値>`:一ページの行数.デフォルトは行送り方向の紙幅の0.75倍になるような値. @@ -129,8 +132,8 @@ pLaTeX / upLaTeX / LuaLaTeX上で動きます.以下のパッケージを内 - `twoside`が指定されていない時は,常に奇数ページ扱いで余白が設定される * `head_space=<寸法;zw,zh>`:天の空き量.デフォルトは中央寄せになるような値. * `foot_space=<寸法;zw,zh>`:地の空き量.デフォルトは中央寄せになるような値. -* `baselineskip=<寸法;Q,zw,zh>`:行送り.デフォルトは`jafontsize`の1.7倍. -* `linegap=<寸法;Q,zw,zh>`:行間. +* `baselineskip=<寸法;Q,H,zw,zh>`:行送り.デフォルトは`jafontsize`の1.7倍. +* `linegap=<寸法;Q,H,zw,zh>`:行間. * `headfoot_sidemargin=<寸法;zw,zh>`:柱やノンブルの左右の空き. * `column_gap=<寸法;zw,zh>`:段間(`twocolumn`指定時のみ). * `sidenote_length=<寸法;zw,zh>`:傍注の幅を指定します. @@ -482,6 +485,10 @@ JFMの名前は次の通りです.`[]`で囲まれている文字は設定に * 2020-09-27 - `\tatechuyoko`の`*`版を追加. - バグ修正 +* 2020-12-29 + - クラスオプションの`fontsize`などで,LuaLaTeXでも`H`を使えるようにした. + - `\jidori`を追加. + - バグ修正. -------------- diff --git a/language/japanese/jlreq/README.md b/language/japanese/jlreq/README.md index 66fbfaafea..be10ec6db5 100644 --- a/language/japanese/jlreq/README.md +++ b/language/japanese/jlreq/README.md @@ -8,7 +8,7 @@ Run `make` to generate JFM files. Move the files as follows: * *.tfm -> $TEXMF/fonts/tfm/public/jlreq * *.vf -> $TEXMF/fonts/vf/public/jlreq -* jfm-jlreq.lua, jfm-jlreqv.lua -> $TEXMF/tex/luatex/jlreq +* jfm-jlreq.lua, jfm-jlreqv.lua, jfm-jlreq-jidori.lua jfm-jlreqv-jidori.lua -> $TEXMF/tex/luatex/jlreq * jlreq.cls, jlreq-helpers.sty -> $TEXMF/tex/latex/jlreq The other way to install is just to run `make install`. It will install all files in `$TEXMFHOME`. @@ -130,6 +130,10 @@ This package is distributed under the BSD 2-Clause License. See [LICENSE](LICENS * 2020-09-27 - Added `*`-version of `\tatechuyoko`. - Fixed bugs. +* 2020-12-29 + - `fontsize` etc. with LuaLaTeX accept `H`. + - Added `\jidori`. + - Fixed bugs. -------------- diff --git a/language/japanese/jlreq/jfm-jlreq-jidori.lua b/language/japanese/jlreq/jfm-jlreq-jidori.lua new file mode 100644 index 0000000000..38990f5585 --- /dev/null +++ b/language/japanese/jlreq/jfm-jlreq-jidori.lua @@ -0,0 +1,190 @@ +local jfm = { + dir = 'yoko', + zw = 1.0, + zh = 1.0, + -- 使わない + kanjiskip = {0, 0, 0}, + xkanjiskip = {0, 0, 0}, + version = 3, + [0] = { + left = 0, + align = 'middle', + width = 1,height = 0.88,depth = 0.12, + glue = { + [1] = {0.5, 0, 0, kanjiskip_stretch = 1}, + [2] = {0, 0, 0}, + [5] = {0.25, 0, 0.25, kanjiskip_stretch = 1}, + } + }, + [1] = { -- 始め括弧類 + chars = {'(', '〔', '[', '{', '〈', '《', '「', '『', '【', '⦅', '〘', '〖', '«', '〝', + '‘', '“'}, + width = 0.5,height = 0.88,depth = 0.12, + align = 'right', + glue = { + [0] = {0, 0, 0}, + [1] = {0, 0, 0}, + [2] = {0, 0, 0}, + [300] = {0, 0, 0}, + [301] = {0, 0, 0}, + [302] = {0, 0, 0}, + [5] = {0.25, 0, 0.25, ratio = 1}, + [7] = {0, 0, 0}, + [8] = {0, 0, 0}, + [14] = {0, 0, 0}, + [27] = {0, 0, 0}, + } + }, + [2] = { -- 終わり括弧類 + chars = { ')', '〕', ']', '}', '〉', '》', '」', '』', '】', '⦆', '〙', '〗', '»', '〟', + '’', '”'}, + width = 0.5,height = 0.88,depth = 0.12, + align = 'left', + glue = { + [0] = {0.5, 0, 0.5, ratio = 0, kanjiskip_stretch = 1}, + [1] = {0.5, 0, 0.5, ratio = 0, kanjiskip_stretch = 1}, + [2] = {0, 0, 0}, + [300] = {0.5, 0, 0.5, ratio = 0, kanjiskip_stretch = 1}, + [301] = {0.5, 0, 0.5, ratio = 0, kanjiskip_stretch = 1}, + [302] = {0.5, 0, 0.5, ratio = 0, kanjiskip_stretch = 1}, + [5] = {0.25, 0, 0.25, ratio = 1, kanjiskip_stretch = 1}, + [8] = {0.5, 0, 0.5, ratio = 0, kanjiskip_stretch = 1}, + [27] = {0.5, 0, 0.5, ratio = 0, kanjiskip_stretch = 1}, + } + }, + [300] = { + chars = {'‐'}, + width = 0.25,height = 0.88,depth = 0.12, + align = 'middle', + glue = { + [1] = {0.5, 0, 0.5, ratio = 1, kanjiskip_stretch = 1}, + [2] = {0, 0, 0}, + [5] = {0.25, 0, 0.25, ratio = 0, kanjiskip_stretch = 1}, + } + }, + + [301] = { + chars = {'゠', '–'}, + width = 0.5,height = 0.88,depth = 0.12, + align = 'middle', + glue = { + [1] = {0.5, 0, 0.5, ratio = 1, kanjiskip_stretch = 1}, + [2] = {0, 0, 0}, + [5] = {0.25, 0, 0.25, ratio = 0, kanjiskip_stretch = 1}, + } + }, + + [302] = { + chars = {'〜'}, + width = 1,height = 0.88,depth = 0.12, + align = 'middle', + glue = { + [1] = {0.5, 0, 0.5, ratio = 1, kanjiskip_stretch = 1}, + [2] = {0, 0, 0}, + [5] = {0.25, 0, 0.25, ratio = 0, kanjiskip_stretch = 1}, + } + }, + [5] = { -- 中点類 + chars = {'・', ':', + ';' + }, + width = 0.5,height = 0.88,depth = 0.12, + align = 'middle', + glue = { + [0] = {0.25, 0, 0.25, ratio = 0, kanjiskip_stretch = 1}, + [1] = {0.25, 0, 0.25, ratio = 0, kanjiskip_stretch = 1}, + [2] = {0.25, 0, 0.25, ratio = 0}, + [300] = {0.25, 0, 0.25, ratio = 0, kanjiskip_stretch = 1}, + [301] = {0.25, 0, 0.25, ratio = 0, kanjiskip_stretch = 1}, + [302] = {0.25, 0, 0.25, ratio = 0, kanjiskip_stretch = 1}, + [5] = {0.25, 0, 0.25, ratio = 0.5, kanjiskip_stretch = 1}, + [6] = {0.25, 0, 0.25, ratio = 0, kanjiskip_stretch = 1}, + [7] = {0.25, 0, 0.25, ratio = 0, kanjiskip_stretch = 1}, + [8] = {0.25, 0, 0.25, ratio = 0, kanjiskip_stretch = 1}, + [14] = {0.25, 0, 0.25, ratio = 0, kanjiskip_stretch = 1}, + [27] = {0.25, 0, 0.25, ratio = 0, kanjiskip_stretch = 1}, + } + }, + [6] = { -- 句点類 + chars = {'。', + '.'}, -- 縦書きでは使わない + width = 0.5,height = 0.88,depth = 0.12, + align = 'left', + glue = { + [0] = {0.5, 0, 0, ratio = 0, kanjiskip_stretch = 1}, + [1] = {0.5, 0, 0, ratio = 0, kanjiskip_stretch = 1}, + [2] = {0, 0, 0}, + [300] = {0.5, 0, 0, ratio = 0, kanjiskip_stretch = 1}, + [301] = {0.5, 0, 0, ratio = 0, kanjiskip_stretch = 1}, + [302] = {0.5, 0, 0, ratio = 0, kanjiskip_stretch = 1}, + [5] = {0.75, 0, 0.25, ratio = 0.33333333, kanjiskip_stretch = 1}, + [8] = {0.5, 0, 0, ratio = 0, kanjiskip_stretch = 1}, + [14] = {0.5, 0, 0, ratio = 0, kanjiskip_stretch = 1}, + [27] = {0.5, 0, 0, ratio = 0, kanjiskip_stretch = 1}, + } + }, + [7] = { -- 読点類 + chars = {'、', + ','}, -- 縦書きでは使わない + width = 0.5,height = 0.88,depth = 0.12, + align = 'left', + glue = { + [0] = {0.5, 0, 0.5, ratio = 0, kanjiskip_stretch = 1}, + [1] = {0.5, 0, 0.5, ratio = 0, kanjiskip_stretch = 1}, + [2] = {0, 0, 0}, + [300] = {0.5, 0, 0.5, ratio = 0, kanjiskip_stretch = 1}, + [301] = {0.5, 0, 0.5, ratio = 0, kanjiskip_stretch = 1}, + [302] = {0.5, 0, 0.5, ratio = 0, kanjiskip_stretch = 1}, + [5] = {0.75, 0, 0.75, ratio = 0.33333333, kanjiskip_stretch = 1}, + [8] = {0.5, 0, 0.5, ratio = 0, kanjiskip_stretch = 1}, + [14] = {0.5, 0, 0.5, ratio = 0, kanjiskip_stretch = 1}, + [27] = {0.5, 0, 0.5, ratio = 0, kanjiskip_stretch = 1}, + } + }, + [8] = { -- 分離禁止文字 + chars = {'—', '…', '‥', '〳', '〴', '〵'}, + width = 1,height = 0.88,depth = 0.12, + align = 'middle', + glue = { + [1] = {0.5, 0, 0.5, ratio = 1, kanjiskip_stretch = 1}, + [2] = {0, 0, 0}, + [5] = {0.25, 0, 0.25, ratio = 1, kanjiskip_stretch = 1}, + [8] = {0, 0, 0}, + } + }, + [14] = { -- 和字間隔,前には空きが入り後ろには入らないようにする. + chars = {' '}, + align = 'middle', + width= 1,height = 0.88,depth = 0.12, + glue = { + [0] = {0, 0, 0}, + [1] = {0, 0, 0}, + [2] = {0, 0, 0}, + [300] = {0, 0, 0}, + [301] = {0, 0, 0}, + [302] = {0, 0, 0}, + [5] = {0.25, 0, 0.25, ratio = 1}, + [6] = {0, 0, 0}, + [8] = {0, 0, 0}, + [27] = {0, 0, 0}, + }, + }, + [27] = {-- 欧文 + chars = {'alchar'}, + glue = { + [1] = {0.5, 0, 0, kanjiskip_stretch = 1}, + [2] = {0, 0, 0}, + [5] = {0.25, 0, 0.25, ratio = 1, kanjiskip_stretch = 1}, + [27] = {0, 0, 0}, + } + }, + [90] = { -- 行頭 + chars = {'parbdd','boxbdd'}, + glue = { + [1] = {0, 0, 0}, + }, + }, +} + +luatexja.jfont.define_jfm(jfm) + diff --git a/language/japanese/jlreq/jlreq-ja.pdf b/language/japanese/jlreq/jlreq-ja.pdf index 2194b7fb14..84439c7cba 100644 Binary files a/language/japanese/jlreq/jlreq-ja.pdf and b/language/japanese/jlreq/jlreq-ja.pdf differ diff --git a/language/japanese/jlreq/jlreq.cls b/language/japanese/jlreq/jlreq.cls index ba89816ec6..71f7426605 100644 --- a/language/japanese/jlreq/jlreq.cls +++ b/language/japanese/jlreq/jlreq.cls @@ -3,12 +3,20 @@ %% The package is distributed under the BSD 2-Clause License %% %% -% (based on JLReq 20120403 https://www.w3.org/TR/2012/NOTE-jlreq-20120403/ja/) +% (based on JLReq 20200811 https://www.w3.org/TR/2020/NOTE-jlreq-20200811/) \NeedsTeXFormat{LaTeX2e} -\ProvidesClass{jlreq}[2020/09/27 jlreq] -\RequirePackage{xkeyval,everyhook,etoolbox,ifthen,filehook} +\ProvidesClass{jlreq}[2020/12/29 jlreq] +\RequirePackage{xkeyval,everyhook,etoolbox,ifthen} \RequirePackage{jlreq-helpers} + +\ExplSyntaxOn +\tl_new:N \l_jlreq_tmpa_tl +\cs_new:Nn \l_jlreq_do: {} +\str_new:N \l_jlreq_tmpa_str +\str_new:N \l_jlreq_tmpb_str +\ExplSyntaxOff + \newcommand*{\jlreq@undeferr}[1]{\ClassError{jlreq}{Trying to delete \string#1 even though it is not defined, may be a bug}{\@ehc}} % クラスファイル内でしか使わないマクロをクラスファイル終了時に未定義にする \newcommand*{\jlreq@aftercls@addtodeletecs}[1]{% @@ -31,17 +39,20 @@ \AtBeginDocument{\jlreq@preamblefalse} \def\jlreq@saveoriginalcs#1{% - \ifx#1\relax - \ClassError{jlreq}{Trying to save \string#1 but it's not defined, may be a bug}{\@ehc}% - \fi - \expandafter\ifx\csname jlreq@original@\expandafter\@gobble\string#1\endcsname\relax\else - \ClassError{jlreq}{Trying to save \string#1 twice, may be a bug}{\@ehc}% - \fi - \expandafter\let\csname jlreq@original@\expandafter\@gobble\string#1\endcsname=#1 + \@ifundefined{#1}{ + \ClassError{jlreq}{Trying to save #1 but it's not defined, may be a bug}{\@ehc}% + }{} + \@ifundefined{jlreq@original@#1}{}{ + \ClassError{jlreq}{Trying to save #1 twice, may be a bug}{\@ehc}% + } + \begingroup + \edef\jlreq@do{\noexpand\let\expandonce{\csname jlreq@original@#1\endcsname}=\expandonce{\csname #1\endcsname}} + \expandafter\endgroup + \jlreq@do } \def\jlreq@useoriginalcs#1{% - \jlreq@if{\ifcsname jlreq@original@\expandafter\@gobble\string#1\endcsname\fi}% - {\csname jlreq@original@\expandafter\@gobble\string#1\endcsname}% + \jlreq@if{\ifcsname jlreq@original@#1\endcsname\fi}% + {\csname jlreq@original@#1\endcsname}% {#1}% } \def\jlreq@restoreoriginalcs#1{% @@ -633,11 +644,13 @@ \providecommand*{\jlreqkanjiskip}{0pt plus 0.25\jlreq@zw minus 0pt} \fi \providecommand*{\jlreqxkanjiskip}{0.25\jlreq@zw plus 0.25\jlreq@zw minus 0.125\jlreq@zw} -\AtBeginDocument{ - \jlreq@if{\ifx l\jlreq@engine\fi}{ - \ltjsetparameter{kanjiskip=\jlreqkanjiskip} - \ltjsetparameter{xkanjiskip=\jlreqxkanjiskip} - }{ +\jlreq@if{\ifx l\jlreq@engine\fi}{ + \AtBeginDocument{% + \ltjsetparameter{kanjiskip=\jlreqkanjiskip}% + \ltjsetparameter{xkanjiskip=\jlreqxkanjiskip}% + } +}{ + \AtBeginDocument{% \kanjiskip=\jlreqkanjiskip \xkanjiskip=\jlreqxkanjiskip } @@ -652,7 +665,7 @@ \dimexpr\directlua{ local act = string.char(92) local s = [[#1]] - s = s:gsub("Q",act .. "dimexpr 0.25mm" .. act .. "relax") + s = s:gsub("[QH]",act .. "dimexpr 0.25mm" .. act .. "relax") tex.print(s) }\relax }% @@ -702,6 +715,29 @@ \edef\jlreq@jafontscale{\strip@pt\jlreq@resultdimen} \jlreq@aftercls@addtodeletecs{\jlreq@jafontscale} \ifx l\jlreq@engine + \jlreq@saveoriginalcs{DeclareFontShape} + \ExplSyntaxOn + \def\DeclareFontShape#1#2#3#4#5#6{ + \group_begin: + \bool_if:nT{\str_if_eq_p:nn{#1}{JY3} || \str_if_eq_p:nn{#1}{JT3}}{ + \tl_set:Nx \l_jlreq_tmpa_tl {#5} + \tl_if_in:NnTF \l_jlreq_tmpa_tl {jfm=jlreq}{ + \tl_if_in:NnTF \l_jlreq_tmpa_tl {jfm=jlreqv}{ + \tl_replace_all:Nnn \l_jlreq_tmpa_tl {jfm=jlreqv}{jfm=jlreqv-jidori} + }{ + \tl_replace_all:Nnn \l_jlreq_tmpa_tl {jfm=jlreq}{jfm=jlreq-jidori} + } + \cs_set:Nx \l_jlreq_do: {\exp_not:n{\jlreq@useoriginalcs{DeclareFontShape}{#1}{#2}{#3}{#4-jidori}}{\tl_use:N \l_jlreq_tmpa_tl}{#6}} + }{ + \tl_if_in:NnT \l_jlreq_tmpa_tl {<->ssub}{ + \cs_set:Nn \l_jlreq_do: {\jlreq@useoriginalcs{DeclareFontShape}{#1}{#2}{#3}{#4-jidori}{#5}{#6}} + } + } + } + \exp_after:wN \group_end: \l_jlreq_do: + \jlreq@useoriginalcs{DeclareFontShape}{#1}{#2}{#3}{#4}{#5}{#6} + } + \ExplSyntaxOff \DeclareFontShape{JY3}{mc}{m}{n}{<->s*[\jlreq@jafontscale]\ltj@stdmcfont:jfm=jlreq;script=latn;-kern}{} \DeclareFontShape{JY3}{gt}{m}{n}{<->s*[\jlreq@jafontscale]\ltj@stdgtfont:jfm=jlreq;script=latn;-kern}{} \DeclareFontShape{JT3}{mc}{m}{n}{<->s*[\jlreq@jafontscale]\ltj@stdmcfont:jfm=jlreqv;script=latn;-kern}{} @@ -711,6 +747,11 @@ \DeclareFontShape{\jlreq@yokokanjiencoding}{gt}{m}{n}{<->s*[\jlreq@jafontscale]\jlreq@jfmnameg}{} \DeclareFontShape{\jlreq@tatekanjiencoding}{mc}{m}{n}{<->s*[\jlreq@jafontscale]\jlreq@jfmname-v}{} \DeclareFontShape{\jlreq@tatekanjiencoding}{gt}{m}{n}{<->s*[\jlreq@jafontscale]\jlreq@jfmnameg-v}{} + \edef\jlreq@tempa{\ifx u\jlreq@engine u\fi} + \DeclareFontShape{\jlreq@yokokanjiencoding}{mc}{m}{n-jidori}{<->s*[\jlreq@jafontscale]\jlreq@tempa jlreq-jidori}{} + \DeclareFontShape{\jlreq@yokokanjiencoding}{gt}{m}{n-jidori}{<->s*[\jlreq@jafontscale]\jlreq@tempa jlreqg-jidori}{} + \DeclareFontShape{\jlreq@tatekanjiencoding}{mc}{m}{n-jidori}{<->s*[\jlreq@jafontscale]\jlreq@tempa jlreq-v-jidori}{} + \DeclareFontShape{\jlreq@tatekanjiencoding}{gt}{m}{n-jidori}{<->s*[\jlreq@jafontscale]\jlreq@tempa jlreqg-v-jidori}{} \fi \@for\jlreq@encoding:=\jlreq@yokokanjiencoding,\jlreq@tatekanjiencoding\do{ \@for\jlreq@shape:=n,it,sl,sc\do{ @@ -761,10 +802,10 @@ \edef\jlreq@charlist@katakana{アイウエオカガキギクグケゲコゴサザシジスズセゼソゾタダチヂツヅテデトドナニヌネノハバパヒビピフブプヘベペホボポマミムメモヤユヨラリルレロワヰヱヲンヴ\ifx p\jlreq@engine\else ヷヸヹヺ\fi}% カ゚キ゚ク゚ケ゚コ゚セ゚ツ゚ト゚ %.. 行頭括弧調整 -\ifx l\jlreq@endgine +\ifx l\jlreq@engine % \item後の行頭括弧のために仕込み. - \jlreq@saveoriginalcs{\list} - \jlreq@saveoriginalcs{\endlist} + \jlreq@saveoriginalcs{list} + \jlreq@saveoriginalcs{endlist} \PushPostHook{par}{\jlreq@parhook@atbeginlist} \pretocmd{\list}{\def\jlreq@parhook@atbeginlist{\ltjfakeparbegin}}{}{} \apptocmd{\endlist}{\def\jlreq@parhook@atbeginlist{}}{}{} @@ -992,10 +1033,9 @@ \DeclareRobustCommand*{\mit}{\@fontswitch\relax\mathnormal} % 和文ファミリと欧文ファミリの連動 -\@ifundefined{@rmfamilyhook}{}{\g@addto@macro\@rmfamilyhook{\prepare@family@series@update@kanji{mc}\mcdefault}} -\@ifundefined{@sffamilyhook}{}{\g@addto@macro\@sffamilyhook{\prepare@family@series@update@kanji{gt}\gtdefault}} -\@ifundefined{@ttfamilyhook}{}{\g@addto@macro\@ttfamilyhook{\prepare@family@series@update@kanji{gt}\gtdefault}} - +\AddToHook{rmfamily}{\prepare@family@series@update@kanji{mc}\mcdefault} +\AddToHook{sffamily}{\prepare@family@series@update@kanji{gt}\gtdefault} +\AddToHook{ttfamily}{\prepare@family@series@update@kanji{gt}\gtdefault} % 数式フォント設定 \ifjlreq@option@enablejfam @@ -1077,7 +1117,7 @@ \dimexpr\directlua{ local act = string.char(92) local s = [[\jlreq@option@baselineskip]] - s = s:gsub("Q",act .. "dimexpr 0.25mm" .. act .. "relax"):gsub("zh",act .. "zh"):gsub("zw",act .. "zw") + s = s:gsub("[QH]",act .. "dimexpr 0.25mm" .. act .. "relax"):gsub("zh",act .. "zh"):gsub("zw",act .. "zw") tex.print(s) }\relax }% @@ -1094,7 +1134,7 @@ \emergencystretch 3\jlreq@gol \setlength{\parindent}{1\zw} \def\jlreq@setfontsizehook{} -\jlreq@saveoriginalcs{\set@fontsize} +\jlreq@saveoriginalcs{set@fontsize} \apptocmd{\set@fontsize}{\expandafter\def\expandafter\size@update\expandafter{\size@update\jlreq@setfontsizehook}}{}{} \appto\jlreq@setfontsizehook{\ifdim\parindent>0pt \setlength{\parindent}{1\jlreq@zw}\fi} \ifx l\jlreq@engine @@ -1553,10 +1593,9 @@ % デフォルトでは\<命令名>markと\addcontentslineが必要ならば呼ばれる. % 見出しの直前に実行される -\newcommand*{\jlreq@hook@beforeheadings}[1]{} +\NewHook{./heading/before} % 見出し名一覧を格納する \def\jlreq@heading@allheadings{} - % 目次を出力する命令\l@<命令名>を作る命令を作る.{1 = 命令名}{2 = レベル}{3 = ラベルのフォーマット} % 結果は\jlreq@resultに入る. \def\jlreq@heading@make@l@#1#2#3{% @@ -1609,6 +1648,7 @@ %.. 中/半扉見出し % addcontentslineに渡すやつ:番号出すのと出さないの \newcommand{\DeclareTobiraHeading}[3]{% + \IfHookExistsTF{jlreq/heading/before/#1}{}{\NewHook{./heading/before/#1}}% \def\jlreq@do{\@removeelement{#1}}% \expandafter\jlreq@do\expandafter{\jlreq@heading@allheadings}{\jlreq@heading@allheadings}% \appto{\jlreq@heading@allheadings}{,#1}% @@ -1690,7 +1730,11 @@ \unexpanded{\if@twocolumn\onecolumn\@restonecoltrue\else\@restonecolfalse\fi\cleartooddpage[empty]}% \ifx\jlreq@pagestyle\@empty\else\noexpand\thispagestyle{\expandonce{\jlreq@pagestyle}}\fi \noexpand\secdef{\expandonce{\csname jlreq@TobiraHeading@start@#1\endcsname}}{\expandonce{\csname jlreq@TobiraHeading@start@s@#1\endcsname}}}% - \noexpand\def\expandonce{\csname #1\endcsname}{\expandonce{\csname jlreq@headingcs@#1\endcsname}}% + \noexpand\def\expandonce{\csname #1\endcsname}{% + \noexpand\UseHook{jlreq/heading/before}% + \noexpand\UseHook{jlreq/heading/before/#1}% + \expandonce{\csname jlreq@headingcs@#1\endcsname}% + }% }% \expandafter\endgroup \jlreq@do @@ -2118,6 +2162,7 @@ % \DeclareBlockHeading{命令名}{レベル}{設定} \def\jlreq@BlockHeading@allheadings{}% 別行見出し一覧 \newcommand{\DeclareBlockHeading}[3]{% + \IfHookExistsTF{jlreq/heading/before/#1}{}{\NewHook{jlreq/heading/before/#1}}% \def\jlreq@do{\@removeelement{#1}}% \expandafter\jlreq@do\expandafter{\jlreq@heading@allheadings}{\jlreq@heading@allheadings}% \appto\jlreq@heading@allheadings{,#1}% @@ -2360,7 +2405,8 @@ \edef\jlreq@do{% \expandonce{\jlreq@do}% \noexpand\edef\expandonce{\csname jlreq@headingcs@#1\endcsname}{\noexpand\unexpanded{% - \noexpand\jlreq@hook@beforeheadings{#1}% + \noexpand\UseHook{jlreq/heading/before}% + \noexpand\UseHook{jlreq/heading/before/#1}% \expandonce{\jlreq@pagebreak}% \unexpanded{\jlreq@BlockHeading@start{#1}{#2}}% {{\expandonce{\jlreq@align}}{\expandonce{\jlreq@indent}}{\expandonce{\jlreq@end@indent}}\expandonce{\jlreq@spaceset}{\expandonce{\jlreq@allowbreak@evenpage}}}% @@ -2729,6 +2775,7 @@ % \DeclareRuninHeading{命令名}{レベル}{設定} \newcommand*{\DeclareRuninHeading}[3]{% + \IfHookExistsTF{jlreq/heading/before/#1}{}{\NewHook{jlreq/heading/before/#1}}% \def\jlreq@do{\@removeelement{#1}}% \expandafter\jlreq@do\expandafter{\jlreq@heading@allheadings}{\jlreq@heading@allheadings}% \appto\jlreq@heading@allheadings{,#1}% @@ -2787,7 +2834,8 @@ % パラメータトークンを含むので,\edefして\unexpandedで包む \noexpand\edef\expandonce{\csname #1\endcsname}{% \noexpand\unexpanded{% - \unexpanded{\jlreq@hook@beforeheadings{#1}}% + \noexpand\UseHook{jlreq/heading/before}% + \noexpand\UseHook{jlreq/heading/before/#1}% \unexpanded{\jlreq@RuninHeading@start{#1}{#2}}{\ifjlreq@number\else -\fi}{\expandonce{\jlreq@label@format}}{\expandonce{\jlreq@format@wlabel}}{\expandonce{\jlreq@format@wolabel}}% }% }% @@ -2876,6 +2924,7 @@ } \newcommand*{\DeclareCutinHeading}[3]{% + \IfHookExistsTF{jlreq/heading/before/#1}{}{\NewHook{jlreq/heading/before/#1}}% \expandafter\def\csname jlreq@heading@level@#1\endcsname{#2}% \expandafter\def\csname jlreq@heading@setting@#1\endcsname{#3}% \expandafter\def\csname jlreq@heading@type@#1\endcsname{\RenewCutinHeading}% @@ -2897,6 +2946,8 @@ }{}% \edef\jlreq@do{% \noexpand\def\expandonce{\csname #1\endcsname}{% + \noexpand\UseHook{jlreq/heading/before}% + \noexpand\UseHook{jlreq/heading/before/#1}% \noexpand\jlreq@CutinHeading@start{#1}{\expandonce{\jlreq@fontcommand}}{\expandonce{\jlreq@indent}}{\expandonce{\jlreq@after@space}}{\expandonce{\jlreq@onelinemax}}{\expandonce{\jlreq@twolinemax}}% }% }% @@ -3130,8 +3181,8 @@ \fi % \footnoteと\footnotemarkの前後に\jlreq@hook@prenote/\jlreq@hook@postnoteを入れる -\jlreq@saveoriginalcs{\footnote} -\jlreq@saveoriginalcs{\footnotemark} +\jlreq@saveoriginalcs{footnote} +\jlreq@saveoriginalcs{footnotemark} \long\def\jlreq@footnotetext@for@footnote[#1]#2{% \def\jlreq@result{\footnotetext[#1]{#2}}% } @@ -3147,11 +3198,11 @@ \@ifnextchar[{\jlreq@footnotemark@impl@woption}{\jlreq@footnotemark@impl@wooption}% } \long\def\jlreq@footnotemark@impl@woption[#1]{% - \jlreq@useoriginalcs{\footnotemark}[#1]% + \jlreq@useoriginalcs{footnotemark}[#1]% \jlreq@hook@postnote } \long\def\jlreq@footnotemark@impl@wooption{% - \jlreq@useoriginalcs{\footnotemark}% + \jlreq@useoriginalcs{footnotemark}% \jlreq@hook@postnote } \def\jlreq@restore@original@footnotes{% @@ -3403,10 +3454,9 @@ \let\@makeendmark=\@makefnmark % \theendnoteの出力を仕込む -\apptocmd{\jlreq@hook@beforeheadings}{\jlreq@endnote@hook@beforeheadings{#1}}{}{} - \jlreq@jlreqsetup@add{endnote_position}{ - \def\jlreq@endnote@hook@beforeheadings##1{} + \AddToHook{jlreq/heading/before}[jlreq/endnote]{} + \RemoveFromHook{jlreq/heading/before}[jlreq/endnote] \jlreq@tempafalse % headingsが指定された \jlreq@tempbfalse % paragraphが指定された % \jlreq@tempcにセクション名たちを入れていく @@ -3436,17 +3486,13 @@ \fi \ifjlreq@tempa - \apptocmd{\jlreq@endnote@hook@beforeheadings}{\theendnotes}{}{} + \AddToHook{jlreq/heading/before}[jlreq/endnote]{\theendnotes} \else \@for\@tempa:=\jlreq@tempc\do{ \ifx\@tempa\@empty\else - \edef\jlreq@do{% - \unexpanded{\def\jlreq@endnote@hook@beforeheadings##1}{\expandonce{\jlreq@endnote@hook@beforeheadings{##1}}% - \unexpanded{\def\@tempa}{\@tempa}\unexpanded{\def\@tempb{##1}}% - \unexpanded{\ifx\@tempa\@tempb\theendnotes\fi}% - } - } - \jlreq@do + \AddToHook{jlreq/heading/before/\@tempa}[jlreq/endnote]{} + \RemoveFromHook{jlreq/heading/before/\@tempa}[jlreq/endnote] + \AddToHook{jlreq/heading/before/\@tempa}[jlreq/endnote]{\theendnotes} \fi } \fi @@ -4962,11 +5008,8 @@ %. 箇条書き. cf. JISX4051 8.4 % 用語定義型 \newenvironment{description}{\list{}{% - \setlength{\leftmargin}{0pt}% 下げない - \setlength{\labelwidth}{0pt}% - \setlength{\labelsep}{1\jlreq@zw} -% \addtolength{\leftmargin}{\leftskip}% たぶんこの二行いらない…… -% \addtolength{\leftmargin}{\labelsep}% + \setlength{\labelsep}{1\jlreq@zw}% + \setlength{\labelwidth}{\dimexpr\leftmargin - \labelsep\relax}% \let\makelabel=\descriptionlabel % 同行じゃない場合はこんな感じ? % \let\jlreq@original@@item=\@item @@ -5069,27 +5112,33 @@ \newenvironment{verse} {\let\\\@centercr - \list{}{\itemsep\z@ \itemindent -2\jlreq@mol + \list{}{\itemsep\z@ \itemindent -2\jlreq@zw \listparindent\itemindent \labelwidth\z@ \labelsep\z@ \leftmargin=\dimexpr\jlreq@quote@indent\relax - \addtolength{\leftmargin}{2\jlreq@mol}% + \addtolength{\leftmargin}{2\jlreq@zw}% \rightmargin=\dimexpr\jlreq@quote@end@indent\relax - \jlreq@quote@fontsize - \@tempdima=1\jlreq@zw + \begingroup + \jlreq@quote@fontsize + \edef\jlreq@do{\noexpand\@tempdima=\the\dimexpr1\jlreq@zw\relax\relax}% + \expandafter\endgroup + \jlreq@do \@tempdimb=\dimexpr\linewidth - \@totalleftmargin - \leftmargin - \rightmargin\relax \@tempdimc=\@tempdimb \divide\@tempdimb by \@tempdima\multiply\@tempdimb by \@tempdima \topsep=\dimexpr\jlreq@quote@beforeafter@space\relax \leftmargin=\dimexpr\leftmargin + \@tempdimc - \@tempdimb\relax}% - \item\relax}{\endlist} + \item\relax\jlreq@quote@fontsize}{\endlist} \newenvironment{quotation} {\list{}{% \leftmargin=\dimexpr\jlreq@quote@indent\relax \rightmargin=\dimexpr\jlreq@quote@end@indent\relax - \jlreq@quote@fontsize - \@tempdima=1\jlreq@zw + \begingroup + \jlreq@quote@fontsize + \edef\jlreq@do{\noexpand\@tempdima=\the\dimexpr1\jlreq@zw\relax\relax}% + \expandafter\endgroup + \jlreq@do \@tempdimb=\dimexpr\linewidth - \@totalleftmargin - \leftmargin - \rightmargin\relax \@tempdimc=\@tempdimb \divide\@tempdimb by \@tempdima\multiply\@tempdimb by \@tempdima @@ -5100,13 +5149,16 @@ \labelsep\z@ \topsep=\dimexpr\jlreq@quote@beforeafter@space\relax \parsep\z@ \@plus.1\jlreq@gol}% - \item\relax}{\endlist} + \item\relax\jlreq@quote@fontsize}{\endlist} \newenvironment{quote} {\list{}{% \leftmargin=\dimexpr\jlreq@quote@indent\relax \rightmargin=\dimexpr\jlreq@quote@end@indent\relax - \jlreq@quote@fontsize - \@tempdima=1\jlreq@zw + \begingroup + \jlreq@quote@fontsize + \edef\jlreq@do{\noexpand\@tempdima=\the\dimexpr 1\jlreq@zw\relax\relax}% + \expandafter\endgroup + \jlreq@do \@tempdimb=\dimexpr\linewidth - \@totalleftmargin - \leftmargin - \rightmargin\relax \@tempdimc=\@tempdimb \divide\@tempdimb by \@tempdima\multiply\@tempdimb by \@tempdima @@ -5115,12 +5167,12 @@ \itemindent\z@ \topsep=\jlreq@speciallength{\jlreq@quote@beforeafter@space}% \listparindent\z@}% - \item\relax}{\endlist} + \item\relax\jlreq@quote@fontsize}{\endlist} %. 表関係 4.4 % 表内の行間を0にする(4.4.3.f) -\jlreq@saveoriginalcs{\tabular} -\jlreq@saveoriginalcs{\endtabular} +\jlreq@saveoriginalcs{tabular} +\jlreq@saveoriginalcs{endtabular} \preto\tabular{\begingroup\appto\@arrayparboxrestore{\baselineskip=0pt\lineskip=0pt}} \appto\endtabular{\endgroup} % 4.4.3.e @@ -5608,6 +5660,49 @@ \jlreq@do } +\ExplSyntaxOn +\jlreq@saveoriginalcs{kanjishape} +\ifx l\jlreq@engine + \cs_set:Nn \l_jlreq_tmpa:n { + \NewDocumentCommand{\jidori}{m m}{ + \mode_if_vertical:TF{\leavevmode}{} + \group_begin: + \ltj@setpar@global + \ltjsetkanjiskip 0pt~plus~1fil~minus~0pt + \ltjsetxkanjiskip 0pt~plus~1fil~minus~0pt + \renewcommand*{\jlreqkanjiskip}{0pt~plus~1fil~minus~0pt} + \renewcommand*{\jlreqxkanjiskip}{0pt~plus~1fil~minus~0pt} + \hbox_to_wd:nn {##1}{ + \def#1{ } + \kanjishape{n-jidori}\selectfont + \def\kanjishape####1{\jlreq@useoriginalcs{kanjishape}{####1-jidori}} + ##2 + \hskip\glueexpr 0pt~minus~1fil\relax + } + \group_end: + } + } + \catcode` =\active + \l_jlreq_tmpa:n{ } + \catcode` =12 +\else + \NewDocumentCommand{\jidori}{m m}{ + \mode_if_vertical:TF{\leavevmode}{} + \group_begin: + \setlength{\kanjiskip}{0pt~plus~15zw~minus~0pt} + \setlength{\xkanjiskip}{0pt~plus~15zw~minus~0pt} + \renewcommand*{\jlreqkanjiskip}{0pt~plus~15zw~minus~0pt} + \renewcommand*{\jlreqxkanjiskip}{0pt~plus~15zw~minus~0pt} + \hbox_to_wd:nn {#1}{ + \kanjishape{n-jidori}\selectfont + \inhibitglue #2 + \hskip\glueexpr 0pt~minus~1fil\relax + } + \group_end: + } +\fi +\ExplSyntaxOff + % 日にち \newif\if西暦 \def\西暦{\西暦true} @@ -5660,8 +5755,8 @@ \minute=\numexpr\time - 60*\hour\relax %.. 定理環境 -\jlreq@saveoriginalcs{\@begintheorem} -\jlreq@saveoriginalcs{\@opargbegintheorem} +\jlreq@saveoriginalcs{@begintheorem} +\jlreq@saveoriginalcs{@opargbegintheorem} \def\@begintheorem#1#2{\topsep=\dimexpr\jlreq@theorem@beforeafter@space\relax \trivlist\labelsep=1\jlreq@zw \itemindent=\dimexpr\jlreq@theorem@indent\relax @@ -5672,9 +5767,9 @@ \itemindent=\dimexpr\jlreq@theorem@indent\relax \jlreq@theorem@font \item[\hskip \labelsep{\reset@font\jlreq@theorem@label@font #1\ #2(#3)}]} -\AtEndOfPackageFile*{amsthm}{% - \jlreq@saveoriginalcs{\proof}% - \jlreq@saveoriginalcs{\endproof}% +\AddToHook{package/after/amsthm}{ + \jlreq@saveoriginalcs{proof}% + \jlreq@saveoriginalcs{endproof}% \edef\jlreq@do{ \unexpanded{\def\jlreq@proof[#1]}{% \unexpanded{\labelsep=1\jlreq@zw}% @@ -5739,8 +5834,8 @@ \if@twoside\ModifyHeading{subsection}{allowbreak_if_evenpage=true}\fi \NewBlockHeading{subsubsection}{3}{font={\jlreq@keepbaselineskip{\normalsize}},indent=10\jlreq@zw,lines=1,before_lines=1,subtitle_break=false,after_label_space=1\jlreq@zw,second_heading_text_indent={-1\jlreq@zw,1\jlreq@zw},,subtitle_font={\jlreq@keepbaselineskip{\scriptsize}}} \if@twoside\ModifyHeading{subsubsection}{allowbreak_if_evenpage=true}\fi - \NewRuninHeading{paragraph}{4}{font={\jlreq@keepbaselineskip{\normalsize}}} - \NewRuninHeading{subparagraph}{5}{font={\jlreq@keepbaselineskip{\normalsize}},indent=1\jlreq@zw} + \NewRuninHeading{paragraph}{4}{font={\jlreq@keepbaselineskip{\normalsize}\sffamily\gtfamily\bfseries}} + \NewRuninHeading{subparagraph}{5}{font={\jlreq@keepbaselineskip{\normalsize}\sffamily\gtfamily\bfseries},indent=1\jlreq@zw} \else% yoko \renewcommand{\thepart}{\Roman{part}} \renewcommand{\thesubsection}{\thesection .\arabic{subsection}} diff --git a/language/japanese/jlreq/jlreq.pdf b/language/japanese/jlreq/jlreq.pdf index e36f3d8a87..3900529078 100644 Binary files a/language/japanese/jlreq/jlreq.pdf and b/language/japanese/jlreq/jlreq.pdf differ diff --git a/language/japanese/jlreq/make_variant_jfm.lua b/language/japanese/jlreq/make_variant_jfm.lua index e91e85cc33..a38ddd1391 100644 --- a/language/japanese/jlreq/make_variant_jfm.lua +++ b/language/japanese/jlreq/make_variant_jfm.lua @@ -97,6 +97,7 @@ function tolf(file) end local originaljfm = "jlreq" +local originaljfm_jidori = "jlreq-jidori" local jfmfile = kpse.find_file("jfm-" .. originaljfm .. ".lua") if jfmfile == nil then @@ -175,3 +176,35 @@ fp:close() tolf(file); + +jfmfile = kpse.find_file("jfm-" .. originaljfm_jidori .. ".lua") +if jfmfile == nil then + print("JFM " .. originaljfm_jidori .. " is not found") + os.exit(1) +end + +jfm = nil +function luatexja.jfont.define_jfm(j) + jfm = j +end +dofile(jfmfile) + +function to_jidori_pl(t) + t = table.fastcopy(t) + -- kanjiskipに任せているところを15zwに変更 + for cl1,val in pairs(t) do + if type(cl1) == "number" then + for cl2,glue in pairs(val.glue) do + if glue.kanjiskip_stretch == 1 then + t[cl1].glue[cl2][2] = 15 + end + end + end + end + return t +end + + +make_jfmfile(to_jidori_pl(jfm),"jfm-jlreq-jidori-pl.lua") +make_jfmfile(to_jidori_pl(tate(jfm)),"jfm-jlreqv-jidori-pl.lua") +make_jfmfile(tate(jfm),"jfm-jlreqv-jidori.lua") -- cgit v1.2.3