From 2f50ed54eb4616352e1630c3b1c29c9738682458 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Mon, 17 May 2021 20:46:20 +0000 Subject: luatexja (17may21) git-svn-id: svn://tug.org/texlive/trunk@59248 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/doc/luatex/luatexja/README | 8 +- .../texmf-dist/doc/luatex/luatexja/luatexja-en.pdf | Bin 689752 -> 693538 bytes .../texmf-dist/doc/luatex/luatexja/luatexja-ja.pdf | Bin 1124961 -> 1130313 bytes .../doc/luatex/luatexja/luatexja-ruby.pdf | Bin 382321 -> 381339 bytes .../doc/luatex/luatexja/luatexja-ruby.tex | 2 + Master/texmf-dist/doc/luatex/luatexja/luatexja.dtx | 108 ++++++++++++++++++--- 6 files changed, 98 insertions(+), 20 deletions(-) (limited to 'Master/texmf-dist/doc/luatex') diff --git a/Master/texmf-dist/doc/luatex/luatexja/README b/Master/texmf-dist/doc/luatex/luatexja/README index c8513509e7b..e0f26c370c5 100644 --- a/Master/texmf-dist/doc/luatex/luatexja/README +++ b/Master/texmf-dist/doc/luatex/luatexja/README @@ -1,4 +1,4 @@ -The LuaTeX-ja Package 20210319.0 +The LuaTeX-ja Package 20210517.0 -------------------------------- Copyright (c) 2011--2021 The LuaTeX-ja project License: modified BSD (see COPYING) @@ -42,9 +42,9 @@ Installation 2. If you must/want to install manually: a. Download the source archive from CTAN, - or tagged as 20210319.0 in the Git repository by + or tagged as 20210517.0 in the Git repository by + ;a=snapshot;h=refs/tags/20210517.0;sf=tgz> b. Extract the archive and process following three files by LuaLaTeX to generate classes for Japanese typesetting: @@ -93,4 +93,4 @@ Notes This file and ltj-kinsoku.lua are not used anymore. (Do not remove ltj-kinsoku.tex.) -Last commit date: Fri Mar 19 19:52:23 2021 +0900 +Last commit date: Mon May 17 11:57:27 2021 +0900 diff --git a/Master/texmf-dist/doc/luatex/luatexja/luatexja-en.pdf b/Master/texmf-dist/doc/luatex/luatexja/luatexja-en.pdf index e0bc2215fff..12aada4965f 100644 Binary files a/Master/texmf-dist/doc/luatex/luatexja/luatexja-en.pdf and b/Master/texmf-dist/doc/luatex/luatexja/luatexja-en.pdf differ diff --git a/Master/texmf-dist/doc/luatex/luatexja/luatexja-ja.pdf b/Master/texmf-dist/doc/luatex/luatexja/luatexja-ja.pdf index 41f5012b672..8799ab20c8f 100644 Binary files a/Master/texmf-dist/doc/luatex/luatexja/luatexja-ja.pdf and b/Master/texmf-dist/doc/luatex/luatexja/luatexja-ja.pdf differ diff --git a/Master/texmf-dist/doc/luatex/luatexja/luatexja-ruby.pdf b/Master/texmf-dist/doc/luatex/luatexja/luatexja-ruby.pdf index 31dc6d4270f..2ca312ab069 100644 Binary files a/Master/texmf-dist/doc/luatex/luatexja/luatexja-ruby.pdf and b/Master/texmf-dist/doc/luatex/luatexja/luatexja-ruby.pdf differ diff --git a/Master/texmf-dist/doc/luatex/luatexja/luatexja-ruby.tex b/Master/texmf-dist/doc/luatex/luatexja/luatexja-ruby.tex index 08bb579204a..a01994faa70 100644 --- a/Master/texmf-dist/doc/luatex/luatexja/luatexja-ruby.tex +++ b/Master/texmf-dist/doc/luatex/luatexja/luatexja-ruby.tex @@ -853,6 +853,8 @@ $r_2$,~$g_2$を行Bから除去・メモリ解放し,代わりに$n_3$を行B ◆\ruby{A}{◆◆◆◆◆}◆\\◆\ruby{A}{◆◆◆◆◆◆}◆\\◆A◆ \makebox[10\zw][s]{値とは\ruby{\texttt{;}}{セミコロン}で区切}% + + \ltjruby{痛}{いたみ}(\ltjruby{病}{びやう}あ } \fbox{\box0} diff --git a/Master/texmf-dist/doc/luatex/luatexja/luatexja.dtx b/Master/texmf-dist/doc/luatex/luatexja/luatexja.dtx index 7e6ccb9f422..4b1dd88c841 100644 --- a/Master/texmf-dist/doc/luatex/luatexja/luatexja.dtx +++ b/Master/texmf-dist/doc/luatex/luatexja/luatexja.dtx @@ -238,9 +238,6 @@ grammatical (and contextual) errors.} Also, several parts are written in Japanese only. % -%<*ja> -\emph{\large 本ドキュメントはまだまだ未完成です.} -% \clearpage %\part{User's manual} @@ -3371,28 +3368,36 @@ Returned value&\texttt{4}&\texttt{3}&\texttt{1}&\texttt{11}&\texttt{0}\\ % %<*en> -\subsection{Overridden box primitives} -To cope with multiple directions, the following primitives are -overridden by \LuaTeX-ja, using~\verb+\protected\def+. +\section{Redefined primitives by \LuaTeX-ja} +The following primitives are redefined by \LuaTeX-ja (using~\verb+\protected\def+), +for supporting Japanese typesetting and multiple directions: \begin{cslist}[style=standard] + \item[\cs{/}] \item[\cs{unhbox}\textrm{, }\cs{unvbox}\textrm{, }\cs{unhcopy}\textrm{, }\cs{unvcopy}] \item[\cs{vadjust}\{\}] \item[\cs{insert}\{\}] \item[\cs{lastbox}] - \item[\cs{raise}\textrm{, }\cs{lower}\textrm{\ etc., }\cs{vcenter}] - \item[\cs{vcenter}] + \item[\cs{raise}\textrm{, }\cs{lower}\textrm{, } + \cs{moveleft}\textrm{, }\cs{moveright}\textrm{, }] + \item[\cs{split}to\textrm{, }\cs{vcenter}\{\}] \end{cslist} + +On each primitive \cs{} in the list above, +its meaning just before loading \LuaTeX-ja is backed up into \cs{ltj@@orig@}, +and the meaning after redefinition by \LuaTeX-ja is stored in \cs{ltj@@}. +For example, \autoref{fig:primitive_meaning} shows the situation of \cs{vadjust} primitive. % %<*ja> -\subsection{プリミティブの再定義} -異なる組方向に対応するために,以下に挙げるプリミティブは -\LuaTeX-jaによる前処理もしくは後処理が行われるように -\ \verb+\protected\def+ により再定義してある. +\section{プリミティブの再定義} +\LuaTeX-jaでは和文組版や異なる組方向に対応するために,以下に挙げるプリミティブは +\ \verb+\protected\def+ により再定義を行っている. \begin{cslist} - \item[\cs{unhbox}\textrm{, }\cs{unvbox}\textrm{, }\cs{unhcopy}\textrm{, }\cs{unvcopy}] + \item[\cs{/}] + 和文フォントに対するイタリック補正のサポートが追加されている. + \item[\cs{unhbox}\textrm{, }\cs{unvbox}\textrm{, }\cs{unhcopy}\textrm{, }\cs{unvcopy}] ボックスの組方向が現在のリストと異なる場合は事前にエラーメッセージを出力する. - \pTeX と異なり,エラーを無視して無理矢理 \cs{unhbox}, \cs{unvbox} を + \pTeX と異なり,エラーを無視して無理矢理 \cs{unhbox}, \cs{unvbox} 等を 続行させることもできるが,その場合の組版結果は保証しない. \item[\cs{vadjust}\{\}] 一旦プリミティブ本来の挙動を行う.その後,の組方向が 周囲の垂直リストの組方向と一致しない場合にエラーを出力し, @@ -3403,10 +3408,81 @@ overridden by \LuaTeX-ja, using~\verb+\protected\def+. \item[\cs{lastbox}] ボックスの「中身」を現在の組方向に合わせるためのノード (\textit{dir\_box}という)を必要ならば除去し, 正しく「中身」のボックスが返されるように前処理をする. - \item[\cs{raise}\textrm{, }\cs{lower}\textrm{\ etc., }\cs{vcenter}] - 一方,こちらでは必要に応じて\textit{dir\_box}を作成する前処理を追加している. + \item[\cs{raise}\textrm{, }\cs{lower}\textrm{, } + \cs{moveleft}\textrm{, }\cs{moveright}\textrm{, }] + \leavevmode\vspace{-\baselineskip} + \item[\cs{split}to\textrm{, }\cs{vcenter}\{\}] + これらのプリミティブについては必要に応じて\textit{dir\_box}を作成する前処理を追加している. \end{cslist} + +上記の一覧中にあるプリミティブ\cs{}については, +\LuaTeX-ja読み込み前の意味が\cs{ltj@@orig@}に, +そして\LuaTeX-jaによる再定義後の意味が\cs{ltj@@}に保存される. +例えば,\cs{vadjust}については\autoref{fig:primitive_meaning}のようになっている. +% +\begin{figure} +\begin{LTXexample}[width=.55\textwidth] +\makeatletter\scriptsize\ttfamily +\meaning\vadjust \\ % current +\meaning\ltj@@vadjust \\ % LuaTeX-ja +\meaning\ltj@@orig@vadjust % original +\end{LTXexample} +\caption{Redefining \cs{vadjust} primitive by \LuaTeX-ja} +\label{fig:primitive_meaning} +\end{figure} + +%<*en> +\subsection{Suppressing redefinitions} +Sometimes redefining primitives by \LuaTeX-ja causes a problem. +For example, the \Pkg{breqn} package~(v0.98k) assumes that \cs{vadjust}~and~\cs{insert} have +their primitive meanings. +So, this package cannot by loaded after \LuaTeX-ja by default. + +\LuaTeX-ja version~20210517.0 has features for that problem. Namely: +\begin{itemize} + \item Primitives which is listed in \cs{ltj@stop@overwrite@primitive} are + retain their meanings at just before loading \LuaTeX-ja. + \item After loading \LuaTeX-ja, + one can specify primitives to \cs{ltj@overwrite@primitive}, to redefine them by \LuaTeX-ja. +\end{itemize} +See \autoref{fig:primitive_overwrite} for an example. +% +%<*ja> +\subsection{再定義の抑制} +場合によっては\LuaTeX-jaによるプリミティブの再定義が不都合を起こすこともある. +たとえば,\Pkg{breqn}パッケージ(少なくともv0.98k, 2020\nobreakdash-09\nobreakdash-24))は +読み込み時に\cs{vadjust}, \cs{insert}がプリミティブのままであることを要請するので, +このままでは\LuaTeX-jaの後で読み込むことはできない. + +この状況に対応するため,バージョン20210517.0以降では +\begin{itemize} + \item 制御綴\cs{ltj@stop@overwrite@primitive}内に並べられたプリミティブは, + \LuaTeX-ja読み込み直前時の意味のままとなる. + \item \LuaTeX-ja読み込み後に + \cs{ltj@overwrite@primitive}に引数として与えたプリミティブを与えることで, + それらを「\LuaTeX-jaによって再定義する」際の意味に再定義する +\end{itemize} +機能を導入した.使用例については\autoref{fig:primitive_overwrite}を参照. % +\begin{figure} +\begin{lstlisting} +\makeatletter +\def\ltj@stop@overwrite@primitive{\insert\vadjust\/\unhbox\vcenter\fontseries} +\makeatother + %% Keep the meaning of \insert, \vadjust, \/, \unhbox and \vcenter. + %% \fontseries will still be redefined by \LuaTeX-ja, because it is not primitive. +\usepackage{luatexja} +... +\usepackage{breqn} +... +\makeatletter +\ltj@overwrite@primitive\expandafter{\insert\vadjust\/\unhbox\vcenter} +\makeatother + %% Redefine \insert, \vadjust, \/, \unhbox and \vcenter. +\end{lstlisting} +\caption{\cs{ltj@stop@overwrite@primitive} and \cs{ltj@overwrite@primitive}} +\label{fig:primitive_overwrite} +\end{figure} %\section{Font Metric and Japanese Font} %\section{フォントメトリックと和文フォント} -- cgit v1.2.3