X-Git-Url: http://git.osdn.jp/view?a=blobdiff_plain;f=doc%2Fluatexja.dtx;h=d9ecfda5eeffa93d91c70c98de3d2b01565872b2;hb=466aee095c5b7d4e8174295dc2cfd5697a87a884;hp=839e8c68e75e319bafd00ba200aebcd6de6ff656;hpb=f3e279292dece1dad0c0ab5e6a02eab168f15b52;p=luatex-ja%2Fluatexja.git diff --git a/doc/luatexja.dtx b/doc/luatexja.dtx index 839e8c6..d9ecfda 100644 --- a/doc/luatexja.dtx +++ b/doc/luatexja.dtx @@ -31,7 +31,7 @@ % %<*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 % %<*zh> @@ -6142,7 +6142,7 @@ Roughly speaking, the \Pkg{listings} package processes input as follows: % %<*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). % %<*ja> \item letterでもdigitでもない文字が現れた時に,収集した文字列を(必要なら修飾して)出力する. @@ -6156,7 +6156,7 @@ Roughly speaking, the \Pkg{listings} package processes input as follows: % %<*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. % %<*ja> \item letterが出現したら集めた文字列を出力する. @@ -6170,8 +6170,8 @@ Roughly speaking, the \Pkg{listings} package processes input as follows: % \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. % %<*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: % %<*ja> さて,日本語の処理である.殆どの和文文字の前後では行分割が可能であるが,その一方で 括弧類や音引きなどでは禁則処理が必要なことから,\Pkg{lltjp-listings.sty} では, -直前が和文文字であるかを示すフラグ \verb+\lst@kanji+ を新たに導入した. +直前が和文文字であるかを示すフラグ \verb+\lst@ifkanji+ を新たに導入した. 以降,説明のために以下のように文字を分類する: % \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. % %<*ja> 例えば,Letterの直後にOpenが来た場合を考える. 文字種Openは和文開き括弧類を想定しているので,Letterの直後では行分割が可能であることが望ましい. そのため,この場合では,すでに収集されている文字列を出力することで行分割を許容するようにした. +% + +%<*en> +The following table summarizes $5\times 5=25$ cases: +% +%<*ja> 同じように,$5\times 5=25$通り全てについて書くと,次のようになる: % \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\\ % @@ -6259,10 +6264,10 @@ Last&Kanji&\multicolumn{4}{c}{\hrulefill \ outputs\ \hrulefill}&collects\\ %In the above table, %上の表において, \begin{itemize} -%\item ``outputs'' means to output the collected string (i.e., line breaking is permitted there). +%\item ``outputs'' means to output the collected character string (i.e., line breaking is permitted there). %\item 「出力」は,それまでに集めた文字列を出力(≒ここで行分割可能)を意味する. -%\item ``collects'' means to append the next character to the collected string (i.e., line breaking is prohibited there). +%\item ``collects'' means to append the next character to the collected character string (i.e., line breaking is prohibited there). %\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}節を参照)に従って行われる: % \begin{itemize} %\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}. % %<*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}の分だけが,行中のグルーの伸縮度に応じて負担されることになる. +…… %