summaryrefslogtreecommitdiff
path: root/Master
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2012-12-10 01:31:19 +0000
committerKarl Berry <karl@freefriends.org>2012-12-10 01:31:19 +0000
commiteb3f5f9a64a4553a16273f9ff5cfe99d10f27dd8 (patch)
tree5e47c27e88cdb655ee7fefcf919ab531e8a4b757 /Master
parent64b7e39503022a8c0ce58857cea7f25d57369757 (diff)
luatexja (9dec12)
git-svn-id: svn://tug.org/texlive/trunk@28482 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master')
-rw-r--r--Master/texmf-dist/doc/luatex/luatexja/README8
-rw-r--r--Master/texmf-dist/doc/luatex/luatexja/luatexja-en.pdfbin497786 -> 563239 bytes
-rw-r--r--Master/texmf-dist/doc/luatex/luatexja/luatexja-ja.pdfbin645339 -> 647611 bytes
-rw-r--r--Master/texmf-dist/doc/luatex/luatexja/luatexja-zh.pdfbin623993 -> 636716 bytes
-rw-r--r--Master/texmf-dist/doc/luatex/luatexja/luatexja.dtx944
-rw-r--r--Master/texmf-dist/source/luatex/luatexja/luatexja-kinsoku.tex (renamed from Master/texmf-dist/tex/luatex/luatexja/luatexja-kinsoku.tex)0
-rw-r--r--Master/texmf-dist/source/luatex/luatexja/luatexja-kinsoku_make.tex32
-rw-r--r--Master/texmf-dist/tex/luatex/luatexja/addons/luatexja-adjust.sty119
-rw-r--r--Master/texmf-dist/tex/luatex/luatexja/addons/luatexja-fontspec.sty17
-rw-r--r--Master/texmf-dist/tex/luatex/luatexja/addons/luatexja-preset.sty9
-rw-r--r--Master/texmf-dist/tex/luatex/luatexja/jfm-ujis.lua158
-rw-r--r--Master/texmf-dist/tex/luatex/luatexja/ltj-adjust.lua247
-rw-r--r--Master/texmf-dist/tex/luatex/luatexja/ltj-cctbreg.sty28
-rw-r--r--Master/texmf-dist/tex/luatex/luatexja/ltj-charrange.lua36
-rw-r--r--Master/texmf-dist/tex/luatex/luatexja/ltj-jfmglue.lua471
-rw-r--r--Master/texmf-dist/tex/luatex/luatexja/ltj-jfont.lua27
-rw-r--r--Master/texmf-dist/tex/luatex/luatexja/ltj-kinsoku.luabin0 -> 32052 bytes
-rw-r--r--Master/texmf-dist/tex/luatex/luatexja/ltj-latex.sty9
-rw-r--r--Master/texmf-dist/tex/luatex/luatexja/ltj-math.lua2
-rw-r--r--Master/texmf-dist/tex/luatex/luatexja/ltj-plain.sty12
-rw-r--r--Master/texmf-dist/tex/luatex/luatexja/ltj-pretreat.lua7
-rw-r--r--Master/texmf-dist/tex/luatex/luatexja/ltj-setwidth.lua29
-rw-r--r--Master/texmf-dist/tex/luatex/luatexja/ltj-stack.lua37
-rw-r--r--Master/texmf-dist/tex/luatex/luatexja/luatexja-core.sty23
-rw-r--r--Master/texmf-dist/tex/luatex/luatexja/luatexja.lua59
-rw-r--r--Master/texmf-dist/tex/luatex/luatexja/luatexja.sty2
-rw-r--r--Master/texmf-dist/tex/luatex/luatexja/patches/lltjfont.sty10
-rw-r--r--Master/texmf-dist/tex/luatex/luatexja/patches/lltjp-listings-jpt.tex1041
-rw-r--r--Master/texmf-dist/tex/luatex/luatexja/patches/lltjp-listings.sty197
29 files changed, 1709 insertions, 1815 deletions
diff --git a/Master/texmf-dist/doc/luatex/luatexja/README b/Master/texmf-dist/doc/luatex/luatexja/README
index a977a5cca6c..1a13b3a1bf0 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 20120904.0
+The LuaTeX-ja Package 20121209.0
--------------------------------
Copyright (c) 2011--2012 The LuaTeX-ja project
License: modified BSD (see COPYING)
@@ -29,9 +29,9 @@ Installation
2. If you must/want to install manually:
a. Download the source archive from CTAN,
- or tagged as 20120904.0 in the Git repository by
+ or tagged as 20121209.0 in the Git repository by
<http://git.sourceforge.jp/view?p=luatex-ja/luatexja.git
- ;a=snapshot;h=refs/tags/20120904.0;sf=tgz>
+ ;a=snapshot;h=refs/tags/20121209.0;sf=tgz>
b. Extract the archive and put src/ into your TEXMF tree.
An example location is TEXMF/tex/luatex/luatexja.
@@ -55,5 +55,5 @@ Simply loading luatexja.sty by \input or \usepackage does the minimal setting.
\jfontspec, which can be used for specifying Japanese fonts.
-Last commit date: Tue Sep 4 21:25:01 2012 +0900
+Last commit date: Sun Dec 9 10:06:33 2012 +0900
diff --git a/Master/texmf-dist/doc/luatex/luatexja/luatexja-en.pdf b/Master/texmf-dist/doc/luatex/luatexja/luatexja-en.pdf
index b12c9f62173..04cc5ef8996 100644
--- a/Master/texmf-dist/doc/luatex/luatexja/luatexja-en.pdf
+++ b/Master/texmf-dist/doc/luatex/luatexja/luatexja-en.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/luatex/luatexja/luatexja-ja.pdf b/Master/texmf-dist/doc/luatex/luatexja/luatexja-ja.pdf
index edafedea2fb..e6fc11c70bc 100644
--- a/Master/texmf-dist/doc/luatex/luatexja/luatexja-ja.pdf
+++ b/Master/texmf-dist/doc/luatex/luatexja/luatexja-ja.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/luatex/luatexja/luatexja-zh.pdf b/Master/texmf-dist/doc/luatex/luatexja/luatexja-zh.pdf
index 6afb80b14f4..5b563f8801e 100644
--- a/Master/texmf-dist/doc/luatex/luatexja/luatexja-zh.pdf
+++ b/Master/texmf-dist/doc/luatex/luatexja/luatexja-zh.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/luatex/luatexja/luatexja.dtx b/Master/texmf-dist/doc/luatex/luatexja/luatexja.dtx
index b2b9b68e0c7..c57030fb430 100644
--- a/Master/texmf-dist/doc/luatex/luatexja/luatexja.dtx
+++ b/Master/texmf-dist/doc/luatex/luatexja/luatexja.dtx
@@ -1,9 +1,9 @@
%<*!showexpl>
%#! lualatex -shell-escape
-%<en> \documentclass[a4paper,titlepage]{article}
-%<ja> \documentclass[a4paper,titlepage]{ltjsarticle}
-%<zh> \documentclass[a4paper,titlepage]{ltjsarticle}
+%<en>\documentclass[a4paper,titlepage]{article}
+%<ja>\documentclass[a4paper,titlepage]{ltjsarticle}
+%<zh>\documentclass[a4paper,titlepage]{ltjsarticle}
%%%%%%%%
\makeatletter
@@ -26,14 +26,17 @@
%<*en>
\usepackage[margin=25mm,footskip=6mm]{geometry}
+\usepackage{luatexja-adjust}\ltjdisableadjust
\parskip=\smallskipamount
%</en>
%<*ja>
\usepackage[textwidth=45\zw, lines=45, footskip=6mm]{geometry}
+\usepackage{luatexja-adjust}%\ltjdisableadjust
\advance\leftmargini-1\zw\advance\leftmarginii-1\zw
%</ja>
%<*zh>
\usepackage[textwidth=45\zw, lines=45, footskip=6mm]{geometry}
+\usepackage{luatexja-adjust}\ltjdisableadjust
\advance\leftmargini-1\zw\advance\leftmarginii-1\zw
\def\postpartname{编}
\DeclareYokoKanjiEncoding{ZH}{}{}
@@ -145,8 +148,8 @@
\DeclareRobustCommand\eTeX{\ensuremath{\varepsilon}-\kern-.125em\TeX}
\DeclareRobustCommand\LuaTeX{Lua\TeX}
\DeclareRobustCommand\pdfTeX{pdf\TeX}
-\DeclareRobustCommand\pTeX{p\kern-.05em\TeX}
-\DeclareRobustCommand\upTeX{up\kern-.05em\TeX}
+\DeclareRobustCommand\pTeX{p\kern-.15em\TeX}
+\DeclareRobustCommand\upTeX{up\kern-.15em\TeX}
\DeclareRobustCommand\pLaTeX{p\kern-.05em\LaTeX}
\DeclareRobustCommand\pLaTeXe{p\kern-.05em\LaTeXe}
\DeclareRobustCommand\epTeX{\ensuremath{\varepsilon}-\kern-.125em\pTeX}
@@ -369,12 +372,12 @@ The followings are major changes from \pTeX:
%<*en>
\item The insertion process of glues/kerns between two Japanese
characters and between a Japanese character and other characters
- (we refer these glues/kerns as \textbf{JAglue}) is rewritten from
+ (we refer glues/kerns of both kinds as \textbf{JAglue}) is rewritten from
scratch.
%</en>
%<*ja>
-\item 2つの和文文字の間,和文文字と欧文文字の間に入るグルー/カーン
- (\textbf{JAglue}と呼ぶ)の挿入処理が0から書き直されている.
+\item 2つの和文文字の間や,和文文字と欧文文字の間に入るグルー/カーン
+ (両者をあわせて\textbf{JAglue}と呼ぶ)の挿入処理が0から書き直されている.
%</ja>
%<*zh>
\item 插在日文字符和其他字符言之间的胶/出格(我们将此称为\textbf{JAglue})是重新实现的。
@@ -544,17 +547,17 @@ We say `alphabetic fonts' for fonts used in \textbf{ALchar}, and `Japanese fonts
%</zh>
%<*en>
-\item A word in a sans-serif font (like \Param{prebreakpenalty})
+\item A word in a sans-serif font (like \Param{\hyperlink{fld:prebp}{prebreakpenalty}})
means an internal parameter for Japanese typesetting, and it
is used as a key in \verb+\ltjsetparameter+ command.
%</en>
%<*ja>
-\item サンセリフ体で書かれた語(例:\Param{prebreakpenalty})は日本語組版用の
+\item サンセリフ体で書かれた語(例:\Param{\hyperlink{fld:prebp}{prebreakpenalty}})は日本語組版用の
パラメータを表し,これらは \verb+\ltjsetparameter+ コマンドのキーとして
用いられる.
%</ja>
%<*zh>
-\item 用无衬线字体表示的词(如:\Param{prebreakpenalty})表示
+\item 用无衬线字体表示的词(如:\Param{\hyperlink{fld:prebp}{prebreakpenalty}})表示
日文排版中的内部便利iang,并用做\verb!\ltjsetparameter!命令一个键。
%</zh>
@@ -982,10 +985,10 @@ Kozuka Mincho字体替代Ryumin-Light)。我们使用默认设定。
%<*en>
\item The amount of glue that are inserted between a \textbf{JAchar} and
- an \textbf{ALchar} (the parameter \Param{xkanjiskip}) is set to
+ an \textbf{ALchar} (the parameter \Param{\hyperlink{fld:xks}{xkanjiskip}}) is set to
%</en>
%<*ja>
-\item \textbf{JAchar}と\textbf{ALchar}の間に入るグルー(\Param{xkanjiskip})の
+\item \textbf{JAchar}と\textbf{ALchar}の間に入るグルー(\Param{\hyperlink{fld:xks}{xkanjiskip}})の
量は次のように設定されている:
%</ja>
%<*zh>
@@ -1502,7 +1505,7 @@ and loads \Pkg{luatexja-fontspec} internally.
%<*en>
Specifying this option enables us to use \textit{mincho} with two weights (medium~and~bold),
\textit{gothic} with three weights (medium,~bold and~heavy), and \textit{rounded gothic}%
-\footnote{Provided by \texttt{\char92mgfamily},
+\footnote{Provided by \texttt{\char92mgfamily},
because \textit{rounded gothic} is called \textit{maru gothic} (丸ゴシック) in Japanese.}.
The heavy weight of \textit{gothic} can be used by ``changing the family'' \verb+\gtebfamily+.
This is because \Pkg{fontspec} package can handle only medium (\verb+\mdseries+) and
@@ -1532,25 +1535,25 @@ Use bold gothic as bold mincho.
%</ja>
\item[90jis]
%<*en>
-Use 90JIS glyphs if possible.
+Use fonts with 90JIS glyphs if possible.
%</en>
%<*ja>
-出来る限り90JISの字形を使う.
+出来る限り90JISの字形を採用しているフォントを使う.
%</ja>
\item[jis2004]
%<*en>
-Use JIS2004 glyphs if possible.
+Use fonts with JIS2004 glyphs if possible.
%</en>
%<*ja>
-出来る限りJIS2004の字形を使う.
+出来る限りJIS2004の字形を採用しているフォントを使う.
%</ja>
\item[jis]
%<*en>
-Use the JFM \texttt{jfm-jis.lua}, instead of the default JFM of
-\LuaTeX-ja, \texttt{jfm-ujis.lua}.
+Use the JFM \texttt{jfm-jis.lua}, instead of \texttt{jfm-ujis.lua}, which is the default JFM of
+\LuaTeX-ja.
%</en>
%<*ja>
-用いるJFMを\texttt{jfm-jis.lua}とする.このオプションがない時は
+用いるJFMを(JISフォントメトリック類似の)\texttt{jfm-jis.lua}にする.このオプションがない時は
\LuaTeX-ja標準の\texttt{jfm-ujis.lua}が用いられる.
%</ja>
\end{list}
@@ -1618,7 +1621,6 @@ as a substitute for \textit{rounded gothic}.
Settings for Hiragino fonts:
%</en>
%<*ja>
-モリサワ・ヒラギノ用の設定はそのようなことは行っていない.
まずヒラギノフォントから:
%</ja>
% これらは持っているわけではないので,フォント名が
@@ -1707,7 +1709,7 @@ Jun Pro 101&Jun Pr6N 101\\
%<*en>
Next, we describe settings for using only single weight.
In four settings below, we use same fonts for medium and bold (and heavy) weights.
-(Hence \verb+\mcfamily\bfseries+ and \verb+\mcfamily\mdseries+ yields same Japanese fonts,
+(Hence \verb+\mcfamily\bfseries+ and \verb+\mcfamily\mdseries+ yields same Japanese fonts,
if \texttt{deluxe} option is also specified).
%</en>
%<*ja>
@@ -1913,7 +1915,7 @@ and the character `漢' to the range number~100.
下面就分配了整个表意文字补充平面和汉字“漢”为100。
%</zh>
\begin{lstlisting}
-\ltjdefcharrange{100}{"10000-"1FFFF,`漢}
+\ltjdefcharrange{100}{"20000-"2FFFF,`漢}
\end{lstlisting}
%<*en>
This assignment of numbers to ranges are always global, so you should
@@ -2120,7 +2122,7 @@ This range consist of the following Unicode ranges, \emph{except characters in t
\item \texttt{U+0180}--\texttt{U+024F}: ラテン文字拡張B
\item \texttt{U+0250}--\texttt{U+02AF}: IPA拡張(国際音声記号)
\item \texttt{U+02B0}--\texttt{U+02FF}: 前進を伴う修飾文字
-\item \texttt{U+0300}--\texttt{U+036F}: ダイアクリティカルマーク(合成可能)
+\item \texttt{U+0300}--\texttt{U+036F}: 合成可能な識別記号
\item \texttt{U+1E00}--\texttt{U+1EFF}: ラテン文字拡張追加
%</ja>
%<*zh>
@@ -2140,7 +2142,7 @@ This range consist of the following Unicode ranges, \emph{except characters in t
fonts) has some of these characters.
%</en>
%<*ja>
-\item[範囲2${}^{\text{J}}$] ギリシャ文字とキリル文字.JIS~X~0208(したがって多くの
+\item[範囲2${}^{\text{J}}$] ギリシャ文字とキリル文字.JIS~X~0208(したがってほとんどの
和文フォント)はこれらの文字を持つ.
%</ja>
%<*zh>
@@ -2154,7 +2156,7 @@ This range consist of the following Unicode ranges, \emph{except characters in t
\item \texttt{U+1F00}--\texttt{U+1FFF}: Greek Extended
%</en>
%<*ja>
-\item \texttt{U+0370}--\texttt{U+03FF}: ギリシア文字及びコプト文字
+\item \texttt{U+0370}--\texttt{U+03FF}: ギリシア文字・コプト文字
\item \texttt{U+0400}--\texttt{U+04FF}: キリル文字
\item \texttt{U+1F00}--\texttt{U+1FFF}: キリル文字補助
%</ja>
@@ -2475,31 +2477,31 @@ The block list is indicated in Table~\ref{table-rng7}.
kanjiskip}).
%</en>
%<*ja>
-\item デフォルトで2つの\textbf{JAchar}の間に挿入されるグルー(\Param{kanjiskip}).
+\item デフォルトで2つの\textbf{JAchar}の間に挿入されるグルー(\Param{\hyperlink{fld:kanjiskip}{kanjiskip}}).
%</ja>
%<*zh>
-\item 两个\textbf{JAchar}之间默认插入的胶(\Param{kanjiskip})。
+\item 两个\textbf{JAchar}之间默认插入的胶(\Param{\hyperlink{fld:kanjiskip}{kanjiskip}})。
%</zh>
%<*en>
\item The default glue which inserted between a \textbf{JAchar} and an
- \textbf{ALchar} (\Param{xkanjiskip}).
+ \textbf{ALchar} (\Param{\hyperlink{fld:xks}{xkanjiskip}}).
%</en>
%<*ja>
-\item デフォルトで\textbf{JAchar}と\textbf{ALchar}の間に挿入されるグルー(\Param{xkanjiskip}).
+\item デフォルトで\textbf{JAchar}と\textbf{ALchar}の間に挿入されるグルー(\Param{\hyperlink{fld:xks}{xkanjiskip}}).
%</ja>
%<*zh>
-\item \textbf{JAchar}和\textbf{ALchar}之间默认插入的胶(\Param{xkanjiskip})。
+\item \textbf{JAchar}和\textbf{ALchar}之间默认插入的胶(\Param{\hyperlink{fld:xks}{xkanjiskip}})。
%</zh>
\end{itemize}
%<*en>
-The value (a skip) of \Param{kanjiskip} or \Param{xkanjiskip} can be
+The value (a skip) of \Param{\hyperlink{fld:kanjiskip}{kanjiskip}} or \Param{\hyperlink{fld:xks}{xkanjiskip}} can be
changed as the following.
%</en>
%<*ja>
-\Param{kanjiskip}や\Param{xkanjiskip}の値は以下のようにして変更可能である.
+\Param{\hyperlink{fld:kanjiskip}{kanjiskip}}や\Param{\hyperlink{fld:xks}{xkanjiskip}}の値は以下のようにして変更可能である.
%</ja>
%<*zh>
-\Param{kanjiskip}和\Param{xkanjiskip}的设定如下所示:
+\Param{\hyperlink{fld:kanjiskip}{kanjiskip}}和\Param{\hyperlink{fld:xks}{xkanjiskip}}的设定如下所示:
%</zh>
\begin{lstlisting}
\ltjsetparameter{kanjiskip={0pt plus 0.4pt minus 0.4pt},
@@ -2507,20 +2509,20 @@ changed as the following.
\end{lstlisting}
%<*en>
-It may occur that JFM contains the data of `ideal width of \Param{kanjiskip}'
-and/or `ideal width of \Param{xkanjiskip}'.
-To use these data from JFM, set the value of \Param{kanjiskip} or
-\Param{xkanjiskip} to \verb+\maxdimen+.
+It may occur that JFM contains the data of `ideal width of \Param{\hyperlink{fld:kanjiskip}{kanjiskip}}'
+and/or `ideal width of \Param{\hyperlink{fld:xks}{xkanjiskip}}'.
+To use these data from JFM, set the value of \Param{\hyperlink{fld:kanjiskip}{kanjiskip}} or
+\Param{\hyperlink{fld:xks}{xkanjiskip}} to \verb+\maxdimen+.
%</en>
%<*ja>
-JFMは「望ましい\Param{kanjiskip}の値」や「望ましい\Param{xkanjiskip}の値」を
+JFMは「望ましい\Param{\hyperlink{fld:kanjiskip}{kanjiskip}}の値」や「望ましい\Param{\hyperlink{fld:xks}{xkanjiskip}}の値」を
持っていることがある.
-これらのデータを使うためには,\Param{kanjiskip}や\Param{xkanjiskip}の
+これらのデータを使うためには,\Param{\hyperlink{fld:kanjiskip}{kanjiskip}}や\Param{\hyperlink{fld:xks}{xkanjiskip}}の
値を \verb+\maxdimen+ の値に設定すればよい.
%</ja>
%<*zh>
-当JFM包含“\Param{kanjiskip}理想宽度”和/或“\Param{xkanjiskip}理想宽度”数据时,
-上述设定产生作用。如果想用JFM中的数据,请设定\Param{kanjiskip}或\textsf{xkanjiskip}为\verb!\maxdimen!。
+当JFM包含“\Param{\hyperlink{fld:kanjiskip}{kanjiskip}}理想宽度”和/或“\Param{\hyperlink{fld:xks}{xkanjiskip}}理想宽度”数据时,
+上述设定产生作用。如果想用JFM中的数据,请设定\Param{\hyperlink{fld:kanjiskip}{kanjiskip}}或\textsf{xkanjiskip}为\verb!\maxdimen!。
%</zh>
%<en>\subsection{Insertion Setting of \Param{xkanjiskip}}
@@ -2528,28 +2530,28 @@ JFMは「望ましい\Param{kanjiskip}の値」や「望ましい\Param{xkanjisk
%<zh>\subsection{\Param{xkanjiskip}插入设定}
%<*en>
-It is not desirable that \Param{xkanjiskip} is inserted into every
+It is not desirable that \Param{\hyperlink{fld:xks}{xkanjiskip}} is inserted into every
boundary between \textbf{JAchar}s and \textbf{ALchar}s. For example,
-\Param{xkanjiskip} should not be inserted after opening parenthesis
+\Param{\hyperlink{fld:xks}{xkanjiskip}} should not be inserted after opening parenthesis
(\textit{e.g.}, compare `(あ' and `(\hskip\ltjgetparameter{xkanjiskip}あ').
-\LuaTeX-ja can control whether \Param{xkanjiskip} can be inserted
+\LuaTeX-ja can control whether \Param{\hyperlink{fld:xks}{xkanjiskip}} can be inserted
before/after a character, by changing \Param{jaxspmode} for \textbf{JAchar}s and
\Param{alxspmode} parameters \textbf{ALchar}s respectively.
%</en>
%<*ja>
-\Param{xkanjiskip}がすべての\textbf{JAchar}と\textbf{ALchar}の境界に
-挿入されるのは望ましいことではない.例えば,\Param{xkanjiskip}は開き括弧の
+\Param{\hyperlink{fld:xks}{xkanjiskip}}がすべての\textbf{JAchar}と\textbf{ALchar}の境界に
+挿入されるのは望ましいことではない.例えば,\Param{\hyperlink{fld:xks}{xkanjiskip}}は開き括弧の
後には挿入されるべきではない(`(あ'と`(\hskip\ltjgetparameter{xkanjiskip}あ'を
比べてみよ).
-\LuaTeX-jaでは\Param{xkanjiskip}をある文字の前/後に挿入するかどうかを,
+\LuaTeX-jaでは\Param{\hyperlink{fld:xks}{xkanjiskip}}をある文字の前/後に挿入するかどうかを,
\textbf{JAchar}に対しては\Param{jaxspmode}を,\textbf{ALchar}に対しては
\Param{alxspmode}をそれぞれ変えることで制御することができる.
%</ja>
%<*zh>
并不是在所有的\textbf{JAchar}和\textbf{ALchar}周围插入\textsf{xkanjiskip}都是合适的。
-比如,在开标点之后插入\Param{xkanjiskip}并不合适[如,比较“(あ”和“(\hskip\ltjgetparameter{xkanjiskip}あ”]。
+比如,在开标点之后插入\Param{\hyperlink{fld:xks}{xkanjiskip}}并不合适[如,比较“(あ”和“(\hskip\ltjgetparameter{xkanjiskip}あ”]。
\LuaTeX-ja可以通过设定\textbf{JAchar}的\Param{jaxspmode}以及\textbf{ALchar}的\Param{alxspmode}来控制
-\Param{xkanjiskip}在字符前后的插入。
+\Param{\hyperlink{fld:xks}{xkanjiskip}}在字符前后的插入。
%</zh>
\begin{LTXexample}
\ltjsetparameter{jaxspmode={`あ,preonly}, alxspmode={`\!,postonly}}
@@ -2558,12 +2560,12 @@ pあq い!う
%<*en>
The second argument \texttt{preonly} means `the insertion of
-\Param{xkanjiskip} is allowed before this character, but not after'.
+\Param{\hyperlink{fld:xks}{xkanjiskip}} is allowed before this character, but not after'.
the other possible values are \texttt{postonly}, \texttt{allow} and \texttt{
inhibit}.
%</en>
%<*ja>
-2つ目の引数の \texttt{preonly}は「\Param{xkanjiskip}の挿入はこの文字の
+2つ目の引数の \texttt{preonly}は「\Param{\hyperlink{fld:xks}{xkanjiskip}}の挿入はこの文字の
前でのみ許され,後では許さない」ことを意味する.他に指定可能な値は
\texttt{postonly}, \texttt{allow}, \texttt{inhibit}である.
%</ja>
@@ -2600,17 +2602,17 @@ One can use also numbers to specify these two parameters (see Subsection~\ref{ss
%</zh>
%<*en>
-If you want to enable/disable all insertions of \Param{kanjiskip} and
-\Param{xkanjiskip}, set \Param{autospacing} and \Param{autoxspacing}
+If you want to enable/disable all insertions of \Param{\hyperlink{fld:kanjiskip}{kanjiskip}} and
+\Param{\hyperlink{fld:xks}{xkanjiskip}}, set \Param{autospacing} and \Param{autoxspacing}
parameters to \texttt{true}/\texttt{false}, respectively.
%</en>
%<*ja>
-もし全ての\Param{kanjiskip}と\Param{xkanjiskip}の挿入を有効化/無効化
+もし全ての\Param{\hyperlink{fld:kanjiskip}{kanjiskip}}と\Param{\hyperlink{fld:xks}{xkanjiskip}}の挿入を有効化/無効化
したければ,それぞれ\Param{autospacing}と\Param{autoxspacing}を
\texttt{true}/\texttt{false}に設定すればよい.
%</ja>
%<*zh>
-如果你想要启用/屏蔽所有的\Param{kanjiskip}和\Param{xkanjiskip}插入,设定
+如果你想要启用/屏蔽所有的\Param{\hyperlink{fld:kanjiskip}{kanjiskip}}和\Param{\hyperlink{fld:xks}{xkanjiskip}}插入,设定
\Param{autospacing}和\Param{autoxspcing}为\texttt{ture}/\texttt{false}即可。
%</zh>
@@ -2857,9 +2859,9 @@ JFMの名前を指定する.もし以前に指定されたJFMが読み込ま
\toprule
&\tt jfm-ujis.lua&\tt jfm-jis.lua&\tt jfm-min.lua\\
\midrule
-%<en>Example~1\footnotemark
-%<ja>例1\footnotemark
-%<zh>例1\footnotemark
+%<en>Example~1\cite{min10}
+%<ja>例1\cite{min10}
+%<zh>例1\cite{min10}
&\r{ujis}&\r{jis}&\r{min}\\
%<en>Example~2
%<ja>例2
@@ -2871,8 +2873,6 @@ Bounding Box&\t{ujis}&\t{jis}&\t{min}\\
\end{center}
\ltjsetparameter{jacharrange={-3}}
\end{table}
-\footnotetext{from: 乙部厳己, min10フォントについて.
-\texttt{http://argent.shinshu-u.ac.jp/\~{\ }otobe/tex/files/min10.pdf}.}
%<en>\paragraph{Note: kern feature}
%<ja>\paragraph{注意:kern feature}
@@ -3095,22 +3095,22 @@ floating-point numbers in design-size unit.
%<zh>(可选)
%<*en>
-This field specifies the `ideal' amount of \Param{kanjiskip}. As noted
+This field specifies the `ideal' amount of \Param{\hyperlink{fld:kanjiskip}{kanjiskip}}. As noted
in Subsection~\ref{subs-kskip}, if the parameter
- \Param{kanjiskip} is \verb+\maxdimen+, the value specified
+ \Param{\hyperlink{fld:kanjiskip}{kanjiskip}} is \verb+\maxdimen+, the value specified
in this field is actually used (if this field is not specified in
JFM, it is regarded as 0\,pt). Note that <stretch> and <shrink>
fields are in design-size unit too.
%</en>
%<*ja>
-「理想的な」\Param{kanjiskip}の量を指定する.\ref{subs-kskip}節で述べたように,
-もし\Param{kanjiskip}が \verb+\maxdimen+ の値ならば,このフィールドで指定された
+「理想的な」\Param{\hyperlink{fld:kanjiskip}{kanjiskip}}の量を指定する.\ref{subs-kskip}節で述べたように,
+もし\Param{\hyperlink{fld:kanjiskip}{kanjiskip}}が \verb+\maxdimen+ の値ならば,このフィールドで指定された
値が実際には用いられる(もしこのフィールドがJFMで指定されていなければ,
0\,ptであるものとして扱われる).<stretch>と<shrink>のフィールドもdesign-size
が単位であることに注意せよ.
%</ja>
%<*zh>
-这部分为“理想长度”\Param{kanjiskip}。\ref{subs-kskip}节有详述,如果参数\Param{kanjiskip}
+这部分为“理想长度”\Param{\hyperlink{fld:kanjiskip}{kanjiskip}}。\ref{subs-kskip}节有详述,如果参数\Param{\hyperlink{fld:kanjiskip}{kanjiskip}}
为\verb!\maxdimen!,则值设定将会被使用(若再JFM中未设定,则被视为0\,pt)。
请注意,<stretch>和<shrink>的长度均为design-size单位。
%</zh>
@@ -3121,15 +3121,15 @@ This field specifies the `ideal' amount of \Param{kanjiskip}. As noted
%<zh>(可选)
%<*en>
-Like the \Param{kanjiskip} field, this field specifies the `ideal'
- amount of \Param{xkanjiskip}.
+Like the \texttt{kanjiskip} field, this field specifies the `ideal'
+ amount of \Param{\hyperlink{fld:xks}{xkanjiskip}}.
%</en>
%<*ja>
-\Param{kanjiskip}フィールドと同様に,\Param{xkanjiskip}の「理想的な」量を
+\texttt{kanjiskip}フィールドと同様に,\Param{\hyperlink{fld:xks}{xkanjiskip}}の「理想的な」量を
指定する.
%</ja>
%<*zh>
-和\Param{kanjiskip}类似,此部分设定\Param{xkanjiskip}的“理想长度”。
+和\texttt{kanjiskip}类似,此部分设定\Param{\hyperlink{fld:xks}{xkanjiskip}}的“理想长度”。
%</zh>
\end{list}
@@ -3378,9 +3378,48 @@ Furthermore, the glyph is shifted according to values of fields
\label{fig-pos}
\end{figure}
-\item[kern={\{[$j$]=<kern>, ...\}}]
+\item[kern={\{[$j$]=<kern>, [$j'$]=\{<kern>, [<ratio>]\}...\}}]
+
+\item[glue={\{[$j$]=\{<width>, <stretch>, <shrink>, [<priority>], [<ratio>]\}, ...\}}]
+%<*ja>
+文字クラス$i$の文字と$j$の文字の間に挿入されるkernやglueの量を指定する.
+
+ <priority>は\texttt{luatexja-adjust.sty} による優先順位付き
+ 行長調整(\ref{ssec-adj}節)が有効なときのみ意味を持つ.
+このフィールドは省略可能であり,行調整処理におけるこのglueの優先
+ 度を$-2$から$+2$の間の整数で指定する.<priority>の省略時の値
+ は0であり,範囲外の値が指定されたときの動作は未定義である).
+
+<ratio>も省略可能フィールドであり,$-1$から$+1$の実数値をとる.省略時の値は0である.
+\begin{itemize}
+\item $-1$はこのグルーが「前の文字」由来であることを示す.
+\item $+1$はこのグルーが「後の文字」由来であることを示す.
+\item それ以外の値は,「前の文字」由来のグルーと「後の文字」由来の
+グルーが混合されていることを示す.
+\end{itemize}
+なお,このフィールドの値は\Param{\hyperlink{fld:diffjfm}{differentjfm}}の値が\texttt{pleft},~\texttt{pright},~\texttt{paverage}の値のときのみ実際に用いられる.
+
+例えば,\cite{x4051}では,句点と中点の間には,
+句点由来の二分空きと中点由来の四分空きが挿入されるが,この場合には
+\begin{itemize}
+\item <width>には$0.5+0.25=0.75$を指定する.
+\item <ratio>には次の値を指定する.
+\[
+ -1\cdot \frac{0.5}{0.5+0.25} + 1 \cdot \frac{0.25}{0.5+0.25} = -\frac13
+\]
+\end{itemize}
+
+%</ja>
+
+\item[end\_stretch=<kern>]
+\item[end\_shrink=<kern>]
+%<*ja>
+これらのフィールドは省略可能である.
+優先順位付き行長調整が有効であり,かつ現在の文字クラスの文字が行
+ 末に来た時に,行長を詰める調整・伸ばす調整のた
+ めにこの文字と行末の間に挿入可能なカーンの大きさを指定する.
+%</ja>
-\item[glue={\{[$j$]=\{<width>, <stretch>, <shrink>\}, ...\}}]
\end{list}
%<*ja>
@@ -3391,7 +3430,7 @@ Furthermore, the glyph is shifted according to values of fields
たとえば,次の内容を一部に含んだ \texttt{jfm-test.lua} を考えよう:
\begin{lstlisting}
[0] = {
- chars = { '漢', 'ヒ*' },
+ chars = { '漢', 'ヒ*' },
align = 'left', left = 0.0, down = 0.0,
width = 1.0, height = 0.88, depth = 0.12, italic=0.0,
},
@@ -3462,15 +3501,15 @@ The following is the list of `imaginary characters':
下列为“假想字符”列表:
%</zh>
\begin{list}{}{\def\makelabel{\ttfamily}\def\{{\char`\{}\def\}{\char`\}}\advance\leftmargin1\zw}
-\item['lineend']
-%<en>An ending of a line.
-%<ja>行の終端を表す.
-%<zh>行尾结束字符。
+%%\item['lineend']
+%%%<en>An ending of a line.
+%%%<ja>行の終端を表す.
+%%%<zh>行尾结束字符。
-\item['diffmet']
-%<en>Used at a boundary between two \textbf{JAchar}s whose JFM or size is different.
-%<ja>JFMやサイズが異なる2つの\textbf{JAchar}の間の境界として用いられる.
-%<zh>用于两个不同大小或不同JFM的两个\textbf{JAchar}间边界。
+%%\item['diffmet']
+%%<en>Used at a boundary between two \textbf{JAchar}s whose JFM or size is different.
+%%<ja>JFMやサイズが異なる2つの\textbf{JAchar}の間の境界として用いられる.
+%%<zh>用于两个不同大小或不同JFM的两个\textbf{JAchar}间边界。
\item['boxbdd']
%<en>The beginning/ending of a horizontal box, and the beginning of a noindented paragraph.
@@ -3657,7 +3696,7 @@ this argument has \texttt{chars} field which contains character codes
%<*en>
An example of this callback is the \texttt{ltjarticle} class, with
forcefully assigning character class~0 to \texttt{'parbdd'}
- in the JFM \texttt{jfm-min.lua}.
+ in the JFM \texttt{jfm-min.lua}.
%</en>
%<*ja>
このコールバックの使用例は\texttt{ltjarticle}クラスにあり,
@@ -3709,7 +3748,7 @@ You may assume that \verb+jfont_info+ has the following fields:
%</ja>
%<*en>
A table which contains the information of a JFM, and \emph{this table must not be changed}.
-The contents of this table are similar to that which is written is the JFM file, but
+The contents of this table are similar to that which is written is the JFM file, but
the following differ:
\begin{itemize}
\item There is a \texttt{chars} table, \dots
@@ -3993,25 +4032,21 @@ At the present version, the lowermost bit of <natural number> indicates
みなされるかどうかを表している(上の\Param{jcharwidowpenalty}の記述を参照).
%</ja>
-\item[\Param{prebreakpenalty}\,=\{<chr\_code>,<penalty>\}] [\verb+\prebreakpenalty+]\
+\item[\Param{\hypertarget{fld:prebp}{prebreakpenalty}}\,=\{<chr\_code>,<penalty>\}] [\verb+\prebreakpenalty+]\
%<*ja>
文字コード<chr\_code>の\textbf{JAchar}が行頭にくることを抑止するために,
この文字の前に挿入/追加されるペナルティの量を指定する.
-例えば閉じ括弧「〗」は絶対に行頭にきてはならないので,標準で読み込まれる
- \texttt{luatexja-kinsoku.tex}において
+例えば閉じ括弧「〗」は絶対に行頭にきてはならないので,
\begin{verbatim}
\ltjsetparameter{prebreakpenalty={`〙,10000}}
\end{verbatim}
-と,最大値の10000が指定されている.他にも,小書きのカナなど,絶対禁止とい
+と,最大値の10000が標準で指定されている.他にも,小書きのカナなど,絶対禁止とい
うわけではないができれば行頭にはきて欲しくない場合に,0と
10000の間の値を指定するのも有用であろう.
-\begin{verbatim}
-\ltjsetparameter{prebreakpenalty={`ゕ,150}}
-\end{verbatim}
%</ja>
-\item[\Param{postbreakpenalty}\,=\{<chr\_code>,<penalty>\}] [\verb+\postbreakpenalty+]
+\item[\Param{\hypertarget{fld:postbp}{postbreakpenalty}}\,=\{<chr\_code>,<penalty>\}] [\verb+\postbreakpenalty+]
%<*ja>
文字コード<chr\_code>の\textbf{JAchar}が行末にくることを抑止するために,
この文字の後に挿入/追加されるペナルティの量を指定する.
@@ -4043,27 +4078,27 @@ At the present version, the lowermost bit of <natural number> indicates
\item[\Param{jaxspmode}\,=\{<chr\_code>,<mode>\}]
%<*en>
-Setting whether inserting \Param{xkanjiskip} is allowed before/after a \textbf{JAchar} whose character code is <chr\_code>.
+Setting whether inserting \Param{\hyperlink{fld:xks}{xkanjiskip}} is allowed before/after a \textbf{JAchar} whose character code is <chr\_code>.
The followings are allowed for <mode>:
%</en>
%<*ja>
-文字コードが<chr\_code>の\textbf{JAchar}の前/後ろに\Param{xkanjiskip}の
+文字コードが<chr\_code>の\textbf{JAchar}の前/後ろに\Param{\hyperlink{fld:xks}{xkanjiskip}}の
挿入を許すかどうかの設定.
以下の<mode>が許される:
%</ja>
\begin{description}
-%<en>\item[0, \texttt{inhibit}] Insertion of \Param{xkanjiskip} is inhibited before the character, nor after the character.
-%<ja>\item[0, \texttt{inhibit}] \Param{xkanjiskip}の挿入は文字の前/後ろのいずれでも禁止される.
-%<zh>\item[0, \texttt{inhibit}] 插入文字前/后的\Param{xkanjiskip}均被禁止。
-%<en>\item[1, \texttt{preonly}] Insertion of \Param{xkanjiskip} is allowed before the character, but not after.
-%<ja>\item[1, \texttt{preonly}] \Param{xkanjiskip}の挿入は文字の前では許されるが,後ろでは許されない.
-%<zh>\item[1, \texttt{preonly}] 文字前允许插入\Param{xkanjiskip},但其后不允许插入。
-%<en>\item[2, \texttt{postonly}] Insertion of \Param{xkanjiskip} is allowed after the character, but not before.
-%<ja>\item[2, \texttt{postonly}] \Param{xkanjiskip}の挿入は文字の後ろでは許されるが,前では許されない.
-%<zh>\item[2, \texttt{postonly}] 文字后允许插入\Param{xkanjiskip},但之前不允许插入。
-%<en>\item[3, \texttt{allow}] Insertion of \Param{xkanjiskip} is allowed both before the character and after the character. This is the default value.
-%<ja>\item[3, \texttt{allow}] \Param{xkanjiskip}の挿入は文字の前/後ろのいずれでも許される.これがデフォルトの値である.
-%<zh>\item[3, \texttt{allow}] 文字前后均可插入\Param{xkanjiskip}。此为默认值。
+%<en>\item[0, \texttt{inhibit}] Insertion of \Param{\hyperlink{fld:xks}{xkanjiskip}} is inhibited before the character, nor after the character.
+%<ja>\item[0, \texttt{inhibit}] \Param{\hyperlink{fld:xks}{xkanjiskip}}の挿入は文字の前/後ろのいずれでも禁止される.
+%<zh>\item[0, \texttt{inhibit}] 插入文字前/后的\Param{\hyperlink{fld:xks}{xkanjiskip}}均被禁止。
+%<en>\item[1, \texttt{preonly}] Insertion of \Param{\hyperlink{fld:xks}{xkanjiskip}} is allowed before the character, but not after.
+%<ja>\item[1, \texttt{preonly}] \Param{\hyperlink{fld:xks}{xkanjiskip}}の挿入は文字の前では許されるが,後ろでは許されない.
+%<zh>\item[1, \texttt{preonly}] 文字前允许插入\Param{\hyperlink{fld:xks}{xkanjiskip}},但其后不允许插入。
+%<en>\item[2, \texttt{postonly}] Insertion of \Param{\hyperlink{fld:xks}{xkanjiskip}} is allowed after the character, but not before.
+%<ja>\item[2, \texttt{postonly}] \Param{\hyperlink{fld:xks}{xkanjiskip}}の挿入は文字の後ろでは許されるが,前では許されない.
+%<zh>\item[2, \texttt{postonly}] 文字后允许插入\Param{\hyperlink{fld:xks}{xkanjiskip}},但之前不允许插入。
+%<en>\item[3, \texttt{allow}] Insertion of \Param{\hyperlink{fld:xks}{xkanjiskip}} is allowed both before the character and after the character. This is the default value.
+%<ja>\item[3, \texttt{allow}] \Param{\hyperlink{fld:xks}{xkanjiskip}}の挿入は文字の前/後ろのいずれでも許される.これがデフォルトの値である.
+%<zh>\item[3, \texttt{allow}] 文字前后均可插入\Param{\hyperlink{fld:xks}{xkanjiskip}}。此为默认值。
\end{description}
%<*en>
This parameter is similar to the \verb+\inhibitxspcode+ primitive of \pTeX, but not compatible with \verb+\inhibitxspcode+.
@@ -4078,28 +4113,28 @@ This parameter is similar to the \verb+\inhibitxspcode+ primitive of \pTeX, but
\item[\Param{alxspmode}\,=\{<chr\_code>,<mode>\}] [\verb+\xspcode+]
%<*en>
-Setting whether inserting \Param{xkanjiskip} is allowed before/after a
+Setting whether inserting \Param{\hyperlink{fld:xks}{xkanjiskip}} is allowed before/after a
\textbf{ALchar} whose character code is <chr\_code>.
The followings are allowed for <mode>:
%</en>
%<*ja>
-文字コードが<chr\_code>の\textbf{ALchar}の前/後ろに\Param{xkanjiskip}の
+文字コードが<chr\_code>の\textbf{ALchar}の前/後ろに\Param{\hyperlink{fld:xks}{xkanjiskip}}の
挿入を許すかどうかの設定.
以下の<mode>が許される:
%</ja>
\begin{description}
-%<en>\item[0, \texttt{inhibit}] Insertion of \Param{xkanjiskip} is inhibited before the character, nor after the character.
-%<ja>\item[0, \texttt{inhibit}] \Param{xkanjiskip}の挿入は文字の前/後ろのいずれでも禁止される.
-%<zh>\item[0, \texttt{inhibit}] 插入文字前/后的\Param{xkanjiskip}均被禁止。
-%<en>\item[1, \texttt{preonly}] Insertion of \Param{xkanjiskip} is allowed before the character, but not after.
-%<ja>\item[1, \texttt{preonly}] \Param{xkanjiskip}の挿入は文字の前では許されるが,後ろでは許されない.
-%<zh>\item[1, \texttt{preonly}] 文字前允许插入\Param{xkanjiskip},但其后不允许插入。
-%<en>\item[2, \texttt{postonly}] Insertion of \Param{xkanjiskip} is allowed after the character, but not before.
-%<ja>\item[2, \texttt{postonly}] \Param{xkanjiskip}の挿入は文字の後ろでは許されるが,前では許されない.
-%<zh>\item[2, \texttt{postonly}] 文字后允许插入\Param{xkanjiskip},但之前不允许插入。
-%<en>\item[3, \texttt{allow}] Insertion of \Param{xkanjiskip} is allowed before the character and after the character. This is the default value.
-%<ja>\item[3, \texttt{allow}] \Param{xkanjiskip}の挿入は文字の前/後ろのいずれでも許される.これがデフォルトの値である.
-%<zh>\item[3, \texttt{allow}] 文字前后均可插入\Param{xkanjiskip}。此为默认值。
+%<en>\item[0, \texttt{inhibit}] Insertion of \Param{\hyperlink{fld:xks}{xkanjiskip}} is inhibited before the character, nor after the character.
+%<ja>\item[0, \texttt{inhibit}] \Param{\hyperlink{fld:xks}{xkanjiskip}}の挿入は文字の前/後ろのいずれでも禁止される.
+%<zh>\item[0, \texttt{inhibit}] 插入文字前/后的\Param{\hyperlink{fld:xks}{xkanjiskip}}均被禁止。
+%<en>\item[1, \texttt{preonly}] Insertion of \Param{\hyperlink{fld:xks}{xkanjiskip}} is allowed before the character, but not after.
+%<ja>\item[1, \texttt{preonly}] \Param{\hyperlink{fld:xks}{xkanjiskip}}の挿入は文字の前では許されるが,後ろでは許されない.
+%<zh>\item[1, \texttt{preonly}] 文字前允许插入\Param{\hyperlink{fld:xks}{xkanjiskip}},但其后不允许插入。
+%<en>\item[2, \texttt{postonly}] Insertion of \Param{\hyperlink{fld:xks}{xkanjiskip}} is allowed after the character, but not before.
+%<ja>\item[2, \texttt{postonly}] \Param{\hyperlink{fld:xks}{xkanjiskip}}の挿入は文字の後ろでは許されるが,前では許されない.
+%<zh>\item[2, \texttt{postonly}] 文字后允许插入\Param{\hyperlink{fld:xks}{xkanjiskip}},但之前不允许插入。
+%<en>\item[3, \texttt{allow}] Insertion of \Param{\hyperlink{fld:xks}{xkanjiskip}} is allowed before the character and after the character. This is the default value.
+%<ja>\item[3, \texttt{allow}] \Param{\hyperlink{fld:xks}{xkanjiskip}}の挿入は文字の前/後ろのいずれでも許される.これがデフォルトの値である.
+%<zh>\item[3, \texttt{allow}] 文字前后均可插入\Param{\hyperlink{fld:xks}{xkanjiskip}}。此为默认值。
\end{description}
%<*en>
Note that parameters \Param{jaxspmode} and \Param{alxspmode} use a common table, hence these two parameters are synonyms of each other.
@@ -4114,10 +4149,23 @@ Note that parameters \Param{jaxspmode} and \Param{alxspmode} use a common table,
\item[\Param{autospacing}\,=<bool>$^\ast$] [\verb+\autospacing+]
\item[\Param{autoxspacing}\,=<bool>$^\ast$] [\verb+\autoxspacing+]
-\item[\Param{kanjiskip}\,=<skip>] [\verb+\kanjiskip+]
-\item[\Param{xkanjiskip}\,=<skip>] [\verb+\xkanjiskip+]
+\item[\Param{\hypertarget{fld:kanjiskip}{kanjiskip}}\,=<skip>] [\verb+\kanjiskip+]
+%<*ja>
+デフォルトで2つの\textbf{JAchar}の間に挿入されるグルーである.
+通常では,\pTeX と同じようにフォントサイズに比例して変わることはない.
+しかし,自然長が \verb+\maxdimen+ の場合は,例外的に和文フォントのJFM側で指定されている
+値を採用(こちらはフォントサイズに比例)することになっている.
+%</ja>
-\item[\Param{differentjfm}\,=<mode>$^\dagger$]
+\item[\Param{\hypertarget{fld:xks}{xkanjiskip}}\,=<skip>] [\verb+\xkanjiskip+]
+%<*ja>
+デフォルトで\textbf{JAchar}と\textbf{ALchar}の間に挿入されるグルーである.
+\Param{\hyperlink{fld:kanjiskip}{kanjiskip}}と同じように,通常ではフォントサイズに比例して変わることはないが,
+自然長が \verb+\maxdimen+ の場合が例外である.
+%</ja>
+
+
+\item[\Param{\hypertarget{fld:diffjfm}{differentjfm}}\,=<mode>$^\dagger$]
%<*en>
Specify how glues/kerns between two \textbf{JAchar}s whose JFM (or size) are different.
@@ -4125,7 +4173,7 @@ The allowed arguments are the followings:
%</en>
%<*ja>
JFM(もしくはサイズ)が異なる2つの\textbf{JAchar}の間にグルー/カーンをどのように
-入れるかを指定うる.
+入れるかを指定する.
許される値は以下の通り:
%</ja>
%<*zh>
@@ -4137,6 +4185,9 @@ JFM(もしくはサイズ)が異なる2つの\textbf{JAchar}の間にグル
\item[\texttt{both}]
\item[\texttt{large}]
\item[\texttt{small}]
+\item[\texttt{pleft}]
+\item[\texttt{pright}]
+\item[\texttt{paverage}]
\end{description}
\item[\Param{jacharrange}\,=<ranges>$^\ast$]
@@ -4480,7 +4531,9 @@ See Subsections~\ref{ssec-jfont} and \ref{ssec-psft} for details.
これら3つのキーはそれぞれ \verb+\jfont+ プリミティブに対する
\texttt{cid}, \texttt{jfm}, \texttt{jfmvar}キーとそれぞれ対応する.
\texttt{CID} は下の \texttt{NoEmbed} と合わせて用いられたときのみ有効である.
-詳細は\ref{ssec-jfont}節と\ref{ssec-psft}節を参照.
+\verb+\jfont+ プリミティブに対する
+\texttt{cid}, \texttt{jfm}, \texttt{jfmvar}キーの詳細は\ref{ssec-jfont}節
+ と\ref{ssec-psft}節を参照.
%</ja>
\item[NoEmbed]
@@ -4573,6 +4626,83 @@ JFMの\texttt{chars}テーブルのエントリとして \verb+'AJ1-xxx'+ の形
使えるようになる.これはAdobe-Japan1におけるCID番号が \verb+xxx+ の文字を表す.
%</ja>
+\subsection{\texttt{luatexja-adjust.sty}}
+\label{ssec-adj}
+\begin{figure}[t]
+\def\sq{%
+ \hbox to 1\zw{\hss\fboxsep=-.5\fboxrule\fbox{%
+  \hskip\dimexpr-.5\zw-.2pt\vrule width.4pt height.08\zw depth.12\zw%
+ \hskip\dimexpr.5\zw-.2pt\relax}\hss}}
+\def\sb{\hbox to 1\zw{\hss\fboxsep=-.5\fboxrule\fbox{%
+ ■\hskip\dimexpr-.5\zw-.2pt\vrule width.4pt height.08\zw depth.12\zw%
+ \hskip\dimexpr.5\zw-.2pt\relax}\hss}}
+\newbox\gridbox
+\def\outbox#1{{\Large%
+ \ltjsetparameter{kanjiskip=0pt plus .2\zw minus .2\zw}%
+ \setbox\gridbox=\hbox to 20\zw{\sq\sq\sq\sq\sb\sq\sq\sq\sq\sb\sq\sq\sq\sq\sb\sq\sq\sq\sq\sb}%
+ \hbox{\textcolor{cyan!50!white}{\copy\gridbox}\hskip-20\zw%
+ \vbox{\hsize=20\zw\noindent\leftskip0pt\rightskip0pt\parfillskip0pt#1}\vrule}%
+}}
+
+{\centering
+\begin{tabular}{lc}
+\toprule
+no adjustment&\outbox{以上の原理は,「包除原理」とよく呼ばれるが\hskip-.5\zw\null}\\
+without priority&%
+\ltjdisableadjust
+\outbox{以上の原理は,「包除原理」とよく呼ばれるが}%
+\ltjenableadjust\\
+with priority&%
+\outbox{以上の原理は,「包除原理」とよく呼ばれるが}
+%<!ja>\ltjdisableadjust
+\\
+\bottomrule
+\end{tabular}\par}
+\smallskip
+
+Note: the value of
+\Param{\hyperlink{fld:kanjiskip}{kanjiskip}} is 0\,pt${}^{+1/5\,\mathrm{em}}_{-1/5\,\mathrm{em}}$ in this figure,
+for making the difference obvious.
+%<ja>\caption{行長調整}\label{fig-adj}
+%<en>\caption{Line adjustment}\label{fig-adj}
+\end{figure}
+
+
+%<*en>
+...
+%</en>
+%<*ja>
+\pTeX では,行長調整において優先度の概念が存在しなかったため,図
+\ref{fig-adj}上段における半角分の半端は,図\ref{fig-adj}中段のように,鍵
+括弧周辺の空白と和文間空白(\Param{\hyperlink{fld:kanjiskip}{kanjiskip}})の両方によって負担される.し
+かし,「日本語組版処理の要件」\cite{jlreq}やJIS~X~4051~\cite{x4051}におい
+ては,このような状況では半端は鍵括弧周辺の空白のみで負担し,その他の和文
+文字はベタ組で組まれる(図\ref{fig-adj}下段)ことになっている.この追加
+パッケージは\cite{jlreq}や\cite{x4051}における規定のような,優先順位付き
+の行長調整を提供する.詳細な仕様については\ref{sec-adjspec}を参照.
+
+
+\texttt{luatexja-adjust.sty}は,以下の命令を提供する.これらはすべてグローバルに効力を発揮する.
+
+\begin{list}{}{\def\makelabel{\ttfamily}\def\{{\char`\{}\def\}{\char`\}}\advance\leftmargin1\zw}
+\item[\char92ltjdisableadjust]
+優先順位付きの行長調整を無効化する.
+
+\item[\char92ltjenableadjust]
+優先順位付きの行長調整を有効化する.
+
+\item[優先度設定……]
+
+\end{list}
+
+
+
+
+
+%</ja>
+
+
+
%<en>\part{Implementations}
%<ja>\part{実装}
\label{part-imp}
@@ -4676,18 +4806,18 @@ The amount of shifting the baseline of Japanese fonts in scaled point ($2^{-16}\
\attr{ltj@autospc}
%<*en>
-Whether the auto insertion of \Param{kanjiskip} is allowed at the node.
+Whether the auto insertion of \Param{\hyperlink{fld:kanjiskip}{kanjiskip}} is allowed at the node.
%</en>
%<*ja>
-そのノードで\Param{kanjiskip}の自動挿入が許されるかどうか.
+そのノードで\Param{\hyperlink{fld:kanjiskip}{kanjiskip}}の自動挿入が許されるかどうか.
%</ja>
\attr{ltj@autoxspc}
%<*en>
-Whether the auto insertion of \Param{xkanjiskip} is allowed at the node.
+Whether the auto insertion of \Param{\hyperlink{fld:xks}{xkanjiskip}} is allowed at the node.
%</en>
%<*ja>
-そのノードで\Param{xkanjiskip}の自動挿入が許されるかどうか.
+そのノードで\Param{\hyperlink{fld:xks}{xkanjiskip}}の自動挿入が許されるかどうか.
%</ja>
\attr{ltj@icflag}
@@ -4704,11 +4834,11 @@ assigned to this attribute:
Glues from an italic correction
(\verb+\/+). This distinction of origins of glues
(from explicit \verb+\kern+, or from \verb+\/+)
- is needed in the insertion process of \Param{xkanjiskip}.
+ is needed in the insertion process of \Param{\hyperlink{fld:xks}{xkanjiskip}}.
%</en>
%<*ja>
イタリック補正(\verb+\/+)によるグルー.このグルーの由来の区別(\verb+\kern+ か
-\verb+\/+ か)は\Param{xkanjiskip}の挿入過程において必要になる.
+\verb+\/+ か)は\Param{\hyperlink{fld:xks}{xkanjiskip}}の挿入過程において必要になる.
%</ja>
\item[\textit{packed} (2)]
@@ -4721,7 +4851,7 @@ Penalties inserted for the word-wrapping process of Japanese characters (\emph{k
和文文字のワードラップ過程において挿入されたペナルティ(\emph{kinsoku}).
%</ja>
-\item[\textit{from\_jfm} (4)]
+\item[\textit{from\_jfm} (6)]
%<*en>
Glues/kerns from JFM.
%</en>
@@ -4729,32 +4859,32 @@ Glues/kerns from JFM.
JFM由来のグルー/カーン.
%</ja>
-\item[\textit{line\_end} (5)]
-%<*en>
-Kerns for \ldots
-%</en>
-%<*ja>
-和文文字が行末にきたとき,行末との間に挿入されるカーンである.
-% ぶら下げ組への応用
-%</ja>
+%%\item[\textit{line\_end} (5)]
+%%%<*en>
+%%Kerns for \ldots
+%%%</en>
+%%%<*ja>
+%%和文文字が行末にきたとき,行末との間に挿入されるカーンである.
+%%% ぶら下げ組への応用
+%%%</ja>
-\item[\textit{kanji\_skip} (6)]
+\item[\textit{kanji\_skip} (9)]
%<*en>
-Glues for \Param{kanjiskip}.
+Glues for \Param{\hyperlink{fld:kanjiskip}{kanjiskip}}.
%</en>
%<*ja>
-\Param{kanjiskip}のグルー.
+\Param{\hyperlink{fld:kanjiskip}{kanjiskip}}のグルー.
%</ja>
-\item[\textit{xkanji\_skip} (7)]
+\item[\textit{xkanji\_skip} (10)]
%<*en>
-Glues for \Param{xkanjiskip}.
+Glues for \Param{\hyperlink{fld:xks}{xkanjiskip}}.
%</en>
%<*ja>
-\Param{xkanjiskip}のグルー.
+\Param{\hyperlink{fld:xks}{xkanjiskip}}のグルー.
%</ja>
-\item[\textit{processed} (8)]
+\item[\textit{processed} (11)]
%<*en>
Nodes which is already processed by \ldots.
%</en>
@@ -4762,7 +4892,7 @@ Nodes which is already processed by \ldots.
\LuaTeX-ja の内部処理によって既に処理されたノード.
%</ja>
-\item[\textit{ic\_processed} (9)]
+\item[\textit{ic\_processed} (12)]
%<*en>
Glues from an italic correction, but also already processed.
%</en>
@@ -4861,13 +4991,13 @@ These whatsits will be removed during the process of inserting \textbf{JAglue}s.
%<*en>
\LuaTeX-ja has its own stack system, and most parameters of \LuaTeX-ja
are stored in it. To clarify the reason, imagine the parameter
-\Param{kanjiskip} is stored by a skip, and consider the following
+\Param{\hyperlink{fld:kanjiskip}{kanjiskip}} is stored by a skip, and consider the following
source:
%</en>
%<*ja>
\LuaTeX-jaは独自のスタックシステムを持ち,\LuaTeX-jaのほとんどのパラメータは
これを用いて保持されている.その理由を明らかにするために,
-\Param{kanjiskip}パラメータがスキップレジスタで保持されているとし,
+\Param{\hyperlink{fld:kanjiskip}{kanjiskip}}パラメータがスキップレジスタで保持されているとし,
以下のコードを考えてみよう:
%</ja>
\begin{LTXexample}
@@ -4878,16 +5008,16 @@ source:
%<*en>
As described in Subsection~\ref{ssec-param}, the only effective value of
-\Param{kanjiskip} in an hbox is the latest value, so the value of
-\Param{kanjiskip} which applied in the entire hbox should be 5\,pt.
+\Param{\hyperlink{fld:kanjiskip}{kanjiskip}} in an hbox is the latest value, so the value of
+\Param{\hyperlink{fld:kanjiskip}{kanjiskip}} which applied in the entire hbox should be 5\,pt.
However, by the implementation method of \LuaTeX, this `5\,pt' cannot be
known from any callbacks. In the \texttt{tex/packaging.w} (which is a
file in the source of \LuaTeX), there are the following codes:
%</en>
%<*ja>
\ref{ssec-param}節で述べたように,ある水平ボックスの中で効力を持つ
-\Param{kanjiskip}の値は最後に現れた値のみであり,したがってボックス全体に適用される
-\Param{kanjiskip}は5\,ptであるべきである.しかし,\LuaTeX の実装のために,
+\Param{\hyperlink{fld:kanjiskip}{kanjiskip}}の値は最後に現れた値のみであり,したがってボックス全体に適用される
+\Param{\hyperlink{fld:kanjiskip}{kanjiskip}}は5\,ptであるべきである.しかし,\LuaTeX の実装のために,
この`5\,pt'はどのコールバックからも知ることはできない.
\texttt{tex/packaging.w}(これは\LuaTeX のソースファイルである)の中に,
以下のコードがある:
@@ -5144,19 +5274,19 @@ after `beginning/ending of a group' characters.
\item[\textsf{5}] \textit{end-of-line} (usually \verb+^^J+).
\item[\textsf{10}] space (usually \sp).
\item[\textsf{O}] other characters, whose category code is in $\{3,4,6,7,8,11,12,13\}$.
-\item[\textsf{[\sp]}, \textsf{[{\tt\char92par}]}]
+\item[\textsf{[\sp]}, \textsf{[{\tt\char92par}]}]
emits a space, or~\verb+\par+.
\end{description}
\end{minipage}
\begin{itemize}
-\item We omitted about category codes
+\item We omitted about category codes
9~(\textit{ignored}), 14~(\textit{comment})~and~15~(\textit{invalid})
from the above diagram. We also ignored the input like `\verb+^^A+' or `\verb+^+\verb+^df+'.
-\item When a character whose category code is 0 (\textit{escape character}) is seen by \TeX,
-the input processor scans a control sequence (\textsf{scan a c.s.}).
+\item When a character whose category code is 0 (\textit{escape character}) is seen by \TeX,
+the input processor scans a control sequence (\textsf{scan a c.s.}).
These paths are not shown in the above diagram.
-After that, the state is changed to State~$S$ (skipping blanks) in most cases, but
+After that, the state is changed to State~$S$ (skipping blanks) in most cases, but
to State~$M$ (middle of line) sometimes.
\end{itemize}
%<en>\caption{State transitions of \pTeX's input processor.}
@@ -5278,17 +5408,17 @@ u
%<ja>\subsection{概要}
%<zh>\subsection{概要}
-\LuaTeX-jaにおける和文処理グルーの挿入方法は,\pTeX のそれとは全く異なる.
+\LuaTeX-jaにおける \textbf{JAglue} の挿入方法は,\pTeX のそれとは全く異なる.
\pTeX では次のような仕様であった:
\begin{itemize}
\item JFMグルーの挿入は,和文文字を表すトークンを元に水平リストに(文字を表す)<char\_node>を
追加する過程で行われる.
-\item \Param{xkanjiskip}の挿入は,水平ボックスへのパッケージングや行分割前に行われる.
-\item \Param{kanjiskip}はノードとしては挿入されない.パッケージングや行分割の計算時に
-「和文文字を表す2つの<char\_node>の間には\Param{kanjiskip}がある」ものとみなされる.
+\item \Param{\hyperlink{fld:xks}{xkanjiskip}}の挿入は,水平ボックスへのパッケージングや行分割前に行われる.
+\item \Param{\hyperlink{fld:kanjiskip}{kanjiskip}}はノードとしては挿入されない.パッケージングや行分割の計算時に
+「和文文字を表す2つの<char\_node>の間には\Param{\hyperlink{fld:kanjiskip}{kanjiskip}}がある」ものとみなされる.
\end{itemize}
しかし,\LuaTeX-jaでは,水平ボックスへのパッケージングや行分割前に全ての
-\textbf{JAglue},即ちJFMグルー・\Param{xkanjiskip}・\Param{kanjiskip}の
+\textbf{JAglue},即ちJFMグルー・\Param{\hyperlink{fld:xks}{xkanjiskip}}・\Param{\hyperlink{fld:kanjiskip}{kanjiskip}}の
3種類を一度に挿入することになっている.これは,\LuaTeX において欧文の合字・
カーニング処理がノードベースになったことに対応する変更である.
@@ -5480,7 +5610,7 @@ $\mathit{Np}.\mathit{head}$, $\mathit{Np}.\mathit{tail}$の算出は,\textbf{
\textit{id}が\textit{id\_pbox}であって$\mathit{Np}.\mathit{head}$が\textbf{JAchar}であるとき.
\item[和文B] リスト中の水平ボックスの中身の先頭として出現した和文文字.和文Aとの違いは,これの前に
-JFMグルーの挿入が行われない(\Param{xkanjiskip},~\Param{kanjiskip}は入り得る)ことである.\\
+JFMグルーの挿入が行われない(\Param{\hyperlink{fld:xks}{xkanjiskip}},~\Param{\hyperlink{fld:kanjiskip}{kanjiskip}}は入り得る)ことである.\\
\textit{id}が\textit{id\_hlist}か\textit{id\_disc}であって$\mathit{Np}.\mathit{head}$が\textbf{JAchar}であるとき.
\item[欧文] リスト中に直接/水平ボックスの中身として出現している欧文文字.次の3つの場合が該当:
@@ -5565,24 +5695,59 @@ $g$は「文字コード\texttt{'boxbdd'}の文字」と\textit{Np}の間に入
まず,「右空白」にあたる量を算出する.通常はこれが,隣り合った2つの和文文字間に入る空白量となる.
\begin{description}
\item[JFM由来{[M]}] JFMの文字クラス指定によって入る空白を以下によって求める.この段階で空白量が未定義(未指定)だった場合,
- デフォルト値\Param{kanjiskip}を採用することとなるので,次へ.
+ デフォルト値\Param{\hyperlink{fld:kanjiskip}{kanjiskip}}を採用することとなるので,次へ.
\begin{enumerate}
\item もし両クラスタの間で\verb+\inhibitglue+が実行されていた場合(証としてwhatsitノードが自動挿入される),
- 代わりに\Param{kanjiskip}が挿入されることとなる.次へ.
+ 代わりに\Param{\hyperlink{fld:kanjiskip}{kanjiskip}}が挿入されることとなる.次へ.
\item \textit{Nq}と\textit{Np}が同じJFM・同じ\texttt{jfmvar}キー・同じサイズの和文フォントであったならば,
- 共通に使っているJFM内で挿入される空白(グルーかカーン)が決まっているか調べる.
+ 共通に使っているJFM内で挿入される空白(グルーかカーン)が決まっているか調べ,決まっていればそれを採用.
\item 1.でも2.でもない場合は,\textit{Nq}と\textit{Np}が違うJFM/\texttt{jfmvar}/サイズである.
この場合,まず
\[
-\vcenter{\halign{\hfil$#:={}$&(\inhibitglue#\inhibitglue)\cr
-gb&\textit{Nq}と「文字コードが{\tt'diffmet'}の文字」との間に入るグルー/カーン\cr
-ga&「文字コードが{\tt'diffmet'}の文字」と\textit{Np}との間に入るグルー/カーン\cr
+\vcenter{\halign{\hfil$#:={}$&\inhibitglue#\inhibitglue\cr
+gb&(\textit{Nq}と「使用フォントが\textit{Nq}のそれと同じで,\hfil\cr
+\omit&\quad 文字コードが\textit{Np}のそれの文字」との間に入るグルー/カーン)\hfil\cr
+ga&(\inhibitglue 「使用フォントが\textit{Np}のそれと同じで,\hfil\cr
+\omit&\quad 文字コードが\textit{Nq}のそれの文字」と\textit{Np}との間に入るグルー/カーン)\hfil\cr
}}
\]
-として,左側由来・右側由来の空白(グルー/カーン)を(それぞれのJFMから)求める.
-$\mathit{ga}$と$\mathit{gb}$のどちらか片方が未定義であるならば,定義されている側の値をそのまま採用する.
-もし$\mathit{ga}$と$\mathit{gb}$が両方決まっているならば,両者の値を平均\footnote{\Param{differentjfm}パラメタの
-値によって,「大きい方」「小さい方」「合計」に変えることができる.}した値を採用する.
+として,前側の文字のJFMを使った時の空白(グルー/カーン)と,後側の文字のJFMを使った時のそれを求める.
+
+$\mathit{gb}$,~$\mathit{ga}$それぞれに対する<ratio>の値を$d_b$,~$d_a$とする.
+\begin{itemize}
+\item
+$\mathit{ga}$と$\mathit{gb}$の両方が未定義であるならば,JFM由来のグルーは挿入されず,\Param{\hyperlink{fld:kanjiskip}{kanjiskip}}を採用することとなる.どちらか片方のみが未定義であるならば,次のステップでその未定義の方は長さ0のkernで,<ratio>の値は0であるかのように扱われる.
+\item
+\Param{\hyperlink{fld:diffjfm}{diffrentjfm}}の値が\texttt{pleft}, \texttt{pright}, \texttt{paverage}のとき,
+<ratio>の指定に従って比例配分を行う.
+JFM由来のグルー/カーンは以下の値となる:
+\[
+ f\left(\frac{1-d_b}2\textit{gb} + \frac{1+d_b}2\textit{ga},
+\frac{1-d_a}2\textit{gb} + \frac{1+d_a}2\textit{ga}\right)
+\]
+ここで.$f(x,y)$は
+\[
+ f(x,y)=\begin{cases}
+x&\text{if\ }\Param{\hyperlink{fld:diffjfm}{diffrentjfm}}=\texttt{pleft};\\
+y&\text{if\ }\Param{\hyperlink{fld:diffjfm}{diffrentjfm}}=\texttt{pright};\\
+(x+y)/2&\text{if\ }\Param{\hyperlink{fld:diffjfm}{diffrentjfm}}=\texttt{paverage};
+\end{cases}.
+\]
+\item
+\Param{differentmet}がそれ以外の値の時は,<ratio>の値は無視され,JFM由来のグルー/カーンは以下の値となる:
+\[
+ f(\textit{gb},\textit{ga})
+\]
+ここで.$f(x,y)$は
+\[
+ f(x,y)=\begin{cases}
+\min(x,y)&\text{if\ }\Param{\hyperlink{fld:diffjfm}{diffrentjfm}}=\texttt{small};\\
+\max(x,y)&\text{if\ }\Param{\hyperlink{fld:diffjfm}{diffrentjfm}}=\texttt{large};\\
+(x+y)/2&\text{if\ }\Param{\hyperlink{fld:diffjfm}{diffrentjfm}}=\texttt{average};\\
+x+y&\text{if\ }\Param{\hyperlink{fld:diffjfm}{diffrentjfm}}=\texttt{both};
+\end{cases}.
+\]
+\end{itemize}
\end{enumerate}
例えば,
@@ -5601,37 +5766,38 @@ $\mathit{ga}$と$\mathit{gb}$のどちらか片方が未定義であるならば
この場合,$p$と$q$の間は,実フォントが異なるにもかかわらず(2)の状況となる一方で,
$q$と$r$の間は(実フォントが同じなのに)\texttt{jfmvar}キーの内容が異なるので(3)の状況となる.
\item[\Param{kanjiskip}~{[K]}] 上の[M]において空白が定まらなかった場合,
-\Param{kanjiskip}の値を以下で定め,それを「右空白」として採用する.
+以下で定めた量「右空白」として採用する.
この段階においては,\verb+\inhibitglue+は効力を持たないため,
結果として,2つの和文文字間には常に何らかのグルー/カーンが挿入されることとなる.
\begin{enumerate}
\item 両クラスタ(厳密には$\mathit{Nq}.\mathit{tail}$,$\mathit{Np}.\mathit{head}$)の中身の文字コードに対する
\Param{autospacing}パラメタが両方ともfalseだった場合は,長さ0のglueとする.
-\item ユーザ側から見た\Param{kanjiskip}パラメタの自然長が${\tt \char92 maxdimen}=(2^{30}-1)\,{\rm sp}$で
-なければ,\Param{kanjiskip}パラメタの値を持つglueを採用する.
-\item 2.でない場合は,\textit{Nq}, \textit{Np}で使われているJFMに指定されている\Param{kanjiskip}の値を用いる.
+\item ユーザ側から見た\Param{\hyperlink{fld:kanjiskip}{kanjiskip}}パラメタの自然長が${\tt \char92 maxdimen}=(2^{30}-1)\,{\rm sp}$で
+なければ,\Param{\hyperlink{fld:kanjiskip}{kanjiskip}}パラメタの値を持つglueを採用する.
+\item 2.でない場合は,\textit{Nq}, \textit{Np}で使われているJFMに指定されている\Param{\hyperlink{fld:kanjiskip}{kanjiskip}}の値を用いる.
どちらか片方のクラスタだけが和文文字(\textsf{和文A}・\textsf{和文B})のときは,そちらのクラスタで使われている
JFM由来の値だけを用いる.もし両者で使われているJFMが異なった場合は,上の[M]~3.と同様の方法を用いて調整する.
\end{enumerate}
\end{description}
\paragraph{「左空白」の算出とそれに伴う補正}
-次に,「左空白」にあたる量を算出する:
-\begin{description}
-\item[line-end~{[E]}]
-\textit{Nq}と\textit{Np}の間で行分割が起きたときに,
-\textit{Nq}と行末の間に入る空白である.ぶら下げ組の組版などに用いられることを期待している.
-\begin{enumerate}
-\item 既に算出した「右空白」がカーンである場合は,「左空白」は挿入されない.
-\item 「右空白」がglueか未定義(長さ0のglueとみなす)の場合は,「左空白」は
-\textit{Nq}と「文字コード\texttt{'lineend'}の文字」との間に入るカーンとして,JFMから決定される.
-\item 2.で決まった「左空白」の長さが0でなければ,その分だけ先ほど算出した「右空白」の自然長を引く.
-\end{enumerate}
-\end{description}
+「左空白」は過去のバージョンでは定義していたが,このバージョンでは挿入は一切行われない(機能自体削除している).しかし,仕様は流動的であり,将来復活する可能性もあるため,マニュアル中の記述は今のところ極力変更しない.
+% 次に,「左空白」にあたる量を算出する:
+% \begin{description}
+% \item[line-end~{[E]}]
+% \textit{Nq}と\textit{Np}の間で行分割が起きたときに,
+% \textit{Nq}と行末の間に入る空白である.ぶら下げ組の組版などに用いられることを期待している.
+% \begin{enumerate}
+% \item 既に算出した「右空白」がカーンである場合は,「左空白」は挿入されない.
+% \item 「右空白」がglueか未定義(長さ0のglueとみなす)の場合は,「左空白」は
+% \textit{Nq}と「文字コード\texttt{'lineend'}の文字」との間に入るカーンとして,JFMから決定される.
+% \item 2.で決まった「左空白」の長さが0でなければ,その分だけ先ほど算出した「右空白」の自然長を引く.
+% \end{enumerate}
+% \end{description}
\paragraph{禁則用ペナルティの挿入}
まず,
\[
- a:=(\text{\textit{Nq}{\footnotemark}の文字に対する\Param{postbreakpenalty}の値})
-+(\text{\textit{Np}{\footnotemark}の文字に対する\Param{prebreakpenalty}の値})
+ a:=(\text{\textit{Nq}{\footnotemark}の文字に対する\Param{\hyperlink{fld:postbp}{postbreakpenalty}}の値})
++(\text{\textit{Np}{\footnotemark}の文字に対する\Param{\hyperlink{fld:prebp}{prebreakpenalty}}の値})
\]
とおく\footnotetext{厳密にはそれぞれ$\mathit{Nq}.\mathit{tail}$,$\mathit{Np}.\mathit{head}$.}.
ペナルティは通常$[-10000,10000]$の整数値をとり,また$\pm 10000$は正負の無限大を意味することになっているが,この$a$の
@@ -5733,7 +5899,7 @@ If this attempt fails, \LuaTeX-ja use the method `\textsf{\Param{kanjiskip}~[K]}
\textit{Nq}が\textsf{和文A}で,\textit{Np}が\textsf{欧文}の場合,JFMグルー挿入処理は次のようにして行われる.
\begin{itemize}
\item 「右空白」については,まず以下に述べる\textsf{Boundary-B~[\OB]}により空白を決定しようと試みる.
-それが失敗した場合は,\textsf{\Param{xkanjiskip}~[X]}によって定める.
+それが失敗した場合は,\textsf{\Param{\hyperlink{fld:xks}{xkanjiskip}}~[X]}によって定める.
\item 「左空白」については,既に述べた\textsf{line-end~[E]}をそのまま採用する.それに伴う「右空白」の補正も同じ.
\item 禁則用ペナルティも,以前述べた\textsf{P-normal~[PN]}と同じである.
\end{itemize}
@@ -5747,23 +5913,23 @@ If this attempt fails, \LuaTeX-ja use the method `\textsf{\Param{kanjiskip}~[K]}
\item そうでなければ,
\textit{Nq}と「文字コードが{\tt'jcharbdd'}の文字」との間に入るグルー/カーンとして定まる.
\end{enumerate}
-\item[\Param{xkanjiskip}~{[X]}]
+\item[\Param{\hyperlink{fld:xks}{xkanjiskip}}~{[X]}]
この段階では,\textsf{\Param{kanjiskip}~[K]}のときと同じように,
-\Param{xkanjiskip}の値を以下で定め,それを「右空白」として採用する.
+以下で定めた量を「右空白」として採用する.
この段階で\verb+\inhibitglue+は効力を持たないのも同じである.
\begin{enumerate}
-\item 以下のいずれかの場合は,\Param{xkanjiskip}の挿入は抑止される.しかし,実際には行分割を許容するために,長さ0のglueを採用する:
+\item 以下のいずれかの場合は,\Param{\hyperlink{fld:xks}{xkanjiskip}}の挿入は抑止される.しかし,実際には行分割を許容するために,長さ0のglueを採用する:
\begin{itemize}
\item 両クラスタにおいて,それらの中身の文字コードに対する\Param{autoxspacing}パラメタが共にfalseである.
-\item \textit{Nq}の中身の文字コードについて,「直後への\Param{xkanjiskip}の挿入」が禁止されている
+\item \textit{Nq}の中身の文字コードについて,「直後への\Param{\hyperlink{fld:xks}{xkanjiskip}}の挿入」が禁止されている
(つまり,\Param{jaxspmode}~(or \Param{alxspmode})パラメタが2以上).
-\item \textit{Np}の中身の文字コードについて,「直前への\Param{xkanjiskip}の挿入」が禁止されている
+\item \textit{Np}の中身の文字コードについて,「直前への\Param{\hyperlink{fld:xks}{xkanjiskip}}の挿入」が禁止されている
(つまり,\Param{jaxspmode}~(or \Param{alxspmode})パラメタが偶数).
\end{itemize}
-\item ユーザ側から見た\Param{xkanjiskip}パラメタの自然長が${\tt \char92 maxdimen}=(2^{30}-1)\,{\rm sp}$で
-なければ,\Param{xkanjiskip}パラメタの値を持つglueを採用する.
+\item ユーザ側から見た\Param{\hyperlink{fld:xks}{xkanjiskip}}パラメタの自然長が${\tt \char92 maxdimen}=(2^{30}-1)\,{\rm sp}$で
+なければ,\Param{\hyperlink{fld:xks}{xkanjiskip}}パラメタの値を持つglueを採用する.
\item 2.でない場合は,\textit{Nq}, \textit{Np}(\textsf{和文A}/\textsf{和文B}なのは片方だけ)
-で使われているJFMに指定されている\Param{xkanjiskip}の値を用いる.
+で使われているJFMに指定されている\Param{\hyperlink{fld:xks}{xkanjiskip}}の値を用いる.
\end{enumerate}
\end{description}
@@ -5772,7 +5938,7 @@ If this attempt fails, \LuaTeX-ja use the method `\textsf{\Param{kanjiskip}~[K]}
\textsf{和文A}のクラスタが逆になるので,\textsf{Boundary-A~[\OA]}の部分が変わるだけ.
\begin{itemize}
\item 「右空白」については,まず以下に述べる\textsf{Boundary-A~[\OA]}により空白を決定しようと試みる.
-それが失敗した場合は,\textsf{\Param{xkanjiskip}~[X]}によって定める.
+それが失敗した場合は,\textsf{\Param{\hyperlink{fld:xks}{xkanjiskip}}~[X]}によって定める.
\item \textit{Nq}が和文でないので,「左空白」は算出されない.
\item 禁則用ペナルティは,以前述べた\textsf{P-normal~[PN]}と同じである.
\end{itemize}
@@ -5799,9 +5965,9 @@ If this attempt fails, \LuaTeX-ja use the method `\textsf{\Param{kanjiskip}~[K]}
\item 「左空白」については,既に述べた\textsf{line-end~[E]}の算出方法をそのまま採用する.それに伴う「右空白」の補正も同じ.
\item 禁則用ペナルティの処理は,後ろのクラスタ\textit{Np}の種類によって異なる.
なお,$\mathit{Np}.\mathit{head}$は無意味であるから,
-「$\mathit{Np}.\mathit{head}$に対する\Param{prebreakpenalty}の値」は0とみなされる.言い換えれば,
+「$\mathit{Np}.\mathit{head}$に対する\Param{\hyperlink{fld:prebp}{prebreakpenalty}}の値」は0とみなされる.言い換えれば,
\[
- a:=(\text{\textit{Nq}{\footnotemark}の文字に対する\Param{postbreakpenalty}の値}).
+ a:=(\text{\textit{Nq}{\footnotemark}の文字に対する\Param{\hyperlink{fld:postbp}{postbreakpenalty}}の値}).
\]
\begin{description}
\item[箱] \textit{Np}が\textsf{箱}であった場合は,両クラスタの間での行分割は
@@ -5845,7 +6011,7 @@ If this attempt fails, \LuaTeX-ja use the method `\textsf{\Param{kanjiskip}~[K]}
\overbrace{\Node{glyph}{`あ'}}^{\mathit{Nq}}\longrightarrow \overbrace{\Node{glue}{1\,pt}}^{\mathit{Np}}
\]
のような状況を考える.
-このとき,$a$,即ち「あ」の\Param{postbreakpenalty}がいかなる値であっても,
+このとき,$a$,即ち「あ」の\Param{\hyperlink{fld:postbp}{postbreakpenalty}}がいかなる値であっても,
この2クラスタ間は最終的に
\begin{equation}
\overbrace{\Node{glyph}{`あ'}}^{\mathit{Nq}}\longrightarrow
@@ -5853,7 +6019,7 @@ If this attempt fails, \LuaTeX-ja use the method `\textsf{\Param{kanjiskip}~[K]}
\label{eq-gref}
\end{equation}
となり,$a$分のペナルティは挿入されないことに注意して欲しい.
-\Param{postbreakpenalty}は($a$は)殆どの場合が非負の値と考えられ,そのような場合では
+\Param{\hyperlink{fld:postbp}{postbreakpenalty}}は($a$は)殆どの場合が非負の値と考えられ,そのような場合では
\eqref{eq-gref}と
\[
\overbrace{\Node{glyph}{`あ'}}^{\mathit{Nq}}\longrightarrow
@@ -5874,7 +6040,7 @@ If this attempt fails, \LuaTeX-ja use the method `\textsf{\Param{kanjiskip}~[K]}
\item 禁則用ペナルティの処理は,\textit{Nq}の種類によって異なる.
$\mathit{Nq}.\mathit{tail}$は無意味なので,
\[
- a:=(\text{\textit{Np}{\footnotemark}の文字に対する\Param{prebreakpenalty}の値}).
+ a:=(\text{\textit{Np}{\footnotemark}の文字に対する\Param{\hyperlink{fld:prebp}{prebreakpenalty}}の値}).
\]
\begin{description}
\item[箱] \textit{Nq}が\textsf{箱}の場合は,\textsf{P-allow~[PA]}を用いる.
@@ -5899,7 +6065,7 @@ $\mathit{Nq}.\mathit{tail}$は無意味なので,
\item \textsf{和文B}と箱・グルー・カーンが隣接したとき(どちらが前かは関係ない),間にJFMグルー・ペナルティの挿入は一切しない.
\item \textsf{和文B}と\textsf{和文B},また\textsf{和文B}と\textsf{欧文}とが隣接した時は,禁則用ペナルティ挿入処理は
\textsf{P-suppress~[PS]}が用いられる.
-\item \textsf{和文B}の文字に対する\Param{prebreakpenalty},~\Param{postbreakpenalty}の値は使われず,0として計算される.
+\item \textsf{和文B}の文字に対する\Param{\hyperlink{fld:prebp}{prebreakpenalty}},~\Param{\hyperlink{fld:postbp}{postbreakpenalty}}の値は使われず,0として計算される.
\end{itemize}
@@ -5911,50 +6077,130 @@ $\mathit{Nq}.\mathit{tail}$は無意味なので,
\end{LTXexample}
\begin{itemize}
\item 1行目の\verb+\inhibitglue+は\textsf{Boundary-B~[\OB]}の処理のみを抑止するので,ピリオドと「A」の間には
-\Param{xkanjiskip}(四分アキ)が入ることに注意.
+\Param{\hyperlink{fld:xks}{xkanjiskip}}(四分アキ)が入ることに注意.
\item 2行目のピリオドと「A」の間においては,前者が\textsf{和文B}となる(水平ボックスの中身の末尾として登場しているから)ので,
-そもそも\textsf{Boundary-B~[\OB]}の処理は行われない.よって,\Param{xkanjiskip}が入ることとなる.
+そもそも\textsf{Boundary-B~[\OB]}の処理は行われない.よって,\Param{\hyperlink{fld:xks}{xkanjiskip}}が入ることとなる.
\item 3行目では,ピリオドの属するクラスタは\textsf{和文A}である.これによって,
ピリオドと「A」の間には\textsf{Boundary-B~[\OB]}由来の半角アキが入ることになる.
\end{itemize}
\section{psft}
+...
+%<en>\section{Patch for the \Pkg{listings} package}
+%<zh>\section{Patch for the \Pkg{listings} package}
+%<ja>\section{\Pkg{listings} パッケージへの対応}
+
+%<*en>
+It is well-known that the \Pkg{listings} package outputs weird results
+for Japanese input.
+The \Pkg{listings} package makes most of letters active and assigns
+output command for each letter \cite{listings}.
+But Japanese characters are not included in these activated letters.
+For \pTeX{} series, there is no method to make Japanese characters active;
+a patch \Pkg{jlisting.sty} \cite{jlisting} resolves the problem forcibly.
+%</en>
%<*ja>
-\section{\Pkg{listings} パッケージへの対応}
\Pkg{listings} パッケージが,そのままでは日本語をまともに出力できないこと
-はよく知られている,きちんと整形して出力するために,\Pkg{listings}パッケー
+はよく知られている.きちんと整形して出力するために,\Pkg{listings}パッケー
ジは内部で「ほとんどの文字」をアクティブにし,各文字に対してその文字の出
-力命令を割り当てている (\cite{listings}).
+力命令を割り当てている \cite{listings}.
しかし,そこでアクティブにする文字の中に,和文文
-字がないためである.p\TeX 系列では,和文文字をアクティブにする手法がなく,
-\Pkg{jlisting.sty} というパッチ\cite{jlisting}を用いることで無理やり解決していたが,
-\LuaTeX-jaでは,(\LuaTeX がネイティブでUnicodeを理解することから)「和文
-文字をアクティブ化し,それらに対して適切に出力命令を設定する」というより正統的な
-方法を取ることにした.
+字がないためである.\pTeX 系列では,和文文字をアクティブにする手法がなく,
+\Pkg{jlisting.sty} というパッチ\cite{jlisting}を用いることで無理やり解決していた.
+%</ja>
+%<*en>
+In \LuaTeX-ja, the problem is resolved by using \verb+process_input_buffer+ callback.
+The callback function inserts the output command before each letter above U+0080.
+This method can omits the process to make all Japanese characters active
+(most of the activated characters are not used in many cases).
+%</en>
+%<*ja>
+\LuaTeX-jaでは,\verb+process_input_buffer+ コールバックを利用することで,
+「各行に出現するU+0080以降の文字に対して,それらの出力命令を前置する」という方法をとっている.
+これにより,(入力には使用されていないかもしれない)和文文字をもすべてアクティブ化する手間もなく,
+見通しが良い実装になっている.
+%</ja>
+
+%<*en>
+If \Pkg{listings.sty} and \LuaTeX-ja were loaded,
+then the patch \Pkg{lltjp-listings.sty} is loaded automatically at \verb+\begin{document}+.
+%</en>
+%<*ja>
\LuaTeX-ja で利用される \Pkg{listings} パッケージへのパッチ \Pkg{lltjp-listings.sty} は,
\Pkg{listings.sty} と\LuaTeX-jaを読み込んでおけば,
\verb+\begin{document}+ の箇所において自動的に読み込まれるので,通常はあまり
意識する必要はない.
+%</ja>
-\paragraph{文字種}
+%<en>\paragraph{Class of characters}
+%<ja>\paragraph{文字種}
+
+%<*en>
+Roughly speaking, the \Pkg{listings} package processes input as follows:
+%</en>
+%<*ja>
\Pkg{listings} パッケージの内部では,大雑把に言うと
+%</ja>
\begin{enumerate}
+%<zh>\item ...
+%<*en>
+\item Collects \textit{letters} and \textit{digits}, which can be used for the name of identifiers.
+%</en>
+%<*ja>
\item 識別子として使える文字 (``letter'',~``digit'') たちを
集める.
+%</ja>
+%<*en>
+\item When reading an \textit{other}, outputs the collected character string (with modification, if needed).
+%</en>
+%<*ja>
\item letterでもdigitでもない文字が現れた時に,収集した文字列を(必要なら修飾して)出力する.
+%</ja>
+%<*en>
+\item Collects \textit{others}.
+%</en>
+%<*ja>
\item 今度は逆に,letterでない文字たちをletterが現れるまで集める.
+%</ja>
+%<*en>
+\item When reading a \textit{letter} or a \textit{digit}, outputs the collected character string.
+%</en>
+%<*ja>
\item letterが出現したら集めた文字列を出力する.
+%</ja>
+%<*en>
+\item Turns back to 1.
+%</en>
+%<*ja>
\item 1.に戻る.
+%</ja>
\end{enumerate}
+%<*en>
+By the above process, line breaks inside of an identifier are blocked.
+A flag \verb+\lst@ifletter+ indicates whether the previous character can be used
+for the name of identifiers or not.
+%</en>
+%<*ja>
という処理が行われている.これにより,識別子の途中では行分割が行われないようになっている.
直前の文字が識別子として使えるか否かは \verb+\lst@ifletter+ というフラグに格納されている.
+%</ja>
+%<*en>
+For Japanese characters, line breaks are permitted on both sides
+except for parentheses, dashes, etc.
+To process Japanese characters,
+The pacth \Pkg{lltjp-listings.sty} introduces a new flag \verb+\lst@ifkanji+, which indicates
+whether the previous character is Japanese character or not.
+For illustration, we introduce the following classes of character:
+%</en>
+%<*ja>
さて,日本語の処理である.殆どの和文文字の前後では行分割が可能であるが,その一方で
括弧類や音引きなどでは禁則処理が必要なことから,\Pkg{lltjp-listings.sty} では,
-直前が和文文字であるかを示すフラグ \verb+lst@kanji+ を新たに導入した.
+直前が和文文字であるかを示すフラグ \verb+\lst@ifkanji+ を新たに導入した.
以降,説明のために以下のように文字を分類する:
+%</ja>
\begin{center}
\small
\begin{tabular}{lccccc}
@@ -5962,23 +6208,55 @@ $\mathit{Nq}.\mathit{tail}$は無意味なので,
&Letter&Other&Kanji&Open&Close\\\midrule
\verb+\lst@ifletter+&T&F&T&F&T\\
\verb+\lst@ifkanji+&F&F&T&T&F\\
-意図&識別子中の文字&その他欧文文字&殆どの和文文字&開き括弧類&閉じ括弧類\\
+%<en>Meaning&identifier char&other alphabet&most of Japanese char&open paren&close paren\\
+%<ja>意図&識別子中の文字&その他欧文文字&殆どの和文文字&開き括弧類&閉じ括弧類\\
\bottomrule
\end{tabular}
\end{center}
+%<*en>
+Note that \textit{digits} in the \Pkg{listings} package can be Letter or
+Other according to circumstances.
+%</en>
+%<*ja>
なお,本来の\Pkg{listings} パッケージでの分類``digit''は,
出現状況によって,上の表のLetterとOtherのどちらにもなりうる.
また,KanjiとCloseは \verb+\lst@ifletter+ と \verb+\lst@ifkanji+ の値が一致しているが,
これは間違いではない.
+%</ja>
+%<*en>
+For example, let us consider the case an Open comes after a Letter.
+Since an Open represents Japanese open parenthesis,
+it is preferred to be permitted to insert line break after the Letter.
+Therefore, the collected character string is output in this case.
+%</en>
+%<*ja>
例えば,Letterの直後にOpenが来た場合を考える.
文字種Openは和文開き括弧類を想定しているので,Letterの直後では行分割が可能であることが望ましい.
そのため,この場合では,すでに収集されている文字列を出力することで行分割を許容するようにした.
+%</ja>
+
+%<*en>
+The following table summarizes $5\times 5=25$ cases:
+%</en>
+%<*ja>
同じように,$5\times 5=25$通り全てについて書くと,次のようになる:
+%</ja>
\begin{center}
\small
\begin{tabular}{llccccc}
\toprule
+%<*en>
+&&\multicolumn{4}{c}{Next}\\\cmidrule(lr){3-7}
+&&\hbox to 4em{\hss Letter\hss}&\hbox to 4em{\hss Other\hss}
+&\hbox to 4em{\hss Kanji\hss}&\hbox to 4em{\hss Open\hss}&Close\\\midrule
+&Letter&collects&\multicolumn{3}{c}{\hrulefill \ outputs\ \hrulefill}&collects\\
+&Other&outputs&collects&\multicolumn{2}{c}{\hrulefill \ outputs\ \hrulefill}&collects\\
+Prev&Kanji&\multicolumn{4}{c}{\hrulefill \ outputs\ \hrulefill}&collects\\
+&Open&\multicolumn{5}{c}{\hrulefill \ collects\ \hrulefill}\\
+&Close&\multicolumn{4}{c}{\hrulefill \ outputs\ \hrulefill}&collects\\
+%</en>
+%<*ja>
&&\multicolumn{4}{c}{後ろ側の文字}\\\cmidrule(lr){3-7}
&&\hbox to 4em{\hss Letter\hss}&\hbox to 4em{\hss Other\hss}
&\hbox to 4em{\hss Kanji\hss}&\hbox to 4em{\hss Open\hss}&Close\\\midrule
@@ -5987,75 +6265,243 @@ $\mathit{Nq}.\mathit{tail}$は無意味なので,
文&Kanji&\multicolumn{4}{c}{\hrulefill \ 出力\ \hrulefill}&収集\\
字&Open&\multicolumn{5}{c}{\hrulefill \ 収集\ \hrulefill}\\
種&Close&\multicolumn{4}{c}{\hrulefill \ 出力\ \hrulefill}&収集\\
+%</ja>
\bottomrule
\end{tabular}
\end{center}
-上の表において,
+%<en>In the above table,
+%<ja>上の表において,
\begin{itemize}
-\item 「出力」は,それまでに集めた文字列を出力(≒ここで行分割可能)を意味する.
-\item 「収集」は,後側の文字を,現在収集された文字列に追加(行分割不可)を意味する.
+%<zh>\item ...
+%<en>\item ``outputs'' means to output the collected character string (i.e., line breaking is permitted there).
+%<ja>\item 「出力」は,それまでに集めた文字列を出力(≒ここで行分割可能)を意味する.
+
+%<en>\item ``collects'' means to append the next character to the collected character string (i.e., line breaking is prohibited there).
+%<ja>\item 「収集」は,後側の文字を,現在収集された文字列に追加(行分割不可)を意味する.
\end{itemize}
-\paragraph{和文文字扱いとなる文字}
+%<en>\paragraph{Classification of characters}
+%<ja>\paragraph{和文文字扱いとなる文字}
+
+%<*en>
+Characters are classified according to \Param{jacharrange} parameter (see Section \ref{ssec-setrange}):
+%</en>
+%<*ja>
\Pkg{listings} パッケージにおいて和文文字と扱われる
(前に述べたKanji, Open,あるいは「閉じ括弧類」分類)か否かは,
-通常の\textbf{JAchar}/\textbf{Alchar}の範囲の設定(\ref{ssec-setrange}節)とは全く関係ない.
+通常の\textbf{JAchar}/\textbf{Alchar}の範囲の設定(\Param{jacharrange} パラメータ,\ref{ssec-setrange}節を参照)に従って行われる:
+%</ja>
+\begin{itemize}
+%<zh>\item ...
-また,禁則処理に関する\Param{prebreakpenalty},~\Param{postbreakpenalty}の設定も
-\Pkg{listings} パッケージ内部ではまったく影響しない.
+%<en>\item \textbf{ALchars} above U+0080 are Letter.
+%<ja>\item (U+0080以降の)\textbf{ALchar}は,すべてLetter扱いである.
-\medskip
-現在の実装では,
+%<en>\item \textbf{JAchars} are classified in the order as follows:
+%<ja>\item (U+0080以降の)\textbf{JAchar}については,以下の順序に従って文字種を決める:
+\begin{enumerate}
+%<zh>\item ...
+%<en>\item Characters whose \Param{\hyperlink{fld:prebp}{prebreakpenalty}} is greater than or equal to 0 are Open.
+%<ja>\item \Param{\hyperlink{fld:prebp}{prebreakpenalty}}が0以上の文字はOpen扱いである.
+
+%<en>\item Characters whose \Param{\hyperlink{fld:postbp}{postbreakpenalty}} is greater than or equal to 0 are Close.
+%<ja>\item \Param{\hyperlink{fld:postbp}{postbreakpenalty}}が0以上の文字はClose扱いである.
+
+%<en>\item Characters that don't satisfy the above two conditions are Kanji.
+%<ja>\item 上の2条件のどちらにも当てはまらなかった文字は,Kanji扱いである.
+\end{enumerate}
+\end{itemize}
+
+%<*en>
+The width of halfwidth kana (U+FF61--U+FF9F) is same as the width of \textbf{ALchar};
+the width of the other \textbf{JAchars} is double the width of \textbf{ALchar}.
+%</en>
+%<*ja>
+なお,半角カナ(U+FF61--U+FF9F)以外の\textbf{JAchar}は欧文文字2文字分の幅をとるものとみなされる.
+半角カナは欧文文字1文字分の幅となる.
+%</ja>
+
+%<*en>
+The classification process is executed every time a character appears in
+listing environments.
+%</en>
+%<*ja>
+これらの文字種決定は,実際に \texttt{lstlisting} 環境などの内部で文字が出てくるたびに行われる.
+%</ja>
+
+%<*ja>
+\section{和文の行長補正方法}
+\label{sec-adjspec}
+\texttt{luatexja-adjust.sty} で提供される優先順位付きの行長調整の詳細を述
+べる.大まかに述べると,次のようになる.
\begin{itemize}
-\item 基本多言語面のU+2000--U+FFFF,追加漢字面の文字は,以下の場合を除きKanji扱いとなり,
-また欧文文字2文字分の幅をとる..但し,以下は例外.
-\item U+FF61--U+FF9Fの半角カナはKanji扱いだが,欧文文字1文字分しか幅がない.
-\item 禁則処理のパラメータの標準値を定めている \texttt{luatexja-kinsoku.tex}\ %
-において \Param{prebreakpenalty} が
-10000と設定されている文字はClose扱いである.
-\item \texttt{luatexja-kinsoku.tex} で \Param{postbreakpenalty} が10000
-と設定されている文字はOpen扱いである.
+\item 通常の\TeX の行分割方法に従って,段落を行分割する.この段階では,行
+ 長に半端が出た場合,その半端分は\Param{\hyperlink{fld:xks}{xkanjiskip}},
+ \Param{\hyperlink{fld:kanjiskip}{kanjiskip}},JFMグルーの全てで(優先順位なく)負担される.
+\item その後,\texttt{post\_linebreak\_filter} callbackを使い,\textbf{段
+ 落中の各行ごとに},行末文字の位置を調整したり,優先度付きの行長調整
+ を実現するためにグルーの伸縮度を調整する.
+\texttt{luatexja-adjust.sty} の作用は,このcallbackを追加するだけであり,
+ この章の残りではcallbackでの処理について解説する.
\end{itemize}
-これらの設定をユーザが\TeX ソースで変更させる仕組みはまだ作成していない.
+
+\paragraph{準備:合計伸縮量の計算}
+グルーの伸縮度(\texttt{plus} や \texttt{minus} で指定されている値)には,
+有限値の他に,\texttt{fi},\texttt{fil},\texttt{fill},\texttt{filll}と
+いう4つの無限大レベル(後ろの方ほど大きい)があり,行の調整に
+\texttt{fi} などの\textbf{無限大レベルの伸縮度が用いられている場合は,そ
+の行に対しての処理を中止}する.
+
+よって,以降,問題にしている行の行長調整は伸縮度が有限長のグルーを用いて
+行われているとして良い.まず,段落中の行中のグルーを
+\begin{itemize}
+\item 下のどれにも該当しないグルー
+\item JFMグルー(優先度別にまとめられる)
+\item 和欧文間空白(\Param{\hyperlink{fld:xks}{xkanjiskip}})
+\item 和文間空白(\Param{\hyperlink{fld:kanjiskip}{kanjiskip}})
+\end{itemize}
+の$1+1+5+1=8$つに類別し,それぞれの種別ごとに許容されている伸縮度の合計を計算する.
+また,行長と自然長との差の絶対値を計算し,それを\textit{total}とおく.
+
+\subsection{行末文字の位置調整}
+まず,行末が文字クラス$n$の\textbf{Jachar}であった場合,
+それを動かすことによって,\textbf{JAglue} が負担する調整量を少なくしようとする.
+この行末文字の左右の移動可能量は,JFM中にある文字クラス$n$の定義の
+\texttt{end\_stretch},~\texttt{end\_shrink}フィールドに全角単位の値として記述されている.
+
+例えば,行末文字が句点「。」であり,そこで用いられているJFM中に
+\begin{verbatim}
+ [2] = {
+ chars = { '。', ... }, width = 0.5, ...,
+ end_stretch = 0.5, end_shrink = 0.5,
+ },
+\end{verbatim}
+という指定があった場合,この行末の句点は
+\begin{itemize}
+\item 通常の\TeX の行分割処理で「半角以上の詰め」が行われていた場合,
+この分の行中の\textbf{JAglue}の負担を軽減するため,
+行末の句点を半角だけ右に移動する(ぶら下げ組を行う).
+\item 通常の\TeX の行分割処理で「半角以上の空き」が行われていた場合,
+逆に行末句点を半角左に移動させる(見た目的に全角取りとなる).
+\item 以上のどちらでもない場合,行末句点の位置調整は行わない.
+\end{itemize}
+となる.
+
+行末文字を移動した場合,その分だけ\textit{total}の値を引いておく.
+
+\subsection{グルーの調整}
+\textit{total}の分だけが,行中のグルーの伸縮度に応じて負担されることになる.
+……
%</ja>
+
%<*en>
-\section{Patch for the \Pkg{listings} package}
+\section{Advanced line-adjustment for Japanese characters}
\dots
%</en>
+
+
+
\begin{thebibliography}{99}
\addcontentsline{toc}{section}{\refname}
\bibitem{texbytopic}
Victor Eijkhout, \emph{\TeX\ by Topic, A \TeX nician's Reference}, Addison-Wesley, 1992.
+\bibitem{listings} C.\ Heinz, B.\ Moses. The \textsf{Listings} Package.
+\bibitem{jlisting} Thor Watanabe. Listings\ -\ MyTeXpert. \newblock
+\url{http://mytexpert.sourceforge.jp/index.php?Listings}
+\bibitem{min10} 乙部厳己,min10フォントについて.
+\url{http://argent.shinshu-u.ac.jp/~otobe/tex/files/min10.pdf}
+\bibitem{jlreq} W3C Japanese Layout Task Force~(ed), Requirements for Japanese Text Layout (W3C Working Group Note), 2011, 2012. \newblock
+\url{http://www.w3.org/TR/jlreq/}%
+%<ja> \\日本語訳の書籍版:W3C日本語組版タスクフォース(編),『W3C技術ノート 日本語組版処理の要件』,東京電機大学出版局,2012.
+\bibitem{x4051} 日本工業規格(Japanese Industrial Standard) JIS~X~4051,
+日本語文書の組版方法(Formatting rules for Japanese documents), 1993, 1995, 2004.
\end{thebibliography}
\newpage
\appendix
+\batchmode
+%<*!zh>
+%<en>\section{The category code of non-kanji characters defined in JIS~X~0213}
+%<ja>\section{\LuaTeX-jaにおけるJIS~X~0213非漢字のcatcode}
+%<*en>
+In these tables, the default catcode (\LuaTeX-ja) and kcatcode ((u)\pTeX) of non-kanji
+characters defined in JIS~X~0213 from row 1 to row 13 is summarized.
+Each character is printed as follows:
+%</en>
%<*ja>
-\section{\LuaTeX-jaにおけるJIS~X~0213非漢字のcatcode}
-
ここでは,JIS~X~0213の非漢字部分(第1区〜第13区)のうち,
どの文字が(u)\pTeX や\LuaTeX-jaで制御綴内に使用可能かを表にしてまとめる.
各文字は
+%</ja>
\begin{center}
\tt\fboxsep=1pt\fbox{\hbox to \zw{\gt あ\hss}}\,\scriptsize LUP
\end{center}
+%<*ja>
のように表示しており,各文字は次の意味を持っている.
-この表の生成は,JIS X 0208の範囲内の文字については\verb+\jis+命令を使って行なっている.
+この表の生成は,JIS~X~0208の範囲内の文字については\verb+\jis+命令を使って行なっている.
+%</ja>
+%<*en>
+The tables are generated by using \verb+\jis+ command for characters included in
+JIS~X~0208.
+Each character in the tables means:
+%</en>
\begin{itemize}
+%<*en>
+\item The background of a character regarded as \textbf{ALchar} in \LuaTeX-ja
+ is colored light blue.
+%</en>
+%<*ja>
\item 背景が薄く青く塗られている文字は,
\LuaTeX-ja の標準で\textbf{ALchar}として認識されている文字である.
+%</ja>
+
+%<*en>
+\item The first letter {\tt L} means that the character is available for
+ the name of a control sequence in \XeTeX{} and \LuaTeX-ja (its catcode is 11).
+%</en>
+%<*ja>
\item 1文字目の {\tt L} は,\XeTeX や\LuaTeX-jaにおいてこの文字が制御綴内に
使用可能(catcodeが11)であることを表している.
+%</ja>
+
+%<*en>
+\item The second letter {\tt U} means that the character is available for
+ the name of a control sequence in \upTeX{} (its kcatcode is 16 or 17).
+ \upTeX{} regards these characters as Japanese character.
+%</en>
+%<*ja>
\item 2文字目の{\tt U} は,\upTeX においてこの文字が制御綴内に使用可能(kcatcodeは16,~17)であることを
表している.この範囲内では,\upTeX は標準で全文字を和文文字として扱うようである.
+%</ja>
+
+%<*en>
+\item The third letter {\tt P} means that the character is available for
+ the name of a control sequence in \pTeX{} (its kcatcode is 16 or 17).
+%</en>
+%<*ja>
\item 3文字目の {\tt P} は,\pTeX においてこの文字が制御綴内に使用可能(kcatcodeは16,~17)であることを
表している.
+%</ja>
+
+%<*en>
+\item If the third letter is {\tt -} (or the character is printed in red),
+ the character is not included in JIS~X~0208.
+ Therefore, you can consider the character is not available in \pTeX.
+%</en>
+%<*ja>
\item 3文字目が{\tt -}となっているもの(本体の文字も赤身がかっている)は,
-JIS~X~0208にないため使用不能と考えて良いものである.
+JIS~X~0208にないため\pTeX では使用不能と考えて良いものである.
+%</ja>
+
+%<*en>
+\item The kana for bidakuon in row 4 and 5 are omitted.
+%</en>
+%<*ja>
\item 第4区と第5区にある,鼻濁音の仮名については省略した.
+%</ja>
\end{itemize}
@@ -6381,7 +6827,9 @@ JIS~X~0208にないため使用不能と考えて良いものである.
}
\def\test#1{{%
-\subsection*{第#1区}\tt\small\fboxsep=1pt\centering\tabcolsep=0.25\zw
+%<en>\subsection*{Row #1}
+%<ja>\subsection*{第#1区}
+\tt\small\fboxsep=1pt\centering\tabcolsep=0.25\zw
\begin{tabular}{ccccccccccccccccc}\toprule&"0&"1&"2&"3&"4&"5&"6&"7&"8&"9&"A&"B&"C&"D&"E&"F\\
\out{#1}{2}\out{#1}{3}\out{#1}{4}\out{#1}{5}\out{#1}{6}\out{#1}{7}\bottomrule
\end{tabular}\par}\medskip}
@@ -6389,9 +6837,9 @@ JIS~X~0208にないため使用不能と考えて良いものである.
\test{1}\test{2}\test{3}\test{4}\test{5}\test{6}\test{7}\test{8}
\test{9}\test{10}\test{11}\test{12}\test{13}
-%</ja>
-
+\errorstopmode
+%</!zh>
\section{Package versions used in this document}
This document was typeset using the following packages:
diff --git a/Master/texmf-dist/tex/luatex/luatexja/luatexja-kinsoku.tex b/Master/texmf-dist/source/luatex/luatexja/luatexja-kinsoku.tex
index bd75dca8375..bd75dca8375 100644
--- a/Master/texmf-dist/tex/luatex/luatexja/luatexja-kinsoku.tex
+++ b/Master/texmf-dist/source/luatex/luatexja/luatexja-kinsoku.tex
diff --git a/Master/texmf-dist/source/luatex/luatexja/luatexja-kinsoku_make.tex b/Master/texmf-dist/source/luatex/luatexja/luatexja-kinsoku_make.tex
index a19c90487cc..8ae1973321f 100644
--- a/Master/texmf-dist/source/luatex/luatexja/luatexja-kinsoku_make.tex
+++ b/Master/texmf-dist/source/luatex/luatexja/luatexja-kinsoku_make.tex
@@ -1,17 +1,15 @@
-\parindent0pt
-\output={\shipout\box255}
-\tt\catcode`\_=12
-\def\{{\char'173 }\def\}{\char'175}
-\toks0={\%}
-\def\postbreakpenalty{\out\toks0={\string\setpostbreakpenalty\{}\count600 }%
-\def\prebreakpenalty{\out\toks0={\string\setprebreakpenalty\{}\count600 }%
-\def\inhibitxspcode{\out\toks0={\string\setinhibitxspcode\{}\count600 }%
-\def\xspcode{\out\toks0={\string\setxspcode\{}\count600 }%
-\catcode`\=13
-\def={\count601 }%\
-\def\out{\par\the\toks0 \the\count600\}\{\the\count601\}}
-\input ukinsoku
-\end
-
-% euptex pte-kinsoku-make ; dvitype -output-level=1 pte-kinsoku-make
-% | grep "\[" | sed "s/\[\(.*\)\]/\1/" > pte-kinsoku.tex \ No newline at end of file
+%#!lualatex --shell-escape luatexja-kinsoku_make.tex
+\documentclass{article}
+\usepackage{luatexja}
+\makeatletter
+\input{luatexja-kinsoku.tex}
+\usepackage{luacode}
+\begin{luacode}
+ s = table.copy(luatexja.stack.charprop_stack_table[0])
+ s[0].jwp, s[0].xsp = nil, nil
+ s.kanjiskip = nil; s.xkanjiskip = nil
+ table.tofile('ltj-kinsoku.out', s, 'return', false, true, false)
+\end{luacode}
+\immediate\write18{texluac -o ltj-kinsoku.lua ltj-kinsoku.out}
+\begin{document}
+\end{document} \ No newline at end of file
diff --git a/Master/texmf-dist/tex/luatex/luatexja/addons/luatexja-adjust.sty b/Master/texmf-dist/tex/luatex/luatexja/addons/luatexja-adjust.sty
new file mode 100644
index 00000000000..21404ec1456
--- /dev/null
+++ b/Master/texmf-dist/tex/luatex/luatexja/addons/luatexja-adjust.sty
@@ -0,0 +1,119 @@
+%
+% luatexja-adjust.sty
+%
+
+%% Avoid multiple loading.
+\csname\if11luatexjaadjustLoaded\fi\endcsname
+\edef\x{%
+\catcode32=\the\catcode32%
+\catcode33=\the\catcode33%
+\catcode35=\the\catcode35%
+\catcode40=\the\catcode40%
+\catcode41=\the\catcode41%
+\catcode42=\the\catcode42%
+\catcode43=\the\catcode43%
+\catcode44=\the\catcode44%
+\catcode45=\the\catcode45%
+\catcode46=\the\catcode46%
+\catcode58=\the\catcode58%
+\catcode59=\the\catcode59%
+\catcode60=\the\catcode60%
+\catcode61=\the\catcode61%
+\catcode62=\the\catcode62%
+\catcode64=\the\catcode64%
+\catcode91=\the\catcode91%
+\catcode93=\the\catcode93%
+\catcode94=\the\catcode94%
+\catcode95=\the\catcode95%
+\catcode126=\the\catcode126%
+\endlinechar=\the\endlinechar
+\relax}
+\catcode32=10 %< >
+\catcode33=12 %<">
+\catcode35=6 %<#>
+\catcode40=12 %<(>
+\catcode41=12 %<)>
+\catcode42=12 %<*>
+\catcode43=12 %<+>
+\catcode44=12 %<,>
+\catcode45=12 %<->
+\catcode46=12 %<.>
+\catcode58=12 %<:>
+\catcode59=12 %<;>
+\catcode60=12 %<<>
+\catcode61=12 %<=>
+\catcode62=12 %<>>
+\catcode64=11 %<@>
+\catcode91=12 %<[>
+\catcode93=12 %<]>
+\catcode94=7 %<^>
+\catcode95=8 %<_>
+\catcode126=13 %<~>
+\endlinechar=-1 %
+
+\edef\ltj@adjust@AtEnd{\x
+ \noexpand\let\noexpand\ltj@adjust@AtEnd\relax}
+\def\luatexjaadjustLoaded{\endinput}
+
+%% Check if LaTeX is used.
+\begingroup\expandafter\expandafter\expandafter\endgroup
+\expandafter\ifx\csname RequirePackage\endcsname\relax %<*!LaTeX>
+ \expandafter\let\csname ifltj@in@latex\expandafter\endcsname
+ \csname iffalse\endcsname
+\else %<*LaTeX>
+ \expandafter\let\csname ifltj@in@latex\expandafter\endcsname
+ \csname iftrue\endcsname
+ \NeedsTeXFormat{LaTeX2e}
+ \ProvidesPackage{luatexja-adjust}[2012/10/01 v0.1]
+\fi %</LaTeX>
+
+% Load core module if not yet.
+\ifx\luatexjacoreLoaded\@undefined
+ \ifltj@in@latex %<*LaTeX>
+ \RequirePackage{luatexja}[2012/04/20]
+ \else %<*!LaTeX>
+ \input luatexja.sty %
+ \fi %</LaTeX>
+\fi
+
+%% When environment check fails, exit now.
+\ifx\LuaTeXjaAvailable\@undefined
+ \ltj@otf@AtEnd
+\expandafter\endinput\fi\relax
+
+%%------------------
+\RequirePackage{expl3}
+%! Main part of luatexja-adjust
+\RequireLuaTeXjaSubmodule{adjust}
+
+% enable/disable ``advanced'' line adjustment
+\protected\def\ltjdisableadjust{\directlua{luatexja.adjust.disable_cb()}}
+\protected\def\ltjenableadjust{\directlua{luatexja.adjust.enable_cb()}}
+\ltjenableadjust
+% there is also a key for \ltjsetparameter, for same effect
+\define@boolkey[ltj]{japaram}{adjust}[true]{%
+ \ifltj@japaram@adjust\ltjenableadjust\else\ltjdisableadjust\fi
+}
+
+\ExplSyntaxOn
+\cs_new:Nn \ltj_adjust_inittable: {
+ % To be filled...
+}
+\cs_new:Nn \ltj_adjust_appendtable:n {
+ % To be filled
+}
+
+\clist_new:N \l_ltj_adjust_priority
+\define@key[ltj]{japaram}{adjustpriority}{% COMMA LIST
+ \clist_set:Nx \l_ltj_adjust_priority {#1}
+ \ltj_adjust_inittable:
+ \clist_map_function:NN \l_ltj_adjust_priority \ltj_adjust_appendtable:n
+}
+
+\ExplSyntaxOff
+
+
+%%------------------ all done
+\ltj@adjust@AtEnd
+\endinput
+%% EOF
diff --git a/Master/texmf-dist/tex/luatex/luatexja/addons/luatexja-fontspec.sty b/Master/texmf-dist/tex/luatex/luatexja/addons/luatexja-fontspec.sty
index b37b08f6c0b..4a037d640cd 100644
--- a/Master/texmf-dist/tex/luatex/luatexja/addons/luatexja-fontspec.sty
+++ b/Master/texmf-dist/tex/luatex/luatexja/addons/luatexja-fontspec.sty
@@ -3,12 +3,12 @@
%
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{luatexja-fontspec}[2011/09/23 v0.2]
+\ProvidesPackage{luatexja-fontspec}[2012/09/17 v0.2a]
\RequirePackage{fontspec,luatexja}
-
\ExplSyntaxOn
+%%%%%%%% Messages
\cs_new:Npn \ltj_fontspec_warning:n { \msg_warning:nn {ltj-fontspec} }
\msg_new:nnn {ltj-fontspec} {addjfontfeatures-ignored}
@@ -19,12 +19,22 @@
\cs_generate_variant:Nn \prg_new_conditional:Nnn {Nnx}
+%%%%%%%% For compatibility with old fontspec.
\prg_new_conditional:Nnx \ltj_fontspec_if_liiikeys: {TF,F} {
\@ifpackagelater {fontspec} {2011/09/13}
{ \exp_not:N \prg_return_true: } % fontspec >= 2.2 (l3keys)
{ \exp_not:N \prg_return_false: } % fontspec < 2.2 (xkeyval)
}
+%%%%%%%% \g_ltj_fontspec_scale_fp
+%% Default scale value for jfont.
+\group_begin:
+\fontsize{10}{10}\selectfont
+\fp_gset:Nn \g_ltj_fontspec_scale_fp {\zw / 10}
+\group_end:
+
+%%%%%%%% Internal control sequences
+%% Each CS is ltj_fontspec version that corresponds to original CS of fontspec.
\cs_new:Nn \ltj_fontspec_define_option:nn {
\ltj_fontspec_if_liiikeys:TF {
\keys_define:nn {fontspec} { #1 .code:n = {#2}}
@@ -70,7 +80,7 @@
\tl_set:Nn \zf@enc {JY3}
}
\tl_set:Nx \g_fontspec_default_fontopts_tl
- {JFM=ujis,Scale=0.962216,Kerning=Off,\g_ltj_fontspec_default_fontopts_tl}
+ {JFM=ujis,Scale=\fp_use:N \g_ltj_fontspec_scale_fp,Kerning=Off,\g_ltj_fontspec_default_fontopts_tl}
\cs_set_eq:NN \DeclareFontFamily \DeclareKanjiFamily
\fontspec_select:nn{#1}{#2}
\group_end:
@@ -84,6 +94,7 @@
\tl_set_eq:NN #1 \l_fontspec_family_tl
}
+%%%%%%%% User commands
\DeclareDocumentCommand \jfontspec { O{} m } {
\ltj_fontspec_set_family:Nnn \k@family {#1}{#2}
\selectfont
diff --git a/Master/texmf-dist/tex/luatex/luatexja/addons/luatexja-preset.sty b/Master/texmf-dist/tex/luatex/luatexja/addons/luatexja-preset.sty
index d4fd53bbfc9..61983d57cbf 100644
--- a/Master/texmf-dist/tex/luatex/luatexja/addons/luatexja-preset.sty
+++ b/Master/texmf-dist/tex/luatex/luatexja/addons/luatexja-preset.sty
@@ -1,6 +1,6 @@
% luatexja-preset.sty
\ProvidesPackage{luatexja-preset}
- [2012/05/18 v0.0]
+ [2012/09/17 v0.1]
\RequirePackage{expl3}
\RequirePackage{luatexja-fontspec}
@@ -25,12 +25,8 @@
\DeclareOption{nodeluxe}{\int_set:Nn \l_ltjpreset_deluxe_int { 0 }} % 2 fonts
% scale
-{ \fontsize{1024}{1024}\selectfont
- \fp_set_from_dim:Nn \l_ltjpreset_scale_fp \zw
- \fp_gdiv:Nn \l_ltjpreset_scale_fp {1024}
-}
\msg_new:nnn { luatexja-preset }{ scale }{
- 日本語フォントは~\fp_use:N \l_ltjpreset_scale_fp~倍にスケーリングされます.
+ 日本語フォントは~\fp_use:N \g_ltj_fontspec_scale_fp~倍にスケーリングされます.
}
\msg_warning:nn { luatexja-preset }{ scale }
@@ -227,7 +223,6 @@
\tl_new:N \l_ltjpreset_add_features_tl
\tl_set:Nx \l_ltjpreset_add_features_tl {
- Scale = \fp_use:N \l_ltjpreset_scale_fp ,
\tl_use:N \l_ltjpreset_kanji_shape_tl,
JFM = \ltjpreset_use_jfm:
}
diff --git a/Master/texmf-dist/tex/luatex/luatexja/jfm-ujis.lua b/Master/texmf-dist/tex/luatex/luatexja/jfm-ujis.lua
index d2cd13b6d91..f64080e02ed 100644
--- a/Master/texmf-dist/tex/luatex/luatexja/jfm-ujis.lua
+++ b/Master/texmf-dist/tex/luatex/luatexja/jfm-ujis.lua
@@ -2,16 +2,28 @@
-- jfm-ujis.lua: LuaTeX-ja 標準 JFM
-- based on upnmlminr-h.tfm (a metric in UTF/OTF package used by upTeX).
+-- JIS X 4051:2004 では,行末の句読点や中点はベタなのでそれに従う
+-- kanjiskip: 0pt plus .25zw minus 0pt
+-- xkanjiskip: .25zw plus .25zw (or .0833zw) minus .125zw
+
+
luatexja.jfont.define_jfm {
dir = 'yoko',
zw = 1.0, zh = 1.0,
-
+ kanjiskip = {0.0, 0.05, 0},
+ xkanjiskip = {0.25, 0.25, .125},
[0] = {
align = 'left', left = 0.0, down = 0.0,
width = 1.0, height = 0.88, depth = 0.12, italic=0.0,
glue = {
- [1] = { 0.5 , 0.0, 0.5 },
- [3] = { 0.25, 0.0, 0.25 }
+ [1] = { 0.5 , 0.0, 0.5, 0, 1 },
+ [2] = {0, 0, 0},
+ [3] = { 0.25, 0.0, 0.25, 1, 1 },
+ [4] = {0, 0, 0},
+ [6] = {0, 0, 0},
+ [7] = {0, 0, 0},
+ [8] = {0, 0, 0},
+ [9] = {0, 0, 0},
}
},
@@ -23,25 +35,39 @@ luatexja.jfont.define_jfm {
align = 'right', left = 0.0, down = 0.0,
width = 0.5, height = 0.88, depth = 0.12, italic=0.0,
glue = {
- [3] = { 0.25, 0.0, 0.25 }
+-- 3 のみ四分,あとは0
+ [0] = {0, 0, 0},
+ [1] = {0, 0, 0},
+ [2] = {0, 0, 0},
+ [3] = { 0.25, 0.0, 0.25, 1 },
+ [4] = {0, 0, 0},
+ [5] = {0, 0, 0},
+ [6] = {0, 0, 0},
+ [7] = {0, 0, 0},
+ [8] = {0, 0, 0},
+ [9] = {0, 0, 0},
}
},
[2] = { -- 閉じ括弧類
chars = {
- '’', '”', '、', '〉', '》', '」', '』', '】', '〕',
- '〗', '〙', '〟', ')', ',*', ']', '}', '⦆',
+ '’', '”', '〉', '》', '」', '』', '】', '〕',
+ '〗', '〙', '〟', ')', ']', '}', '⦆', '、', ',*'
},
align = 'left', left = 0.0, down = 0.0,
width = 0.5, height = 0.88, depth = 0.12, italic=0.0,
glue = {
- [0] = { 0.5 , 0.0, 0.5 },
- [1] = { 0.5 , 0.0, 0.5 },
- [3] = { 0.25, 0.0, 0.25 },
- [5] = { 0.5 , 0.0, 0.5 },
- [6] = { 0.5 , 0.0, 0.5 },
- [7] = { 0.5 , 0.0, 0.5 },
- [8] = { 0.5 , 0.0, 0.5 },
+-- 3 は四分, 2, 4, 9 は0, あとは0.5
+ [0] = { 0.5 , 0.0, 0.5, 0, -1 },
+ [1] = { 0.5 , 0.0, 0.5, 0, -1 },
+ [2] = {0, 0, 0},
+ [3] = { 0.25, 0.0, 0.25, 1, 1 },
+ [4] = {0, 0, 0},
+ [5] = { 0.5 , 0.0, 0.5, 0, -1 },
+ [6] = { 0.5 , 0.0, 0.5, 0, -1 },
+ [7] = { 0.5 , 0.0, 0.5, 0, -1 },
+ [8] = { 0.5 , 0.0, 0.5, 0, -1 },
+ [9] = {0, 0, 0},
}
},
@@ -49,16 +75,19 @@ luatexja.jfont.define_jfm {
chars = {'・', ':', ';'},
align = 'middle', left = 0.0, down = 0.0,
width = 0.5, height = 0.88, depth = 0.12, italic=0.0,
+ --end_stretch = 0.25,
glue = {
- [0] = { 0.25, 0.0, 0.25 },
- [1] = { 0.25, 0.0, 0.25 },
- [2] = { 0.25, 0.0, 0.25 },
- [3] = { 0.5 , 0.0, 0.5 },
- [4] = { 0.25, 0.0, 0.25 },
- [5] = { 0.25, 0.0, 0.25 },
- [6] = { 0.25, 0.0, 0.25 },
- [7] = { 0.25, 0.0, 0.25 },
- [8] = { 0.25, 0.0, 0.25 },
+-- 3 のみ 0.5,あとは0.25
+ [0] = { 0.25, 0.0, 0.25, 1, 1 },
+ [1] = { 0.25, 0.0, 0.25, 1, 1 },
+ [2] = { 0.25, 0.0, 0.25, 1, 1 },
+ [3] = { 0.5 , 0.0, 0.5 , 1, 0 },
+ [4] = { 0.25, 0.0, 0.25, 1, 1 },
+ [5] = { 0.25, 0.0, 0.25, 1, 1 },
+ [6] = { 0.25, 0.0, 0.25, 1, 1 },
+ [7] = { 0.25, 0.0, 0.25, 1, 1 },
+ [8] = { 0.25, 0.0, 0.25, 1, 1 },
+ [9] = { 0.25, 0.0, 0.25, 1, 1 },
}
},
@@ -67,23 +96,29 @@ luatexja.jfont.define_jfm {
align = 'left', left = 0.0, down = 0.0,
width = 0.5, height = 0.88, depth = 0.12, italic=0.0,
glue = {
- [0] = { 0.5 , 0.0, 0.0 },
- [1] = { 0.5 , 0.0, 0.0 },
- [3] = { 0.75, 0.0, 0.25 },
- [5] = { 0.5 , 0.0, 0.0 },
- [6] = { 0.5 , 0.0, 0.0 },
- [7] = { 0.5 , 0.0, 0.0 },
- [8] = { 0.5 , 0.0, 0.0 },
+-- 3 は.75, 2, 4 は0, あとは0.5
+ [0] = { 0.5 , 0.0, 0.5, 0, -1 },
+ [1] = { 0.5 , 0.0, 0.5, 0, -1 },
+ [3] = { 0.75, 0.0, 0.25, 1, -1/3 },
+ [5] = { 0.5 , 0.0, 0.5, 0, -1 },
+ [6] = { 0.5 , 0.0, 0.5, 0, -1 },
+ [7] = { 0.5 , 0.0, 0.5, 0, -1 },
+ [8] = { 0.5 , 0.0, 0.5, 0, -1 },
+ [9] = { 0.5 , 0.0, 0.5, 0, -1 },
}
},
[5] = { -- ダッシュ
- chars = { '—', '―', '‥', '…' },
+ chars = { '—', '―', '‥', '…', '〳', '〴', '〵', },
align = 'left', left = 0.0, down = 0.0,
width = 1.0, height = 0.88, depth = 0.12, italic=0.0,
glue = {
- [1] = { 0.5 , 0.0, 0.5 },
- [3] = { 0.25, 0.0, 0.25 }
+ [1] = { 0.5 , 0.0, 0.5, 0, 1 },
+ [2] = {0, 0, 0},
+ [3] = { 0.25, 0.0, 0.25, 1, 1 },
+ [4] = {0, 0, 0},
+ [6] = {0, 0, 0},
+ [9] = {0, 0, 0},
},
kern = {
[5] = 0.0
@@ -91,18 +126,22 @@ luatexja.jfont.define_jfm {
},
[6] = { -- 感嘆符・疑問符
- chars = { '?', '!' },
+ chars = { '?', '!', '‼', '⁇', '⁈', '⁉', },
align = 'left', left = 0.0, down = 0.0,
width = 1.0, height = 0.88, depth = 0.12, italic=0.0,
glue = {
- [0] = { 0.5 , 0.0, 0.5 },
- [1] = { 0.5 , 0.0, 0.5 },
- [3] = { 0.25, 0.0, 0.25 },
- [7] = { 0.5 , 0.0, 0.5 },
+ [0] = {0, 0, 0},
+ [1] = { 0.5 , 0.0, 0.5, 0, 1 },
+ [2] = {0, 0, 0},
+ [3] = { 0.25, 0.0, 0.25, 1, 1 },
+ [4] = {0, 0, 0},
+ [6] = {0, 0, 0},
+ [7] = {0, 0, 0},
+ [8] = {0, 0, 0},
+ [9] = {0, 0, 0},
},
kern = {
- [5] = 0.0,
- [8] = 0.0
+ [5] = 0.0
}
},
@@ -131,8 +170,14 @@ luatexja.jfont.define_jfm {
align = 'left', left = 0.0, down = 0.0,
width = 0.5, height = 0.88, depth = 0.12, italic=0.0,
glue = {
- [1] = { 0.5 , 0.0, 0.5 },
- [3] = { 0.25, 0.0, 0.25 }
+ [1] = { 0.5 , 0.0, 0.5, 0, 1 },
+ [2] = {0, 0, 0},
+ [3] = { 0.25, 0.0, 0.25, 1, 1 },
+ [4] = {0, 0, 0},
+ [6] = {0, 0, 0},
+ [7] = {0, 0, 0},
+ [8] = {0, 0, 0},
+ [9] = {0, 0, 0},
}
},
@@ -158,18 +203,43 @@ luatexja.jfont.define_jfm {
align = 'left', left = 0.0, down = 0.0,
width = 1.0, height = 0.88, depth = 0.12, italic=0.0,
glue = {
- [1] = { 0.5 , 0.0, 0.5 },
- [3] = { 0.25, 0.0, 0.25 }
+ [1] = { 0.5 , 0.0, 0.5, 0, 1 },
+ [2] = {0, 0, 0},
+ [3] = { 0.25, 0.0, 0.25, 1, 1 },
+ [4] = {0, 0, 0},
+ [6] = {0, 0, 0},
+ [9] = {0, 0, 0},
},
kern = {
[8] = 0.0
}
},
+ [9] = { -- 和字間隔
+ chars = {
+ ' '
+ },
+ align = 'left', left = 0.0, down = 0.0,
+ width = 1.0, height = 0.88, depth = 0.12, italic=0.0,
+ glue = {
+ [0] = {0, 0, 0},
+ [1] = {0, 0, 0},
+ [2] = {0, 0, 0},
+ [3] = { 0.25, 0.0, 0.25, 1 },
+ [4] = {0, 0, 0},
+ [5] = {0, 0, 0},
+ [6] = {0, 0, 0},
+ [7] = {0, 0, 0},
+ [8] = {0, 0, 0},
+ [9] = {0, 0, 0},
+ },
+ },
+
+
[99] = { -- box末尾
chars = {'boxbdd', 'parbdd'},
glue = {
- [3] = { 0.25, 0.0, 0.25 },
+ [3] = { 0.25, 0.0, 0.25, 1 },
}
},
diff --git a/Master/texmf-dist/tex/luatex/luatexja/ltj-adjust.lua b/Master/texmf-dist/tex/luatex/luatexja/ltj-adjust.lua
new file mode 100644
index 00000000000..db92b2a345f
--- /dev/null
+++ b/Master/texmf-dist/tex/luatex/luatexja/ltj-adjust.lua
@@ -0,0 +1,247 @@
+--
+-- luatexja/otf.lua
+--
+luatexbase.provides_module({
+ name = 'luatexja.adjust',
+ date = '2012/09/27',
+ version = '0.1',
+ description = 'Advanced line adjustment for LuaTeX-ja',
+})
+module('luatexja.adjust', package.seeall)
+
+luatexja.load_module('jfont'); local ltjf = luatexja.jfont
+luatexja.load_module('jfmglue'); local ltjj = luatexja.jfmglue
+
+local id_glyph = node.id('glyph')
+local id_kern = node.id('kern')
+local id_hlist = node.id('hlist')
+local id_glue = node.id('glue')
+local id_glue_spec = node.id('glue_spec')
+local has_attr = node.has_attribute
+local set_attr = node.set_attribute
+local attr_icflag = luatexbase.attributes['ltj@icflag']
+local attr_jchar_class = luatexbase.attributes['ltj@charclass']
+local attr_curjfnt = luatexbase.attributes['ltj@curjfnt']
+local node_copy = node.copy
+local node_next = node.next
+local node_free = node.free
+
+local ltjf_font_metric_table = ltjf.font_metric_table
+local spec_zero_glue = ltjj.spec_zero_glue
+
+local PACKED = luatexja.icflag_table.PACKED
+local FROM_JFM = luatexja.icflag_table.FROM_JFM
+local KANJI_SKIP = luatexja.icflag_table.KANJI_SKIP
+local XKANJI_SKIP = luatexja.icflag_table.XKANJI_SKIP
+
+local priority_table = {
+ FROM_JFM + 2,
+ FROM_JFM + 1,
+ FROM_JFM,
+ FROM_JFM - 1,
+ FROM_JFM - 2,
+ XKANJI_SKIP,
+ KANJI_SKIP
+}
+
+local PROCESSED_BEGIN_FLAG = 32
+local function get_attr_icflag(p)
+ return (node.has_attribute(p, attr_icflag) or 0) % PROCESSED_BEGIN_FLAG
+end
+
+-- box 内で伸縮された glue の合計値を計算
+
+local function get_stretched(q, go, gs)
+ local qs = q.spec
+ if not qs.writable then return 0 end
+ if gs == 1 then -- stretching
+ if qs.stretch_order == go then return qs.stretch end
+ else -- shrinking
+ if qs.shrink_order == go then return qs.shrink end
+ end
+end
+
+-- local new_ks, new_xs
+local function get_total_stretched(p)
+ local go, gf, gs = p.glue_order, p.glue_set, p.glue_sign
+ local res = {
+ [0] = 0,
+ glue_set = gf, name = (gs==1) and 'stretch' or 'shrink'
+ }
+ for i=1,#priority_table do res[priority_table[i]]=0 end
+ if go ~= 0 then return nil end
+ if gs ~= 1 and gs ~= 2 then return res end
+ local head = p.head
+ q = p.head
+ --luatexja.ext_show_node_list(p.head, '>>> ', print)
+ while q do
+ if q.id==id_glue then
+ local a, ic = get_stretched(q, go, gs), get_attr_icflag(q)
+ if type(res[ic]) == 'number' then
+ -- kanjiskip, xkanjiskip は段落内で spec を共有しているが,
+ -- それはここでは望ましくないので,各 glue ごとに異なる spec を使う.
+ -- JFM グルーはそれぞれ異なる glue_spec を用いているので,問題ない.
+ res[ic] = res[ic] + a
+ if ic == KANJI_SKIP or ic == XKANJI_SKIP then
+ if q.spec ~= spec_zero_glue then
+ local ts, g;
+ q.spec, ts = node_copy(q.spec), q.spec
+ g = node.copy(q); q.spec = ts
+ node.insert_before(head, q, g);
+ head = node.remove(head, q); node.free(q); q = g
+ end
+ end
+ else
+ res[0] = res[0] + a
+ end
+ end
+ q = node_next(q)
+ end
+ return res
+end
+
+local function clear_stretch(p, ic, name)
+ --print('clear ' .. ic)
+ for q in node.traverse_id(id_glue, p.head) do
+ if get_attr_icflag(q) == ic then
+ local qs = q.spec
+ if qs.writable then
+ qs[name..'_order'], qs[name] = 0, 0
+ end
+ end
+ end
+end
+
+local set_stretch_table = {}
+local function set_stretch(p, after, before, ic, name)
+ if before > 0 then
+ --print (ic, before, after)
+ local ratio = after/before
+ for i,_ in pairs(set_stretch_table) do
+ set_stretch_table[i] = nil
+ end
+ for q in node.traverse_id(id_glue, p.head) do
+ if get_attr_icflag(q) == ic then
+ local qs, do_flag = q.spec, true
+ for i=1,#set_stretch_table do
+ if set_stretch_table[i]==qs then do_flag = false end
+ end
+ if qs.writable and qs[name..'_order'] == 0 and do_flag then
+ qs[name] = qs[name]*ratio;
+ set_stretch_table[#set_stretch_table+1] = qs
+ end
+ end
+ end
+ end
+end
+
+-- step 1: 行末に kern を挿入(句読点,中点用)
+local function aw_step1(p, res, total)
+ local x = node.tail(p.head); if not x then return false end
+ local x = node.prev(x) ; if not x then return false end
+ -- 本当の行末の node を格納
+ if x.id == id_glue and x.subtype == 15 then
+ -- 段落最終行のときは,\penalty10000 \parfillskip が入るので,
+ -- その前の node が本来の末尾文字となる
+ x = node.prev(node.prev(x))
+ end
+
+ local xi, xc = x.id
+ if xi == id_glyph and has_attr(x, attr_curjfnt) == x.font then
+ -- 和文文字
+ xc = x
+ elseif xi == id_hlist and get_attr_icflag(x) == PACKED then
+ -- packed JAchar
+ xc = x.head
+ else
+ return false-- それ以外は対象外.
+ end
+ local xk = ltjf_font_metric_table --
+ [xc.font].size_cache.char_type[has_attr(xc, attr_jchar_class) or 0]
+ ['end_' .. res.name] or 0
+ --print(res.name, total, xk, unicode.utf8.char(xc.char))
+
+ if xk>0 and total>=xk then
+ --print("ADDED")
+ total = total - xk
+ local kn = node.new(id_kern)
+ kn.kern = (res.name=='shrink' and -1 or 1) * xk
+ set_attr(kn, attr_icflag, FROM_JFM)
+ node.insert_after(p.head, x, kn)
+ return true
+ else return false
+ end
+end
+
+-- step 2: 行中の glue を変える
+local function aw_step2(p, res, total, added_flag)
+ if total == 0 then -- もともと伸縮の必要なし
+ if added_flag then -- 行末に kern 追加したので,それによる補正
+ local f = node.hpack(p.head, p.width, 'exactly')
+ f.head, p.glue_set, p.glue_sign, p.glue_order
+ = nil, f.glue_set, f.glue_sign, f.glue_order
+ node.free(f); return
+ end
+ elseif total <= res[0] then -- 和文処理グルー以外で足りる
+ for _,v in pairs(priority_table) do clear_stretch(p, v, res.name) end
+ local f = node.hpack(p.head, p.width, 'exactly')
+ f.head, p.glue_set, p.glue_sign, p.glue_order
+ = nil, f.glue_set, f.glue_sign, f.glue_order
+ node.free(f)
+ else
+ total, i = total - res[0], 1
+ while i <= #priority_table do
+ local v = priority_table[i]
+ if total <= res[v] then
+ for j = i+1,#priority_table do
+ clear_stretch(p, priority_table[j], res.name)
+ end
+ set_stretch(p, total, res[v], v, res.name)
+ i = #priority_table + 9 -- ループから抜けさせたいため
+ end
+ total, i= total - res[v], i+1
+ end
+ if i == #priority_table + 10 or added_flag then
+ local f = node.hpack(p.head, p.width, 'exactly')
+ f.head, p.glue_set, p.glue_sign, p.glue_order
+ = nil, f.glue_set, f.glue_sign, f.glue_order
+ node.free(f)
+ end
+ end
+end
+
+
+function adjust_width(head)
+ if not head then return head end
+ for p in node.traverse_id(id_hlist, head) do
+ local res = get_total_stretched(p)
+ --print(table.serialize(res))
+ if res then
+ -- 調整量の合計
+ local total = 0
+ for i,v in pairs(res) do
+ if type(i)=='number' then
+ total = total + v
+ end
+ end; total = tex.round(total * res.glue_set)
+ local added_flag = aw_step1(p, res, total)
+ --print(total, res[0], res[KANJI_SKIP], res[FROM_JFM])
+ aw_step2(p, res, total, added_flag)
+ end
+ end
+ return head
+end
+
+local is_reg = false
+function enable_cb()
+ if not is_reg then
+ luatexbase.add_to_callback('post_linebreak_filter', adjust_width, 'Adjust width', 100)
+ is_reg = true
+ end
+end
+function disable_cb()
+ if is_reg then
+ luatexbase.remove_from_callback('post_linebreak_filter', 'Adjust width')
+ is_reg = false
+ end
+end
diff --git a/Master/texmf-dist/tex/luatex/luatexja/ltj-cctbreg.sty b/Master/texmf-dist/tex/luatex/luatexja/ltj-cctbreg.sty
index c63933beb92..3cd0375820a 100644
--- a/Master/texmf-dist/tex/luatex/luatexja/ltj-cctbreg.sty
+++ b/Master/texmf-dist/tex/luatex/luatexja/ltj-cctbreg.sty
@@ -28,7 +28,10 @@
\fi %</LaTeX>
% LS = Size of storage reserved for luatex-pkg.
-\chardef\ltj@cctb@lower@stor@size=32768
+\chardef\ltj@cctb@lower@stor@size=16384
+
+% LL = (upper bound of cctb index used by luatexbase.sty and luatex.sty) - 1
+\chardef\ltj@cctb@limit=32766
%-------------------
@@ -77,7 +80,7 @@
\catcode`\_=12
\gdef\ltj@@cctb@org@def#1{%
\ifnum\lltxb@catcodetable@alloc<65535\relax
- \global\advance\lltxb@catcodetable@alloc\@ne
+ \global\advance\lltxb@catcodetable@alloc\tw@
\allocationnumber\lltxb@catcodetable@alloc
\global\chardef#1\allocationnumber
\luatexinitcatcodetable\allocationnumber
@@ -126,6 +129,27 @@
%-------------------
+\begingroup
+\endlinechar=13
+\catcode`\_=12
+\gdef\newluatexcatcodetable#1{%
+ \ifnum\lltxb@catcodetable@alloc<\ltj@cctb@limit\relax
+ \global\advance\lltxb@catcodetable@alloc\tw@
+ \allocationnumber\lltxb@catcodetable@alloc
+ \global\chardef#1\allocationnumber
+ \luatexinitcatcodetable\allocationnumber
+ \begingroup\escapechar\m@ne
+ \luatexbase@directlua{luatexbase.catcodetabledef_from_tex(
+ '\luatexluaescapestring{\string#1}', '\number\allocationnumber')}%
+ \endgroup
+ \wlog{\string#1=\string\luatexcatcodetable\the\allocationnumber}%
+ \else
+ \errmessage{No room for a new \string\luatexcatcodetable}%
+ \fi}
+\endgroup
+
+%-------------------
+
% The luatex package stores its preset settings to registers 1, 3, 5, 7
% and new user allocations go to odd number 9, 11, 13, etc.; registers
% with even number are reserved for the "category code table stack".
diff --git a/Master/texmf-dist/tex/luatex/luatexja/ltj-charrange.lua b/Master/texmf-dist/tex/luatex/luatexja/ltj-charrange.lua
index d976cb3debd..6d13c916349 100644
--- a/Master/texmf-dist/tex/luatex/luatexja/ltj-charrange.lua
+++ b/Master/texmf-dist/tex/luatex/luatexja/ltj-charrange.lua
@@ -12,22 +12,23 @@ local err, warn, info, log = luatexbase.errwarinf(_NAME)
luatexja.load_module('base'); local ltjb = luatexja.base
+ATTR_RANGE = 7
local floor = math.floor
local pow = math.pow
local has_attr = node.has_attribute
local kcat_attr_table = {}
local pow_table = {}
-for i = 0, 216 do
+for i = 0, 31*ATTR_RANGE-1 do
kcat_attr_table[i] = luatexbase.attributes['ltj@kcat'..floor(i/31)]
pow_table[i] = pow(2, i%31)
end
-pow_table[217] = pow(2, 31)
+pow_table[31*ATTR_RANGE] = pow(2, 31)
-- jcr_table_main[chr_code] = index
-- index : internal 0, 1, 2, ..., 216 0: 'other'
-- external 1 2 216, (out of range): 'other'
--- initialize
+-- initialize
local jcr_table_main = {}
local jcr_cjk = 0; local jcr_noncjk = 1; local ucs_out = 0x110000
@@ -36,11 +37,12 @@ for i=0x100,ucs_out-1 do jcr_table_main[i]=0 end
-- EXT: add characters to a range
function add_char_range(b,e,ind) -- ind: external range number
- if not ind or ind<0 or ind>216 then -- 0 は error にしない(隠し)
+ if not ind or ind<0 or ind>=7*ATTR_RANGE then -- 0 は error にしない(隠し)
ltjb.package_error('luatexja',
"invalid character range number (" .. ind .. ")",
- {"A character range number should be in the range 1..216,",
- "ignored."})
+ "A character range number should be in the range 1.."
+ .. 7+ATTR_RANGE-1 .. ",\n" ..
+ "ignored.")
return
elseif b<0x80 or e>=ucs_out then
ltjb.package_warning('luatexja',
@@ -48,7 +50,7 @@ function add_char_range(b,e,ind) -- ind: external range number
'I take the intersection with [0x80, 0x10ffff].')
elseif b>e then
local j=b; e=b; b=j
- end
+ end
for i=math.max(0x80,b),math.min(ucs_out-1,e) do
jcr_table_main[i]=ind
end
@@ -58,8 +60,8 @@ function char_to_range(c) -- return the (external) range number
if not c or c<0 or c>0x10FFFF then
ltjb.package_error('luatexja',
'bad character code (' .. tostring(c) .. ')',
- {'A character number must be between 0 and 0x10ffff.',
- 'So I changed this one to zero.'})
+ 'A character number must be between 0 and 0x10ffff.\n' ..
+ 'So I changed this one to zero.')
c=0
elseif c<0x80 then return -1
else return jcr_table_main[c] or 0 end
@@ -72,12 +74,12 @@ end
-- glyph_node p は和文文字か?
function is_ucs_in_japanese_char(p)
local c = p.char
- if c<0x80 then
- return false
- else
- local i=jcr_table_main[c]
+ if c<0x80 then
+ return false
+ else
+ local i=jcr_table_main[c]
return (floor(
- has_attr(p, kcat_attr_table[i])/pow_table[i])%2 ~= jcr_noncjk)
+ has_attr(p, kcat_attr_table[i])/pow_table[i])%2 ~= jcr_noncjk)
end
end
@@ -87,15 +89,15 @@ function toggle_char_range(g, i) -- i: external range number
ltjb.package_error('luatexja',
"invalid character range number (" .. tostring(i).. ")",
"A character range number must be a number, ignored.")
- elseif i==0 then return
+ elseif i==0 then return
else
local kc
if i>0 then kc=0 else kc=1; i=-i end
- if i>216 then i=0 end
+ if i>=7*ATTR_RANGE then i=0 end
local attr = kcat_attr_table[i]
local a = tex.getattribute(attr)
tex.setattribute(g,attr,(floor(a/pow_table[i+1])*2+kc)*pow_table[i]+a%pow_table[i])
end
end
--- EOF \ No newline at end of file
+-- EOF
diff --git a/Master/texmf-dist/tex/luatex/luatexja/ltj-jfmglue.lua b/Master/texmf-dist/tex/luatex/luatexja/ltj-jfmglue.lua
index fdf878eb919..0dc28f7c35d 100644
--- a/Master/texmf-dist/tex/luatex/luatexja/ltj-jfmglue.lua
+++ b/Master/texmf-dist/tex/luatex/luatexja/ltj-jfmglue.lua
@@ -54,26 +54,21 @@ local sid_start_thread = node.subtype('pdf_start_thread')
local sid_end_link = node.subtype('pdf_end_link')
local sid_end_thread = node.subtype('pdf_end_thread')
-local ITALIC = 1
-local PACKED = 2
-local KINSOKU = 3
-local FROM_JFM = 4
-local LINE_END = 5
-local KANJI_SKIP = 6
-local XKANJI_SKIP = 7
-local PROCESSED = 8
-local IC_PROCESSED = 9
-local BOXBDD = 15
-local PROCESSED_BEGIN_FLAG = 16
-
+local ITALIC = luatexja.icflag_table.ITALIC
+local PACKED = luatexja.icflag_table.PACKED
+local KINSOKU = luatexja.icflag_table.KINSOKU
+local FROM_JFM = luatexja.icflag_table.FROM_JFM
+local KANJI_SKIP = luatexja.icflag_table.KANJI_SKIP
+local XKANJI_SKIP = luatexja.icflag_table.XKANJI_SKIP
+local PROCESSED = luatexja.icflag_table.PROCESSED
+local IC_PROCESSED = luatexja.icflag_table.IC_PROCESSED
+local BOXBDD = luatexja.icflag_table.BOXBDD
+local PROCESSED_BEGIN_FLAG = luatexja.icflag_table.PROCESSED_BEGIN_FLAG
local kanji_skip
local xkanji_skip
-local attr_orig_char = luatexbase.attributes['ltj@origchar']
local attr_curjfnt = luatexbase.attributes['ltj@curjfnt']
local attr_icflag = luatexbase.attributes['ltj@icflag']
-local attr_autospc = luatexbase.attributes['ltj@autospc']
-local attr_autoxspc = luatexbase.attributes['ltj@autoxspc']
local max_dimen = 1073741823
local function get_attr_icflag(p)
@@ -91,13 +86,20 @@ local function fast_find_char_class(c,m)
return m.size_cache.chars[c] or 0
end
-local spec_zero_glue = node_new(id_glue_spec)
+-- 文字クラスの決定
+local function slow_find_char_class(c, m, oc)
+ local xc = c or oc
+ local cls = ltjf_find_char_class(oc, m)
+ if xc ~= oc and cls==0 then cls, xc = ltjf_find_char_class(-xc, m) end
+ return cls, xc
+end
+
+local zero_glue = node_new(id_glue)
+spec_zero_glue = node_new(id_glue_spec) -- must be public, since mentioned from other sources
+local spec_zero_glue = spec_zero_glue
spec_zero_glue.width = 0; spec_zero_glue.stretch_order = 0; spec_zero_glue.stretch = 0
spec_zero_glue.shrink_order = 0; spec_zero_glue.shrink = 0
-
-local function get_zero_spec()
- return node_copy(spec_zero_glue)
-end
+ zero_glue.spec = spec_zero_glue
local function skip_table_to_spec(n)
local g, st = node_new(id_glue_spec), ltjs.fast_get_skip_table(n)
@@ -109,54 +111,27 @@ end
-- penalty 値の計算
local function add_penalty(p,e)
- if p.penalty>=10000 then
- if e<=-10000 then p.penalty = 0 end
- elseif p.penalty<=-10000 then
- if e>=10000 then p.penalty = 0 end
+ local pp = p.penalty
+ if pp>=10000 then
+ if e<=-10000 then pp = 0 end
+ elseif pp<=-10000 then
+ if e>=10000 then pp = 0 end
else
- p.penalty = p.penalty + e
- if p.penalty>=10000 then p.penalty = 10000
- elseif p.penalty<=-10000 then p.penalty = -10000 end
+ pp = pp + e
+ if pp>=10000 then p.penalty = 10000
+ elseif pp<=-10000 then p.penalty = -10000
+ else p.penalty = pp end
end
return
end
-- 「異なる JFM」の間の調整方法
-diffmet_rule = math.two_average
+diffmet_rule = math.two_paverage
function math.two_add(a,b) return a+b end
function math.two_average(a,b) return (a+b)*0.5 end
-
--------------------- idea
--- 2 node の間に glue/kern/penalty を挿入する.
--- 基本方針: char node q と char node p の間
-
---  Np: 「p を核とする塊」
---   first: 最初の node,nuc: p,last: 最後の node
---   id: 核 node の種類
---  Nq: 「q を核とする塊」
---   実際の glue は Np.last, Nq.first の間に挿入される
---  Bp: Np.last, Nq.first の間の penalty node 達の配列
-
--- Np, Nq, Bp, widow_Bp について
--- Np, Nq は別々のテーブル.
--- 1回のループごとに Nq = Np, Np = (new table) となるのは効率が悪いので,
--- Np <-> Nq 入れ替え,その後 Np をクリアすることでテーブルを再利用.
--- 同様の関係は Bp, widow_Bp にも.
-
-
--- 核の定義:
---  node x が non-char node のときは,x のみ
---  x が char_node のときは,
---  - x が \accent の第二引数だったとき
---   [kern2 kern y kern2] x の 3 node が核に加わる
---  - x の直後に \/ 由来 kern があったとき
---   その \/ 由来の kern が核に加わる
--- p, q の走査で無視するもの:
---  ins, mark, adjust, whatsit, penalty
---
--- Nq.last .. + .. Bp.first .... Bp[last] .... * .. Np.first
--- +: kern from LINEEND はここに入る
--- *: jfm glue はここに入る
+function math.two_paverage(a,b) return (a+b)*0.5 end
+function math.two_pleft(a,b) return a end
+function math.two_pright(a,b) return b end
local head -- the head of current list
@@ -228,7 +203,7 @@ function check_box_high(Nx, box_ptr, box_end)
first_char = nil; last_char = nil; find_first_char = true
if check_box(box_ptr, box_end) then
if first_char then
- if first_char.font == has_attr(first_char, attr_curjfnt) then
+ if first_char.font == (has_attr(first_char, attr_curjfnt) or -1) then
set_np_xspc_jachar(Nx, first_char)
else
set_np_xspc_alchar(Nx, first_char.char,first_char, ligature_head)
@@ -274,7 +249,7 @@ local function calc_np_pbox(lp, last)
set_attr(lp, attr_icflag, get_attr_icflag(lp));
while lp~=last and lpa>=PACKED and lpa<BOXBDD do
Np.nuc = lp;
- lp = node_next(lp); lpa = has_attr(lp, attr_icflag)
+ lp = node_next(lp); lpa = has_attr(lp, attr_icflag) or 0
-- get_attr_icflag() ではいけない!
end
return check_next_ickern(lp)
@@ -284,7 +259,7 @@ end
local calc_np_auxtable = {
[id_glyph] = function (lp)
Np.first, Np.nuc = (Np.first or lp), lp;
- Np.id = (lp.font == has_attr(lp, attr_curjfnt)) and id_jglyph or id_glyph
+ Np.id = (lp.font == (has_attr(lp, attr_curjfnt) or -1)) and id_jglyph or id_glyph
--set_attr_icflag_processed(lp) treated in ltj-setwidth.lua
return true, check_next_ickern(node_next(lp));
end,
@@ -350,7 +325,7 @@ local calc_np_auxtable = {
set_attr_icflag_processed(lp); lp = node_next(lp)
set_attr_icflag_processed(lp); lp = node_next(lp)
set_attr_icflag_processed(lp); Np.nuc = lp
- Np.id = (lp.font == has_attr(lp, attr_curjfnt)) and id_jglyph or id_glyph
+ Np.id = (lp.font == (has_attr(lp, attr_curjfnt) or -1)) and id_jglyph or id_glyph
return true, check_next_ickern(node_next(lp));
else
Np.id = id_kern; set_attr_icflag_processed(lp);
@@ -373,13 +348,13 @@ calc_np_auxtable[id_glue] = calc_np_auxtable.discglue
local pairs = pairs
function calc_np(lp, last)
- local k
+ local k
-- We assume lp = node_next(Np.last)
Np, Nq, ihb_flag = Nq, Np, false
-- We clear `predefined' entries of Np before pairs() loop,
-- because using only pairs() loop is slower.
Np.post, Np.pre, Np.xspc = nil, nil, nil
- Np.first, Np.id, Np.last, Np.lend, Np.met = nil, nil, nil, nil
+ Np.first, Np.id, Np.last, Np.met = nil, nil, nil
Np.auto_kspc, Np.auto_xspc, Np.char, Np.class, Np.nuc = nil, nil, nil, nil, nil
for k in pairs(Np) do Np[k] = nil end
@@ -412,42 +387,49 @@ do
-- 和文文字のデータを取得
local attr_jchar_class = luatexbase.attributes['ltj@charclass']
+ local attr_orig_char = luatexbase.attributes['ltj@origchar']
+ local attr_autospc = luatexbase.attributes['ltj@autospc']
+ local attr_autoxspc = luatexbase.attributes['ltj@autoxspc']
function set_np_xspc_jachar(Nx, x)
local m = ltjf_font_metric_table[x.font]
- local c = has_attr(x, attr_orig_char) or x.char
- local cls = ltjf_find_char_class(x.char, m)
- if c ~= x.char and cls==0 then cls = ltjf_find_char_class(-c, m) end
+ local cls, c = slow_find_char_class(has_attr(x, attr_orig_char), m, x.char)
Nx.class = cls; set_attr(x, attr_jchar_class, cls)
- Nx.lend = m.size_cache.char_type[cls].kern[fast_find_char_class('lineend', m)] or 0
- Nx.met, Nx.var, Nx.char = m, m.var, c
- Nx.pre = ltjs_fast_get_penalty_table('pre', c) or 0
- Nx.post = ltjs_fast_get_penalty_table('post', c) or 0
- Nx.xspc = ltjs_fast_get_penalty_table('xsp', c) or 3
+ Nx.met, Nx.char = m, c
+ local t = ltjs.fast_get_penalty_table_parent(c)
+ Nx.pre = t.pre or 0
+ Nx.post = t.post or 0
+ Nx.xspc = t.xsp or 3
+ Nx.kcat = t.kcat or 0
Nx.auto_kspc, Nx.auto_xspc = (has_attr(x, attr_autospc)==1), (has_attr(x, attr_autoxspc)==1)
- end
+ end
local set_np_xspc_jachar = set_np_xspc_jachar
-- 欧文文字のデータを取得
local floor = math.floor
function set_np_xspc_alchar(Nx, c,x, lig)
if c~=-1 then
+ local xc, xs = x.components, x.subtype
if lig == ligature_head then
- while x.components and x.subtype and math.floor(x.subtype*0.5)%2==1 do
- x = x.components; c = x.char
+ while xc and xs and xs%4>=2 do
+ x = xc; xc, xs = x.components, x.subtype
end
+ c = x.char
else
- while x.components and x.subtype and math.floor(x.subtype*0.5)%2==1 do
- x = node.tail(x.components); c = x.char
+ while xc and xs and xs%4>=2 do
+ x = node.tail(xc); xc, xs = x.components, x.subtype
end
+ c = x.char
end
- Nx.pre = ltjs_fast_get_penalty_table('pre', c) or 0
- Nx.post = ltjs_fast_get_penalty_table('post', c) or 0
+ local t = ltjs.fast_get_penalty_table_parent(c)
+ Nx.pre = t.pre or 0
+ Nx.post = t.post or 0
+ Nx.xspc = t.xsp or 3
Nx.char = 'jcharbdd'
else
Nx.pre, Nx.post, Nx.char = 0, 0, -1
+ Nx.xspc = ltjs_fast_get_penalty_table('xsp', -1) or 3
end
Nx.met = nil
- Nx.xspc = ltjs_fast_get_penalty_table('xsp', c) or 3
Nx.auto_xspc = (has_attr(x, attr_autoxspc)==1)
end
local set_np_xspc_alchar = set_np_xspc_alchar
@@ -469,7 +451,7 @@ do
function after_hlist(Nx)
local s = Nx.last_char
if s then
- if s.font == has_attr(s, attr_curjfnt) then
+ if s.font == (has_attr(s, attr_curjfnt) or -1) then
set_np_xspc_jachar(Nx, s)
else
set_np_xspc_alchar(Nx, s.char, s, ligature_tail)
@@ -489,26 +471,11 @@ local after_hlist, after_alchar, extract_np = after_hlist, after_alchar, extract
-------------------- 最下層の処理
-local function lineend_fix(g)
- if g and g.id==id_kern then
- Nq.lend = 0
- elseif Nq.lend~=0 then
- if not g then
- g = node_new(id_kern); --copy_attr(g, Nq.nuc);
- g.subtype = 1; g.kern = -Nq.lend;
- set_attr(g, attr_icflag, LINEEND)
- else
- g.spec.width = g.spec.width - Nq.lend
- end
- end
- return g
-end
-
-- change penalties (or create a new penalty, if needed)
local function handle_penalty_normal(post, pre, g)
local a = (pre or 0) + (post or 0)
if #Bp == 0 then
- if (a~=0 and not(g and g.id==id_kern)) or Nq.lend~=0 then
+ if (a~=0 and not(g and g.id==id_kern)) then
local p = node_new(id_penalty); --copy_attr(p, Nq.nuc)
if a<-10000 then a = -10000 elseif a>10000 then a = 10000 end
p.penalty = a
@@ -523,7 +490,7 @@ end
local function handle_penalty_always(post, pre, g)
local a = (pre or 0) + (post or 0)
if #Bp == 0 then
- if not (g and g.id==id_glue) or Nq.lend~=0 then
+ if not (g and g.id==id_glue) then
local p = node_new(id_penalty); --copy_attr(p, Nq.nuc)
if a<-10000 then a = -10000 elseif a>10000 then a = 10000 end
p.penalty = a
@@ -549,28 +516,26 @@ local function handle_penalty_suppress(post, pre, g)
end
-- 和文文字間の JFM glue を node 化
-local function new_jfm_glue(Nn, bc, ac)
+local function new_jfm_glue(m, bc, ac)
-- bc, ac: char classes
- local z = Nn.met.size_cache.char_type[bc]
- local g = z.glue[ac]
+ local z = m.size_cache.char_type[bc]
+ local g, d = z.glue[ac], 0
if g then
- g = node_copy(g); g.spec = node.copy(g.spec);
- elseif z.kern[ac] then
- g = node_new(id_kern); --copy_attr(g, Nn.nuc)
- g.subtype = 1; g.kern = z.kern[ac]
- set_attr(g, attr_icflag, FROM_JFM);
+ g,d = node_copy(g[1]), g[2];
+ g.spec = node_copy(g.spec); -- node_copy は spec をコピーする
+ else
+ local k = z.kern[ac]
+ if k then
+ g = node_new(id_kern); --copy_attr(g, Nn.nuc)
+ g.subtype = 1; g.kern, d = k[1], k[2]
+ set_attr(g, attr_icflag, FROM_JFM);
+ end
end
- return g
+ return g, d
end
-- Nq.last (kern w) .... (glue/kern g) Np.first
local function real_insert(w, g)
- if w~=0 then
- local h = node_new(id_kern); --copy_attr(h, Nq.nuc)
- set_attr(h, attr_icflag, LINE_END)
- h.kern = w; h.subtype = 1
- head = node.insert_after(head, Nq.last, h)
- end
if g then
head = insert_before(head, Np.first, g)
Np.first = g
@@ -584,87 +549,112 @@ end
local get_kanjiskip
local function get_kanjiskip_normal()
- local g = node_new(id_glue); --copy_attr(g, Nq.nuc)
- g.spec = (Np.auto_kspc or Nq.auto_kspc) and node_copy(kanji_skip) or get_zero_spec()
- set_attr(g, attr_icflag, KANJI_SKIP)
- return g
+ if Np.auto_kspc or Nq.auto_kspc then
+ return node_copy(kanji_skip)
+ else
+ local g = node_copy(zero_glue)
+ set_attr(g, attr_icflag, KANJI_SKIP)
+ return g
+ end
end
local function get_kanjiskip_jfm()
- local g = node_new(id_glue); --copy_attr(g, Nq.nuc)
+ local g
if Np.auto_kspc or Nq.auto_kspc then
- local gx = node_new(id_glue_spec);
- gx.stretch_order, gx.shrink_order = 0, 0
- local bk = Nq.met.size_cache.kanjiskip
- local ak
- if (Np.met.size_cache==Nq.met.size_cache) and (Nq.var==Np.var) then
- ak = nil
- else
- ak = Np.met.size_cache.kanjiskip
- end
- if bk then
- if ak then
- gx.width = round(diffmet_rule(bk[1], ak[1]))
- gx.stretch = round(diffmet_rule(bk[2], ak[2]))
- gx.shrink = -round(diffmet_rule(-bk[3], -ak[3]))
- else
- gx.width = bk[1]; gx.stretch = bk[2]; gx.shrink = bk[3]
- end
- elseif ak then
- gx.width = ak[1]; gx.stretch = ak[2]; gx.shrink = ak[3]
- else
- gx.width, gx.stretch, gx.shrink = 0, 0, 0
- end
- g.spec = gx
+ g = node_new(id_glue); --copy_attr(g, Nq.nuc)
+ local gx = node_new(id_glue_spec);
+ gx.stretch_order, gx.shrink_order = 0, 0
+ local pm, qm = Np.met, Nq.met
+ local bk = qm.size_cache.kanjiskip or {0, 0, 0}
+ if (pm.size_cache==qm.size_cache) and (qm.var==pm.var) then
+ gx.width = bk[1]; gx.stretch = bk[2]; gx.shrink = bk[3]
+ else
+ local ak = pm.size_cache.kanjiskip or {0, 0, 0}
+ gx.width = round(diffmet_rule(bk[1], ak[1]))
+ gx.stretch = round(diffmet_rule(bk[2], ak[2]))
+ gx.shrink = -round(diffmet_rule(-bk[3], -ak[3]))
+ end
+ g.spec = gx
else
- g.spec = get_zero_spec()
+ g = node_copy(zero_glue)
end
set_attr(g, attr_icflag, KANJI_SKIP)
return g
end
-local function calc_ja_ja_aux(gb,ga)
+local function calc_ja_ja_aux(gb,ga, db, da)
+ local rbb, rab = (1-db)/2, (1-da)/2 -- 「前の文字」由来のグルーの割合
+ local rba, raa = (1+db)/2, (1+da)/2 -- 「前の文字」由来のグルーの割合
+ if diffmet_rule ~= math.two_pleft and diffmet_rule ~= math.two_pright
+ and diffmet_rule ~= math.two_paverage then
+ rbb, rab, rba, raa = 1,0,0,1
+ end
if not gb then
+ if ga then gb = node_new(id_kern); gb.kern = 0 else return nil end
+ elseif not ga then
+ ga = node_new(id_kern); ga.kern = 0
+ end
+
+ local k = node.type(gb.id) .. node.type(ga.id)
+ if k == 'glueglue' then
+ -- 両方とも glue.
+ gb.spec.width = round(diffmet_rule(
+ rbb*gb.spec.width + rba*ga.spec.width,
+ rab*gb.spec.width + raa*ga.spec.width ))
+ gb.spec.stretch = round(diffmet_rule(
+ rbb*gb.spec.stretch + rba*ga.spec.stretch,
+ rab*gb.spec.stretch + raa*ga.spec.stretch ))
+ gb.spec.shrink = -round(diffmet_rule(
+ -rbb*gb.spec.shrink - rba*ga.spec.shrink,
+ -rab*gb.spec.shrink - raa*ga.spec.shrink ))
+ node.free(ga)
+ return gb
+ elseif k == 'kernkern' then
+ -- 両方とも kern.
+ gb.kern = round(diffmet_rule(
+ rbb*gb.kern + rba*ga.kern,
+ rab*gb.kern + raa*ga.kern ))
+ node.free(ga)
+ return gb
+ elseif k == 'kernglue' then
+ -- gb: kern, ga: glue
+ ga.spec.width = round(diffmet_rule(
+ rbb*gb.kern + rba*ga.spec.width,
+ rab*gb.kern + raa*ga.spec.width ))
+ ga.spec.stretch = round(diffmet_rule(
+ rba*ga.spec.stretch, raa*ga.spec.stretch ))
+ ga.spec.shrink = -round(diffmet_rule(
+ -rba*ga.spec.shrink,-raa*ga.spec.shrink ))
+ node.free(gb)
return ga
else
- if not ga then return gb end
- local k = node.type(gb.id) .. node.type(ga.id)
- if k == 'glueglue' then
- -- 両方とも glue.
- gb.spec.width = round(diffmet_rule(gb.spec.width, ga.spec.width))
- gb.spec.stretch = round(diffmet_rule(gb.spec.stretch,ga.spec.shrink))
- gb.spec.shrink = -round(diffmet_rule(-gb.spec.shrink, -ga.spec.shrink))
- node.free(ga)
- return gb
- elseif k == 'kernkern' then
- -- 両方とも kern.
- gb.kern = round(diffmet_rule(gb.kern, ga.kern))
- node.free(ga)
- return gb
- elseif k == 'kernglue' then
- -- gb: kern, ga: glue
- ga.spec.width = round(diffmet_rule(gb.kern,ga.spec.width))
- ga.spec.stretch = round(diffmet_rule(ga.spec.stretch, 0))
- ga.spec.shrink = -round(diffmet_rule(-ga.spec.shrink, 0))
- node.free(gb)
- return ga
- else
- -- gb: glue, ga: kern
- gb.spec.width = round(diffmet_rule(ga.kern, gb.spec.width))
- gb.spec.stretch = round(diffmet_rule(gb.spec.stretch, 0))
- gb.spec.shrink = -round(diffmet_rule(-gb.spec.shrink, 0))
- node.free(ga)
- return gb
- end
+ -- gb: glue, ga: kern
+ gb.spec.width = round(diffmet_rule(
+ rba*ga.kern + rbb*gb.spec.width,
+ raa*ga.kern + rab*gb.spec.width ))
+ gb.spec.stretch = round(diffmet_rule(
+ rbb*gb.spec.stretch, rab*gb.spec.stretch ))
+ gb.spec.shrink = -round(diffmet_rule(
+ -rbb*gb.spec.shrink,-rab*gb.spec.shrink ))
+ node.free(ga)
+ return gb
end
end
local function calc_ja_ja_glue()
if ihb_flag then return nil
- elseif (Nq.met.size_cache==Np.met.size_cache) and (Nq.var==Np.var) then
- return new_jfm_glue(Nq, Nq.class, Np.class)
else
- return calc_ja_ja_aux(new_jfm_glue(Nq, Nq.class, fast_find_char_class('diffmet',Nq.met)),
- new_jfm_glue(Np, fast_find_char_class('diffmet',Np.met), Np.class))
+ local qm, pm = Nq.met, Np.met
+ if (qm.size_cache==pm.size_cache) and (qm.var==pm.var) then
+ return new_jfm_glue(qm, Nq.class, Np.class)
+ else
+ local npn, nqn = Np.nuc, Nq.nuc
+ local gb, db = new_jfm_glue(qm, Nq.class,
+ slow_find_char_class(has_attr(npn, attr_orig_char), qm, npn.char))
+ local ga, da = new_jfm_glue(pm,
+ slow_find_char_class(has_attr(nqn, attr_orig_char), pm, nqn.char),
+ Np.class)
+ return calc_ja_ja_aux(gb, ga, db, da);
+ end
end
end
@@ -673,30 +663,25 @@ end
-- get xkanjiskip
local get_xkanjiskip
local function get_xkanjiskip_normal(Nn)
- local g = node_new(id_glue); --copy_attr(g, Nn.nuc)
- local gx = node_new(id_glue_spec); g.spec = gx
if (Nq.xspc>=2) and (Np.xspc%2==1) and (Nq.auto_xspc or Np.auto_xspc) then
- g.spec = node_copy(xkanji_skip)
+ return node_copy(xkanji_skip)
else
- g.spec = get_zero_spec()
+ local g = node_copy(zero_glue)
+ set_attr(g, attr_icflag, XKANJI_SKIP)
+ return g
end
- set_attr(g, attr_icflag, XKANJI_SKIP)
- return g
end
local function get_xkanjiskip_jfm(Nn)
- local g = node_new(id_glue); --copy_attr(g, Nn.nuc)
+ local g
if (Nq.xspc>=2) and (Np.xspc%2==1) and (Nq.auto_xspc or Np.auto_xspc) then
+ g = node_new(id_glue); --copy_attr(g, Nn.nuc)
local gx = node_new(id_glue_spec);
gx.stretch_order, gx.shrink_order = 0, 0
- local bk = Nn.met.size_cache.xkanjiskip
- if bk then
- gx.width = bk[1]; gx.stretch = bk[2]; gx.shrink = bk[3]
- else
- gx.width, gx.stretch, gx.shrink = 0, 0, 0
- end
+ local bk = Nn.met.size_cache.xkanjiskip or {0, 0, 0}
+ gx.width = bk[1]; gx.stretch = bk[2]; gx.shrink = bk[3]
g.spec = gx
else
- g.spec = get_zero_spec()
+ g = node_copy(zero_glue)
end
set_attr(g, attr_icflag, XKANJI_SKIP)
return g
@@ -708,40 +693,43 @@ end
local function get_OA_skip()
if not ihb_flag then
- return new_jfm_glue(Np,
- fast_find_char_class(((Nq.id == id_math and -1) or 'jcharbdd'), Np.met), Np.class)
+ local pm = Np.met
+ return new_jfm_glue(pm,
+ fast_find_char_class(((Nq.id == id_math and -1) or 'jcharbdd'), pm), Np.class)
else return nil
end
end
local function get_OB_skip()
if not ihb_flag then
- return new_jfm_glue(Nq, Nq.class,
- fast_find_char_class(((Np.id == id_math and -1) or'jcharbdd'), Nq.met))
+ local qm = Nq.met
+ return new_jfm_glue(qm, Nq.class,
+ fast_find_char_class(((Np.id == id_math and -1) or'jcharbdd'), qm))
else return nil
end
end
-- (anything) .. jachar
local function handle_np_jachar(mode)
- if Nq.id==id_jglyph or ((Nq.id==id_pbox or Nq.id==id_pbox_w) and Nq.met) then
- local g = lineend_fix(calc_ja_ja_glue() or get_kanjiskip()) -- M->K
- handle_penalty_normal(Nq.post, Np.pre, g); real_insert(Nq.lend, g)
- elseif Nq.met then -- Nq.id==id_hlist
+ local qid = Nq.id
+ if qid==id_jglyph or ((qid==id_pbox or qid==id_pbox_w) and Nq.met) then
+ local g = calc_ja_ja_glue() or get_kanjiskip() -- M->K
+ handle_penalty_normal(Nq.post, Np.pre, g); real_insert(0, g)
+ elseif Nq.met then -- qid==id_hlist
local g = get_OA_skip() or get_kanjiskip() -- O_A->K
handle_penalty_normal(0, Np.pre, g); real_insert(0, g)
elseif Nq.pre then
local g = get_OA_skip() or get_xkanjiskip(Np) -- O_A->X
- if Nq.id==id_hlist then Nq.post = 0 end
+ if qid==id_hlist then Nq.post = 0 end
handle_penalty_normal(Nq.post, Np.pre, g); real_insert(0, g)
else
local g = get_OA_skip() -- O_A
- if Nq.id==id_glue then handle_penalty_normal(0, Np.pre, g)
- elseif Nq.id==id_kern then handle_penalty_suppress(0, Np.pre, g)
+ if qid==id_glue then handle_penalty_normal(0, Np.pre, g)
+ elseif qid==id_kern then handle_penalty_suppress(0, Np.pre, g)
else handle_penalty_always(0, Np.pre, g)
end
real_insert(0, g)
end
- if mode and (ltjs_fast_get_penalty_table('kcat', Np.char) or 0)%2~=1 then
+ if mode and Np.kcat%2~=1 then
widow_Np.first, widow_Bp, Bp = Np.first, Bp, widow_Bp
end
end
@@ -751,23 +739,24 @@ end
local function handle_nq_jachar()
if Np.pre then
if Np.id==id_hlist then Np.pre = 0 end
- local g = lineend_fix(get_OB_skip() or get_xkanjiskip(Nq)) -- O_B->X
- handle_penalty_normal(Nq.post, Np.pre, g); real_insert(Nq.lend, g)
+ local g = get_OB_skip() or get_xkanjiskip(Nq) -- O_B->X
+ handle_penalty_normal(Nq.post, Np.pre, g); real_insert(0, g)
else
- local g = lineend_fix(get_OB_skip()) -- O_B
+ local g = get_OB_skip() -- O_B
if Np.id==id_glue then handle_penalty_normal(Nq.post, 0, g)
elseif Np.id==id_kern then handle_penalty_suppress(Nq.post, 0, g)
else handle_penalty_always(Nq.post, 0, g)
end
- real_insert(Nq.lend, g)
+ real_insert(0, g)
end
end
-- (anything) .. (和文文字で始まる hlist)
local function handle_np_ja_hlist()
- if Nq.id==id_jglyph or ((Nq.id==id_pbox or Nq.id == id_pbox_w) and Nq.met) then
- local g = lineend_fix(get_OB_skip() or get_kanjiskip()) -- O_B->K
- handle_penalty_normal(Nq.post, 0, g); real_insert(Nq.lend, g)
+ local qid = Nq.id
+ if qid==id_jglyph or ((qid==id_pbox or Nq.id == id_pbox_w) and Nq.met) then
+ local g = get_OB_skip() or get_kanjiskip() -- O_B->K
+ handle_penalty_normal(Nq.post, 0, g); real_insert(0, g)
elseif Nq.met then -- Nq.id==id_hlist
local g = get_kanjiskip() -- K
handle_penalty_suppress(0, 0, g); real_insert(0, g)
@@ -801,25 +790,18 @@ end
local function handle_list_tail(mode)
adjust_nq(); Np = Nq
if mode then
- -- the current list is to be line-breaked:
- if Np.id == id_jglyph or (Np.id==id_pbox and Np.met) then
- if Np.lend~=0 then
- g = node_new(id_kern); g.subtype = 0; g.kern = Np.lend
- --copy_attr(g, Np.nuc);
- set_attr(g, attr_icflag, BOXBDD)
- node.insert_after(head, Np.last, g)
- end
- end
+ -- the current list is to be line-breaked.
-- Insert \jcharwidowpenalty
- Bp = widow_Bp; Np = widow_Np; Nq.lend = 0
+ Bp = widow_Bp; Np = widow_Np
if Np.first then
handle_penalty_normal(0,
ltjs_fast_get_penalty_table('jwp', 0) or 0)
end
else
-- the current list is the contents of a hbox
- if Np.id == id_jglyph or (Np.id==id_pbox and Np.met) then
- local g = new_jfm_glue(Np, Np.class, fast_find_char_class('boxbdd',Np.met))
+ local npi, pm = Np.id, Np.met
+ if npi == id_jglyph or (npi==id_pbox and pm) then
+ local g = new_jfm_glue(pm, Np.class, fast_find_char_class('boxbdd', pm))
if g then
set_attr(g, attr_icflag, BOXBDD)
head = node.insert_after(head, Np.last, g)
@@ -830,9 +812,10 @@ end
-- リスト先頭の処理
local function handle_list_head(par_indented)
- if Np.id == id_jglyph or (Np.id==id_pbox and Np.met) then
+ local npi, pm = Np.id, Np.met
+ if npi == id_jglyph or (npi==id_pbox and pm) then
if not ihb_flag then
- local g = new_jfm_glue(Np, fast_find_char_class(par_indented, Np.met), Np.class)
+ local g = new_jfm_glue(pm, fast_find_char_class(par_indented, pm), Np.class)
if g then
set_attr(g, attr_icflag, BOXBDD)
if g.id==id_glue and #Bp==0 then
@@ -849,30 +832,37 @@ end
-- return value: (the initial cursor lp), (last node)
local function init_var(mode)
Bp, widow_Bp, widow_Np = {}, {}, {first = nil}
- kanji_skip=skip_table_to_spec('kanjiskip')
- get_kanjiskip = (kanji_skip.width == max_dimen)
+
+ kanji_skip = node_new(id_glue)
+ kanji_skip.spec = skip_table_to_spec('kanjiskip')
+ set_attr(kanji_skip, attr_icflag, KANJI_SKIP)
+ get_kanjiskip = (kanji_skip.spec.width == max_dimen)
and get_kanjiskip_jfm or get_kanjiskip_normal
- xkanji_skip=skip_table_to_spec('xkanjiskip')
- get_xkanjiskip = (xkanji_skip.width == max_dimen)
+
+ xkanji_skip = node_new(id_glue)
+ xkanji_skip.spec = skip_table_to_spec('xkanjiskip')
+ set_attr(xkanji_skip, attr_icflag, XKANJI_SKIP)
+ get_xkanjiskip = (xkanji_skip.spec.width == max_dimen)
and get_xkanjiskip_jfm or get_xkanjiskip_normal
+
Np = {
auto_kspc=nil, auto_xspc=nil, char=nil, class=nil,
- first=nil, id=nil, last=nil, lend=0, met=nil, nuc=nil,
+ first=nil, id=nil, last=nil, met=nil, nuc=nil,
post=nil, pre=nil, xspc=nil,
}
Nq = {
auto_kspc=nil, auto_xspc=nil, char=nil, class=nil,
- first=nil, id=nil, last=nil, lend=0, met=nil, nuc=nil,
+ first=nil, id=nil, last=nil, met=nil, nuc=nil,
post=nil, pre=nil, xspc=nil,
}
if mode then
-- the current list is to be line-breaked:
-- hbox from \parindent is skipped.
- local lp, par_indented = head, 'boxbdd'
- while lp and ((lp.id==id_whatsit and lp.subtype~=sid_user)
- or ((lp.id==id_hlist) and (lp.subtype==3))) do
- if (lp.id==id_hlist) and (lp.subtype==3) then par_indented = 'parbdd' end
- lp=node_next(lp) end
+ local lp, par_indented, lpi, lps = head, 'boxbdd', head.id, head.subtype
+ while lp and ((lpi==id_whatsit and lps~=sid_user)
+ or ((lpi==id_hlist) and (lps==3))) do
+ if (lpi==id_hlist) and (lps==3) then par_indented = 'parbdd' end
+ lp=node_next(lp); lpi, lps = lp.id, lp.subtype end
return lp, node.tail(head), par_indented
else
-- the current list is the contents of a hbox:
@@ -919,11 +909,12 @@ function main(ahead, mode)
lp = calc_np(lp, last)
while Np do
extract_np(); adjust_nq()
+ local pid, pm = Np.id, Np.met
-- 挿入部
- if Np.id == id_jglyph then
+ if pid == id_jglyph then
handle_np_jachar(mode)
- elseif Np.met then
- if Np.id==id_hlist then handle_np_ja_hlist()
+ elseif pm then
+ if pid==id_hlist then handle_np_ja_hlist()
else handle_np_jachar() end
elseif Nq.met then
if Nq.id==id_hlist then handle_nq_ja_hlist()
@@ -965,6 +956,8 @@ local function whatsit_callback(Np, lp, Nq)
return Np
end
end
+
+
local function whatsit_after_callback(s, Nq, Np)
if not s and Nq.nuc.user_id == 30114 then
local x, y = node.prev(Nq.nuc), Nq.nuc
diff --git a/Master/texmf-dist/tex/luatex/luatexja/ltj-jfont.lua b/Master/texmf-dist/tex/luatex/luatexja/ltj-jfont.lua
index e15563a0cef..c360a6e80dd 100644
--- a/Master/texmf-dist/tex/luatex/luatexja/ltj-jfont.lua
+++ b/Master/texmf-dist/tex/luatex/luatexja/ltj-jfont.lua
@@ -24,8 +24,9 @@ local id_kern = node.id('kern')
local id_glue_spec = node.id('glue_spec')
local id_glue = node.id('glue')
local cat_lp = luatexbase.catcodetables['latex-package']
-local ITALIC = 1
-local FROM_JFM = 4
+local ITALIC = luatexja.icflag_table.ITALIC
+local FROM_JFM = luatexja.icflag_table.FROM_JFM
+
------------------------------------------------------------------------
-- LOADING JFM
------------------------------------------------------------------------
@@ -74,6 +75,9 @@ function define_jfm(t)
defjfm_res= nil; return
end
end
+ if type(v.align)~='string' then
+ v.align = 'left' -- left
+ end
if real_char then
if not (type(v.width)=='number' or v.width~='prop') then
defjfm_res= nil; return
@@ -93,9 +97,6 @@ function define_jfm(t)
if type(v.down)~='number' then
v.down = 0.0
end
- if type(v.align)~='string' then
- v.align = 'left'
- end
end
end
v.chars = nil
@@ -105,6 +106,13 @@ function define_jfm(t)
for j in pairs(v.glue) do
if v.kern[j] then defjfm_res= nil; return end
end
+ for j,x in pairs(v.kern) do
+ if type(x)=='number' then
+ v.kern[j] = {x, 0}
+ elseif type(x)=='table' then
+ v.kern[j] = {x[1], x[2] or 0}
+ end
+ end
t.char_type[i] = v
t[i] = nil
end
@@ -139,10 +147,15 @@ local function update_jfm_cache(j,sz)
for i,v in pairs(t.char_type) do
if type(i) == 'number' then -- char_type
for k,w in pairs(v.glue) do
- local g, h = node.new(id_glue), node_new(id_glue_spec); v.glue[k] = g
+ local g, h = node.new(id_glue), node_new(id_glue_spec)
+ v.glue[k] = {g, (w[5] and w[5]/sz or 0)}
h.width, h.stretch, h.shrink = w[1], w[2], w[3]
h.stretch_order, h.shrink_order = 0, 0
- g.subtype = 0; g.spec = h; set_attr(g, attr_icflag, FROM_JFM);
+ g.subtype = 0; g.spec = h; set_attr(g, attr_icflag, FROM_JFM +
+ (w[4] and w[4]/sz or 0));
+ end
+ for k,w in pairs(v.kern) do
+ w[2] = w[2]/sz
end
end
end
diff --git a/Master/texmf-dist/tex/luatex/luatexja/ltj-kinsoku.lua b/Master/texmf-dist/tex/luatex/luatexja/ltj-kinsoku.lua
new file mode 100644
index 00000000000..c22760e5b9f
--- /dev/null
+++ b/Master/texmf-dist/tex/luatex/luatexja/ltj-kinsoku.lua
Binary files differ
diff --git a/Master/texmf-dist/tex/luatex/luatexja/ltj-latex.sty b/Master/texmf-dist/tex/luatex/luatexja/ltj-latex.sty
index 3cb52389e14..84901b0bf37 100644
--- a/Master/texmf-dist/tex/luatex/luatexja/ltj-latex.sty
+++ b/Master/texmf-dist/tex/luatex/luatexja/ltj-latex.sty
@@ -38,14 +38,19 @@
\usepackage{lltjcore}
%%% default parameters
+\directlua{
+ luatexja.stack.charprop_stack_table[0]
+ = dofile(assert(kpse.find_file('ltj-kinsoku.lua', 'tex'),
+ "File `ltj-kinsoku.lua' not found"))
+}
+
\ltjsetparameter{kanjiskip=0pt plus 0.4pt minus 0.4pt,
xkanjiskip=.25\zw plus 1pt minus 1pt,
autospacing, autoxspacing, jacharrange={-1},
yalbaselineshift=0pt, yjabaselineshift=0pt,
- jcharwidowpenalty=500, differentjfm=average
+ jcharwidowpenalty=500, differentjfm=paverage
}
-\input luatexja-kinsoku.tex
\expandafter\let\csname JY3/mc/m/n/10\endcsname\relax
%%% patch for packages
diff --git a/Master/texmf-dist/tex/luatex/luatexja/ltj-math.lua b/Master/texmf-dist/tex/luatex/luatexja/ltj-math.lua
index fd77dc450d7..793d6586aa0 100644
--- a/Master/texmf-dist/tex/luatex/luatexja/ltj-math.lua
+++ b/Master/texmf-dist/tex/luatex/luatexja/ltj-math.lua
@@ -41,7 +41,7 @@ local id_frac = node.id('fraction')
local id_simple = node.id('noad')
local id_sub_mlist = node.id('sub_mlist')
-local PROCESSED = 8
+local PROCESSED = 11
local ltjf_font_metric_table = ltjf.font_metric_table
local ltjf_find_char_class = ltjf.find_char_class
diff --git a/Master/texmf-dist/tex/luatex/luatexja/ltj-plain.sty b/Master/texmf-dist/tex/luatex/luatexja/ltj-plain.sty
index d09d05be2bd..30012f30fd3 100644
--- a/Master/texmf-dist/tex/luatex/luatexja/ltj-plain.sty
+++ b/Master/texmf-dist/tex/luatex/luatexja/ltj-plain.sty
@@ -32,16 +32,20 @@
\let\mc=\tenmin
\let\gt=\tengt
\mc
+
+\directlua{
+ luatexja.stack.charprop_stack_table[0]
+ = dofile(assert(kpse.find_file('ltj-kinsoku.lua', 'tex'),
+ "File `ltj-kinsoku.lua' not found"))
+}
+
\ltjsetparameter{kanjiskip=0pt plus 0.4pt minus 0.4pt,
xkanjiskip=.25\zw plus 1pt minus 1pt,
autospacing, autoxspacing, jacharrange={-1},
yalbaselineshift=0pt, yjabaselineshift=0pt,
- jcharwidowpenalty=500, differentjfm=average
+ jcharwidowpenalty=500, differentjfm=paverage
}
-\input luatexja-kinsoku.tex
-
-
\ltjdefcharrange{1}{"80-"36F, "1E00-"1EFF}
\ltjdefcharrange{2}{"370-"4FF, "1F00-"1FFF}
\ltjdefcharrange{3}{%
diff --git a/Master/texmf-dist/tex/luatex/luatexja/ltj-pretreat.lua b/Master/texmf-dist/tex/luatex/luatexja/ltj-pretreat.lua
index 18a1df06e78..d0ea84da1be 100644
--- a/Master/texmf-dist/tex/luatex/luatexja/ltj-pretreat.lua
+++ b/Master/texmf-dist/tex/luatex/luatexja/ltj-pretreat.lua
@@ -45,16 +45,17 @@ local function suppress_hyphenate_ja(head)
local non_math, p = true, head
wt = {}
while p do
- if p.id == id_glyph then
+ local pid = p.id
+ if pid == id_glyph then
if (has_attr(p, attr_icflag) or 0)<=0 and ltjc_is_ucs_in_japanese_char(p) then
p.font = has_attr(p, attr_curjfnt) or p.font
p.subtype = floor(p.subtype*0.5)*2
set_attr(p, attr_orig_char, p.char)
end
- elseif p.id == id_math then
+ elseif pid == id_math then
p = node_next(p) -- skip math on
while p and p.id~=id_math do p = node_next(p) end
- elseif p.id == id_whatsit and p.subtype==sid_user and p.user_id==30112 then
+ elseif pid == id_whatsit and p.subtype==sid_user and p.user_id==30112 then
wt[#wt+1] = p; head = node_remove(head, p)
end
p = node_next(p)
diff --git a/Master/texmf-dist/tex/luatex/luatexja/ltj-setwidth.lua b/Master/texmf-dist/tex/luatex/luatexja/ltj-setwidth.lua
index 57db242c19f..5b3ad291521 100644
--- a/Master/texmf-dist/tex/luatex/luatexja/ltj-setwidth.lua
+++ b/Master/texmf-dist/tex/luatex/luatexja/ltj-setwidth.lua
@@ -40,15 +40,15 @@ local attr_icflag = luatexbase.attributes['ltj@icflag']
local ltjf_font_metric_table = ltjf.font_metric_table
local PACKED = 2
-local PROCESSED = 8
-local IC_PROCESSED = 9
-local PROCESSED_BEGIN_FLAG = 16
+local PROCESSED = 11
+local IC_PROCESSED = 12
+local PROCESSED_BEGIN_FLAG = 32
do
local floor = math.floor
function get_pr_begin_flag(p)
- return floor((has_attr(p, attr_icflag) or 0)
- /PROCESSED_BEGIN_FLAG)*PROCESSED_BEGIN_FLAG
+ local i = has_attr(p, attr_icflag) or 0
+ return i - i%PROCESSED_BEGIN_FLAG
end
end
local get_pr_begin_flag = get_pr_begin_flag
@@ -66,24 +66,26 @@ local fshift = { down = 0, left = 0}
function capsule_glyph(p, dir, mode, met, class)
local char_data = met.size_cache.char_type[class]
if not char_data then return node_next(p) end
- local fwidth = (char_data.width ~= 'prop') and char_data.width or p.width
+ local fwidth, pwidth = char_data.width, p.width
+ fwidth = (fwidth ~= 'prop') and fwidth or pwidth
local fheight, fdepth = char_data.height, char_data.depth
fshift.down = char_data.down; fshift.left = char_data.left
fshift = luatexbase.call_callback("luatexja.set_width", fshift, met, class)
- if (mode or p.width ~= fwidth or p.height ~= fheight or p.depth ~= fdepth) then
- local y_shift, total = - p.yoffset + (has_attr(p,attr_ykblshift) or 0), fwidth - p.width
+ if (mode or pwidth ~= fwidth or p.height ~= fheight or p.depth ~= fdepth) then
+ local y_shift, ca
+ = - p.yoffset + (has_attr(p,attr_ykblshift) or 0), char_data.align
local q; head, q = node.remove(head, p)
p.yoffset, p.next = -fshift.down, nil
- if total ~= 0 and char_data.align~='left' then
+ if total ~= 0 and ca~='left' then
p.xoffset = p.xoffset - fshift.left
- + (((char_data.align=='right') and total) or round(total*0.5))
+ + (((ca=='right') and fwidth - pwidth) or round((fwidth - pwidth)*0.5))
else
p.xoffset = p.xoffset - fshift.left
end
local box = node_new(id_hlist);
box.width, box.height, box.depth = fwidth, fheight, fdepth
box.head, box.shift, box.dir = p, y_shift, (dir or 'TLT')
- box.glue_set, box.glue_order = 0, 0
+ --box.glue_set, box.glue_order = 0, 0 not needed
set_attr(box, attr_icflag, PACKED + get_pr_begin_flag(p))
head = q and node_insert_before(head, q, box)
or node_insert_after(head, node_tail(head), box)
@@ -102,8 +104,9 @@ function set_ja_width(ahead, dir)
while p do
if (p.id==id_glyph)
and ((has_attr(p, attr_icflag) or 0)%PROCESSED_BEGIN_FLAG)<=0 then
- if p.font == has_attr(p, attr_curjfnt) then
- p = capsule_glyph(p, dir, false, ltjf_font_metric_table[p.font],
+ local pf = p.font
+ if pf == has_attr(p, attr_curjfnt) then
+ p = capsule_glyph(p, dir, false, ltjf_font_metric_table[pf],
has_attr(p, attr_jchar_class))
else
set_attr(p, attr_icflag, PROCESSED + get_pr_begin_flag(p))
diff --git a/Master/texmf-dist/tex/luatex/luatexja/ltj-stack.lua b/Master/texmf-dist/tex/luatex/luatexja/ltj-stack.lua
index c7f52c93fb6..de985d59175 100644
--- a/Master/texmf-dist/tex/luatex/luatexja/ltj-stack.lua
+++ b/Master/texmf-dist/tex/luatex/luatexja/ltj-stack.lua
@@ -17,7 +17,9 @@ local id_whatsit = node.id('whatsit')
local sid_user = node.subtype('user_defined')
local hmode = 118 -- in luatexref-t.pdf, this must be 127
-local charprop_stack_table={}; charprop_stack_table[0]={}
+charprop_stack_table={};
+local charprop_stack_table = charprop_stack_table
+charprop_stack_table[0]={}
-- modified from table.fastcopy
local next = next
@@ -96,14 +98,14 @@ function set_stack_table(g,m,c,p,lb,ub)
"(-1 is used for denoting `math boundary')\n" ..
'So I changed this one to zero.')
c=0
- elseif not charprop_stack_table[i][m] then
- charprop_stack_table[i][m] = {}
+ elseif not charprop_stack_table[i][c] then
+ charprop_stack_table[i][c] = {}
end
- charprop_stack_table[i][m][c] = p
+ charprop_stack_table[i][c][m] = p
if g=='global' then
for j,v in pairs(charprop_stack_table) do
- if not charprop_stack_table[j][m] then charprop_stack_table[j][m] = {} end
- charprop_stack_table[j][m][c] = p
+ if not charprop_stack_table[j][c] then charprop_stack_table[j][c] = {} end
+ charprop_stack_table[j][c][m] = p
end
end
end
@@ -117,14 +119,14 @@ function set_stack_font(g,m,c,p)
"The family number should in the range 0 .. 255.\n" ..
"I'm going to use 0 instead of that illegal family number.")
c=0
- elseif not charprop_stack_table[i][m] then
- charprop_stack_table[i][m] = {}
+ elseif not charprop_stack_table[i][c] then
+ charprop_stack_table[i][c] = {}
end
- charprop_stack_table[i][m][c] = p
+ charprop_stack_table[i][c][m] = p
if g=='global' then
for j,v in pairs(charprop_stack_table) do
- if not charprop_stack_table[j][m] then charprop_stack_table[j][m] = {} end
- charprop_stack_table[j][m][c] = p
+ if not charprop_stack_table[j][c] then charprop_stack_table[j][c] = {} end
+ charprop_stack_table[j][c][m] = p
end
end
end
@@ -163,8 +165,13 @@ function fast_get_skip_table(m)
or { width = 0, stretch = 0, shrink = 0, stretch_order = 0, shrink_order = 0 }
end
function fast_get_penalty_table(m,c)
- local i = table_current_stack[m]
- return (i and i[c])
+ local i = table_current_stack[c]
+ return (i and i[m])
+end
+
+local empty_table = {}
+function fast_get_penalty_table_parent(c)
+ return table_current_stack[c] or empty_table
end
-- For other situations, use the following instead:
@@ -173,8 +180,8 @@ function get_skip_table(m, idx)
or { width = 0, stretch = 0, shrink = 0, stretch_order = 0, shrink_order = 0 }
end
function get_penalty_table(m,c,d, idx)
- local i = charprop_stack_table[idx][m]
- return (i and i[c]) or d
+ local i = charprop_stack_table[idx][c]
+ return (i and i[m]) or d
end
diff --git a/Master/texmf-dist/tex/luatex/luatexja/luatexja-core.sty b/Master/texmf-dist/tex/luatex/luatexja/luatexja-core.sty
index 53ef07766c2..ea54c3e5e9e 100644
--- a/Master/texmf-dist/tex/luatex/luatexja/luatexja-core.sty
+++ b/Master/texmf-dist/tex/luatex/luatexja/luatexja-core.sty
@@ -132,16 +132,16 @@
\def\ltj@defdimen{0}
%%%%%%%% Attributes for Japanese typesetting.
+\newluatexattribute\ltj@icflag % attribute for italic correction
\newluatexattribute\ltj@curjfnt % index for ``current Japanese font''
-\newluatexattribute\jfam % index for current jfam
-\newluatexattribute\ltj@charclass %
\newluatexattribute\ltj@origchar %
-\newluatexattribute\ltj@yablshift % attribute for \yabaselineshift
-\newluatexattribute\ltj@ykblshift % attribute for \ykbaselineshift
+\newluatexattribute\ltj@charclass %
\newluatexattribute\ltj@autospc % attribute for autospacing
\newluatexattribute\ltj@autoxspc % attribute for autoxspacing
-\newluatexattribute\ltj@icflag % attribute for italic correction
-\ltj@icflag=0 \ltj@origchar=0
+\newluatexattribute\ltj@yablshift % attribute for \yabaselineshift
+\newluatexattribute\ltj@ykblshift % attribute for \ykbaselineshift
+\newluatexattribute\jfam % index for current jfam
+\ltj@icflag=0\ltj@origchar=0
%%%%%%%% Attributes for character ranges
\newcount\ltj@tempcnta
@@ -341,19 +341,22 @@
\define@key[ltj]{japaram}{jcharwidowpenalty}{% %COUNT
\ltj@@set@stack0,#1:{jwp}{-10000}{10000}}
-% differentjfm = { large | small | average | both }
+% differentjfm = { large | small | average | pleft | pright | paverage | both}
\define@choicekey*+[ltj]{japaram}{differentjfm}[\ltj@temp\ltj@tempr]%
- {large,small,average,both}{%
+ {large,small,average,pleft,pright,paverage,both}{%
\ifcase\ltj@tempr
\directlua{luatexja.jfmglue.diffmet_rule = math.max}\or
\directlua{luatexja.jfmglue.diffmet_rule = math.min}\or
\directlua{luatexja.jfmglue.diffmet_rule = math.two_average}\or
+ \directlua{luatexja.jfmglue.diffmet_rule = math.two_pleft}\or
+ \directlua{luatexja.jfmglue.diffmet_rule = math.two_pright}\or
+ \directlua{luatexja.jfmglue.diffmet_rule = math.two_paverage}\or
\directlua{luatexja.jfmglue.diffmet_rule = math.two_add}
\fi
}{\ltj@PackageError{luatexja}{invalid argument `#1' for `differentjfm'}{%
Argument for `differentjfm' must be one of `large', `small', `average',^^J%
- and `both'. }}
- % large, small, average, both
+ `pleft', `pright', 'paverage' or `both'. }}
+ % large, small, average, pleft, pright, paverage, both
% jacharrange = { +-<range_number> }
diff --git a/Master/texmf-dist/tex/luatex/luatexja/luatexja.lua b/Master/texmf-dist/tex/luatex/luatexja/luatexja.lua
index 98b0ae7dc5d..adf741f1938 100644
--- a/Master/texmf-dist/tex/luatex/luatexja/luatexja.lua
+++ b/Master/texmf-dist/tex/luatex/luatexja/luatexja.lua
@@ -34,6 +34,22 @@ function luatexja.load_lua(fn)
end
end
+local icflag_table = {}
+luatexja.icflag_table = icflag_table
+icflag_table.ITALIC = 1
+icflag_table.PACKED = 2
+icflag_table.KINSOKU = 3
+icflag_table.FROM_JFM = 6
+-- FROM_JFM: 4, 5, 6, 7, 8 →優先度高
+-- 6 が標準
+icflag_table.KANJI_SKIP = 9
+icflag_table.XKANJI_SKIP = 10
+icflag_table.PROCESSED = 11
+icflag_table.IC_PROCESSED = 12
+icflag_table.BOXBDD = 15
+icflag_table.PROCESSED_BEGIN_FLAG = 32
+
+
local load_module = luatexja.load_module
load_module('base'); local ltjb = luatexja.base
load_module('rmlgbm'); local ltjr = luatexja.rmlgbm -- must be 1st
@@ -76,19 +92,6 @@ local attr_icflag = luatexbase.attributes['ltj@icflag']
local attr_uniqid = luatexbase.attributes['ltj@uniqid']
local cat_lp = luatexbase.catcodetables['latex-package']
-local ITALIC = 1
-local PACKED = 2
-local KINSOKU = 3
-local FROM_JFM = 4
-local LINE_END = 5
-local KANJI_SKIP = 6
-local XKANJI_SKIP = 7
-local PROCESSED = 8
-local IC_PROCESSED = 9
-local BOXBDD = 15
-local PROCESSED_BEGIN_FLAG = 16
-
-
-- Three aux. functions, bollowed from tex.web
local unity=65536
local function print_scaled(s)
@@ -180,14 +183,16 @@ function luatexja.ext_get_parameter_binary(k,c)
c=0
end
if k == 'jacharrange' then
- if c<0 or c>216 then
+ if c>=7*ltjc.ATTR_RANGE then
ltjb.package_error('luatexja',
'invalid character range number (' .. c .. ')',
- 'A character range number should be in the range 0..216,\n'..
+ 'A character range number should be in the range 0..'
+ .. 7+ATTR_RANGE-1 .. ",\n"..
'So I changed this one to zero.')
c=0
end
- tex.write(ltjc.get_range_setting(c))
+ -- 負の値は <U+0080 の文字の文字範囲,として出てくる.この時はいつも欧文文字なので 1 を返す
+ tex.write( (c<0) and -1 or ltjc.get_range_setting(c))
else
if c<0 or c>0x10FFFF then
ltjb.package_error('luatexja',
@@ -275,7 +280,7 @@ local function debug_show_node_X(p,print_fn)
for i = 2, p.glue_order do s = s .. 'l' end
end
end
- if get_attr_icflag(p) == PACKED then
+ if get_attr_icflag(p) == icflag_table.PACKED then
s = s .. ' (packed)'
end
print_fn(s)
@@ -287,11 +292,12 @@ local function debug_show_node_X(p,print_fn)
debug_depth=k
elseif pt == 'glue' then
s = base .. ' ' .. print_spec(p.spec)
- if get_attr_icflag(p)==FROM_JFM then
- s = s .. ' (from JFM)'
- elseif get_attr_icflag(p)==KANJI_SKIP then
+ if get_attr_icflag(p)>icflag_table.KINSOKU
+ and get_attr_icflag(p)<icflag_table.KANJI_SKIP then
+ s = s .. ' (from JFM: priority ' .. get_attr_icflag(p)-icflag_table.FROM_JFM .. ')'
+ elseif get_attr_icflag(p)==icflag_table.KANJI_SKIP then
s = s .. ' (kanjiskip)'
- elseif get_attr_icflag(p)==XKANJI_SKIP then
+ elseif get_attr_icflag(p)==icflag_table.XKANJI_SKIP then
s = s .. ' (xkanjiskip)'
end
print_fn(s)
@@ -299,19 +305,18 @@ local function debug_show_node_X(p,print_fn)
s = base .. ' ' .. print_scaled(p.kern) .. 'pt'
if p.subtype==2 then
s = s .. ' (for accent)'
- elseif get_attr_icflag(p)==IC_PROCESSED then
+ elseif get_attr_icflag(p)==icflag_table.IC_PROCESSED then
s = s .. ' (italic correction)'
-- elseif get_attr_icflag(p)==ITALIC then
-- s = s .. ' (italic correction)'
- elseif get_attr_icflag(p)==FROM_JFM then
- s = s .. ' (from JFM)'
- elseif get_attr_icflag(p)==LINE_END then
- s = s .. " (from 'lineend' in JFM)"
+ elseif get_attr_icflag(p)>icflag_table.KINSOKU
+ and get_attr_icflag(p)<icflag_table.KANJI_SKIP then
+ s = s .. ' (from JFM: priority ' .. get_attr_icflag(p)-icflag_table.FROM_JFM .. ')'
end
print_fn(s)
elseif pt == 'penalty' then
s = base .. ' ' .. tostring(p.penalty)
- if get_attr_icflag(p)==KINSOKU then
+ if get_attr_icflag(p)==icflag_table.KINSOKU then
s = s .. ' (for kinsoku)'
end
print_fn(s)
diff --git a/Master/texmf-dist/tex/luatex/luatexja/luatexja.sty b/Master/texmf-dist/tex/luatex/luatexja/luatexja.sty
index 46b7e87f9eb..c4224b4c6fb 100644
--- a/Master/texmf-dist/tex/luatex/luatexja/luatexja.sty
+++ b/Master/texmf-dist/tex/luatex/luatexja/luatexja.sty
@@ -35,7 +35,7 @@
\expandafter\let\csname ifltj@in@latex\expandafter\endcsname
\csname iftrue\endcsname
\NeedsTeXFormat{LaTeX2e}
- \ProvidesPackage{luatexja}[2011/04/01 v0.1]
+ \ProvidesPackage{luatexja}[2012/04/20 v0.2]
\fi %</LaTeX>
\ifnum\catcode`漢=12
diff --git a/Master/texmf-dist/tex/luatex/luatexja/patches/lltjfont.sty b/Master/texmf-dist/tex/luatex/luatexja/patches/lltjfont.sty
index e0d8ee84b1a..936b6253b66 100644
--- a/Master/texmf-dist/tex/luatex/luatexja/patches/lltjfont.sty
+++ b/Master/texmf-dist/tex/luatex/luatexja/patches/lltjfont.sty
@@ -452,8 +452,8 @@
\edef\k@family{#1}%
\else % search font definition file...
\ifcsname kfam@list@\k@encoding\endcsname\else
- \expandafter\gdef\csname kfam@list@\k@encoding\endcsname{}
- \expandafter\gdef\csname notkfam@list@\k@encoding\endcsname{}
+ \expandafter\gdef\csname kfam@list@\k@encoding\endcsname{}%
+ \expandafter\gdef\csname notkfam@list@\k@encoding\endcsname{}%
\fi
\edef\@templist{\@nameuse{kfam@list@\k@encoding}}%
\expandafter\expandafter\expandafter\inlist@\expandafter\tmp@item\expandafter{\@templist}%
@@ -478,8 +478,8 @@
\edef\f@family{#1}%
\else % search font definition file...
\ifcsname ffam@list@\f@encoding\endcsname\else
- \expandafter\gdef\csname ffam@list@\f@encoding\endcsname{}
- \expandafter\gdef\csname notffam@list@\f@encoding\endcsname{}
+ \expandafter\gdef\csname ffam@list@\f@encoding\endcsname{}%
+ \expandafter\gdef\csname notffam@list@\f@encoding\endcsname{}%
\fi
\edef\@templist{\@nameuse{ffam@list@\f@encoding}}%
\expandafter\expandafter\expandafter\inlist@\expandafter\tmp@item\expandafter{\@templist}%
@@ -519,7 +519,7 @@
\def\useroman#1#2#3#4{%
\romanencoding{#1}\romanfamily{#2}\romanseries{#3}\romanshape{#4}%
\selectfont\ignorespaces}
-\def\usefont#1#2#3#4{%
+\protected\def\usefont#1#2#3#4{%
\edef\tmp@item{{#1}}%
\expandafter\expandafter\expandafter
\inlist@\expandafter\tmp@item\expandafter{\kenc@list}%
diff --git a/Master/texmf-dist/tex/luatex/luatexja/patches/lltjp-listings-jpt.tex b/Master/texmf-dist/tex/luatex/luatexja/patches/lltjp-listings-jpt.tex
deleted file mode 100644
index 505ea3882aa..00000000000
--- a/Master/texmf-dist/tex/luatex/luatexja/patches/lltjp-listings-jpt.tex
+++ /dev/null
@@ -1,1041 +0,0 @@
-% This file is automatically generated by ltjlist.lua.
-\message{BMP}
-\ltj@@listing@jpset{8192}{8319}
-\ltj@@listing@jpset{8320}{8447}
-\ltj@@listing@jpset{8448}{8575}
-\ltj@@listing@jpset{8576}{8703}
-\ltj@@listing@jpset{8704}{8831}
-\ltj@@listing@jpset{8832}{8959}
-\ltj@@listing@jpset{8960}{9087}
-\ltj@@listing@jpset{9088}{9215}
-\ltj@@listing@jpset{9216}{9343}
-\ltj@@listing@jpset{9344}{9471}
-\ltj@@listing@jpset{9472}{9599}
-\ltj@@listing@jpset{9600}{9727}
-\ltj@@listing@jpset{9728}{9855}
-\ltj@@listing@jpset{9856}{9983}
-\ltj@@listing@jpset{9984}{10111}
-\ltj@@listing@jpset{10112}{10239}
-\ltj@@listing@jpset{10240}{10367}
-\ltj@@listing@jpset{10368}{10495}
-\ltj@@listing@jpset{10496}{10623}
-\ltj@@listing@jpset{10624}{10751}
-\ltj@@listing@jpset{10752}{10879}
-\ltj@@listing@jpset{10880}{11007}
-\ltj@@listing@jpset{11008}{11135}
-\ltj@@listing@jpset{11136}{11263}
-\ltj@@listing@jpset{11264}{11391}
-\ltj@@listing@jpset{11392}{11519}
-\ltj@@listing@jpset{11520}{11647}
-\ltj@@listing@jpset{11648}{11775}
-\ltj@@listing@jpset{11776}{11903}
-\ltj@@listing@jpset{11904}{12031}
-\ltj@@listing@jpset{12032}{12159}
-\ltj@@listing@jpset{12160}{12287}
-\ltj@@listing@jpset{12288}{12415}
-\ltj@@listing@jpset{12416}{12543}
-\ltj@@listing@jpset{12544}{12671}
-\ltj@@listing@jpset{12672}{12799}
-\ltj@@listing@jpset{12800}{12927}
-\ltj@@listing@jpset{12928}{13055}
-\ltj@@listing@jpset{13056}{13183}
-\ltj@@listing@jpset{13184}{13311}
-\ltj@@listing@jpset{13312}{13439}
-\ltj@@listing@jpset{13440}{13567}
-\ltj@@listing@jpset{13568}{13695}
-\ltj@@listing@jpset{13696}{13823}
-\ltj@@listing@jpset{13824}{13951}
-\ltj@@listing@jpset{13952}{14079}
-\ltj@@listing@jpset{14080}{14207}
-\ltj@@listing@jpset{14208}{14335}
-\ltj@@listing@jpset{14336}{14463}
-\ltj@@listing@jpset{14464}{14591}
-\ltj@@listing@jpset{14592}{14719}
-\ltj@@listing@jpset{14720}{14847}
-\ltj@@listing@jpset{14848}{14975}
-\ltj@@listing@jpset{14976}{15103}
-\ltj@@listing@jpset{15104}{15231}
-\ltj@@listing@jpset{15232}{15359}
-\ltj@@listing@jpset{15360}{15487}
-\ltj@@listing@jpset{15488}{15615}
-\ltj@@listing@jpset{15616}{15743}
-\ltj@@listing@jpset{15744}{15871}
-\ltj@@listing@jpset{15872}{15999}
-\ltj@@listing@jpset{16000}{16127}
-\ltj@@listing@jpset{16128}{16255}
-\ltj@@listing@jpset{16256}{16383}
-\ltj@@listing@jpset{16384}{16511}
-\ltj@@listing@jpset{16512}{16639}
-\ltj@@listing@jpset{16640}{16767}
-\ltj@@listing@jpset{16768}{16895}
-\ltj@@listing@jpset{16896}{17023}
-\ltj@@listing@jpset{17024}{17151}
-\ltj@@listing@jpset{17152}{17279}
-\ltj@@listing@jpset{17280}{17407}
-\ltj@@listing@jpset{17408}{17535}
-\ltj@@listing@jpset{17536}{17663}
-\ltj@@listing@jpset{17664}{17791}
-\ltj@@listing@jpset{17792}{17919}
-\ltj@@listing@jpset{17920}{18047}
-\ltj@@listing@jpset{18048}{18175}
-\ltj@@listing@jpset{18176}{18303}
-\ltj@@listing@jpset{18304}{18431}
-\ltj@@listing@jpset{18432}{18559}
-\ltj@@listing@jpset{18560}{18687}
-\ltj@@listing@jpset{18688}{18815}
-\ltj@@listing@jpset{18816}{18943}
-\ltj@@listing@jpset{18944}{19071}
-\ltj@@listing@jpset{19072}{19199}
-\ltj@@listing@jpset{19200}{19327}
-\ltj@@listing@jpset{19328}{19455}
-\ltj@@listing@jpset{19456}{19583}
-\ltj@@listing@jpset{19584}{19711}
-\ltj@@listing@jpset{19712}{19839}
-\ltj@@listing@jpset{19840}{19967}
-\ltj@@listing@jpset{19968}{20095}
-\ltj@@listing@jpset{20096}{20223}
-\ltj@@listing@jpset{20224}{20351}
-\ltj@@listing@jpset{20352}{20479}
-\ltj@@listing@jpset{20480}{20607}
-\ltj@@listing@jpset{20608}{20735}
-\ltj@@listing@jpset{20736}{20863}
-\ltj@@listing@jpset{20864}{20991}
-\ltj@@listing@jpset{20992}{21119}
-\ltj@@listing@jpset{21120}{21247}
-\ltj@@listing@jpset{21248}{21375}
-\ltj@@listing@jpset{21376}{21503}
-\ltj@@listing@jpset{21504}{21631}
-\ltj@@listing@jpset{21632}{21759}
-\ltj@@listing@jpset{21760}{21887}
-\ltj@@listing@jpset{21888}{22015}
-\ltj@@listing@jpset{22016}{22143}
-\ltj@@listing@jpset{22144}{22271}
-\ltj@@listing@jpset{22272}{22399}
-\ltj@@listing@jpset{22400}{22527}
-\ltj@@listing@jpset{22528}{22655}
-\ltj@@listing@jpset{22656}{22783}
-\ltj@@listing@jpset{22784}{22911}
-\ltj@@listing@jpset{22912}{23039}
-\ltj@@listing@jpset{23040}{23167}
-\ltj@@listing@jpset{23168}{23295}
-\ltj@@listing@jpset{23296}{23423}
-\ltj@@listing@jpset{23424}{23551}
-\ltj@@listing@jpset{23552}{23679}
-\ltj@@listing@jpset{23680}{23807}
-\ltj@@listing@jpset{23808}{23935}
-\ltj@@listing@jpset{23936}{24063}
-\ltj@@listing@jpset{24064}{24191}
-\ltj@@listing@jpset{24192}{24319}
-\ltj@@listing@jpset{24320}{24447}
-\ltj@@listing@jpset{24448}{24575}
-\ltj@@listing@jpset{24576}{24703}
-\ltj@@listing@jpset{24704}{24831}
-\ltj@@listing@jpset{24832}{24959}
-\ltj@@listing@jpset{24960}{25087}
-\ltj@@listing@jpset{25088}{25215}
-\ltj@@listing@jpset{25216}{25343}
-\ltj@@listing@jpset{25344}{25471}
-\ltj@@listing@jpset{25472}{25599}
-\ltj@@listing@jpset{25600}{25727}
-\ltj@@listing@jpset{25728}{25855}
-\ltj@@listing@jpset{25856}{25983}
-\ltj@@listing@jpset{25984}{26111}
-\ltj@@listing@jpset{26112}{26239}
-\ltj@@listing@jpset{26240}{26367}
-\ltj@@listing@jpset{26368}{26495}
-\ltj@@listing@jpset{26496}{26623}
-\ltj@@listing@jpset{26624}{26751}
-\ltj@@listing@jpset{26752}{26879}
-\ltj@@listing@jpset{26880}{27007}
-\ltj@@listing@jpset{27008}{27135}
-\ltj@@listing@jpset{27136}{27263}
-\ltj@@listing@jpset{27264}{27391}
-\ltj@@listing@jpset{27392}{27519}
-\ltj@@listing@jpset{27520}{27647}
-\ltj@@listing@jpset{27648}{27775}
-\ltj@@listing@jpset{27776}{27903}
-\ltj@@listing@jpset{27904}{28031}
-\ltj@@listing@jpset{28032}{28159}
-\ltj@@listing@jpset{28160}{28287}
-\ltj@@listing@jpset{28288}{28415}
-\ltj@@listing@jpset{28416}{28543}
-\ltj@@listing@jpset{28544}{28671}
-\ltj@@listing@jpset{28672}{28799}
-\ltj@@listing@jpset{28800}{28927}
-\ltj@@listing@jpset{28928}{29055}
-\ltj@@listing@jpset{29056}{29183}
-\ltj@@listing@jpset{29184}{29311}
-\ltj@@listing@jpset{29312}{29439}
-\ltj@@listing@jpset{29440}{29567}
-\ltj@@listing@jpset{29568}{29695}
-\ltj@@listing@jpset{29696}{29823}
-\ltj@@listing@jpset{29824}{29951}
-\ltj@@listing@jpset{29952}{30079}
-\ltj@@listing@jpset{30080}{30207}
-\ltj@@listing@jpset{30208}{30335}
-\ltj@@listing@jpset{30336}{30463}
-\ltj@@listing@jpset{30464}{30591}
-\ltj@@listing@jpset{30592}{30719}
-\ltj@@listing@jpset{30720}{30847}
-\ltj@@listing@jpset{30848}{30975}
-\ltj@@listing@jpset{30976}{31103}
-\ltj@@listing@jpset{31104}{31231}
-\ltj@@listing@jpset{31232}{31359}
-\ltj@@listing@jpset{31360}{31487}
-\ltj@@listing@jpset{31488}{31615}
-\ltj@@listing@jpset{31616}{31743}
-\ltj@@listing@jpset{31744}{31871}
-\ltj@@listing@jpset{31872}{31999}
-\ltj@@listing@jpset{32000}{32127}
-\ltj@@listing@jpset{32128}{32255}
-\ltj@@listing@jpset{32256}{32383}
-\ltj@@listing@jpset{32384}{32511}
-\ltj@@listing@jpset{32512}{32639}
-\ltj@@listing@jpset{32640}{32767}
-\ltj@@listing@jpset{32768}{32895}
-\ltj@@listing@jpset{32896}{33023}
-\ltj@@listing@jpset{33024}{33151}
-\ltj@@listing@jpset{33152}{33279}
-\ltj@@listing@jpset{33280}{33407}
-\ltj@@listing@jpset{33408}{33535}
-\ltj@@listing@jpset{33536}{33663}
-\ltj@@listing@jpset{33664}{33791}
-\ltj@@listing@jpset{33792}{33919}
-\ltj@@listing@jpset{33920}{34047}
-\ltj@@listing@jpset{34048}{34175}
-\ltj@@listing@jpset{34176}{34303}
-\ltj@@listing@jpset{34304}{34431}
-\ltj@@listing@jpset{34432}{34559}
-\ltj@@listing@jpset{34560}{34687}
-\ltj@@listing@jpset{34688}{34815}
-\ltj@@listing@jpset{34816}{34943}
-\ltj@@listing@jpset{34944}{35071}
-\ltj@@listing@jpset{35072}{35199}
-\ltj@@listing@jpset{35200}{35327}
-\ltj@@listing@jpset{35328}{35455}
-\ltj@@listing@jpset{35456}{35583}
-\ltj@@listing@jpset{35584}{35711}
-\ltj@@listing@jpset{35712}{35839}
-\ltj@@listing@jpset{35840}{35967}
-\ltj@@listing@jpset{35968}{36095}
-\ltj@@listing@jpset{36096}{36223}
-\ltj@@listing@jpset{36224}{36351}
-\ltj@@listing@jpset{36352}{36479}
-\ltj@@listing@jpset{36480}{36607}
-\ltj@@listing@jpset{36608}{36735}
-\ltj@@listing@jpset{36736}{36863}
-\ltj@@listing@jpset{36864}{36991}
-\ltj@@listing@jpset{36992}{37119}
-\ltj@@listing@jpset{37120}{37247}
-\ltj@@listing@jpset{37248}{37375}
-\ltj@@listing@jpset{37376}{37503}
-\ltj@@listing@jpset{37504}{37631}
-\ltj@@listing@jpset{37632}{37759}
-\ltj@@listing@jpset{37760}{37887}
-\ltj@@listing@jpset{37888}{38015}
-\ltj@@listing@jpset{38016}{38143}
-\ltj@@listing@jpset{38144}{38271}
-\ltj@@listing@jpset{38272}{38399}
-\ltj@@listing@jpset{38400}{38527}
-\ltj@@listing@jpset{38528}{38655}
-\ltj@@listing@jpset{38656}{38783}
-\ltj@@listing@jpset{38784}{38911}
-\ltj@@listing@jpset{38912}{39039}
-\ltj@@listing@jpset{39040}{39167}
-\ltj@@listing@jpset{39168}{39295}
-\ltj@@listing@jpset{39296}{39423}
-\ltj@@listing@jpset{39424}{39551}
-\ltj@@listing@jpset{39552}{39679}
-\ltj@@listing@jpset{39680}{39807}
-\ltj@@listing@jpset{39808}{39935}
-\ltj@@listing@jpset{39936}{40063}
-\ltj@@listing@jpset{40064}{40191}
-\ltj@@listing@jpset{40192}{40319}
-\ltj@@listing@jpset{40320}{40447}
-\ltj@@listing@jpset{40448}{40575}
-\ltj@@listing@jpset{40576}{40703}
-\ltj@@listing@jpset{40704}{40831}
-\ltj@@listing@jpset{40832}{40959}
-\ltj@@listing@jpset{40960}{41087}
-\ltj@@listing@jpset{41088}{41215}
-\ltj@@listing@jpset{41216}{41343}
-\ltj@@listing@jpset{41344}{41471}
-\ltj@@listing@jpset{41472}{41599}
-\ltj@@listing@jpset{41600}{41727}
-\ltj@@listing@jpset{41728}{41855}
-\ltj@@listing@jpset{41856}{41983}
-\ltj@@listing@jpset{41984}{42111}
-\ltj@@listing@jpset{42112}{42239}
-\ltj@@listing@jpset{42240}{42367}
-\ltj@@listing@jpset{42368}{42495}
-\ltj@@listing@jpset{42496}{42623}
-\ltj@@listing@jpset{42624}{42751}
-\ltj@@listing@jpset{42752}{42879}
-\ltj@@listing@jpset{42880}{43007}
-\ltj@@listing@jpset{43008}{43135}
-\ltj@@listing@jpset{43136}{43263}
-\ltj@@listing@jpset{43264}{43391}
-\ltj@@listing@jpset{43392}{43519}
-\ltj@@listing@jpset{43520}{43647}
-\ltj@@listing@jpset{43648}{43775}
-\ltj@@listing@jpset{43776}{43903}
-\ltj@@listing@jpset{43904}{44031}
-\ltj@@listing@jpset{44032}{44159}
-\ltj@@listing@jpset{44160}{44287}
-\ltj@@listing@jpset{44288}{44415}
-\ltj@@listing@jpset{44416}{44543}
-\ltj@@listing@jpset{44544}{44671}
-\ltj@@listing@jpset{44672}{44799}
-\ltj@@listing@jpset{44800}{44927}
-\ltj@@listing@jpset{44928}{45055}
-\ltj@@listing@jpset{45056}{45183}
-\ltj@@listing@jpset{45184}{45311}
-\ltj@@listing@jpset{45312}{45439}
-\ltj@@listing@jpset{45440}{45567}
-\ltj@@listing@jpset{45568}{45695}
-\ltj@@listing@jpset{45696}{45823}
-\ltj@@listing@jpset{45824}{45951}
-\ltj@@listing@jpset{45952}{46079}
-\ltj@@listing@jpset{46080}{46207}
-\ltj@@listing@jpset{46208}{46335}
-\ltj@@listing@jpset{46336}{46463}
-\ltj@@listing@jpset{46464}{46591}
-\ltj@@listing@jpset{46592}{46719}
-\ltj@@listing@jpset{46720}{46847}
-\ltj@@listing@jpset{46848}{46975}
-\ltj@@listing@jpset{46976}{47103}
-\ltj@@listing@jpset{47104}{47231}
-\ltj@@listing@jpset{47232}{47359}
-\ltj@@listing@jpset{47360}{47487}
-\ltj@@listing@jpset{47488}{47615}
-\ltj@@listing@jpset{47616}{47743}
-\ltj@@listing@jpset{47744}{47871}
-\ltj@@listing@jpset{47872}{47999}
-\ltj@@listing@jpset{48000}{48127}
-\ltj@@listing@jpset{48128}{48255}
-\ltj@@listing@jpset{48256}{48383}
-\ltj@@listing@jpset{48384}{48511}
-\ltj@@listing@jpset{48512}{48639}
-\ltj@@listing@jpset{48640}{48767}
-\ltj@@listing@jpset{48768}{48895}
-\ltj@@listing@jpset{48896}{49023}
-\ltj@@listing@jpset{49024}{49151}
-\ltj@@listing@jpset{49152}{49279}
-\ltj@@listing@jpset{49280}{49407}
-\ltj@@listing@jpset{49408}{49535}
-\ltj@@listing@jpset{49536}{49663}
-\ltj@@listing@jpset{49664}{49791}
-\ltj@@listing@jpset{49792}{49919}
-\ltj@@listing@jpset{49920}{50047}
-\ltj@@listing@jpset{50048}{50175}
-\ltj@@listing@jpset{50176}{50303}
-\ltj@@listing@jpset{50304}{50431}
-\ltj@@listing@jpset{50432}{50559}
-\ltj@@listing@jpset{50560}{50687}
-\ltj@@listing@jpset{50688}{50815}
-\ltj@@listing@jpset{50816}{50943}
-\ltj@@listing@jpset{50944}{51071}
-\ltj@@listing@jpset{51072}{51199}
-\ltj@@listing@jpset{51200}{51327}
-\ltj@@listing@jpset{51328}{51455}
-\ltj@@listing@jpset{51456}{51583}
-\ltj@@listing@jpset{51584}{51711}
-\ltj@@listing@jpset{51712}{51839}
-\ltj@@listing@jpset{51840}{51967}
-\ltj@@listing@jpset{51968}{52095}
-\ltj@@listing@jpset{52096}{52223}
-\ltj@@listing@jpset{52224}{52351}
-\ltj@@listing@jpset{52352}{52479}
-\ltj@@listing@jpset{52480}{52607}
-\ltj@@listing@jpset{52608}{52735}
-\ltj@@listing@jpset{52736}{52863}
-\ltj@@listing@jpset{52864}{52991}
-\ltj@@listing@jpset{52992}{53119}
-\ltj@@listing@jpset{53120}{53247}
-\ltj@@listing@jpset{53248}{53375}
-\ltj@@listing@jpset{53376}{53503}
-\ltj@@listing@jpset{53504}{53631}
-\ltj@@listing@jpset{53632}{53759}
-\ltj@@listing@jpset{53760}{53887}
-\ltj@@listing@jpset{53888}{54015}
-\ltj@@listing@jpset{54016}{54143}
-\ltj@@listing@jpset{54144}{54271}
-\ltj@@listing@jpset{54272}{54399}
-\ltj@@listing@jpset{54400}{54527}
-\ltj@@listing@jpset{54528}{54655}
-\ltj@@listing@jpset{54656}{54783}
-\ltj@@listing@jpset{54784}{54911}
-\ltj@@listing@jpset{54912}{55039}
-\ltj@@listing@jpset{55040}{55167}
-\ltj@@listing@jpset{55168}{55295}
-\ltj@@listing@jpset{55296}{55423}
-\ltj@@listing@jpset{55424}{55551}
-\ltj@@listing@jpset{55552}{55679}
-\ltj@@listing@jpset{55680}{55807}
-\ltj@@listing@jpset{55808}{55935}
-\ltj@@listing@jpset{55936}{56063}
-\ltj@@listing@jpset{56064}{56191}
-\ltj@@listing@jpset{56192}{56319}
-\ltj@@listing@jpset{56320}{56447}
-\ltj@@listing@jpset{56448}{56575}
-\ltj@@listing@jpset{56576}{56703}
-\ltj@@listing@jpset{56704}{56831}
-\ltj@@listing@jpset{56832}{56959}
-\ltj@@listing@jpset{56960}{57087}
-\ltj@@listing@jpset{57088}{57215}
-\ltj@@listing@jpset{57216}{57343}
-\ltj@@listing@jpset{57344}{57471}
-\ltj@@listing@jpset{57472}{57599}
-\ltj@@listing@jpset{57600}{57727}
-\ltj@@listing@jpset{57728}{57855}
-\ltj@@listing@jpset{57856}{57983}
-\ltj@@listing@jpset{57984}{58111}
-\ltj@@listing@jpset{58112}{58239}
-\ltj@@listing@jpset{58240}{58367}
-\ltj@@listing@jpset{58368}{58495}
-\ltj@@listing@jpset{58496}{58623}
-\ltj@@listing@jpset{58624}{58751}
-\ltj@@listing@jpset{58752}{58879}
-\ltj@@listing@jpset{58880}{59007}
-\ltj@@listing@jpset{59008}{59135}
-\ltj@@listing@jpset{59136}{59263}
-\ltj@@listing@jpset{59264}{59391}
-\ltj@@listing@jpset{59392}{59519}
-\ltj@@listing@jpset{59520}{59647}
-\ltj@@listing@jpset{59648}{59775}
-\ltj@@listing@jpset{59776}{59903}
-\ltj@@listing@jpset{59904}{60031}
-\ltj@@listing@jpset{60032}{60159}
-\ltj@@listing@jpset{60160}{60287}
-\ltj@@listing@jpset{60288}{60415}
-\ltj@@listing@jpset{60416}{60543}
-\ltj@@listing@jpset{60544}{60671}
-\ltj@@listing@jpset{60672}{60799}
-\ltj@@listing@jpset{60800}{60927}
-\ltj@@listing@jpset{60928}{61055}
-\ltj@@listing@jpset{61056}{61183}
-\ltj@@listing@jpset{61184}{61311}
-\ltj@@listing@jpset{61312}{61439}
-\ltj@@listing@jpset{61440}{61567}
-\ltj@@listing@jpset{61568}{61695}
-\ltj@@listing@jpset{61696}{61823}
-\ltj@@listing@jpset{61824}{61951}
-\ltj@@listing@jpset{61952}{62079}
-\ltj@@listing@jpset{62080}{62207}
-\ltj@@listing@jpset{62208}{62335}
-\ltj@@listing@jpset{62336}{62463}
-\ltj@@listing@jpset{62464}{62591}
-\ltj@@listing@jpset{62592}{62719}
-\ltj@@listing@jpset{62720}{62847}
-\ltj@@listing@jpset{62848}{62975}
-\ltj@@listing@jpset{62976}{63103}
-\ltj@@listing@jpset{63104}{63231}
-\ltj@@listing@jpset{63232}{63359}
-\ltj@@listing@jpset{63360}{63487}
-\ltj@@listing@jpset{63488}{63615}
-\ltj@@listing@jpset{63616}{63743}
-\ltj@@listing@jpset{63744}{63871}
-\ltj@@listing@jpset{63872}{63999}
-\ltj@@listing@jpset{64000}{64127}
-\ltj@@listing@jpset{64128}{64255}
-\ltj@@listing@jpset{64256}{64383}
-\ltj@@listing@jpset{64384}{64511}
-\ltj@@listing@jpset{64512}{64639}
-\ltj@@listing@jpset{64640}{64767}
-\ltj@@listing@jpset{64768}{64895}
-\ltj@@listing@jpset{64896}{65023}
-\ltj@@listing@jpset{65024}{65151}
-\ltj@@listing@jpset{65152}{65279}
-\message{SIP}
-\ltj@@listing@jpset{131072}{131199}
-\ltj@@listing@jpset{131200}{131327}
-\ltj@@listing@jpset{131328}{131455}
-\ltj@@listing@jpset{131456}{131583}
-\ltj@@listing@jpset{131584}{131711}
-\ltj@@listing@jpset{131712}{131839}
-\ltj@@listing@jpset{131840}{131967}
-\ltj@@listing@jpset{131968}{132095}
-\ltj@@listing@jpset{132096}{132223}
-\ltj@@listing@jpset{132224}{132351}
-\ltj@@listing@jpset{132352}{132479}
-\ltj@@listing@jpset{132480}{132607}
-\ltj@@listing@jpset{132608}{132735}
-\ltj@@listing@jpset{132736}{132863}
-\ltj@@listing@jpset{132864}{132991}
-\ltj@@listing@jpset{132992}{133119}
-\ltj@@listing@jpset{133120}{133247}
-\ltj@@listing@jpset{133248}{133375}
-\ltj@@listing@jpset{133376}{133503}
-\ltj@@listing@jpset{133504}{133631}
-\ltj@@listing@jpset{133632}{133759}
-\ltj@@listing@jpset{133760}{133887}
-\ltj@@listing@jpset{133888}{134015}
-\ltj@@listing@jpset{134016}{134143}
-\ltj@@listing@jpset{134144}{134271}
-\ltj@@listing@jpset{134272}{134399}
-\ltj@@listing@jpset{134400}{134527}
-\ltj@@listing@jpset{134528}{134655}
-\ltj@@listing@jpset{134656}{134783}
-\ltj@@listing@jpset{134784}{134911}
-\ltj@@listing@jpset{134912}{135039}
-\ltj@@listing@jpset{135040}{135167}
-\ltj@@listing@jpset{135168}{135295}
-\ltj@@listing@jpset{135296}{135423}
-\ltj@@listing@jpset{135424}{135551}
-\ltj@@listing@jpset{135552}{135679}
-\ltj@@listing@jpset{135680}{135807}
-\ltj@@listing@jpset{135808}{135935}
-\ltj@@listing@jpset{135936}{136063}
-\ltj@@listing@jpset{136064}{136191}
-\ltj@@listing@jpset{136192}{136319}
-\ltj@@listing@jpset{136320}{136447}
-\ltj@@listing@jpset{136448}{136575}
-\ltj@@listing@jpset{136576}{136703}
-\ltj@@listing@jpset{136704}{136831}
-\ltj@@listing@jpset{136832}{136959}
-\ltj@@listing@jpset{136960}{137087}
-\ltj@@listing@jpset{137088}{137215}
-\ltj@@listing@jpset{137216}{137343}
-\ltj@@listing@jpset{137344}{137471}
-\ltj@@listing@jpset{137472}{137599}
-\ltj@@listing@jpset{137600}{137727}
-\ltj@@listing@jpset{137728}{137855}
-\ltj@@listing@jpset{137856}{137983}
-\ltj@@listing@jpset{137984}{138111}
-\ltj@@listing@jpset{138112}{138239}
-\ltj@@listing@jpset{138240}{138367}
-\ltj@@listing@jpset{138368}{138495}
-\ltj@@listing@jpset{138496}{138623}
-\ltj@@listing@jpset{138624}{138751}
-\ltj@@listing@jpset{138752}{138879}
-\ltj@@listing@jpset{138880}{139007}
-\ltj@@listing@jpset{139008}{139135}
-\ltj@@listing@jpset{139136}{139263}
-\ltj@@listing@jpset{139264}{139391}
-\ltj@@listing@jpset{139392}{139519}
-\ltj@@listing@jpset{139520}{139647}
-\ltj@@listing@jpset{139648}{139775}
-\ltj@@listing@jpset{139776}{139903}
-\ltj@@listing@jpset{139904}{140031}
-\ltj@@listing@jpset{140032}{140159}
-\ltj@@listing@jpset{140160}{140287}
-\ltj@@listing@jpset{140288}{140415}
-\ltj@@listing@jpset{140416}{140543}
-\ltj@@listing@jpset{140544}{140671}
-\ltj@@listing@jpset{140672}{140799}
-\ltj@@listing@jpset{140800}{140927}
-\ltj@@listing@jpset{140928}{141055}
-\ltj@@listing@jpset{141056}{141183}
-\ltj@@listing@jpset{141184}{141311}
-\ltj@@listing@jpset{141312}{141439}
-\ltj@@listing@jpset{141440}{141567}
-\ltj@@listing@jpset{141568}{141695}
-\ltj@@listing@jpset{141696}{141823}
-\ltj@@listing@jpset{141824}{141951}
-\ltj@@listing@jpset{141952}{142079}
-\ltj@@listing@jpset{142080}{142207}
-\ltj@@listing@jpset{142208}{142335}
-\ltj@@listing@jpset{142336}{142463}
-\ltj@@listing@jpset{142464}{142591}
-\ltj@@listing@jpset{142592}{142719}
-\ltj@@listing@jpset{142720}{142847}
-\ltj@@listing@jpset{142848}{142975}
-\ltj@@listing@jpset{142976}{143103}
-\ltj@@listing@jpset{143104}{143231}
-\ltj@@listing@jpset{143232}{143359}
-\ltj@@listing@jpset{143360}{143487}
-\ltj@@listing@jpset{143488}{143615}
-\ltj@@listing@jpset{143616}{143743}
-\ltj@@listing@jpset{143744}{143871}
-\ltj@@listing@jpset{143872}{143999}
-\ltj@@listing@jpset{144000}{144127}
-\ltj@@listing@jpset{144128}{144255}
-\ltj@@listing@jpset{144256}{144383}
-\ltj@@listing@jpset{144384}{144511}
-\ltj@@listing@jpset{144512}{144639}
-\ltj@@listing@jpset{144640}{144767}
-\ltj@@listing@jpset{144768}{144895}
-\ltj@@listing@jpset{144896}{145023}
-\ltj@@listing@jpset{145024}{145151}
-\ltj@@listing@jpset{145152}{145279}
-\ltj@@listing@jpset{145280}{145407}
-\ltj@@listing@jpset{145408}{145535}
-\ltj@@listing@jpset{145536}{145663}
-\ltj@@listing@jpset{145664}{145791}
-\ltj@@listing@jpset{145792}{145919}
-\ltj@@listing@jpset{145920}{146047}
-\ltj@@listing@jpset{146048}{146175}
-\ltj@@listing@jpset{146176}{146303}
-\ltj@@listing@jpset{146304}{146431}
-\ltj@@listing@jpset{146432}{146559}
-\ltj@@listing@jpset{146560}{146687}
-\ltj@@listing@jpset{146688}{146815}
-\ltj@@listing@jpset{146816}{146943}
-\ltj@@listing@jpset{146944}{147071}
-\ltj@@listing@jpset{147072}{147199}
-\ltj@@listing@jpset{147200}{147327}
-\ltj@@listing@jpset{147328}{147455}
-\ltj@@listing@jpset{147456}{147583}
-\ltj@@listing@jpset{147584}{147711}
-\ltj@@listing@jpset{147712}{147839}
-\ltj@@listing@jpset{147840}{147967}
-\ltj@@listing@jpset{147968}{148095}
-\ltj@@listing@jpset{148096}{148223}
-\ltj@@listing@jpset{148224}{148351}
-\ltj@@listing@jpset{148352}{148479}
-\ltj@@listing@jpset{148480}{148607}
-\ltj@@listing@jpset{148608}{148735}
-\ltj@@listing@jpset{148736}{148863}
-\ltj@@listing@jpset{148864}{148991}
-\ltj@@listing@jpset{148992}{149119}
-\ltj@@listing@jpset{149120}{149247}
-\ltj@@listing@jpset{149248}{149375}
-\ltj@@listing@jpset{149376}{149503}
-\ltj@@listing@jpset{149504}{149631}
-\ltj@@listing@jpset{149632}{149759}
-\ltj@@listing@jpset{149760}{149887}
-\ltj@@listing@jpset{149888}{150015}
-\ltj@@listing@jpset{150016}{150143}
-\ltj@@listing@jpset{150144}{150271}
-\ltj@@listing@jpset{150272}{150399}
-\ltj@@listing@jpset{150400}{150527}
-\ltj@@listing@jpset{150528}{150655}
-\ltj@@listing@jpset{150656}{150783}
-\ltj@@listing@jpset{150784}{150911}
-\ltj@@listing@jpset{150912}{151039}
-\ltj@@listing@jpset{151040}{151167}
-\ltj@@listing@jpset{151168}{151295}
-\ltj@@listing@jpset{151296}{151423}
-\ltj@@listing@jpset{151424}{151551}
-\ltj@@listing@jpset{151552}{151679}
-\ltj@@listing@jpset{151680}{151807}
-\ltj@@listing@jpset{151808}{151935}
-\ltj@@listing@jpset{151936}{152063}
-\ltj@@listing@jpset{152064}{152191}
-\ltj@@listing@jpset{152192}{152319}
-\ltj@@listing@jpset{152320}{152447}
-\ltj@@listing@jpset{152448}{152575}
-\ltj@@listing@jpset{152576}{152703}
-\ltj@@listing@jpset{152704}{152831}
-\ltj@@listing@jpset{152832}{152959}
-\ltj@@listing@jpset{152960}{153087}
-\ltj@@listing@jpset{153088}{153215}
-\ltj@@listing@jpset{153216}{153343}
-\ltj@@listing@jpset{153344}{153471}
-\ltj@@listing@jpset{153472}{153599}
-\ltj@@listing@jpset{153600}{153727}
-\ltj@@listing@jpset{153728}{153855}
-\ltj@@listing@jpset{153856}{153983}
-\ltj@@listing@jpset{153984}{154111}
-\ltj@@listing@jpset{154112}{154239}
-\ltj@@listing@jpset{154240}{154367}
-\ltj@@listing@jpset{154368}{154495}
-\ltj@@listing@jpset{154496}{154623}
-\ltj@@listing@jpset{154624}{154751}
-\ltj@@listing@jpset{154752}{154879}
-\ltj@@listing@jpset{154880}{155007}
-\ltj@@listing@jpset{155008}{155135}
-\ltj@@listing@jpset{155136}{155263}
-\ltj@@listing@jpset{155264}{155391}
-\ltj@@listing@jpset{155392}{155519}
-\ltj@@listing@jpset{155520}{155647}
-\ltj@@listing@jpset{155648}{155775}
-\ltj@@listing@jpset{155776}{155903}
-\ltj@@listing@jpset{155904}{156031}
-\ltj@@listing@jpset{156032}{156159}
-\ltj@@listing@jpset{156160}{156287}
-\ltj@@listing@jpset{156288}{156415}
-\ltj@@listing@jpset{156416}{156543}
-\ltj@@listing@jpset{156544}{156671}
-\ltj@@listing@jpset{156672}{156799}
-\ltj@@listing@jpset{156800}{156927}
-\ltj@@listing@jpset{156928}{157055}
-\ltj@@listing@jpset{157056}{157183}
-\ltj@@listing@jpset{157184}{157311}
-\ltj@@listing@jpset{157312}{157439}
-\ltj@@listing@jpset{157440}{157567}
-\ltj@@listing@jpset{157568}{157695}
-\ltj@@listing@jpset{157696}{157823}
-\ltj@@listing@jpset{157824}{157951}
-\ltj@@listing@jpset{157952}{158079}
-\ltj@@listing@jpset{158080}{158207}
-\ltj@@listing@jpset{158208}{158335}
-\ltj@@listing@jpset{158336}{158463}
-\ltj@@listing@jpset{158464}{158591}
-\ltj@@listing@jpset{158592}{158719}
-\ltj@@listing@jpset{158720}{158847}
-\ltj@@listing@jpset{158848}{158975}
-\ltj@@listing@jpset{158976}{159103}
-\ltj@@listing@jpset{159104}{159231}
-\ltj@@listing@jpset{159232}{159359}
-\ltj@@listing@jpset{159360}{159487}
-\ltj@@listing@jpset{159488}{159615}
-\ltj@@listing@jpset{159616}{159743}
-\ltj@@listing@jpset{159744}{159871}
-\ltj@@listing@jpset{159872}{159999}
-\ltj@@listing@jpset{160000}{160127}
-\ltj@@listing@jpset{160128}{160255}
-\ltj@@listing@jpset{160256}{160383}
-\ltj@@listing@jpset{160384}{160511}
-\ltj@@listing@jpset{160512}{160639}
-\ltj@@listing@jpset{160640}{160767}
-\ltj@@listing@jpset{160768}{160895}
-\ltj@@listing@jpset{160896}{161023}
-\ltj@@listing@jpset{161024}{161151}
-\ltj@@listing@jpset{161152}{161279}
-\ltj@@listing@jpset{161280}{161407}
-\ltj@@listing@jpset{161408}{161535}
-\ltj@@listing@jpset{161536}{161663}
-\ltj@@listing@jpset{161664}{161791}
-\ltj@@listing@jpset{161792}{161919}
-\ltj@@listing@jpset{161920}{162047}
-\ltj@@listing@jpset{162048}{162175}
-\ltj@@listing@jpset{162176}{162303}
-\ltj@@listing@jpset{162304}{162431}
-\ltj@@listing@jpset{162432}{162559}
-\ltj@@listing@jpset{162560}{162687}
-\ltj@@listing@jpset{162688}{162815}
-\ltj@@listing@jpset{162816}{162943}
-\ltj@@listing@jpset{162944}{163071}
-\ltj@@listing@jpset{163072}{163199}
-\ltj@@listing@jpset{163200}{163327}
-\ltj@@listing@jpset{163328}{163455}
-\ltj@@listing@jpset{163456}{163583}
-\ltj@@listing@jpset{163584}{163711}
-\ltj@@listing@jpset{163712}{163839}
-\ltj@@listing@jpset{163840}{163967}
-\ltj@@listing@jpset{163968}{164095}
-\ltj@@listing@jpset{164096}{164223}
-\ltj@@listing@jpset{164224}{164351}
-\ltj@@listing@jpset{164352}{164479}
-\ltj@@listing@jpset{164480}{164607}
-\ltj@@listing@jpset{164608}{164735}
-\ltj@@listing@jpset{164736}{164863}
-\ltj@@listing@jpset{164864}{164991}
-\ltj@@listing@jpset{164992}{165119}
-\ltj@@listing@jpset{165120}{165247}
-\ltj@@listing@jpset{165248}{165375}
-\ltj@@listing@jpset{165376}{165503}
-\ltj@@listing@jpset{165504}{165631}
-\ltj@@listing@jpset{165632}{165759}
-\ltj@@listing@jpset{165760}{165887}
-\ltj@@listing@jpset{165888}{166015}
-\ltj@@listing@jpset{166016}{166143}
-\ltj@@listing@jpset{166144}{166271}
-\ltj@@listing@jpset{166272}{166399}
-\ltj@@listing@jpset{166400}{166527}
-\ltj@@listing@jpset{166528}{166655}
-\ltj@@listing@jpset{166656}{166783}
-\ltj@@listing@jpset{166784}{166911}
-\ltj@@listing@jpset{166912}{167039}
-\ltj@@listing@jpset{167040}{167167}
-\ltj@@listing@jpset{167168}{167295}
-\ltj@@listing@jpset{167296}{167423}
-\ltj@@listing@jpset{167424}{167551}
-\ltj@@listing@jpset{167552}{167679}
-\ltj@@listing@jpset{167680}{167807}
-\ltj@@listing@jpset{167808}{167935}
-\ltj@@listing@jpset{167936}{168063}
-\ltj@@listing@jpset{168064}{168191}
-\ltj@@listing@jpset{168192}{168319}
-\ltj@@listing@jpset{168320}{168447}
-\ltj@@listing@jpset{168448}{168575}
-\ltj@@listing@jpset{168576}{168703}
-\ltj@@listing@jpset{168704}{168831}
-\ltj@@listing@jpset{168832}{168959}
-\ltj@@listing@jpset{168960}{169087}
-\ltj@@listing@jpset{169088}{169215}
-\ltj@@listing@jpset{169216}{169343}
-\ltj@@listing@jpset{169344}{169471}
-\ltj@@listing@jpset{169472}{169599}
-\ltj@@listing@jpset{169600}{169727}
-\ltj@@listing@jpset{169728}{169855}
-\ltj@@listing@jpset{169856}{169983}
-\ltj@@listing@jpset{169984}{170111}
-\ltj@@listing@jpset{170112}{170239}
-\ltj@@listing@jpset{170240}{170367}
-\ltj@@listing@jpset{170368}{170495}
-\ltj@@listing@jpset{170496}{170623}
-\ltj@@listing@jpset{170624}{170751}
-\ltj@@listing@jpset{170752}{170879}
-\ltj@@listing@jpset{170880}{171007}
-\ltj@@listing@jpset{171008}{171135}
-\ltj@@listing@jpset{171136}{171263}
-\ltj@@listing@jpset{171264}{171391}
-\ltj@@listing@jpset{171392}{171519}
-\ltj@@listing@jpset{171520}{171647}
-\ltj@@listing@jpset{171648}{171775}
-\ltj@@listing@jpset{171776}{171903}
-\ltj@@listing@jpset{171904}{172031}
-\ltj@@listing@jpset{172032}{172159}
-\ltj@@listing@jpset{172160}{172287}
-\ltj@@listing@jpset{172288}{172415}
-\ltj@@listing@jpset{172416}{172543}
-\ltj@@listing@jpset{172544}{172671}
-\ltj@@listing@jpset{172672}{172799}
-\ltj@@listing@jpset{172800}{172927}
-\ltj@@listing@jpset{172928}{173055}
-\ltj@@listing@jpset{173056}{173183}
-\ltj@@listing@jpset{173184}{173311}
-\ltj@@listing@jpset{173312}{173439}
-\ltj@@listing@jpset{173440}{173567}
-\ltj@@listing@jpset{173568}{173695}
-\ltj@@listing@jpset{173696}{173823}
-\ltj@@listing@jpset{173824}{173951}
-\ltj@@listing@jpset{173952}{174079}
-\ltj@@listing@jpset{174080}{174207}
-\ltj@@listing@jpset{174208}{174335}
-\ltj@@listing@jpset{174336}{174463}
-\ltj@@listing@jpset{174464}{174591}
-\ltj@@listing@jpset{174592}{174719}
-\ltj@@listing@jpset{174720}{174847}
-\ltj@@listing@jpset{174848}{174975}
-\ltj@@listing@jpset{174976}{175103}
-\ltj@@listing@jpset{175104}{175231}
-\ltj@@listing@jpset{175232}{175359}
-\ltj@@listing@jpset{175360}{175487}
-\ltj@@listing@jpset{175488}{175615}
-\ltj@@listing@jpset{175616}{175743}
-\ltj@@listing@jpset{175744}{175871}
-\ltj@@listing@jpset{175872}{175999}
-\ltj@@listing@jpset{176000}{176127}
-\ltj@@listing@jpset{176128}{176255}
-\ltj@@listing@jpset{176256}{176383}
-\ltj@@listing@jpset{176384}{176511}
-\ltj@@listing@jpset{176512}{176639}
-\ltj@@listing@jpset{176640}{176767}
-\ltj@@listing@jpset{176768}{176895}
-\ltj@@listing@jpset{176896}{177023}
-\ltj@@listing@jpset{177024}{177151}
-\ltj@@listing@jpset{177152}{177279}
-\ltj@@listing@jpset{177280}{177407}
-\ltj@@listing@jpset{177408}{177535}
-\ltj@@listing@jpset{177536}{177663}
-\ltj@@listing@jpset{177664}{177791}
-\ltj@@listing@jpset{177792}{177919}
-\ltj@@listing@jpset{177920}{178047}
-\ltj@@listing@jpset{178048}{178175}
-\ltj@@listing@jpset{178176}{178303}
-\ltj@@listing@jpset{178304}{178431}
-\ltj@@listing@jpset{178432}{178559}
-\ltj@@listing@jpset{178560}{178687}
-\ltj@@listing@jpset{178688}{178815}
-\ltj@@listing@jpset{178816}{178943}
-\ltj@@listing@jpset{178944}{179071}
-\ltj@@listing@jpset{179072}{179199}
-\ltj@@listing@jpset{179200}{179327}
-\ltj@@listing@jpset{179328}{179455}
-\ltj@@listing@jpset{179456}{179583}
-\ltj@@listing@jpset{179584}{179711}
-\ltj@@listing@jpset{179712}{179839}
-\ltj@@listing@jpset{179840}{179967}
-\ltj@@listing@jpset{179968}{180095}
-\ltj@@listing@jpset{180096}{180223}
-\ltj@@listing@jpset{180224}{180351}
-\ltj@@listing@jpset{180352}{180479}
-\ltj@@listing@jpset{180480}{180607}
-\ltj@@listing@jpset{180608}{180735}
-\ltj@@listing@jpset{180736}{180863}
-\ltj@@listing@jpset{180864}{180991}
-\ltj@@listing@jpset{180992}{181119}
-\ltj@@listing@jpset{181120}{181247}
-\ltj@@listing@jpset{181248}{181375}
-\ltj@@listing@jpset{181376}{181503}
-\ltj@@listing@jpset{181504}{181631}
-\ltj@@listing@jpset{181632}{181759}
-\ltj@@listing@jpset{181760}{181887}
-\ltj@@listing@jpset{181888}{182015}
-\ltj@@listing@jpset{182016}{182143}
-\ltj@@listing@jpset{182144}{182271}
-\ltj@@listing@jpset{182272}{182399}
-\ltj@@listing@jpset{182400}{182527}
-\ltj@@listing@jpset{182528}{182655}
-\ltj@@listing@jpset{182656}{182783}
-\ltj@@listing@jpset{182784}{182911}
-\ltj@@listing@jpset{182912}{183039}
-\ltj@@listing@jpset{183040}{183167}
-\ltj@@listing@jpset{183168}{183295}
-\ltj@@listing@jpset{183296}{183423}
-\ltj@@listing@jpset{183424}{183551}
-\ltj@@listing@jpset{183552}{183679}
-\ltj@@listing@jpset{183680}{183807}
-\ltj@@listing@jpset{183808}{183935}
-\ltj@@listing@jpset{183936}{184063}
-\ltj@@listing@jpset{184064}{184191}
-\ltj@@listing@jpset{184192}{184319}
-\ltj@@listing@jpset{184320}{184447}
-\ltj@@listing@jpset{184448}{184575}
-\ltj@@listing@jpset{184576}{184703}
-\ltj@@listing@jpset{184704}{184831}
-\ltj@@listing@jpset{184832}{184959}
-\ltj@@listing@jpset{184960}{185087}
-\ltj@@listing@jpset{185088}{185215}
-\ltj@@listing@jpset{185216}{185343}
-\ltj@@listing@jpset{185344}{185471}
-\ltj@@listing@jpset{185472}{185599}
-\ltj@@listing@jpset{185600}{185727}
-\ltj@@listing@jpset{185728}{185855}
-\ltj@@listing@jpset{185856}{185983}
-\ltj@@listing@jpset{185984}{186111}
-\ltj@@listing@jpset{186112}{186239}
-\ltj@@listing@jpset{186240}{186367}
-\ltj@@listing@jpset{186368}{186495}
-\ltj@@listing@jpset{186496}{186623}
-\ltj@@listing@jpset{186624}{186751}
-\ltj@@listing@jpset{186752}{186879}
-\ltj@@listing@jpset{186880}{187007}
-\ltj@@listing@jpset{187008}{187135}
-\ltj@@listing@jpset{187136}{187263}
-\ltj@@listing@jpset{187264}{187391}
-\ltj@@listing@jpset{187392}{187519}
-\ltj@@listing@jpset{187520}{187647}
-\ltj@@listing@jpset{187648}{187775}
-\ltj@@listing@jpset{187776}{187903}
-\ltj@@listing@jpset{187904}{188031}
-\ltj@@listing@jpset{188032}{188159}
-\ltj@@listing@jpset{188160}{188287}
-\ltj@@listing@jpset{188288}{188415}
-\ltj@@listing@jpset{188416}{188543}
-\ltj@@listing@jpset{188544}{188671}
-\ltj@@listing@jpset{188672}{188799}
-\ltj@@listing@jpset{188800}{188927}
-\ltj@@listing@jpset{188928}{189055}
-\ltj@@listing@jpset{189056}{189183}
-\ltj@@listing@jpset{189184}{189311}
-\ltj@@listing@jpset{189312}{189439}
-\ltj@@listing@jpset{189440}{189567}
-\ltj@@listing@jpset{189568}{189695}
-\ltj@@listing@jpset{189696}{189823}
-\ltj@@listing@jpset{189824}{189951}
-\ltj@@listing@jpset{189952}{190079}
-\ltj@@listing@jpset{190080}{190207}
-\ltj@@listing@jpset{190208}{190335}
-\ltj@@listing@jpset{190336}{190463}
-\ltj@@listing@jpset{190464}{190591}
-\ltj@@listing@jpset{190592}{190719}
-\ltj@@listing@jpset{190720}{190847}
-\ltj@@listing@jpset{190848}{190975}
-\ltj@@listing@jpset{190976}{191103}
-\ltj@@listing@jpset{191104}{191231}
-\ltj@@listing@jpset{191232}{191359}
-\ltj@@listing@jpset{191360}{191487}
-\ltj@@listing@jpset{191488}{191615}
-\ltj@@listing@jpset{191616}{191743}
-\ltj@@listing@jpset{191744}{191871}
-\ltj@@listing@jpset{191872}{191999}
-\ltj@@listing@jpset{192000}{192127}
-\ltj@@listing@jpset{192128}{192255}
-\ltj@@listing@jpset{192256}{192383}
-\ltj@@listing@jpset{192384}{192511}
-\ltj@@listing@jpset{192512}{192639}
-\ltj@@listing@jpset{192640}{192767}
-\ltj@@listing@jpset{192768}{192895}
-\ltj@@listing@jpset{192896}{193023}
-\ltj@@listing@jpset{193024}{193151}
-\ltj@@listing@jpset{193152}{193279}
-\ltj@@listing@jpset{193280}{193407}
-\ltj@@listing@jpset{193408}{193535}
-\ltj@@listing@jpset{193536}{193663}
-\ltj@@listing@jpset{193664}{193791}
-\ltj@@listing@jpset{193792}{193919}
-\ltj@@listing@jpset{193920}{194047}
-\ltj@@listing@jpset{194048}{194175}
-\ltj@@listing@jpset{194176}{194303}
-\ltj@@listing@jpset{194304}{194431}
-\ltj@@listing@jpset{194432}{194559}
-\ltj@@listing@jpset{194560}{194687}
-\ltj@@listing@jpset{194688}{194815}
-\ltj@@listing@jpset{194816}{194943}
-\ltj@@listing@jpset{194944}{195071}
-\ltj@@listing@jpset{195072}{195199}
-\ltj@@listing@jpset{195200}{195327}
-\ltj@@listing@jpset{195328}{195455}
-\ltj@@listing@jpset{195456}{195583}
-\ltj@@listing@jpset{195584}{195711}
-\ltj@@listing@jpset{195712}{195839}
-\ltj@@listing@jpset{195840}{195967}
-\ltj@@listing@jpset{195968}{196095}
-\ltj@@listing@jpset{196096}{196223}
-\ltj@@listing@jpset{196224}{196351}
-\ltj@@listing@jpset{196352}{196479}
-\ltj@@listing@jpset{196480}{196607}
-\message{Hankaku}
-\ltj@@listing@jpsetN{65280}{65376}{\lst@ProcessJALetter}
-\ltj@@listing@jpsetN{65377}{65439}{\lst@ProcessJALetterHalf}
-\ltj@@listing@jpsetN{65504}{65509}{\lst@ProcessJALetter}
-
-\message{Opening and Closing brackets}
-\@temptokena{}% DO NOT REMOVE THIS LINE
-
-\ltj@@listing@jpsetN@{`,}{\lst@ProcessJALetter@inhibit@prebreak}
-\ltj@@listing@jpsetN@{`。}{\lst@ProcessJALetter@inhibit@prebreak}
-\ltj@@listing@jpsetN@{`,}{\lst@ProcessJALetter@inhibit@prebreak}
-\ltj@@listing@jpsetN@{`.}{\lst@ProcessJALetter@inhibit@prebreak}
-\ltj@@listing@jpsetN@{`・}{\lst@ProcessJALetter@inhibit@prebreak}
-\ltj@@listing@jpsetN@{`:}{\lst@ProcessJALetter@inhibit@prebreak}
-\ltj@@listing@jpsetN@{`;}{\lst@ProcessJALetter@inhibit@prebreak}
-\ltj@@listing@jpsetN@{`?}{\lst@ProcessJALetter@inhibit@prebreak}
-\ltj@@listing@jpsetN@{`!}{\lst@ProcessJALetter@inhibit@prebreak}
-\ltj@@listing@jpsetN@{`゛}{\lst@ProcessJALetter@inhibit@prebreak}%\jis"212B
-\ltj@@listing@jpsetN@{`゜}{\lst@ProcessJALetter@inhibit@prebreak}%\jis"212C
-\ltj@@listing@jpsetN@{`´}{\lst@ProcessJALetter@inhibit@prebreak}%\jis"212D
-\ltj@@listing@jpsetN@{``}{\lst@ProcessJALetter@inhibit@postbreak}%\jis"212E
-\ltj@@listing@jpsetN@{`々}{\lst@ProcessJALetter@inhibit@prebreak}%\jis"2139
-\ltj@@listing@jpsetN@{`…}{\lst@ProcessJALetter@inhibit@prebreak}%\jis"2144
-\ltj@@listing@jpsetN@{`‥}{\lst@ProcessJALetter@inhibit@prebreak}%\jis"2145
-\ltj@@listing@jpsetN@{`‘}{\lst@ProcessJALetter@inhibit@postbreak}%\jis"2146
-\ltj@@listing@jpsetN@{`’}{\lst@ProcessJALetter@inhibit@prebreak}%\jis"2147
-\ltj@@listing@jpsetN@{`“}{\lst@ProcessJALetter@inhibit@postbreak}%\jis"2148
-\ltj@@listing@jpsetN@{`”}{\lst@ProcessJALetter@inhibit@prebreak}%\jis"2149
-\ltj@@listing@jpsetN@{`)}{\lst@ProcessJALetter@inhibit@prebreak}
-\ltj@@listing@jpsetN@{`(}{\lst@ProcessJALetter@inhibit@postbreak}
-\ltj@@listing@jpsetN@{`}}{\lst@ProcessJALetter@inhibit@prebreak}
-\ltj@@listing@jpsetN@{`{}{\lst@ProcessJALetter@inhibit@postbreak}
-\ltj@@listing@jpsetN@{`]}{\lst@ProcessJALetter@inhibit@prebreak}
-\ltj@@listing@jpsetN@{`[}{\lst@ProcessJALetter@inhibit@postbreak}
-\ltj@@listing@jpsetN@{`〔}{\lst@ProcessJALetter@inhibit@postbreak}%\jis"214C
-\ltj@@listing@jpsetN@{`〕}{\lst@ProcessJALetter@inhibit@prebreak}%\jis"214D
-\ltj@@listing@jpsetN@{`〈}{\lst@ProcessJALetter@inhibit@postbreak}%\jis"2152
-\ltj@@listing@jpsetN@{`〉}{\lst@ProcessJALetter@inhibit@prebreak}%\jis"2153
-\ltj@@listing@jpsetN@{`《}{\lst@ProcessJALetter@inhibit@postbreak}%\jis"2154
-\ltj@@listing@jpsetN@{`》}{\lst@ProcessJALetter@inhibit@prebreak}%\jis"2155
-\ltj@@listing@jpsetN@{`「}{\lst@ProcessJALetter@inhibit@postbreak}%\jis"2156
-\ltj@@listing@jpsetN@{`」}{\lst@ProcessJALetter@inhibit@prebreak}%\jis"2157
-\ltj@@listing@jpsetN@{`『}{\lst@ProcessJALetter@inhibit@postbreak}%\jis"2158
-\ltj@@listing@jpsetN@{`』}{\lst@ProcessJALetter@inhibit@prebreak}%\jis"2159
-\ltj@@listing@jpsetN@{`【}{\lst@ProcessJALetter@inhibit@postbreak}%\jis"215A
-\ltj@@listing@jpsetN@{`】}{\lst@ProcessJALetter@inhibit@prebreak}%\jis"215B
-\ltj@@listing@jpsetN@{`ー}{\lst@ProcessJALetter@inhibit@prebreak}
-\ltj@@listing@jpsetN@{`〳}{\lst@ProcessJALetter@inhibit@prebreak}
-\ltj@@listing@jpsetN@{`〴}{\lst@ProcessJALetter@inhibit@prebreak}
-\ltj@@listing@jpsetN@{`〵}{\lst@ProcessJALetter@inhibit@prebreak}
-\ltj@@listing@jpsetN@{`〻}{\lst@ProcessJALetter@inhibit@prebreak}
-\ltj@@listing@jpsetN@{`⦅}{\lst@ProcessJALetter@inhibit@postbreak}
-\ltj@@listing@jpsetN@{`⦆}{\lst@ProcessJALetter@inhibit@prebreak}
-\ltj@@listing@jpsetN@{`⦅}{\lst@ProcessJALetter@inhibit@postbreak}
-\ltj@@listing@jpsetN@{`⦆}{\lst@ProcessJALetter@inhibit@prebreak}
-\ltj@@listing@jpsetN@{`〘}{\lst@ProcessJALetter@inhibit@postbreak}
-\ltj@@listing@jpsetN@{`〙}{\lst@ProcessJALetter@inhibit@prebreak}
-\ltj@@listing@jpsetN@{`〖}{\lst@ProcessJALetter@inhibit@postbreak}
-\ltj@@listing@jpsetN@{`〗}{\lst@ProcessJALetter@inhibit@prebreak}
-\ltj@@listing@jpsetN@{`«}{\lst@ProcessJALetter@inhibit@postbreak}
-\ltj@@listing@jpsetN@{`»}{\lst@ProcessJALetter@inhibit@prebreak}
-\ltj@@listing@jpsetN@{`〝}{\lst@ProcessJALetter@inhibit@postbreak}
-\ltj@@listing@jpsetN@{`〟}{\lst@ProcessJALetter@inhibit@prebreak}
-\ltj@@listing@jpsetN@{`‼}{\lst@ProcessJALetter@inhibit@prebreak}
-\ltj@@listing@jpsetN@{`⁇}{\lst@ProcessJALetter@inhibit@prebreak}
-\ltj@@listing@jpsetN@{`⁈}{\lst@ProcessJALetter@inhibit@prebreak}
-\ltj@@listing@jpsetN@{`⁉}{\lst@ProcessJALetter@inhibit@prebreak}
-\ltj@@listing@jpsetN@{`¡}{\lst@ProcessJALetter@inhibit@postbreak}
-\ltj@@listing@jpsetN@{`¿}{\lst@ProcessJALetter@inhibit@postbreak}
-\ltj@@listing@jpsetN@{`ː}{\lst@ProcessJALetter@inhibit@prebreak}
-\ltj@@listing@jpsetN@{`ª}{\lst@ProcessJALetter@inhibit@prebreak}
-\ltj@@listing@jpsetN@{`º}{\lst@ProcessJALetter@inhibit@prebreak}
-\ltj@@listing@jpsetN@{`¹}{\lst@ProcessJALetter@inhibit@prebreak}
-\ltj@@listing@jpsetN@{`²}{\lst@ProcessJALetter@inhibit@prebreak}
-\ltj@@listing@jpsetN@{`³}{\lst@ProcessJALetter@inhibit@prebreak}
-\ltj@@listing@jpsetN@{`€}{\lst@ProcessJALetter@inhibit@postbreak}
-\ltj@@listing@jpsetN@{`™}{\lst@ProcessJALetter@inhibit@prebreak}
-
-\ltj@@listing@jpset@after{other}% DO NOT REMOVE THIS LINE
-\message{done.}
diff --git a/Master/texmf-dist/tex/luatex/luatexja/patches/lltjp-listings.sty b/Master/texmf-dist/tex/luatex/luatexja/patches/lltjp-listings.sty
index aa8c2bd3fda..f175f88f76b 100644
--- a/Master/texmf-dist/tex/luatex/luatexja/patches/lltjp-listings.sty
+++ b/Master/texmf-dist/tex/luatex/luatexja/patches/lltjp-listings.sty
@@ -3,76 +3,83 @@
%
\NeedsTeXFormat{LaTeX2e}
-\def\filedate{2012/02/02}
-\def\fileversion{0.51}
+\def\filedate{2012/09/22}
+\def\fileversion{0.6}
\ProvidesPackage{lltjp-listings}[\filedate\space\fileversion]
\RequirePackage{listings,luatexbase-cctb}
-% catcode 対策
-\newluatexcatcodetable\CatcodeTableLTJlistings
-\setluatexcatcodetable\CatcodeTableLTJlistings{
- \luatexcatcodetable\CatcodeTableLaTeXAtLetter
- \catcode"FFFFF=9%"
- \setcatcoderange{"2000}{"FFFF}{13}%
- \setcatcoderange{"20000}{"2FFFF}{13}}
-
% lowest level
\def\lst@kanjitrue{\let\lst@ifkanji\iftrue}
\def\lst@kanjifalse{\let\lst@ifkanji\iffalse}
\lst@AddToHook{InitVars}{\lst@kanjifalse}
+\def\lst@AppendLetter{%
+ \ltj@lst@setletterflag\lst@Append}
\def\lst@AppendOther{%
\lst@ifletter\lst@Output\lst@letterfalse\fi\lst@kanjifalse
\futurelet\lst@lastother\lst@Append}
-\def\lst@AppendLetter{%
- \lst@ifletter
- \lst@ifkanji\lst@Output\lst@kanjifalse
- \fi
- \else
- \lst@lettertrue\lst@ifkanji\lst@kanjifalse\else\lst@OutputOther\fi
- \fi
- \lst@Append}
-
-\def\lst@ProcessJALetter{\lst@whitespacefalse \lst@AppendJALetter}
-\def\lst@ProcessJALetterHalf{\lst@whitespacefalse \lst@AppendJALetterHalf}
-\def\lst@ProcessJALetter@inhibit@prebreak{%
- \lst@whitespacefalse \lst@AppendJALetter@inhibit@prebreak}
-\def\lst@ProcessJALetter@inhibit@postbreak{%
- \lst@whitespacefalse \lst@AppendJALetter@inhibit@postbreak}
-
-\def\lst@AppendJALetter{%
- \lst@ifletter
- \lst@Output
- \else
- \lst@ifkanji\else\lst@OutputOther\fi\lst@lettertrue
- \fi\lst@kanjitrue
- \advance\lst@length\@ne\lst@Append}
-\def\lst@AppendJALetterHalf{%
- \lst@ifletter
- \lst@Output
+
+\def\ltj@lst@setletterflag{%
+ \lst@ifletter
+ \lst@ifkanji\lst@Output\lst@kanjifalse\fi
+ \else
+ \lst@lettertrue\lst@ifkanji\lst@kanjifalse\else\lst@OutputOther\fi
+ \fi}
+
+\def\ltj@lst@setkanjiflag{%
+ \lst@ifletter
+ \lst@Output
+ \else
+ \lst@ifkanji\else\lst@OutputOther\fi\lst@lettertrue
+ \fi}
+
+\def\ltj@lst@setopenflag{%
+ \lst@ifletter
+ \lst@letterfalse\lst@Output
+ \else
+ \lst@ifkanji\else\lst@OutputOther\fi
+ \fi\lst@kanjitrue}
+
+\def\ltj@lst@setcloseflag{%
+ \lst@ifletter\else\lst@lettertrue\fi\lst@kanjitrue}
+
+\def\lst@ProcessJALetter#1{%
+ \lst@whitespacefalse
+ \ifnum\ltjgetparameter{jacharrange}{\ltjgetparameter{chartorange}{`#1}}=0
+ \ifnum\ltjgetparameter{postbreakpenalty}{`#1}>0
+ \ltj@lst@setopenflag % 開き括弧類
\else
- \lst@ifkanji\else\lst@OutputOther\fi\lst@lettertrue
- \fi\lst@kanjitrue
- \lst@Append}
-\def\lst@AppendJALetter@inhibit@prebreak{%
- \lst@ifletter\else\lst@lettertrue\fi\lst@kanjitrue
- \advance\lst@length\@ne\lst@Append}
-\def\lst@AppendJALetter@inhibit@postbreak{%
- \lst@ifletter
- \lst@Output
+ \ifnum\ltjgetparameter{prebreakpenalty}{`#1}>0
+ \ltj@lst@setcloseflag % 閉じ括弧類,句読点
+ \else
+ \ltj@lst@setkanjiflag % 通常の和文文字
+ \fi\fi
+ \advance\lst@length\@ne % 和文文字は通常の2倍の幅
+ \else
+ \ltj@lst@setletterflag
+ \fi
+ \lst@Append#1}
+
+\def\lst@ProcessJALetterHalf#1{%
+ \lst@whitespacefalse
+ \ifnum\ltjgetparameter{jacharrange}{\ltjgetparameter{chartorange}{`#1}}=0
+ \ifnum\ltjgetparameter{postbreakpenalty}{`#1}>0
+ \ltj@lst@setopenflag % 開き括弧類
\else
- \lst@ifkanji\else\lst@OutputOther\fi
- \fi\lst@letterfalse\lst@kanjitrue
- \advance\lst@length\@ne\lst@Append}
+ \ifnum\ltjgetparameter{prebreakpenalty}{`#1}>0
+ \ltj@lst@setcloseflag % 閉じ括弧類
+ \else
+ \ltj@lst@setkanjiflag % 通常の和文文字
+ \fi\fi
+ % 半角カナは欧文文字と同じ幅
+ \else
+ \ltj@lst@setletterflag
+ \fi
+ \lst@Append#1}
-% loading lltjp-listing-jpt.tex
-\def\ltj@@listing@jpset#1#2{% fast: #2-#1+1 must be a multiple of 16
- \@tempcnta=#1 \@tempcntb=#2 \@temptokena{}%
- \loop\relax\ifnum\@tempcnta<\@tempcntb\relax
- \ltj@@listing@jpset@\global\advance\@tempcnta\sixt@@n\repeat
- \ltj@@listing@jpset@after{#1}
-}
+% 半角カナの扱い
+
\def\ltj@@listing@jpsetN#1#2#3{% for (not large) range
\@tempcnta=#1 \@tempcntb=\numexpr 1+#2\relax \@temptokena{}%
\loop \global\advance\@tempcnta\@ne\ifnum\@tempcnta<\@tempcntb\relax
@@ -88,64 +95,44 @@
\@temptokena{}%
}
-\begingroup
-\catcode`\^^a0=13\catcode`\^^a1=13\catcode`\^^a2=13\catcode`\^^a3=13
-\catcode`\^^a4=13\catcode`\^^a5=13\catcode`\^^a6=13\catcode`\^^a7=13
-\catcode`\^^a8=13\catcode`\^^a9=13\catcode`\^^aa=13\catcode`\^^ab=13
-\catcode`\^^ac=13\catcode`\^^ad=13\catcode`\^^ae=13\catcode`\^^af=13
-\catcode`\^^b0=12\catcode`\^^b1=12\catcode`\^^b2=12\catcode`\^^b3=12
-\catcode`\^^b4=12\catcode`\^^b5=12\catcode`\^^b6=12\catcode`\^^b7=12
-\catcode`\^^b8=12\catcode`\^^b9=12\catcode`\^^ba=12\catcode`\^^bb=12
-\catcode`\^^bc=12\catcode`\^^bd=12\catcode`\^^be=12\catcode`\^^bf=12
-\gdef\ltj@@listing@jpset@{%
- {\lccode`\^^a0=\@tempcnta \lccode`\^^b0=\@tempcnta
- \advance\@tempcnta\@ne\lccode`\^^a1=\@tempcnta \lccode`\^^b1=\@tempcnta
- \advance\@tempcnta\@ne\lccode`\^^a2=\@tempcnta \lccode`\^^b2=\@tempcnta
- \advance\@tempcnta\@ne\lccode`\^^a3=\@tempcnta \lccode`\^^b3=\@tempcnta
- \advance\@tempcnta\@ne\lccode`\^^a4=\@tempcnta \lccode`\^^b4=\@tempcnta
- \advance\@tempcnta\@ne\lccode`\^^a5=\@tempcnta \lccode`\^^b5=\@tempcnta
- \advance\@tempcnta\@ne\lccode`\^^a6=\@tempcnta \lccode`\^^b6=\@tempcnta
- \advance\@tempcnta\@ne\lccode`\^^a7=\@tempcnta \lccode`\^^b7=\@tempcnta
- \advance\@tempcnta\@ne\lccode`\^^a8=\@tempcnta \lccode`\^^b8=\@tempcnta
- \advance\@tempcnta\@ne\lccode`\^^a9=\@tempcnta \lccode`\^^b9=\@tempcnta
- \advance\@tempcnta\@ne\lccode`\^^aa=\@tempcnta \lccode`\^^ba=\@tempcnta
- \advance\@tempcnta\@ne\lccode`\^^ab=\@tempcnta \lccode`\^^bb=\@tempcnta
- \advance\@tempcnta\@ne\lccode`\^^ac=\@tempcnta \lccode`\^^bc=\@tempcnta
- \advance\@tempcnta\@ne\lccode`\^^ad=\@tempcnta \lccode`\^^bd=\@tempcnta
- \advance\@tempcnta\@ne\lccode`\^^ae=\@tempcnta \lccode`\^^be=\@tempcnta
- \advance\@tempcnta\@ne\lccode`\^^af=\@tempcnta \lccode`\^^bf=\@tempcnta
- \lowercase{\gdef\@temp{%
- \gdef^^a0{\lst@ProcessJALetter^^b0}\gdef^^a1{\lst@ProcessJALetter^^b1}%
- \gdef^^a2{\lst@ProcessJALetter^^b2}\gdef^^a3{\lst@ProcessJALetter^^b3}%
- \gdef^^a4{\lst@ProcessJALetter^^b4}\gdef^^a5{\lst@ProcessJALetter^^b5}%
- \gdef^^a6{\lst@ProcessJALetter^^b6}\gdef^^a7{\lst@ProcessJALetter^^b7}%
- \gdef^^a8{\lst@ProcessJALetter^^b8}\gdef^^a9{\lst@ProcessJALetter^^b9}%
- \gdef^^aa{\lst@ProcessJALetter^^ba}\gdef^^ab{\lst@ProcessJALetter^^bb}%
- \gdef^^ac{\lst@ProcessJALetter^^bc}\gdef^^ad{\lst@ProcessJALetter^^bd}%
- \gdef^^ae{\lst@ProcessJALetter^^be}\gdef^^af{\lst@ProcessJALetter^^bf}%
- }}%\message{\meaning\@temp}%
- }%
- \@temptokena\expandafter\expandafter\expandafter\expandafter%
- \expandafter\expandafter\expandafter{\expandafter\expandafter%
- \expandafter\the\expandafter\@temptokena\@temp}%
-}
-\gdef\ltj@@listing@jpsetN@#1#2{{%
+\def\ltj@@listing@jpsetN@#1#2{{%
\@tempcnta=#1 \lccode`\~=\@tempcnta \lccode`\/=\@tempcnta
\lowercase{\gdef\@temp{\gdef~{#2/}}}}%
\@temptokena\expandafter\expandafter\expandafter\expandafter%
\expandafter\expandafter\expandafter{\expandafter\expandafter%
\expandafter\the\expandafter\@temptokena\@temp}%
}
-\endgroup
-
-\toks@{}
-\input lltjp-listings-jpt.tex
-\edef\ltj@@listing@jpcmd{\the\toks@}
\toks@{}
-\lst@AddToHook{Init}{%
- \luatexcatcodetable\CatcodeTableLTJlistings
- \ltj@@listing@jpcmd}
+\ltj@@listing@jpsetN{65377}{65439}{\lst@ProcessJALetterHalf}
+\edef\ltj@@listing@jpcmd{\the\toks@}\toks@{}
+
+% catcode 対策
+\newluatexcatcodetable\CatcodeTableLTJlistings
+\setluatexcatcodetable\CatcodeTableLTJlistings{
+ \luatexcatcodetable\CatcodeTableLaTeXAtLetter
+ \catcode"FFFFF=13%"
+ \setcatcoderange{"FF61}{"FF9F}{13}% 半角文字
+}
+
+% hook!
+\lst@AddToHook{Init}{
+ \luatexcatcodetable\CatcodeTableLTJlistings\ltj@@listing@jpcmd
+ \lccode`\~="FFFFF\lowercase{\let~\lst@ProcessJALetter}%"
+ \directlua{luatexbase.add_to_callback('process_input_buffer',
+ function(buf)
+ local ret = ''
+ for i = 1, utf.len(buf) do
+ local c = utf.sub(buf, i, i)
+ local cu = utf.byte(c)
+ if cu > 0x80 and tex.getcatcode(cu) \string~= 13 then
+ ret = ret .. utf.char(1048575) % U+FFFFF
+ end
+ ret = ret .. c
+ end
+ return ret
+ end, 'ltj.listings_unicode', 1)}}
+\lst@AddToHook{ExitVars}{\directlua{luatexbase.remove_from_callback('process_input_buffer', 'ltj.listings_unicode')}}
% 白線対策