summaryrefslogtreecommitdiff
path: root/macros/luatex
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2020-08-09 03:02:03 +0000
committerNorbert Preining <norbert@preining.info>2020-08-09 03:02:03 +0000
commit68df63effba2e77fb0218b91a6722821355885cd (patch)
treeb83f3e8c1ebfbfd59df87a4a6e89abb5a0442008 /macros/luatex
parent1c9455caf30309c8b8ba69afdc5a16a83d9f9a58 (diff)
CTAN sync 202008090302
Diffstat (limited to 'macros/luatex')
-rw-r--r--macros/luatex/generic/luatexja/README21
-rw-r--r--macros/luatex/generic/luatexja/doc/lltjp-geometry.pdfbin164277 -> 166499 bytes
-rw-r--r--macros/luatex/generic/luatexja/doc/lltjp-geometry.tex20
-rw-r--r--macros/luatex/generic/luatexja/doc/ltjclasses.pdfbin400100 -> 400552 bytes
-rw-r--r--macros/luatex/generic/luatexja/doc/ltjsclasses.pdfbin455647 -> 457743 bytes
-rw-r--r--macros/luatex/generic/luatexja/doc/luatexja-en.pdfbin687538 -> 687159 bytes
-rw-r--r--macros/luatex/generic/luatexja/doc/luatexja-ja.pdfbin1104209 -> 1105103 bytes
-rw-r--r--macros/luatex/generic/luatexja/doc/luatexja.dtx58
-rw-r--r--macros/luatex/generic/luatexja/src/lltjext.sty4
-rw-r--r--macros/luatex/generic/luatexja/src/ltj-base.sty15
-rw-r--r--macros/luatex/generic/luatexja/src/ltj-direction.lua24
-rw-r--r--macros/luatex/generic/luatexja/src/ltj-kinsoku.tex (renamed from macros/luatex/generic/luatexja/src/ltj-kinsoku_make.tex)44
-rw-r--r--macros/luatex/generic/luatexja/src/ltj-latex.sty77
-rw-r--r--macros/luatex/generic/luatexja/src/ltj-plain.sty12
-rw-r--r--macros/luatex/generic/luatexja/src/ltjclasses.dtx13
-rw-r--r--macros/luatex/generic/luatexja/src/luatexja-compat.sty22
-rw-r--r--macros/luatex/generic/luatexja/src/luatexja-core.sty26
-rw-r--r--macros/luatex/generic/luatexja/src/luatexja.lua22
-rw-r--r--macros/luatex/generic/luatexja/src/luatexja.sty4
-rw-r--r--macros/luatex/generic/luatexja/src/patches/lltjdefs.sty15
-rw-r--r--macros/luatex/generic/luatexja/src/patches/lltjp-atbegshi.sty62
-rw-r--r--macros/luatex/generic/luatexja/src/patches/lltjp-geometry.sty52
22 files changed, 275 insertions, 216 deletions
diff --git a/macros/luatex/generic/luatexja/README b/macros/luatex/generic/luatexja/README
index 9998677f89..41528dbd95 100644
--- a/macros/luatex/generic/luatexja/README
+++ b/macros/luatex/generic/luatexja/README
@@ -1,4 +1,4 @@
-The LuaTeX-ja Package 20200802.0
+The LuaTeX-ja Package 20200808.0
--------------------------------
Copyright (c) 2011--2020 The LuaTeX-ja project
License: modified BSD (see COPYING)
@@ -45,9 +45,9 @@ Installation
2. If you must/want to install manually:
a. Download the source archive from CTAN,
- or tagged as 20200802.0 in the Git repository by
+ or tagged as 20200808.0 in the Git repository by
<http://git.osdn.jp/view?p=luatex-ja/luatexja.git
- ;a=snapshot;h=refs/tags/20200802.0;sf=tgz>
+ ;a=snapshot;h=refs/tags/20200808.0;sf=tgz>
b. Extract the archive and process following three files by LuaLaTeX
to generate classes for Japanese typesetting:
@@ -55,16 +55,13 @@ Installation
src/ltjltxdoc.ins
src/ltjsclasses.ins
- c. Process src/ltj-kinsoku_make.tex by (plain) LuaTeX to generate ltj-kinsoku.lua,
- which stores default "kinsoku" parameters.
-
- d. Put src/ into your TEXMF tree.
+ c. Put src/ into your TEXMF tree.
An example location is TEXMF/tex/luatex/luatexja.
If you are updating from old version, you MUST remove it before
extracting the new version of LuaTeX-ja.
- e. You may need to update the filename database, by mktexlsr (or by another program).
+ d. You may need to update the filename database, by mktexlsr (or by another program).
Basic Usage
@@ -93,6 +90,10 @@ Notes
No .{dtx,ins} pair generates .sty files of LuaTeX-ja package.
-* src/*.{ins.dtx} and src/ltj-kinsoku_make.tex are not needed in regular use.
+* src/*.{ins.dtx} are not needed in regular use.
+
+* ltj-kinsoku_make.tex is removed in version 20200808.0.
+ This file and ltj-kinsoku.lua are not used anymore.
+ (Do not remove ltj-kinsoku.tex.)
-Last commit date: Sun Aug 2 19:53:42 2020 +0900
+Last commit date: Sat Aug 8 18:25:40 2020 +0900
diff --git a/macros/luatex/generic/luatexja/doc/lltjp-geometry.pdf b/macros/luatex/generic/luatexja/doc/lltjp-geometry.pdf
index 92ac414f9f..20c4edb88f 100644
--- a/macros/luatex/generic/luatexja/doc/lltjp-geometry.pdf
+++ b/macros/luatex/generic/luatexja/doc/lltjp-geometry.pdf
Binary files differ
diff --git a/macros/luatex/generic/luatexja/doc/lltjp-geometry.tex b/macros/luatex/generic/luatexja/doc/lltjp-geometry.tex
index 1b2aa5ed59..28be8dad3c 100644
--- a/macros/luatex/generic/luatexja/doc/lltjp-geometry.tex
+++ b/macros/luatex/generic/luatexja/doc/lltjp-geometry.tex
@@ -1,6 +1,6 @@
%#! lualatex
-\documentclass[a4paper,10pt]{ltjsarticle}
-\usepackage[textwidth=45\zw, lines=45, footskip=2\zh, verbose]{geometry}
+\documentclass[a4paper,10ptj]{ltjsarticle}
+\usepackage[textwidth=42\zw, lines=42, footskip=2\zh, verbose]{geometry}
\usepackage{listings,amsmath,booktabs,lltjext,bxghost}
\usepackage{unicode-math}
\setmathfont{Latin Modern Math}
@@ -48,10 +48,10 @@
\section{利用方法}
\Pkg{lltjp-geometry}パッケージは,\LuaTeX-jaに標準で含まれている.
本パッケージの動作には\href{http://www.ctan.org/pkg/ifluatex}{\Pkg{ifluatex}},
-\href{http://www.ctan.org/pkg/filehook}{\Pkg{filehook}}パッケージが必要である.
+\href{https://www.ctan.org/pkg/etoolbox}{\Pkg{etoolbox}}パッケージが必要である.
+また,\LaTeXe~2020\nobreakdash-02\nobreakdash-02以前では\href{http://www.ctan.org/pkg/filehook}{\Pkg{filehook}}パッケージも必要である.
-\LuaTeX-jaでは,\Pkg{geometry}パッケージ読み込み時に
-自動的に\Pkg{lltjp-geometry}パッケージが読み込まれる.
+\LuaTeX-jaでは,自動的に\Pkg{lltjp-geometry}パッケージが読み込まれる.
縦組クラスか否かの自動判定(\ref{ssec:auto}節)を上書きしたい場合は,
\begin{lstlisting}
% \PassOptionsToPackage{force}{lltjp-geometry} % 強制的に有効
@@ -60,7 +60,7 @@
\usepackage[...]{geometry}
\end{lstlisting}
のように\emph{\Pkg{luatexja}の読み込み前}に\cs{PassOptionsToPackage}で
-本パッケージに渡すオプションを指定する(\cs{usepackage\{lltjp-geometry\}}\>は使えない).
+本パッケージに渡すオプションを指定する(\cs{usepackage\{lltjp-geometry\}}\>を行っても意味がない).
\pTeX 系列では,\Pkg{tarticle}, \Pkg{tbook}, \Pkg{treport}といった
\emph{縦組クラスを使う場合}に,
@@ -68,7 +68,7 @@
\usepackage[...]{lltjp-geometry}
\usepackage[...]{geometry}
\end{lstlisting}
-と,\Pkg{geometry}パッケージの前に読み込む.
+と,\Pkg{geometry}パッケージの\emph{前}に読み込む.
\subsection{縦組クラスか否かの判定}
\label{ssec:auto}
@@ -76,10 +76,12 @@
\Pkg{geometry}パッケージ読み込み直後にパッチを当てる:
\begin{enumerate}
\item \Pkg{geometry}パッケージを読み込む際に,現在の組方向が縦組になっている.
- \item \cs{AtBeginDocument}により指定される,\cs{begin\{document\}}\>時に実行される内容に
- \cs{tate}(というトークン)が含まれている.
+ \item \cs{AtBeginDocument}により
+ \footnote{\LaTeXe~2020-10-01以降ではそれと同義な\>\cs{AddToHook\{begindocument\}}\>も含む.}指定される,
+ \cs{begin\{document\}}\>時に実行される内容に\cs{tate}(というトークン)が含まれている.
\item 本パッケージを読み込む際に\texttt{force}オプションが指定されている.
\end{enumerate}
+
\LuaTeX-jaで縦組クラスを利用する場合は主に1.の,
\pTeX 系列で縦組クラスを利用する場合は主に2.の状況となる
\footnote{%
diff --git a/macros/luatex/generic/luatexja/doc/ltjclasses.pdf b/macros/luatex/generic/luatexja/doc/ltjclasses.pdf
index 46209980cc..4184764810 100644
--- a/macros/luatex/generic/luatexja/doc/ltjclasses.pdf
+++ b/macros/luatex/generic/luatexja/doc/ltjclasses.pdf
Binary files differ
diff --git a/macros/luatex/generic/luatexja/doc/ltjsclasses.pdf b/macros/luatex/generic/luatexja/doc/ltjsclasses.pdf
index e7b415f52b..b9edb1d562 100644
--- a/macros/luatex/generic/luatexja/doc/ltjsclasses.pdf
+++ b/macros/luatex/generic/luatexja/doc/ltjsclasses.pdf
Binary files differ
diff --git a/macros/luatex/generic/luatexja/doc/luatexja-en.pdf b/macros/luatex/generic/luatexja/doc/luatexja-en.pdf
index dbe97a5116..ba86234554 100644
--- a/macros/luatex/generic/luatexja/doc/luatexja-en.pdf
+++ b/macros/luatex/generic/luatexja/doc/luatexja-en.pdf
Binary files differ
diff --git a/macros/luatex/generic/luatexja/doc/luatexja-ja.pdf b/macros/luatex/generic/luatexja/doc/luatexja-ja.pdf
index 72227e28e7..6936022302 100644
--- a/macros/luatex/generic/luatexja/doc/luatexja-ja.pdf
+++ b/macros/luatex/generic/luatexja/doc/luatexja-ja.pdf
Binary files differ
diff --git a/macros/luatex/generic/luatexja/doc/luatexja.dtx b/macros/luatex/generic/luatexja/doc/luatexja.dtx
index 18ca18cdae..3467498552 100644
--- a/macros/luatex/generic/luatexja/doc/luatexja.dtx
+++ b/macros/luatex/generic/luatexja/doc/luatexja.dtx
@@ -651,15 +651,16 @@ and \emph{Japanese fonts} for fonts used in \textbf{JAchar}.
\item \Pkg{adobemapping} (Adobe cmap and pdfmapping files)
\item \LaTeX\ 2020-02-02 patch level 5 or later
%<en> (if you want to use \LuaTeX-ja with \LaTeXe)
-%<ja> (\LaTeX 下で\LuaTeX-jaを使う場合)
+%<ja> (\LaTeXe 下で\LuaTeX-jaを使う場合)
\item \href{https://github.com/josephwright/etoolbox/}{\Pkg{etoolbox}},
\Pkg{everysel}
%<en> (if you want to use \LuaTeX-ja with \LaTeXe)
-%<ja> (\LaTeX 下で\LuaTeX-jaを使う場合)
-\item \Pkg{ltxcmds}, \Pkg{pdftexcmds}, \Pkg{filehook}, \Pkg{atbegshi}
+%<ja> (\LaTeXe 下で\LuaTeX-jaを使う場合)
+\item \Pkg{ltxcmds}, \Pkg{pdftexcmds}
+\item \Pkg{filehook}, \Pkg{atbegshi}
+%<en> (not needed if you want to use \LuaTeX-ja with \LaTeXe~2020-10-01 or later)
+%<ja> (\LaTeXe 2020-10-01以降で\LuaTeX-jaを使う場合はどちらも不要)
\item \href{https://github.com/wspr/fontspec/}{\Pkg{fontspec}} v2.7c (or later)
-%%% %<en>\item \emph{IPAex fonts} (\url{http://ipafont.ipa.go.jp/})
-%%% %<ja>\item \emph{IPAexフォント(\url{http://ipafont.ipa.go.jp/})}
%<*en>
\item \emph{Harano Aji fonts} (\url{https://github.com/trueroad/HaranoAjiFonts})\\
More specifically, HaranoAjiMincho-Regular~and~HaranoAjiGothic-Medium.
@@ -678,9 +679,10 @@ the following distributions:
\begin{itemize}
\item \href{https://www.tug.org/texlive/}{\TeX~Live} (in \texttt{texmf-dist/tex/luatex/luatexja})
\item \href{http://w32tex.org/}{W32\TeX}\ (in \texttt{luatexja.tar.xz})
- \item MiK\TeX\ (in \texttt{luatexja.tar.lzma}); see the next subsection
+ \item MiK\TeX\ (in \texttt{luatexja.tar.xz})
\end{itemize}
-Harano Aji fonts are available in \TeX~Live and MiK\TeX.
+Harano Aji fonts are also available in these distributions
+(\texttt{haranoaji} in \TeX~Live and MiK\TeX, and \texttt{luatexja.tar.xz} in W32\TeX).
%</en>
%<*ja>
現在,\LuaTeX-jaはCTAN (\texttt{macros/luatex/generic/luatexja})に収録されている他,
@@ -690,7 +692,8 @@ Harano Aji fonts are available in \TeX~Live and MiK\TeX.
\item \TeX~Live (\texttt{texmf-dist/tex/luatex/luatexja})
\item W32\TeX\ (\texttt{luatexja.tar.xz})
\end{itemize}
-\TeX~Live, MiK\TeX は原ノ味フォントも収録している.
+これらのディストリビューションは原ノ味フォントも収録している
+(\TeX~Live, MiK\TeX では\texttt{haranoaji},W32\TeX では\texttt{luatexja.tar.xz}).
%</ja>
%<*en>
@@ -766,13 +769,10 @@ But only the contents in \texttt{src/} are needed to work \LuaTeX-ja.
%<*en>
\item If you downloaded this package from CTAN, you have to run following commands
- to generate classes
- and \texttt{ltj-kinsoku.lua} (the file which stores default ``\textit{kinsoku}'' parameters):
+ to generate classes:
%</en>
%<*ja>
-\item もしCTANから本パッケージを取得したのであれば,日本語用クラスファイルや
-標準の禁則処理用パラメータを
-格納した \texttt{ltj-kinsoku.lua} を生成するために,
+\item もしCTANから本パッケージを取得したのであれば,日本語用クラスファイルを生成するために,
以下を実行する必要がある:
%</ja>
\begin{lstlisting}
@@ -780,19 +780,7 @@ $ cd src
$ lualatex ltjclasses.ins
$ lualatex ltjsclasses.ins
$ lualatex ltjltxdoc.ins
-$ luatex ltj-kinsoku_make.tex
\end{lstlisting}
-%<*en>
-\emph{Do not forget processing \texttt{ltj-kinsoku\_make.tex}}.
-\texttt{*.\{dtx,ins\}} and \texttt{ltj-kinsoku\_make.tex} used here are not needed in regular use.
-%</en>
-%<*ja>
-\emph{最後の \texttt{ltj-kinsoku\_make.tex} の実行を忘れないように注意}.
-ここで使用した \texttt{*.\{dtx,ins\}} と \texttt{ltj-kinsoku\_make.tex} は
-通常の使用にあたっては必要ない.
-%</ja>
-
-
%<*en>
\item Copy all the contents of \texttt{src/} into one of your \texttt{TEXMF} tree.
@@ -1149,7 +1137,7 @@ By default, the following fonts are used for these two families.
フォントを変更する命令)の前で実行することにより使うことができる.
\pLaTeX では標準の欧文フォントはOT1エンコーディングのComputer Modern Roman (\texttt{cmr})%
- であったが,2017年以降の\LuaLaTeX ではTUエンコーディングのlatin Modern Roman (\texttt{lmr})%
+ であったが,2017年以降の\LuaLaTeX ではTUエンコーディングのLatin Modern Roman (\texttt{lmr})%
に変更されている.そのため,前段落で述べた「従属欧文」も,Latin Modern Romanに設定している.
%</ja>
@@ -1694,7 +1682,8 @@ as an external package \Pkg{luatexja-otf}.
%</ja>
\begin{LTXexample}[width=0.4\textwidth]
-森\UTF{9DD7}外と内田百\UTF{9592}とが\UTF{9AD9}島屋に\\
+森\UTF{9DD7}外と\CID{13966}田百\UTF{9592}とが
+\UTF{9AD9}島屋に\\
\CID{7652}飾区の\CID{13706}野家,
\CID{1481}城市,葛西駅,\\
高崎と\CID{8705}\UTF{FA11},濱と\ajMayuHama\\
@@ -1827,7 +1816,7 @@ determined from the following data:
%<en>\item Blocks in Unicode~12.0.0.
%<ja>\item Unicode~12.0のブロック.
%<en>\item The \texttt{Adobe-Japan1-UCS2} mapping between a CID Adobe-Japan1- and Unicode.
-%<ja>\item Adobe-Japan1-7のCIDとUnicodeの間の対応表\texttt{Adobe-Japan1-UCS2}7.
+%<ja>\item Adobe-Japan1-7のCIDとUnicodeの間の対応表\texttt{Adobe-Japan1-UCS2}.
%<en>\item The \Pkg{PXbase} bundle for \upTeX\ by Takayuki Yato.
%<ja>\item 八登崇之氏による\upTeX 用の\Pkg{PXbase}バンドル.
\end{itemize}
@@ -2019,12 +2008,12 @@ these eight ranges belongs to the character range~217.
で構成されている.したがって,ブロックのリストを示す
代わりに,範囲の定義そのものを示す.
%</ja>
-\begin{lstlisting}
+\begin{lstlisting}[escapechar=\!]
\ltjdefcharrange{4}{%
"500-"10FF, "1200-"1DFF, "2440-"245F, "27C0-"28FF, "2A00-"2AFF,
"2C00-"2E7F, "4DC0-"4DFF, "A4D0-"A95F, "A980-"ABFF, "E000-"F8FF,
"FB00-"FE0F, "FE20-"FE2F, "FE70-"FEFF, "10000-"1AFFF, "1B170-"1F0FF,
- "1F300-"1FFFF, ... (characters in "2000-"206F which are not in range 9)
+ "1F300-"1FFFF, ... !\rmfamily (and characters in \texttt{U+2000}--\texttt{U+206F} which are not in range 9)!
} % non-Japanese
\end{lstlisting}
%<en>\item[Range~5${}^{\text{A}}$] Surrogates and Supplementary Private Use Areas.
@@ -11105,6 +11094,15 @@ Adobe-CNS1-*&ltj-cid-auto-adobe-cns1.\{lua.gz,luc\}&UniCNS-UTF32-*&Adobe-CNS1-UC
\end{table}
%<*ja>
+\item[ltj-kinsoku\_default.\{lua.gz,luc\}]
+禁則処理,\Param{kansujichar}などの標準設定が格納されたファイルである.
+%</ja>
+%<*en>
+\item[ltj-kinsoku.luc]
+The bytecode cache which default \textit{kinsoku} parameters are stored.
+%</en>
+
+%<*ja>
\item[ltj-jisx0208.luc]
\LuaTeX-ja配布中の\texttt{ltj-jisx0208.lua}をバイトコード化したものである.
これはJIS~X~0208とUnicodeとの変換テーブルであり,
diff --git a/macros/luatex/generic/luatexja/src/lltjext.sty b/macros/luatex/generic/luatexja/src/lltjext.sty
index 9e1421b130..d19db9ab61 100644
--- a/macros/luatex/generic/luatexja/src/lltjext.sty
+++ b/macros/luatex/generic/luatexja/src/lltjext.sty
@@ -738,7 +738,6 @@
\lineskip\z@skip\baselineskip\z@skip\@preamble}
\def\endarray{\crcr\egroup\egroup\@end@alignbox\@arrayright}
}
-
\@ifpackageloaded{array}{%
\let\tabular=\ltj@lltjext@orig@tabular
\let\array=\ltj@lltjext@orig@array
@@ -746,8 +745,7 @@
}{%
\let\ltj@lltjext@orig@tabular\relax
\let\ltj@lltjext@orig@array\relax
- \RequirePackage{filehook,etoolbox}
- \AtEndOfPackageFile{array}{\ltj@lltjext@patch@array}
+ \ltj@ExecuteAfterPackage{array}{\ltj@lltjext@patch@array}
}
%%%%%%%%%%%%%%%% LuaTeX-ja original
diff --git a/macros/luatex/generic/luatexja/src/ltj-base.sty b/macros/luatex/generic/luatexja/src/ltj-base.sty
index 605797f3a3..622b387723 100644
--- a/macros/luatex/generic/luatexja/src/ltj-base.sty
+++ b/macros/luatex/generic/luatexja/src/ltj-base.sty
@@ -13,7 +13,7 @@
\ifltj@in@latex %<*LaTeX>
\NeedsTeXFormat{LaTeX2e}
- \ProvidesPackage{ltj-base}[2020-07-27]
+ \ProvidesPackage{ltj-base}[2020-08-04]
\fi %</LaTeX>
%%------------------ Tiny helpers
@@ -96,13 +96,6 @@
%! plain であるか.
\ltj@csletcs{ifltj@in@plain}{iffalse}
-%% \ltj@require@package{<package>}{<date>}
-%! サブパッケージを読み込む. LaTeX では \RequirePackage、それ以外では
-%! \input を使う. <date> は必須だが空でもよい.
-\def\ltj@require@package#1#2{
- \RequirePackage{#1}[#2]
-}
-
%% \ltj@print{<message>}
%! 端末への出力.
\let\ltj@print\typeout
@@ -116,11 +109,6 @@
\ltj@csletcs{ifltj@in@plain}{iffalse}
\fi
-%% \ltj@require@package{<package>}{<date>}
-\def\ltj@require@package#1#2{
- \input #1.sty\relax
-}
-
%% \ltj@print{<message>}
\def\ltj@print#1{
\immediate\write16{#1}
@@ -299,6 +287,7 @@
%% from Sonja Maus, ``Looking Ahead for a <box>'',
%% TUGBoat, 11, No. 4, 1990.
\newbox\ltj@afbox
+\directlua{luatexja.afbox_number=\the\ltj@afbox}
\protected\def\ltj@afterbox#1{%
\def\ltj@afb@xarg{#1}%
\afterassignment\ltj@afb@x
diff --git a/macros/luatex/generic/luatexja/src/ltj-direction.lua b/macros/luatex/generic/luatexja/src/ltj-direction.lua
index 523397d804..4c6c3b6bd7 100644
--- a/macros/luatex/generic/luatexja/src/ltj-direction.lua
+++ b/macros/luatex/generic/luatexja/src/ltj-direction.lua
@@ -900,8 +900,7 @@ do
local sd = to_direct(s)
local box_dir = get_box_dir(sd, dir_yoko)
if box_dir%dir_math_mod ~= list_dir then
- setbox(
- 'ltj@afbox',
+ setbox('ltj@afbox',
to_node(copy_list(make_dir_whatsit(sd, sd, list_dir, 'box_move')))
-- copy_list しないとリストの整合性が崩れる……?
)
@@ -1059,8 +1058,7 @@ do
local finalize_inner
local function finalize_dir_node(db,new_dir)
local b = getlist(db)
- if getid(b)==id_whatsit and getsubtype(b)==sid_user
- and getfield(b, 'user_id')==DIR then
+ while b and ((getid(b)~=id_hlist) and (getid(b)~=id_vlist)) do
local ob = b; b = node_remove(b,b); setfield(db, 'head', b);
node_free(ob)
end
@@ -1115,19 +1113,21 @@ do
end
end
end
- local getbox = tex.getbox
+ local getbox, shipout = tex.getbox, tex.shipout
local setbox, copy = node.direct.setbox, node.direct.copy
- local lua_mem_kb = 0
- function luatexja.direction.finalize()
- local a = to_direct(tex.getbox("AtBeginShipoutBox"))
+ local afbox
+ function luatexja.direction.shipout()
+ start_time_measure 'box_primitive_hook'
+ if (not afbox) and luatexja.afbox_number then afbox = luatexja.afbox_number end
+ local a = to_direct(getbox 'ltj@afbox')
local a_dir = get_box_dir(a, dir_yoko)
if a_dir~=dir_yoko then
local b = create_dir_node(a, a_dir, dir_yoko, false)
setfield(b, 'head', a); a = b
end
- setfield(shipout_temp, 'head', a)
- finalize_inner(shipout_temp)
- setbox('global', "AtBeginShipoutBox", copy(getlist(shipout_temp)))
- setfield(shipout_temp, 'head',nil)
+ setfield(shipout_temp, 'head', a); finalize_inner(shipout_temp)
+ setbox(afbox, copy(getlist(shipout_temp))); setfield(shipout_temp, 'head',nil)
+ shipout(afbox)
+ stop_time_measure 'box_primitive_hook'
end
end
diff --git a/macros/luatex/generic/luatexja/src/ltj-kinsoku_make.tex b/macros/luatex/generic/luatexja/src/ltj-kinsoku.tex
index 5d25ff0f11..d5b9c183b7 100644
--- a/macros/luatex/generic/luatexja/src/ltj-kinsoku_make.tex
+++ b/macros/luatex/generic/luatexja/src/ltj-kinsoku.tex
@@ -1,27 +1,22 @@
-%#!luatex ltj-kinsoku_make.tex
-%\tracingall
-\input luatexja.sty
-
-\catcode`\@=11
\ltj@tempcnta="0%"
\loop\ifnum\ltj@tempcnta<"100%"
\ltjsetparameter{alxspmode={\ltj@tempcnta,0}}%
\advance\ltj@tempcnta by1
\repeat
-\ltj@tempcnta=`\0%"
-\loop\ifnum\ltj@tempcnta<`\:%"
+\ltj@tempcnta=`0%"
+\loop\ifnum\ltj@tempcnta<`:%"
\ltjsetparameter{alxspmode={\ltj@tempcnta,3}}%
\advance\ltj@tempcnta by1
\repeat
-\ltj@tempcnta=`\A%"
-\loop\ifnum\ltj@tempcnta<`\[%"
+\ltj@tempcnta=`A%"
+\loop\ifnum\ltj@tempcnta<`[%"
\ltjsetparameter{alxspmode={\ltj@tempcnta,3}}%
\advance\ltj@tempcnta by1
\repeat
-\ltj@tempcnta=`\a%"
+\ltj@tempcnta=`a%"
\loop\ifnum\ltj@tempcnta<`\{%"
\ltjsetparameter{alxspmode={\ltj@tempcnta,3}}%
\advance\ltj@tempcnta by1
@@ -446,11 +441,28 @@
\ltjsetparameter{jaxspmode={`「,preonly}}
\ltjsetparameter{jaxspmode={`」,postonly}}
-\catcode`\_=12
-\directlua{
- s = table.copy(luatexja.stack.charprop_stack_table[0])
- s.kanjiskip = nil; s.xkanjiskip = nil
- table.tofile('ltj-kinsoku.lua', s, 'return', false, true, false)
+\ltjsetparameter{%
+ kanjiskip=\z@ plus .4pt minus .5pt,
+ xkanjiskip=2.40554pt plus 1pt minus 1pt,
+ yalbaselineshift=\z@, yjabaselineshift=\z@,
+ jcharwidowpenalty=500
}
-\bye
+% default setting of kansujichar (luatexja-compat)
+\define@key[ltj]{japaram}{kansujichar}{\ltj@@set@stack{KSJ}{0}{0x7FFFFFFF}#1 }
+
+\ltjsetparameter{kansujichar={0,`〇}}
+\ltjsetparameter{kansujichar={1,`一}}
+\ltjsetparameter{kansujichar={2,`二}}
+\ltjsetparameter{kansujichar={3,`三}}
+\ltjsetparameter{kansujichar={4,`四}}
+\ltjsetparameter{kansujichar={5,`五}}
+\ltjsetparameter{kansujichar={6,`六}}
+\ltjsetparameter{kansujichar={7,`七}}
+\ltjsetparameter{kansujichar={8,`八}}
+\ltjsetparameter{kansujichar={9,`九}}
+
+\directlua{%
+ local s = table.copy(luatexja.stack.charprop_stack_table[0])
+ luatexja.base.save_cache('ltj-kinsoku_default', {s, version=1})
+}
diff --git a/macros/luatex/generic/luatexja/src/ltj-latex.sty b/macros/luatex/generic/luatexja/src/ltj-latex.sty
index ca774fe8cd..55fd5d4ebd 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-05-17 LaTeX support of LuaTeX-ja]
+\ProvidesPackage{ltj-latex}[2020-08-08 LaTeX support of LuaTeX-ja]
% cleanup at end of the document
%\let\ltj@@orig@end=\@@end
@@ -27,45 +27,49 @@
\usepackage{lltjcore}
%%% patching commands
-\RequirePackage{filehook}
-
-\def\ltj@pkgpatch@im#1{%
- \@ifnextchar[{\ltj@pkgpatch@im@{#1}}{\ltj@pkgpatch@im@{#1}[lltjp-#1]}}%]
-\def\ltj@pkgpatch@im@#1[#2]{%
- \AtEndOfPackageFile*{#1}{%
- \@ifpackageloaded{#2}{}{%
- \@namedef{ver@#2.\@pkgextension}{0000/00/00}%dummy
- \if\catcode`@=11\let\ltj@temp\relax\else
- \edef\ltj@temp{\noexpand\catcode`@=\the\catcode`@\relax}\makeatletter
- \fi
- \@@input{#2.\@pkgextension}\ltj@temp
- }%
+\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
+}{}
+\ifltj@ltfilehook@avail
+ \def\@@ltj@ExecuteAfterPackage#1{\AddToHook{package/after/#1}}
+ \def\@@ltj@ExecuteBeforePackage#1{\AddToHook{package/before/#1}}
+ \def\ltj@ExecuteAfterPackage{\@ifstar\@@ltj@ExecuteAfterPackage@star\@@ltj@ExecuteAfterPackage}
+ \def\@@ltj@ExecuteAfterPackage@star#1#2{%
+ \@ifpackageloaded{#1}{#2}{\@@ltj@ExecuteAfterPackage{#1}{#2}}%
+ }
+ \def\ltj@ExecuteBeforePackage{\@ifstar\@@ltj@ExecuteBeforePackage@star\@@ltj@ExecuteBeforePackage}
+ \def\@@ltj@ExecuteBeforePackage@star#1#2{%
+ \@ifpackageloaded{#1}{#2}{\@@ltj@ExecuteBeforePackage{#1}{#2}}%
+ }
+\else
+ \RequirePackage{filehook}
+ \let\ltj@ExecuteAfterPackage=\AtEndOfPackageFile
+ \let\ltj@ExecuteBeforePackage=\AtBeginOfPackageFile
+\fi
+\def\ltj@pkgpatch@im#1{\@ifnextchar[{\ltj@pkgpatch@im@{#1}}{\ltj@pkgpatch@im@{#1}[lltjp-#1]}}%]
+\def\ltj@pkgpatch@im@#1[#2]{\ltj@ExecuteAfterPackage*{#1}{\ltj@pkgpatch@im@@{#2}}}
+\def\ltj@pkgpatch@im@@#1{%
+ \@ifpackageloaded{#1}{}{%
+ \if\catcode`@=11\let\ltj@temp\relax\else
+ \edef\ltj@temp{\noexpand\catcode`@=\the\catcode`@\relax}\makeatletter
+ \fi
+ \@@input{#1.\@pkgextension}\ltj@temp
}%
}
-\def\ltj@pkgpatch#1{%
- \@ifnextchar[{\ltj@pkgpatch@@{#1}}{\ltj@pkgpatch@@{#1}[lltjp-#1]}}%]
-\def\ltj@pkgpatch@@#1[#2]{%
- \gpreto\@begindocumenthook{%
- \@ifpackageloaded{#1}{%
- \@ifpackageloaded{#2}{}{\RequirePackage{#2}}%
- }{}%
+\def\ltj@pkgpatch#1{\@ifnextchar[{\ltj@pkgpatch@{#1}}{\ltj@pkgpatch@{#1}[lltjp-#1]}}%]
+\ifltj@ltfilehook@avail
+ \def\ltj@pkgpatch@@{\AddToHook{env/document/before}[luatexja.autopatch]}
+\else
+ \def\ltj@pkgpatch@@{\gpreto\@begindocumenthook}
+\fi
+\def\ltj@pkgpatch@#1[#2]{%
+ \ltj@pkgpatch@@{%
+ \@ifpackageloaded{#1}{\@ifpackageloaded{#2}{}{\RequirePackage{#2}}}{}%
}%
}
-
-%%% default parameters
-\directlua{
- local s = kpse.find_file('ltj-kinsoku.lua', 'tex')
- luatexja.stack.charprop_stack_table[0] = s and dofile(s) or {}
-}
-
-\ltjsetparameter{kanjiskip=\z@ plus .4pt minus .5pt,
- xkanjiskip=.25\zw plus 1pt minus 1pt,
- autospacing, autoxspacing, jacharrange={-1},
- yalbaselineshift=\z@, yjabaselineshift=\z@,
- jcharwidowpenalty=500, differentjfm=paverage
-}
-
\expandafter\let\csname JY3/mc/m/n/10\endcsname\relax
%%% patch for packages
@@ -83,7 +87,8 @@
\ltj@pkgpatch@im{unicode-math}
\ltj@pkgpatch@im{siunitx}
\ltj@pkgpatch@im{microtype}
-\ltj@pkgpatch@im{everyshi}
+
+\ifltj@ltshipout@avail\else\ltj@pkgpatch@im{everyshi}\fi
\RequirePackage{lltjp-geometry}
diff --git a/macros/luatex/generic/luatexja/src/ltj-plain.sty b/macros/luatex/generic/luatexja/src/ltj-plain.sty
index 16e71e1060..58baa9ff9d 100644
--- a/macros/luatex/generic/luatexja/src/ltj-plain.sty
+++ b/macros/luatex/generic/luatexja/src/ltj-plain.sty
@@ -57,16 +57,8 @@
\def\gt{\tengt\tentgt}
\mc
-\directlua{
- local s = kpse.find_file('ltj-kinsoku.lua', 'tex')
- luatexja.stack.charprop_stack_table[0] = s and dofile(s) or {}
-}
-
-\ltjsetparameter{kanjiskip=\z@ plus .4pt minus .4pt,
- xkanjiskip=.25\zw plus 1pt minus 1pt,
- autospacing, autoxspacing, jacharrange={-1},
- yalbaselineshift=\z@, yjabaselineshift=\z@,
- jcharwidowpenalty=500, differentjfm=paverage,
+\ltjsetparameter{%
+ autospacing, autoxspacing, differentjfm=paverage,
jatextfont={0, \tenmin}, jascriptfont={0, \sevenmin},
jascriptscriptfont={0, \fivemin},
}
diff --git a/macros/luatex/generic/luatexja/src/ltjclasses.dtx b/macros/luatex/generic/luatexja/src/ltjclasses.dtx
index dd156b3393..a868bcb58e 100644
--- a/macros/luatex/generic/luatexja/src/ltjclasses.dtx
+++ b/macros/luatex/generic/luatexja/src/ltjclasses.dtx
@@ -133,6 +133,7 @@
% 新設の|ptexmin|オプション指定時にのみ行うようにした。
% 句読点を「、」「。」に統一。}
% \changes{v1.8e-ltj-19}{2020/07/27}{|everyshi|パッケージへのパッチを別パッケージへ分離。}
+% \changes{v1.8e-ltj-20}{2020/08/03}{\LaTeX~2020-10-01への対応.}
% \fi
%
% \iffalse
@@ -4706,8 +4707,12 @@
% \section{各種パッケージへの対応}
% もともと縦組での利用を想定されていないいくつかのパッケージについて、
% 補正するためのコードを記述しておきます。
-% この節のコードは|filehook|パッケージ(Lua\TeX-ja読み込み時に自動でロードされます)
-% の機能を用いています。
+%% この節のコードは|filehook|パッケージ(Lua\TeX-ja読み込み時に自動でロードされます)
+%% の機能を用いています。
+%
+% [2020-08-03 LTJ] \LaTeX\~2020-10-01に対応するため、Lua\TeX-jaの提供する命令
+% (|filehook|パッケージの命令の別名か、新\LaTeX のフック機構を利用して同様の内容を書いたもの)
+% に置き換えました。
%
% \subsection{\texttt{ftnright}パッケージ}
% 脚注番号の書式が|ftnright|パッケージによって勝手に書き換えられるので、
@@ -4715,8 +4720,8 @@
% \changes{v1.7d}{2017/02/19}{コード追加}
% \begin{macrocode}
%<*article|report|book>
-\AtBeginOfPackageFile*{ftnright}{\let\ltjt@orig@@makefntext=\@makefntext}
-\AtEndOfPackageFile*{ftnright}{\let\@makefntext=\ltjt@orig@@makefntext}
+\ltj@ExecuteBeforePackage*{ftnright}{\let\ltjt@orig@@makefntext=\@makefntext}
+\ltj@ExecuteAfterPackage*{ftnright}{\let\@makefntext=\ltjt@orig@@makefntext}
%</article|report|book>
% \end{macrocode}
%
diff --git a/macros/luatex/generic/luatexja/src/luatexja-compat.sty b/macros/luatex/generic/luatexja/src/luatexja-compat.sty
index f55bf51114..2d6d053979 100644
--- a/macros/luatex/generic/luatexja/src/luatexja-compat.sty
+++ b/macros/luatex/generic/luatexja/src/luatexja-compat.sty
@@ -65,7 +65,7 @@
\expandafter\let\csname ifltj@in@latex\expandafter\endcsname
\csname iftrue\endcsname
\NeedsTeXFormat{LaTeX2e}
- \ProvidesPackage{luatexja-compat}[2018/03/29 Compatibility with pTeX]
+ \ProvidesPackage{luatexja-compat}[2020-08-08 Compatibility with pTeX]
\fi %</LaTeX>
% Load core module if not yet.
@@ -99,26 +99,10 @@
\def\sjis{\ltj@code@conv{sjis}}
\def\ucs{\ltj@code@conv{ucs}}
-\def\ltj@code@conv#1{%
- \directlua{luatexja.compat.from_#1(token.scan_int())}%
-}
-
-\def\kansuji{%
- \directlua{luatexja.compat.to_kansuji(token.scan_int())}%
-}
+\def\ltj@code@conv#1{\directlua{luatexja.compat.from_#1(token.scan_int())}}
+\def\kansuji{\directlua{luatexja.compat.to_kansuji(token.scan_int())}}
\define@key[ltj]{japaram}{kansujichar}{\ltj@@set@stack{KSJ}{0}{0x7FFFFFFF}#1 }
-
-\ltjsetparameter{kansujichar={0,`〇}}
-\ltjsetparameter{kansujichar={1,`一}}
-\ltjsetparameter{kansujichar={2,`二}}
-\ltjsetparameter{kansujichar={3,`三}}
-\ltjsetparameter{kansujichar={4,`四}}
-\ltjsetparameter{kansujichar={5,`五}}
-\ltjsetparameter{kansujichar={6,`六}}
-\ltjsetparameter{kansujichar={7,`七}}
-\ltjsetparameter{kansujichar={8,`八}}
-\ltjsetparameter{kansujichar={9,`九}}
\ltj@@decl@array@param{kansujichar}
\ifltj@in@latex
diff --git a/macros/luatex/generic/luatexja/src/luatexja-core.sty b/macros/luatex/generic/luatexja/src/luatexja-core.sty
index 4acc74cb32..fee1a78a2f 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-07-27 Core of LuaTeX-ja]
+ \ProvidesPackage{luatexja-core}[2020-08-08 Core of LuaTeX-ja]
\fi %</LaTeX>
%% Load prerequisite packages.
@@ -80,7 +80,6 @@
\RequirePackage{xkeyval} [2012/10/14] % v2.6b
\RequirePackage{etoolbox}
\RequirePackage{lltjp-atbegshi}
- \AtBeginShipoutInit
\IfFileExists{everyhook.sty}{\RequirePackage{everyhook}\ltj@everyhook@availtrue}{}
\else %<*!LaTeX>
\input luatexbase.sty
@@ -88,8 +87,6 @@
\input ltxcmds.sty
\input pdftexcmds.sty
\input xkeyval
- \input lltjp-atbegshi.sty
- \AtBeginShipoutInit
\fi %</LaTeX>
\endlinechar=-1 %
@@ -619,7 +616,7 @@
%%%% \hbox, \vbox, \vtop
\setbox\z@\hbox{%
- \primitive\everymath{}
+ \primitive\everymath{}%
$\directlua{% This value depends on the version of LuaTeX.
luatexja.stack.mmode = -tex.nest[tex.nest.ptr].mode
}$%
@@ -655,8 +652,6 @@
\protected\def\ltj@@reset@badness{\luafunction\ltj@@reset@badness@inner}
-\AtBeginShipout{\directlua{luatexja.direction.finalize()}}
-
%%%% \raise, \lower, \moveleft, \moveright
\newluafunction\ltj@@lua@raisebox@inner
\directlua{
@@ -686,6 +681,7 @@
%%%%\vsplit
\let\ltj@@orig@vsplit=\vsplit
\protected\def\vsplit{\directlua{luatexja.direction.vsplit()}}
+
%%%% \vcenter
\let\ltj@@orig@vcenter=\vcenter
\protected\def\vcenter{\ltj@afterbox\ltj@@vcenter\vbox}
@@ -693,6 +689,21 @@
\ltj@@lua@raisebox\ltj@@orig@vcenter{\box\ltj@afbox}%
}
+%%%% \shipout
+\newluafunction\ltj@@lua@shipout@inner
+\directlua{
+ local t = lua.get_functions_table()
+ t[\the\ltj@@lua@shipout@inner]=luatexja.direction.shipout
+}
+\protected\luadef\ltj@@lua@shipout\ltj@@lua@shipout@inner
+\protected\def\ltj@shipout{\ltj@afterbox\ltj@@lua@shipout}
+\ifprimitive\shipout\let\shipout\ltj@shipout\fi
+\ifcsname tex_shipout:D\endcsname
+ \expandafter\let\csname tex_shipout:D\endcsname\ltj@shipout
+\fi
+\ifdefined\AtBeginShipoutOriginalShipout
+ \let\AtBeginShipoutOriginalShipout\ltj@shipout
+\fi
%%%% \unhbox and \unvbox
\newluafunction\ltj@@lua@unboxcheckdir@inner
\directlua{
@@ -745,6 +756,7 @@
%%------------------ Load module for the format
+\directlua{luatexja.load_kinsoku()}
\ifltj@in@latex %<*LaTeX>
\RequirePackage{ltj-latex}
\else\ifltj@in@plain %<*plain>
diff --git a/macros/luatex/generic/luatexja/src/luatexja.lua b/macros/luatex/generic/luatexja/src/luatexja.lua
index 988f51955e..074d050276 100644
--- a/macros/luatex/generic/luatexja/src/luatexja.lua
+++ b/macros/luatex/generic/luatexja/src/luatexja.lua
@@ -347,6 +347,22 @@ do
end
end
+do
+ local cache_ver = 1 -- must be same as ltj-kinsoku.tex
+ local cache_outdate_fn = function (t) return t.version~=cache_ver end
+ local t = ltjs.charprop_stack_table
+ function luatexja.load_kinsoku()
+ for i,_ in pairs(t) do t[i]=nil end
+ local kinsoku = ltjb.load_cache('ltj-kinsoku_default',cache_outdate_fn)
+ if kinsoku and kinsoku[1] then
+ t[0] = kinsoku[1]
+ else
+ t[0] = {}; tex.print(cat_lp, '\\input ltj-kinsoku.tex\\relax')
+ end
+ luatexja.load_kinsoku=nil
+ end
+end
+
-- debug
do
@@ -372,8 +388,7 @@ local function debug_show_node_X(p,print_fn, limit, inner_depth)
local k = prefix
local s
local pt, pic = node_type(p.id), (has_attr(p, attr_icflag) or 0) % icflag_table.PROCESSED_BEGIN_FLAG
- local base = prefix .. string.format('%X', pic)
- .. ' ' .. pt .. ' ' .. tostring(p.subtype) .. ' '
+ local base = prefix .. string.format('%X', pic) .. ' ' .. pt .. ' ' .. tostring(p.subtype) .. ' '
if pt == 'glyph' then
s = base .. ' '
.. (p.char<0xF0000 and utfchar(p.char) or '')
@@ -505,6 +520,9 @@ local function debug_show_node_X(p,print_fn, limit, inner_depth)
for i=1,#p.data do
print_fn(s .. ' [' .. i .. '] = ' .. tostring(p.data[i].csname))
end
+ elseif p.subtype==16 then
+ s = s .. ' mode=' .. p.mode .. ', literal="' .. p.data .. '"'
+ print_fn(s)
else
print_fn(s)
end
diff --git a/macros/luatex/generic/luatexja/src/luatexja.sty b/macros/luatex/generic/luatexja/src/luatexja.sty
index d51b575f76..0f16a8c190 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-08-02 Japanese Typesetting with Lua(La)TeX]
+ \ProvidesPackage{luatexja}[2020-08-08 Japanese Typesetting with Lua(La)TeX]
\DeclareOption{disablejfam}{\ltj@disablejfamtrue}
\DeclareOption*{}
\ProcessOptions\relax
\fi %</LaTeX>
%%%% VERSION
-\def\LuaTeXjaversion{20200802.0}
+\def\LuaTeXjaversion{20200808.0}
\directlua{require('ltj-unicode-ccfix.lua')}% catcode of ideographs
diff --git a/macros/luatex/generic/luatexja/src/patches/lltjdefs.sty b/macros/luatex/generic/luatexja/src/patches/lltjdefs.sty
index e0dba37547..76a3147036 100644
--- a/macros/luatex/generic/luatexja/src/patches/lltjdefs.sty
+++ b/macros/luatex/generic/luatexja/src/patches/lltjdefs.sty
@@ -3,12 +3,10 @@
%
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{lltjdefs}[2020/03/16 Default font settings of LuaTeX-ja]
+\ProvidesPackage{lltjdefs}[2020-08-08 Default font settings of LuaTeX-ja]
\ifdefined\ltj@stdmcfont\else\def\ltj@stdmcfont{file:HaranoAjiMincho-Regular.otf}\fi
\ifdefined\ltj@stdgtfont\else\def\ltj@stdgtfont{file:HaranoAjiGothic-Medium.otf}\fi
-%\ifdefined\ltj@stdmcfont\else\def\ltj@stdmcfont{IPAExMincho}\fi
-%\ifdefined\ltj@stdgtfont\else\def\ltj@stdgtfont{IPAExGothic}\fi
\ifdefined\ltj@stdyokojfm\else\def\ltj@stdyokojfm{ujis}\fi
\ifdefined\ltj@stdtatejfm\else\def\ltj@stdtatejfm{ujisv}\fi
\InputIfFileExists{luatexja.cfg}{%
@@ -34,11 +32,9 @@
\newcommand\kanjiencodingdefault{JY3}
\newcommand\kanjifamilydefault{\mcdefault}
\newcommand\kanjiseriesdefault{\mddefault}
-\ifdefined\@rmfamilyhook
- %% LaTeX 2020-02-02
+\ifdefined\@rmfamilyhook%% LaTeX 2020-02-02
\newcommand\kanjishapedefault{\shapedefault}
-\else
- %% LaTeX 2019-10-01
+\else %% LaTeX 2019-10-01
\newcommand\kanjishapedefault{\updefault}
\fi
@@ -78,8 +74,7 @@
\DeclareOldFontCommand{\gt}{\normalfont\gtfamily}{}
\unless\ifltj@disablejfam
- \DeclareSymbolFont{mincho}{JY3}{mc}{m}{n}
- \jfam\symmincho
+ \DeclareSymbolFont{mincho}{JY3}{mc}{m}{n}\jfam\symmincho
\SetSymbolFont{mincho}{bold}{JY3}{gt}{m}{n}
\DeclareSymbolFontAlphabet{\mathmc}{mincho}
\DeclareMathAlphabet{\mathgt}{JY3}{gt}{m}{n}
@@ -132,6 +127,8 @@
\expandafter\patchcmd\csname em \endcsname{\itshape}{\gtfamily\itshape}{}{}
\def\eminnershape{\mcfamily \upshape}
+\ltjsetparameter{autospacing, autoxspacing, differentjfm=paverage}
+
\ltjdefcharrange{1}{"80-"36F, "1E00-"1EFF}
\ltjdefcharrange{2}{"370-"4FF, "1F00-"1FFF}
\ltjdefcharrange{3}{%
diff --git a/macros/luatex/generic/luatexja/src/patches/lltjp-atbegshi.sty b/macros/luatex/generic/luatexja/src/patches/lltjp-atbegshi.sty
index ecdfd48c22..8512023874 100644
--- a/macros/luatex/generic/luatexja/src/patches/lltjp-atbegshi.sty
+++ b/macros/luatex/generic/luatexja/src/patches/lltjp-atbegshi.sty
@@ -2,23 +2,40 @@
% lltjp-atbegshi.sty
%
-\ifdefined\NeedsTeXFormat
- \NeedsTeXFormat{LaTeX2e}
- \ProvidesPackage{lltjp-atbegshi}[2020-07-30 Patch to atbegshi for LuaTeX-ja]
- \RequirePackage{atbegshi}
-\else
- \input atbegshi.sty
-\fi
+\newif\ifltj@ltshipout@avail
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesPackage{lltjp-atbegshi}[2020-08-08 Patching \string\shipout\space hooks for LuaTeX-ja]
+\@ifl@t@r\fmtversion{2020-10-01}{%
+ \ifnum\patch@level<0\relax \ifnum\patch@level<-6 \ltj@ltshipout@availtrue\fi
+ \else\ltj@ltshipout@availtrue\fi
+}{}
+\ifltj@ltshipout@avail\else\RequirePackage{atbegshi}\fi
+
+% concept: execute all hooks inside yoko direction \vbox
-%--------------------------------------
-% following codes are almost copied from
-% pxatbegshi.sty 2019/09/07 v0.5 (in platex-tools bundle, by H. Yamashita).
+\ifltj@ltshipout@avail
+%<*ltshipout>-----------------------------------
+%
+\RequirePackage{expl3}
+\ExplSyntaxOn\makeatletter
+\box_new:N \l__platex_shipout_dummy_box
+\pretocmd {\__shipout_execute_cont:}
+ {\tex_setbox:D \l__platex_shipout_dummy_box \tex_vbox:D \c_group_begin_token \yoko } {} {}
+\apptocmd {\__shipout_execute_cont:} {\c_group_end_token} {} {}
+\ExplSyntaxOff
+%</ltshipout>-----------------------------------
+
+\else
+\AtBeginShipoutInit
+%<*atbegshi>-------------------------------------
+% patching atbegshi.sty
+%%% following codes are almost copied from
+%%% pxatbegshi.sty 2019/09/07 v0.5 (in platex-tools bundle, by H. Yamashita).
%% internal macros are locally effective
\begingroup
-%--------------------------------------- helpers
-
+% helpers
%% unique tokens
\def\pxabgs@mark{\pxabgs@mark@}
\def\pxabgs@fin{\pxabgs@fin@}
@@ -27,29 +44,25 @@
\def\pxabgs@patch@cmd#1#2#3{%
\ifx#1\relax\else
\def\pxabgs@next##1#2##2\pxabgs@mark##3\pxabgs@fin{%
- \ifx\pxabgs@mark##3\pxabgs@mark
- \let#1\relax
+ \ifx\pxabgs@mark##3\pxabgs@mark\let#1\relax
\else
- \def\pxabgs@fragment{##2}%
- \def#1{##1#3##2}%
+ \def\pxabgs@fragment{##2}\def#1{##1#3##2}%
\fi}%
\expandafter\pxabgs@next#1\pxabgs@mark#2\pxabgs@mark\pxabgs@fin
\fi
}
-%---------------------------------------
-
-% concept: execute all hooks inside yoko direction \vbox
-
% prepare
-\let\pxabgs@AtBegShi@Output\AtBegShi@Output
+\ifdefined\AtBegShi@Output
+ \let\pxabgs@AtBegShi@Output\AtBegShi@Output
+\else\let\pxabgs@AtBegShi@Output\relax\fi
% try first patch
\pxabgs@patch@cmd\pxabgs@AtBegShi@Output
{\let\AtBegShi@OrgProtect\protect}%
{\setbox8\vbox\bgroup\yoko\let\AtBegShi@OrgProtect\protect}
\pxabgs@patch@cmd\pxabgs@AtBegShi@Output
- {\AtBeginShipoutOriginalShipout\box\AtBeginShipoutBox}%
- {\AtBeginShipoutOriginalShipout\box\AtBeginShipoutBox\egroup}
+ {\AtBeginShipoutOriginalShipout\box\AtBeginShipoutBox}%
+ {\AtBeginShipoutOriginalShipout\box\AtBeginShipoutBox\egroup}
\pxabgs@patch@cmd\pxabgs@AtBegShi@Output
{%
\begingroup
@@ -75,5 +88,6 @@
\endgroup
%% internal macros are no longer effective
-
+%</atbegshi>-------------------------------------
+\fi
\endinput
diff --git a/macros/luatex/generic/luatexja/src/patches/lltjp-geometry.sty b/macros/luatex/generic/luatexja/src/patches/lltjp-geometry.sty
index 9b8f1fc7a1..eba249fa5e 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/02/25 Patch to geometry for LuaTeX-ja with vertical writing mode]
+\ProvidesPackage{lltjp-geometry}[2020-08-05 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
@@ -29,33 +29,65 @@
}
\fi
-\RequirePackage{filehook}
+%============================================
+\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
+}{}
+\ifltj@ltfilehook@avail
+ \def\@@ltj@ExecuteAfterPackage#1{\AddToHook{package/after/#1}}
+ \def\@@ltj@ExecuteBeforePackage#1{\AddToHook{package/before/#1}}
+ \def\ltj@ExecuteAfterPackage{\@ifstar\@@ltj@ExecuteAfterPackage@star\@@ltj@ExecuteAfterPackage}
+ \def\@@ltj@ExecuteAfterPackage@star#1#2{%
+ \@ifpackageloaded{#1}{#2}{\@@ltj@ExecuteAfterPackage{#1}{#2}}%
+ }
+ \def\ltj@ExecuteBeforePackage{\@ifstar\@@ltj@ExecuteBeforePackage@star\@@ltj@ExecuteBeforePackage}
+ \def\@@ltj@ExecuteBeforePackage@star#1#2{%
+ \@ifpackageloaded{#1}{#2}{\@@ltj@ExecuteBeforePackage{#1}{#2}}%
+ }
+\else
+ \RequirePackage{filehook}
+ \let\ltj@ExecuteAfterPackage=\AtEndOfPackageFile
+ \let\ltj@ExecuteBeforePackage=\AtBeginOfPackageFile
+\fi
+\fi
+%============================================
+
\RequirePackage{etoolbox}
\newif\ifGm@ltj@layoutswitch
\let\orig@PackageWarningNoLine=\PackageWarningNoLine
% define ifGm@swap@papersize if it is undefined
\expandafter\newif\csname ifGm@swap@papersize\endcsname
-\AtBeginOfPackageFile{geometry}{%
+\ExplSyntaxOn
+\ltj@ExecuteBeforePackage{geometry}{%
\edef\Gm@ltj@topskip{\the\topskip}
\edef\Gm@ltj@headsep{\the\headsep}
\edef\Gm@ltj@footskip{\the\footskip}
+\bool_set_false:N \l_tmpa_bool
\ifluatex
- \ifnum\ltjgetparameter{direction}=3 \@ltj@@geometry@tatetrue\fi
+ \ifnum\ltjgetparameter{direction}=3 \bool_set_true:N \l_tmpa_bool \fi
\else
- \@gobble\iftrue\csname iftdir\endcsname\@ltj@@geometry@tatetrue\fi
+ \@gobble\iftrue\csname iftdir\endcsname \bool_set_true:N \l_tmpa_bool \fi
\fi
-\csname tl_if_in:NnT\endcsname\@begindocumenthook{\tate}{\@ltj@@geometry@tatetrue}
-\if@ltj@@geometry@tate
+\ifltj@ltfilehook@avail
+ \prop_map_inline:Nn \g__hook_begindocument_code_prop
+ { \tl_if_in:nnT {#2} {\tate} {\bool_set_true:N \l_tmpa_bool} }
+\else
+ \tl_if_in:NnT \@begindocumenthook {\tate} {\bool_set_true:N \l_tmpa_bool}
+\fi
+\bool_if:NT \l_tmpa_bool {
\if@ltj@@geometry@forceoff
\@ltj@@geometry@tatefalse
\else
\let\PackageWarningNoLine\@gobbletwo% 警告抑止
\fi
-\fi
}
-
-\AtEndOfPackageFile{geometry}{%
+}
+\ExplSyntaxOff
+\ltj@ExecuteAfterPackage{geometry}{%
\let\PackageWarningNoLine=\orig@PackageWarningNoLine
\if@ltj@@geometry@tate
\let\PackageWarningNoLine=\orig@PackageWarningNoLine