OSDN Git Service

Compiled default "kinsoku" parameters into ltj-kinsoku.lua.
[luatex-ja/luatexja.git] / doc / luatexja.dtx
index 839e8c6..d9ecfda 100644 (file)
@@ -31,7 +31,7 @@
 %</en>
 %<*ja>
 \usepackage[textwidth=45\zw, lines=45, footskip=6mm]{geometry}
-\usepackage{luatexja-adjust}
+\usepackage{luatexja-adjust}%\ltjdisableadjust
 \advance\leftmargini-1\zw\advance\leftmarginii-1\zw
 %</ja>
 %<*zh>
@@ -6142,7 +6142,7 @@ Roughly speaking, the \Pkg{listings} package processes input as follows:
 %</ja>
 
 %<*en>
-\item When reading an \textit{other}, outputs the collected string (with modification, if needed).
+\item When reading an \textit{other}, outputs the collected character string (with modification, if needed).
 %</en>
 %<*ja>
 \item letterでもdigitでもない文字が現れた時に,収集した文字列を(必要なら修飾して)出力する.
@@ -6156,7 +6156,7 @@ Roughly speaking, the \Pkg{listings} package processes input as follows:
 %</ja>
 
 %<*en>
-\item When reading a \textit{letter} or a \textit{digit}, outputs the collected string.
+\item When reading a \textit{letter} or a \textit{digit}, outputs the collected character string.
 %</en>
 %<*ja>
 \item letterが出現したら集めた文字列を出力する.
@@ -6170,8 +6170,8 @@ Roughly speaking, the \Pkg{listings} package processes input as follows:
 %</ja>
 \end{enumerate}
 %<*en>
-By the above process, line breaks inside of an identifier is blocked.
-A flag \verb+\lst@ifletter+ shows whether the last character can be used
+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>
@@ -6183,14 +6183,14 @@ for the name of identifiers or not.
 For Japanese characters, line breaks are permitted on both sides
 except for parentheses, dashes, etc.
 To process Japanese characters,
-\Pkg{lltjp-listings.sty} introduces a new flag \verb+\lst@kanji+, which indicates
-whether the last character is Japanese character or not.
+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}
@@ -6220,13 +6220,18 @@ Other according to circumstances.
 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 string is output in this case.
-The following table summarizes $5\times 5=25$ cases:
+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}
@@ -6239,7 +6244,7 @@ The following table summarizes $5\times 5=25$ cases:
 &\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\\
-Last&Kanji&\multicolumn{4}{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>
@@ -6259,10 +6264,10 @@ Last&Kanji&\multicolumn{4}{c}{\hrulefill \ outputs\ \hrulefill}&collects\\
 %<en>In the above table,
 %<ja>上の表において,
 \begin{itemize}
-%<en>\item ``outputs'' means to output the collected string (i.e., line breaking is permitted there).
+%<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 string (i.e., line breaking is prohibited there).
+%<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}
 
@@ -6275,7 +6280,7 @@ Characters are classified according to \Param{jacharrange} parameter (see Sectio
 %<*ja>
 \Pkg{listings} パッケージにおいて和文文字と扱われる
 (前に述べたKanji, Open,あるいは「閉じ括弧類」分類)か否かは,
-通常の\textbf{JAchar}/\textbf{Alchar}の範囲の設定(\ref{ssec-setrange}節)に従って行われる:
+通常の\textbf{JAchar}/\textbf{Alchar}の範囲の設定(\Param{jacharrange} パラメータ,\ref{ssec-setrange}節を参照)に従って行われる:
 %</ja>
 \begin{itemize}
 %<en>\item \textbf{ALchars} above U+0080 are Letter.
@@ -6296,7 +6301,8 @@ Characters are classified according to \Param{jacharrange} parameter (see Sectio
 \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}.
+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文字分の幅をとるものとみなされる.
@@ -6338,16 +6344,42 @@ listing environments.
 行われているとして良い.まず,段落中の行中のグルーを
 \begin{itemize}
 \item 下のどれにも該当しないグルー
-\item 和欧文間空白(\Param{xkanjiskip})
 \item JFMグルー(優先度別にまとめられる)
+\item 和欧文間空白(\Param{xkanjiskip})
 \item 和文間空白(\Param{kanjiskip})
 \end{itemize}
 の$1+1+5+1=8$つに類別し,それぞれの種別ごとに許容されている伸縮度の合計を計算する.
 また,行長と自然長との差の絶対値を計算し,それを\textit{total}とおく.
 
 \subsection{行末文字の位置調整}
-まず,行末が和文文字であった場合,それを動かすことによって,\textbf{JAglue} が負担する調整量を
-少なくしようとする.
+まず,行末が文字クラス$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>