OSDN Git Service

Fix ticket #27998.
[luatex-ja/luatexja.git] / doc / manual.dtx
index 8247a87..39ad3db 100644 (file)
@@ -14,7 +14,7 @@
 \usepackage{booktabs,listings,showexpl,multicol}
 \usepackage{luatexja-otf}
 \usepackage{luatexja-fontspec}
-\usepackage[unicode]{hyperref}
+\usepackage[unicode=true]{hyperref}
 \usepackage[all]{xy}
 \SelectTips{cm}{}
 \def\labelenumii{(\arabic{enumii})}
@@ -28,8 +28,6 @@
 \DeclareRobustCommand\pLaTeXe{p\kern-.05em\LaTeXe}
 \DeclareRobustCommand\epTeX{\ensuremath{\varepsilon}-\kern-.125em\pTeX}
 
-\ltjsetparameter{jacharrange={-3}}
-\ltjdefcharrange{6}{`■,`…,`→,`←,`↓,`↑}
 \theoremstyle{definition}
 %<en>\newtheorem{defn}{Definition}
 %<ja>\newtheorem{defn}{定義}
@@ -417,7 +415,7 @@ This project is hosted by SourceForge.JP.
 \def\labelenumi{$\bullet$}
 \mitemxxx{Hironori KITAGAWA}{Kazuki MAEDA}{Takayuki YATO}
 \mitemxxx{Yusuke KUROKI}{Noriyuki ABE}{Munehiro YAMAMOTO}
-\mitemxxo{Tomoaki HONDA}{Shuzaburo SAITO}
+\mitemxxx{Tomoaki HONDA}{Shuzaburo SAITO}{MA Qiyuan}
 \end{multienumerate}
 %</en>
 %<*ja>
@@ -425,7 +423,7 @@ This project is hosted by SourceForge.JP.
 \def\labelenumi{$\bullet$}
 \mitemxxx{北川 弘典}{前田 一貴}{八登 崇之}
 \mitemxxx{黒木 裕介}{阿部 紀行}{山本 宗宏}
-\mitemxxo{本田 知亮}{齋藤 修三郎}
+\mitemxxx{本田 知亮}{齋藤 修三郎}{馬 起園}
 \end{multienumerate}
 %</ja>
 
@@ -506,7 +504,7 @@ Note that the forefront of development may not be in \texttt{master} branch.
 \item Extract the archive. You will see \texttt{src/} and several other sub-directories.
 %</en>
 %<*ja>
-\item 後者の方法でアーカイブ取得したならば,それをを展開する.
+\item 後者の方法でアーカイブを取得したならば,それを展開する.
       \texttt{src/} をはじめとしたいくつかのディレクトリができるが,
       動作には \texttt{src/} 以下の内容だけで十分.
 %</ja>
@@ -538,31 +536,8 @@ Note that the forefront of development may not be in \texttt{master} branch.
 %</en>
 %<*ja>
 \item 原稿のソースファイルの文字コードは UTF-8 固定である.
-      å¾\93æ\9d¥æ\97¥æ\9c¬èª\9eã\81®æ\96\87å­\97ã\82³ã\83¼ã\83\89ã\81¨ã\81\97ã\81¦ç\94¨ã\81\84ã\82\89ã\82\8cã\81¦ã\81\8dã\81\9f EUC-JP ã\82\84 Shift-JIS ã\81¯ä½¿ç\94¨ã\81§ã\81\8dã\81¾ã\81\9bã\82\93
+      å¾\93æ\9d¥æ\97¥æ\9c¬èª\9eã\81®æ\96\87å­\97ã\82³ã\83¼ã\83\89ã\81¨ã\81\97ã\81¦ç\94¨ã\81\84ã\82\89ã\82\8cã\81¦ã\81\8dã\81\9f EUC-JP ã\82\84 Shift-JIS ã\81¯ä½¿ç\94¨ã\81§ã\81\8dã\81ªã\81\84
 %</ja>
-
-%<*en>
-\item May be conflict with other packages.
-
-      For example, the default setting of \textbf{JAchar} in the present
-      version does not coexist with the \Pkg{unicode-math}
-      package. Putting the following line in preamble makes that
-      mathematical symbols will be typeset correctly, but several
-      Japanese characters will be treated as an \textbf{ALchar} as
-      side-effect:
-%</en>
-%<*ja>
-\item いくつかのパッケージと衝突する.
-
-      例えば,\textbf{JAchar} の範囲の設定がデフォルトのままだと,現行の
-      バージョンでは \Pkg{unicode-math} パッケージと共存できない.
-      以下の行をプリアンブルに追加することで数学記号が正しく出るように
-      なるが,副作用としていくつかの和文文字が \textbf{ALchar} として
-      扱われるようになってしまう:
-%</ja>
-\begin{verbatim}
-\ltjsetparameter{jacharrange={-3, -8}}
-\end{verbatim}
 \end{itemize}
 
 %<en>\subsection{Using in plain \TeX}
@@ -1046,7 +1021,7 @@ feature が \textbf{JAglue} と衝突するためである(\ref{para-kern} 節
 %<*en>
 \paragraph{Caution}
 \Pkg{xunicode} package will be reloaded during the loading of \Pkg{luatexja-fontspec} package.
-However, this reloading won't work for the current version (2011/09/09,~v0.981) of 
+However, this reloading won't work for the current version (2011/09/09,~v0.981) of
 \Pkg{xunicode} package. Hence we have to patch it, using the following patch, for example:
 %</en>
 %<*ja>
@@ -1060,7 +1035,7 @@ However, this reloading won't work for the current version (2011/09/09,~v0.981)
 --- xunicode.sty.orig   2011-09-12 08:31:47.000000000 +0900
 +++ xunicode.sty        2011-11-16 22:06:17.061413113 +0900
 @@ -1475,7 +1475,11 @@
+
  \newtoks\tipasavetokens
  \newtoks\tipachecktokens
 +
@@ -1073,7 +1048,8 @@ However, this reloading won't work for the current version (2011/09/09,~v0.981)
   \def\textipa##1{##1}% prevent recursion
 \end{lstlisting}
 %<*ja>
-なお,上流で v0.984 (2011/10/14) でこの問題は修正されているそうです.
+なお,上流で v0.984 (2011/10/14) でこの問題は修正されているそうです(が,2012/03/20
+現在,まだ CTAN には上がっていない).
 %</ja>
 
 
@@ -1101,14 +1077,14 @@ parameters, you have to use commands \verb+\ltjsetparameter+ and
 To edit the range of \textbf{JAchar}s, you have to assign a non-zero
 natural number which is less than 217 to the character range first. This
 can be done by using \verb+\ltjdefcharrange+ primitive. For example, the
-next line assigns whole characters in Supplementary Multilingual Plane
+next line assigns whole characters in Supplementary Ideographic Plane
 and the character `漢' to the range number~100.
 %</en>
 %<*ja>
 \textbf{JAchar} の範囲を設定するためには,まず各文字に0より大きく217より小さい index を
 割り当てる必要がある.これには \verb+\ltjdefcharrange+ プリミティブを用いる.
-例えば,次のように書くことで追加多言語面 (SMP) にある全ての文字と `漢' が
-「100番の文字範囲」に属する設定される.
+例えば,次のように書くことで追加漢字面 (SIP) にある全ての文字と `漢' が
+「100番の文字範囲」に属するように設定される.
 %</ja>
 \begin{lstlisting}
 \ltjdefcharrange{100}{"10000-"1FFFF,`漢}
@@ -1124,15 +1100,15 @@ not do this in the middle of a document.
 
 %<*en>
 If some character has been belonged to some non-zero numbered range,
-this will be overwritten by the new setting. For example, whole SMP
+this will be overwritten by the new setting. For example, whole SIP
 belong to the range~4 in the default setting of \LuaTeX-ja, and if you
-specify the above line, then SMP will belong to the range~100 and be
+specify the above line, then SIP will belong to the range~100 and be
 removed from the range~4.
 %</en>
 %<*ja>
 もし指定されたある文字がある非零番号の範囲に属していたならば,これは新しい設定で
-上書きされる.例えば,SMP は全て \LuaTeX-ja のデフォルトでは4番の文字範囲に
-属しているが,上記の指定を行えば SMP は100番に属すようになり,4番からは除かれる.
+上書きされる.例えば,SIP は全て \LuaTeX-ja のデフォルトでは4番の文字範囲に
+属しているが,上記の指定を行えば SIP は100番に属すようになり,4番からは除かれる.
 %</ja>
 
 %<*en>
@@ -1436,7 +1412,7 @@ This range consist of the following Unicode ranges, \emph{except characters in t
 "FE10--"FE1F&縦書き形&
 "FE30--"FE4F&CJK互換形\\
 "FE50--"FE6F&小字形&
-"{20}000--"{2F}FFF&(追加多言語面)
+"{20}000--"{2F}FFF&(追加漢字面)
 %</ja>
 \end{tabular}
 \end{center}
@@ -1774,7 +1750,7 @@ which JFM will be used for this font by the following keys:
 \begin{list}{}{\def\makelabel{\ttfamily}\def\{{\char`\{}\def\}{\char`\}}\advance\leftmargin1\zw}
 \item[jfm=<name>]
 %<*en>
-Specify the name of JFM. If specified JFM has not been loaded, \LuaTeX-ja search and load 
+Specify the name of JFM. If specified JFM has not been loaded, \LuaTeX-ja search and load
 a file named \texttt{jfm-<name>.lua}.
 
 The following JFMs are shipped with \LuaTeX-ja:
@@ -1938,71 +1914,148 @@ Japanese Font Packs for Adobe Reader) will be used.
 
 %<en>\subsection{Structure of JFM file}
 %<ja>\subsection{JFM ファイルの構造}
+
+%<*en>
 A JFM file is a Lua script which has only one function call:
+%</en>
+%<*ja>
+JFM ファイルはただ一つの関数呼び出しを含む Lua スクリプトである:
+%</ja>
 \begin{verbatim}
 luatexja.jfont.define_jfm { ... }
 \end{verbatim}
+%<*en>
 Real data are stored in the table which indicated above by
 \verb+{ ... }+.  So, the rest of this subsection are devoted to describe the
 structure of this table.  Note that all lengths in a JFM file are
 floating-point numbers in design-size unit.
+%</en>
+%<*ja>
+実際のデータは上で \verb+{ ... }+ で示されたテーブルの中に格納されている.
+以下ではこのテーブルの構造について記す.
+なお,JFM ファイル中の長さは全て design-size を単位とする浮動小数点数であることに
+注意する.
+%</ja>
 
 \begin{list}{}{\def\makelabel{\ttfamily}\def\{{\char`\{}\def\}{\char`\}}\advance\leftmargin1\zw}
-\item[dir=<direction>] (required)
 
-The direction of JFM. At the present, only \texttt{'yoko'} is supported.
+\item[dir=<direction>]
+%<en>(required)
+%<ja>(必須)
+
+%<en>The direction of JFM. At the present, only \texttt{'yoko'} is supported.
+%<ja>JFM の書字方向.現時点では \texttt{'yoko'} のみがサポートされる.
 
-\item[zw=<length>] (required)
+\item[zw=<length>]
+%<en>(required)
+%<ja>(必須)
 
-The amount of the length of the `full-width'.
+%<en>The amount of the length of the `full-width'.
+%<ja>「全角幅」の長さ.
 
-\item[zh=<length>] (required)
+\item[zh=<length>]
+%<en>(required)
+%<ja>(必須)
 
-\item[kanjiskip=\{<natural>, <stretch>, <shrink>\}] (optional)
+%<en>The amount of the length of the `full-height' (height + depth).
+%<ja>「全角高さ」(height + depth)の長さ.
 
+\item[kanjiskip=\{<natural>, <stretch>, <shrink>\}]
+%<en>(optional)
+%<ja>(任意)
+
+%<*en>
 This field specifies the `ideal' amount of \Param{kanjiskip}. As noted
             in Subsection~\ref{subs-kskip}, if the parameter
             \Param{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+ の値ならば,このフィールドで指定された
+値が実際には用いられる(もしこのフィールドが JFM で指定されていなければ,
+0\,pt であるものとして扱われる).<stretch> と <shrink> のフィールドも design-size
+が単位であることに注意せよ.
+%</ja>
 
+\item[xkanjiskip=\{<natural>, <stretch>, <shrink>\}]
+%<en>(optional)
+%<ja>(任意)
 
-\item[xkanjiskip=\{<natural>, <stretch>, <shrink>\}] (optional)
-
+%<*en>
 Like the \Param{kanjiskip} field, this field specifies the `ideal'
             amount of \Param{xkanjiskip}.
-
+%</en>
+%<*ja>
+\Param{kanjiskip} フィールドと同様に,\Param{xkanjiskip} の「理想的な」量を
+指定する.
+%</ja>
 \end{list}
 
+%<*en>
 Besides from above fields, a JFM file have several sub-tables those
 indices are natural numbers.  The table indexed by~$i\in\omega$ stores
 information of `character class'~$i$. At least, the character class~0 is
 always present, so each JFM file must have a sub-table whose index is
 \texttt{[0]}.  Each sub-table (its numerical index is denoted by $i$) has
 the following fields:
+%</en>
+%<*ja>
+上記のフィールドに加えて,JFM ファイルはそのインデックスが自然数であるいくつかの
+サブテーブルを持つ.インデックスが $i\in\omega$ であるテーブルは「文字クラス」$i$ の
+情報を格納する.少なくとも,文字クラス0は常に存在するので,JFM ファイルはインデックス
+が \texttt{[0]} のサブテーブルを持たなければならない.それぞれのサブテーブル
+(そのインデックスを $i$ で表わす)は以下のフィールドを持つ:
+%</ja>
 
 \begin{list}{}{\def\makelabel{\ttfamily}\def\{{\char`\{}\def\}{\char`\}}\advance\leftmargin1\zw}
-\item[chars=\{<character>, ...\}] (required except character class~0)
+\item[chars=\{<character>, ...\}]
+%<en>(required except character class~0)
+%<ja>(文字クラス0を除いて必須)
 
+%<*en>
 This field is a list of characters which are in this character
             type~$i$. This field is not required if $i=0$, since all
             \textbf{JAchar} which are not in any character class other
-            than 0 (hence, the character class~0 contains most of
+            than 0 are in the character class 0
+             (hence, the character class~0 contains most of
             \textbf{JAchar}s). In the list, a character can be
             specified by its code number, or by the character itself
             (as a string of length~1). Moreover, there are `imaginary
             characters' which specified in the list. We will describe these later.
+%</en>
+%<*ja>
+このフィールドは文字クラス~$i$ に属する文字のリストである.このフィールドは $i=0$ の
+場合には必須ではない.なぜならば,文字クラス 0 には,0 以外の文字クラスに属するものを
+除いた全ての \textbf{JAchar} が属するからである(よって,文字クラス 0 はほとんどの
+\textbf{JAchar} を含む).このリストでは,文字はその文字コードを用いて,もしくは
+文字それ自体(長さ1の文字列)によって指定される.さらに,このリストで指定される
+「仮想的な文字」も存在する.これらについては後に記す.
+%</ja>
 
-\item[width=<length>, height=<length>, depth=<length>, italic=<length>]\ (required)
+\item[width=<length>, height=<length>, depth=<length>, italic=<length>]
+%<en>(required)
+%<ja>(必須)
 
+%<*en>
 Specify width of characters in character class~$i$, height, depth and
 the amount of italic correction. All characters in character class~$i$ are regarded that its width, height and depth are
 as values of these fields.
 But there is one exception: if \texttt{'prop'} is specified in \texttt{width} field, width of a character becomes that of its `real' glyph
+%</en>
+%<*ja>
+文字クラス~$i$ に属する文字の幅,高さ,深さ,イタリック補正の量を指定する.
+文字クラス~$i$ に属する全ての文字は,その幅,高さ,深さがこのフィールドで指定した
+値であるものとして扱われる.
+しかし,例外が一つある:もし \texttt{'prop'} が \texttt{width} フィールドに
+指定された場合,文字の幅はその「実際の」グリフの幅となる.
+%</ja>
 
 \item[left=<length>, down=<length>, align=<align>]\
 
+%<*en>
 These fields are for adjusting the position of the `real' glyph. Legal
             values of \texttt{align} field are \texttt{'left'},
             \texttt{'middle'} and \texttt{'right'}. If one of these
@@ -2010,11 +2063,29 @@ These fields are for adjusting the position of the `real' glyph. Legal
             treated as~0, and \texttt{align} field is treated as
             \texttt{'left'}.
 The effects of these 3~fields are indicated in Figure~\ref{fig-pos}.
+%</en>
+%<*ja>
+これらのフィールドは「実際の」グリフの位置を調整するためにある.
+\texttt{align} フィールドに指定できる値は \texttt{'left'}, \texttt{'middle'},
+\texttt{'right'} のいずれかである.もしこれら3つのフィールドのうちの1つが省かれた
+場合,\texttt{left} と \texttt{down} は 0,\texttt{align} フィールドは
+\texttt{'left'} であるものとして扱われる.
+これら3つのフィールドの意味については図\ref{fig-pos} で説明する.
+%</ja>
 
+%<*en>
 In most cases, \texttt{left} and \texttt{down} fields are~0, while
 it is not uncommon that the \texttt{align} field is \texttt{'middle'} or \texttt{'right'}.
 For example, setting the \texttt{align} field to \texttt{'right'} is practically needed
 when the current character class is the class for opening delimiters'.
+%</en>
+%<*ja>
+多くの場合,\texttt{left} と \texttt{down} は 0 である一方,
+\texttt{align} フィールドが \texttt{'middle'} や \texttt{'right'} であることは
+珍しいことではない.
+例えば,\texttt{align} フィールドを \texttt{'right'} に指定することは,
+文字クラスが開き括弧類であるときに実際必要である.
+%</ja>
 \begin{figure}[!tb]
 \begin{minipage}{0.4\textwidth}%
 \begin{center}\unitlength=10pt\small
@@ -2069,19 +2140,49 @@ when the current character class is the class for opening delimiters'.
 \end{center}
 \end{minipage}%
 \begin{minipage}{0.6\textwidth}%
+%<*en>
 Consider a node containing Japanese character whose value of the \texttt{align}
 field is \texttt{'middle'}.
+%</en>
+%<*ja>
+\texttt{align} フィールドの値が \texttt{'middle'} である和文文字を含むノードを
+考えよう.
+%</ja>
 \begin{itemize}
-\item The black rectangle is a frame of the node.
+\item
+%<*en>
+The black rectangle is a frame of the node.
 Its width, height and depth are specified by JFM.
-\item Since the \texttt{align} field is \texttt{'middle'},
+%</en>
+%<*ja>
+黒色の長方形はノードの枠である.
+その幅,高さ,深さは JFM によって指定される.
+%</ja>
+\item
+%<*en>
+Since the \texttt{align} field is \texttt{'middle'},
 the `real' glyph is centered horizontally (the green rectangle).
-\item Furthermore, the glyph is shifted according to values of fields
+%</en>
+%<*ja>
+\texttt{align} フィールドは \texttt{middle} なので,「実際の」グリフは
+水平方向の中心に配置される(緑色の長方形).
+%</ja>
+\item
+%<*en>
+Furthermore, the glyph is shifted according to values of fields
       \texttt{left} and \texttt{down}. The ultimate position of the real
       glyph is indicated by the red rectangle.
+%</en>
+%<*ja>
+さらに,グリフは \texttt{left} と \texttt{down} の値に従ってシフトされる.
+最終的な実際のグリフの位置は赤色の長方形で示された位置になる.
+%</ja>
 \end{itemize}
 \end{minipage}
-\caption{The position of the `real' glyph.}
+\caption{
+%<en>The position of the `real' glyph.
+%<ja>「実際の」グリフの位置.
+}
 \label{fig-pos}
 \end{figure}
 
@@ -2092,34 +2193,54 @@ the `real' glyph is centered horizontally (the green rectangle).
 \end{list}
 
 %<*en>
-\begin{list}{}{\def\makelabel{\ttfamily}\def\{{\char`\{}\def\}{\char`\}}\advance\leftmargin1\zw}
-\item['lineend'] An ending of a line.
-\item['diffmet'] Used at a boundary between two \textbf{JAchar}s whose JFM or size is different.
-\item['boxbdd'] The beginning/ending of a horizontal box, and the beginning of a noindented paragraph.
-\item['parbdd'] The beginning of an (indented) paragraph.
-\item['jcharbdd'] A boundary between \textbf{JAchar} and anything else
-            (such as \textbf{ALchar}, kern, glue, ...).
-\item[$-1$] The left/right boundary of an inline math formula.
-\end{list}
+As described before, you can specify several `imaginary characters' in
+\texttt{chars} field. The most of these characters are regarded as the
+characters of class 0 in \pTeX.
+As a result, \LuaTeX-ja can control typesetting finer than \pTeX.
+The following is the list of `imaginary characters':
 %</en>
-
 %<*ja>
 上で説明した通り,\texttt{chars}フィールド中にはいくつかの「特殊文字」も
 指定可能である.これらは,大半が\pTeX のJFMグルーの挿入処理ではみな「文字
 クラス0の文字」として扱われていた文字であり,その結果として\pTeX より細か
 い組版調整ができるようになっている.以下でその一覧を述べる:
+%</ja>
 \begin{list}{}{\def\makelabel{\ttfamily}\def\{{\char`\{}\def\}{\char`\}}\advance\leftmargin1\zw}
-\item['lineend'] 行の終端を表す.
+\item['lineend']
+%<en>An ending of a line.
+%<ja>行の終端を表す.
+
 \item['diffmet']
+%<en>Used at a boundary between two \textbf{JAchar}s whose JFM or size is different.
+%<ja>JFM やサイズが異なる2つの \textbf{JAchar} の間の境界として用いられる.
+
+\item['boxbdd']
+%<en>The beginning/ending of a horizontal box, and the beginning of a noindented paragraph.
+%<ja>hboxの先頭と末尾,及びインデントされていない(\verb+\noindent+で開始された)段落の先頭を表す.
+
+\item['parbdd']
+%<en>The beginning of an (indented) paragraph.
+%<ja>通常の(\verb+\noindent+で開始されていない)段落の先頭.
 
-\item['boxbdd'] hboxの先頭と末尾,及びインデントされていない
-            (\verb+\noindent+で開始された)段落の先頭を表す.
-\item['parbdd'] 通常の(\verb+\noindent+で開始されていない)段落の先頭.
-\item['jcharbdd'] 和文文字と「その他のもの」(欧文文字,glue,kern等)との境界.
-\item[$-1$] 行中数式と地の文との境界.
+\item['jcharbdd']
+%<en>A boundary between \textbf{JAchar} and anything else (such as \textbf{ALchar}, kern, glue, ...).
+%<ja>和文文字と「その他のもの」(欧文文字,glue,kern等)との境界.
+
+\item[$-1$]
+%<en>The left/right boundary of an inline math formula.
+%<ja>行中数式と地の文との境界.
 \end{list}
 
-\paragraph{\pTeX 用和文フォントメトリックの移植}
+%<en>\paragraph{Porting JFM from \pTeX}
+%<ja>\paragraph{\pTeX 用和文フォントメトリックの移植}
+
+% ToDo: English version.
+
+%<*en>
+...
+%</en>
+
+%<*ja>
 以下に,\pTeX 用和文フォントメトリックを\LuaTeX-ja用に移植する場合の注意点を挙げておく.
 \begin{itemize}
 \item 実際に出力される和文フォントのサイズがdesign sizeとなる.
@@ -2166,25 +2287,44 @@ the `real' glyph is centered horizontally (the green rectangle).
 
 %<en>\subsection{Math Font Family}
 %<ja>\subsection{数式フォントファミリ}
+
+%<*en>
 \TeX\ handles fonts in math formulas by 16~font families\footnote{Omega,
-Aleph, \LuaTeX~and $\varepsilon$-\kern-.125em(u)\pTeX can handles 256~families, but
+Aleph, \LuaTeX~and $\varepsilon$-\kern-.125em(u)\pTeX\ can handles 256~families, but
 an external package is needed to support this in plain \TeX\ and
 \LaTeX.}, and each family has three fonts:
 \verb+\textfont+, \verb+\scriptfont+ and \verb+\scriptscriptfont+.
+%</en>
+%<*ja>
+\TeX\ は数式フォントを16のファミリ\footnote{Omega, Aleph, \LuaTeX,そして
+  $\varepsilon$-\kern-.125em(u)\pTeX\ では256 の数式ファミリを扱うことができるが,
+  これをサポートするために plain \TeX と \LaTeX では外部パッケージを読み込む必要が
+  ある.}で管理し,それぞれのファミリは3つのフォントを持っている:\verb+\textfont+, \verb+\scriptfont+ そして \verb+\scriptscriptfont+ である.
+%</ja>
 
+%<*en>
 \LuaTeX-ja's handling of Japanese fonts in math formulas is similar;
 Table~\ref{tab-math} shows counterparts to \TeX's primitives for math
 font families. There is no relation between the value of
 \verb+\fam+ and that of \verb+\jfam+; with appropriate settings,
-you can set both \verb+\fam+ and \verb+\jfam+ to~the same value.
+you can set both \verb+\fam+ and \verb+\jfam+ to the same value.
+%</en>
+%<*ja>
+\LuaTeX-ja の数式中での和文フォントの扱いも同様である.
+表 \ref{tab-math} は数式フォントファミリに対する \TeX\ のプリミティブと対応する
+ものを示している.\verb+\fam+ と \verb+\jfam+ の値の間には関係はなく,
+適切な設定の下では \verb+\fam+ と \verb+\jfam+ の両方に同じ値を設定することができる.
+%</ja>
 
 \begin{table}[!tb]
-\caption{Primitives for Japanese math fonts.}
+%<en>\caption{Primitives for Japanese math fonts.}
+%<ja>\caption{和文数式フォントに対するプリミティブ.}
 \label{tab-math}
 \begin{center}\def\{{\char`\{}\def\}{\char`\}}
 \begin{tabular}{lll}
 \toprule
-&Japanese fonts&alphabetic fonts\\
+%<en>&Japanese fonts&alphabetic fonts\\
+%<ja>&和文フォント&欧文フォント\\
 \midrule
 font family&\verb+\jfam+${}\in [0,256)$&\verb+\fam+\\
 text size&\tt\Param{jatextfont}\,=\{<jfam>,<jfont\_cs>\}&\tt\verb+\textfont+<fam>=<font\_cs>\\
@@ -2197,59 +2337,130 @@ scriptscript size&\tt\Param{jascriptscriptfont}\,=\{<jfam>,<jfont\_cs>\}&\tt\ver
 
 %<en>\subsection{Callbacks}
 %<ja>\subsection{コールバック}
+
+%<*en>
 Like \LuaTeX\ itself, \LuaTeX-ja also has callbacks. These callbacks can
-be accessed via \verb+luatexbase.add_to_callback+ function and so on, as other callbacks
+be accessed via \verb+luatexbase.add_to_callback+ function and so on, as other callbacks.
+%</en>
+%<*ja>
+\LuaTeX 自体のものに加えて,\LuaTeX-ja もコールバックを持っている.
+これらのコールバックには,他のコールバックと同様に \verb+luatexbase.add_to_callback+
+関数などを用いることでアクセスすることができる.
+%</ja>
 \begin{list}{}%
 {\def\makelabel#1{\bfseries#1}}
-\item[\texttt{luatexja.load\_jfm} callback]
+%<en>\item[\texttt{luatexja.load\_jfm} callback]
+%<ja>\item[\texttt{luatexja.load\_jfm} コールバック]
+%<*en>
 With this callback you can overwrite JFMs.
 This callback is called when a new JFM is loaded.
+%</en>
+%<*ja>
+このコールバックを用いることで JFM を上書きすることができる.
+このコールバックは新しい JFM が読み込まれるときに呼び出される.
+%</ja>
 
-\begin{verbatim}
+\begin{lstlisting}[numbers=left]
 function (<table> jfm_info, <string> jfm_name)
   return <table> new_jfm_info
 end
-\end{verbatim}
+\end{lstlisting}
 
+%<*en>
 The argument \verb+jfm_info+ contains a table similar to the table in a JFM file, except
 this argument has \texttt{chars} field which contains character codes
             whose character class is not~0.
+%</en>
+%<*ja>
+引数 \verb+jfm_info+ は JFM ファイルのテーブルと似たものが格納されるが,
+クラス0を除いた文字のコードを含んだ \texttt{chars} フィールドを持つ点が異なる.
+%</ja>
 
+%<*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}. This callback doesn't
             replace any code of \LuaTeX-ja.
+%</en>
+%<*ja>
+このコールバックの使用例は \texttt{ltjarticle} クラスにあり,
+\texttt{jfm-min.lua} 中の \texttt{'parbdd'} を強制的にクラス0に割り当てている.
+このコールバックは \LuaTeX-ja のコードを書き換えない.
+%</ja>
 
-\item[\texttt{luatexja.define\_font} callback]
+%<en>\item[\texttt{luatexja.define\_font} callback]
+%<ja>\item[\texttt{luatexja.define\_font} コールバック]
+%<*en>
 This callback and the next callback form a pair, and you can assign letters which don't have
             fixed code points in Unicode to non-zero character classes.
 This \texttt{luatexja.define\_font} callback is called just when new Japanese font is loaded.
-\begin{verbatim}
+%</en>
+%<*ja>
+このコールバックと次のコールバックは組をなしており,Unicode 中に固定された文字コード
+番号を持たない文字を非零の文字クラスに割り当てることができる.
+このコールバックは新しい和文フォントが読み込まれたときに呼び出される.
+%</ja>
+
+\begin{lstlisting}[numbers=left]
 function (<table> jfont_info, <number> font_number)
   return <table> new_jfont_info
 end
-\end{verbatim}
+\end{lstlisting}
 
+%<*en>
 You may assume that \verb+jfont_info+ has the following fields:
+%</en>
+%<*ja>
+\verb+jfont_info+ は以下のフィールドを持つ:
+%</ja>
 \begin{description}
-\item[\tt jfm] The index number of JFM.
-\item[\tt size] Font size in a scaled point (${}=2^{-16}\,\textrm{pt}$).
-\item[\tt var] The value specified in \texttt{jfmvar=...} at a call of \verb+\jfont+.
+\item[\tt jfm]
+%<en>The index number of JFM.
+%<ja>JFM のインデックス番号.
+
+\item[\tt size]
+%<en>Font size in a scaled point (${}=2^{-16}\,\textrm{pt}$).
+%<ja>スケールド・ポイント (${}=2^{-16}\,\textrm{pt}$) を単位としたフォントのサイズ.
+
+\item[\tt var]
+%<en>The value specified in \texttt{jfmvar=...} at a call of \verb+\jfont+.
+%<ja>\verb+\jfont+ の呼び出しの際に \texttt{jfmvar=...} で指定された値.
 \end{description}
 
+%<*en>
 The returned table \verb+new_jfont_info+ also should include these three fields.
 The \verb+font_number+ is a font number.
+%</en>
+%<*ja>
+戻り値の \verb+new_jfont_info+ テーブルもこれら3つのフィールドを含まなければならない.
+\verb+font_number+ はフォント番号である.
+%</ja>
 
+%<*en>
 A good example of this and the next callbacks is the \Pkg{luatexja-otf}
             package, supporting \verb+"AJ1-xxx"+ form for Adobe-Japan1
             CID characters in a JFM. This callback doesn't replace any
             code of \LuaTeX-ja.
+%</en>
+%<*ja>
+これと次のコールバックの良い使用例は \Pkg{luatexja-otf} パッケージであり,
+JFM 中で Adobe-Japan1 CID の文字を \verb+"AJ1-xxx"+ の形で指定するために
+用いられている.
+このコールバックは \LuaTeX-ja のコードを書き換えない.
+%</ja>
 
-
-\item[\texttt{luatexja.find\_char\_class} callback]
-This callback is called just when \LuaTeX-ja inready to determine which
+%<en>\item[\texttt{luatexja.find\_char\_class} callback]
+%<ja>\item[\texttt{luatexja.find\_char\_class} コールバック]
+%<*en>
+This callback is called just when \LuaTeX-ja is trying to determine which
             character class a character \verb+chr_code+ belongs.
 A function used in this callback should be in the following form:
+%</en>
+%<*ja>
+このコールバックは \LuaTeX-ja が \verb+chr_code+ の文字がどの文字クラスに
+属するかを決定しようとする際に呼び出される.
+このコールバックで呼び出される関数は次の形をしていなければならない:
+%</ja>
 \begin{lstlisting}[numbers=left]
 function (<number> char_class, <table> jfont_info, <number> chr_code)
   if char_class~=0 then return char_class
@@ -2260,29 +2471,73 @@ function (<number> char_class, <table> jfont_info, <number> chr_code)
 end
 \end{lstlisting}
 
+%<*en>
 The argument \verb+char_class+ is the result of \LuaTeX-ja's default
             routine or previous function calls in this callback, hence
             this argument may not be 0. Moreover, the returned
             \verb+new_char_class+ should be as same as \verb+char_class+ when \verb+char_class+
             is not~0, otherwise you will overwrite the \LuaTeX-ja's
             default routine.
+%</en>
+%<*ja>
+引数 \verb+char_class+ は \LuaTeX-ja のデフォルトルーチンか,このコールバックの
+直前の関数呼び出しの結果を含んでおり,したがってこの値は0ではないかもしれない.
+さらに,戻り値の \verb+new_char_class+ は \verb+char_class+ が非零のときには
+\verb+char_class+ の値と同じであるべきで,そうでないときは \LuaTeX-ja の
+デフォルトルーチンを書き換えることになる.
+%</ja>
 
+%<*en>
 This callback doesn't replace any code of \LuaTeX-ja.
+%</en>
+%<*ja>
+このコールバックは \LuaTeX-ja のコードを書き換えない.
+%</ja>
 
-\item[\texttt{luatexja.set\_width} callback]
+%<en>\item[\texttt{luatexja.set\_width} callback]
+%<ja>\item[\texttt{luatexja.set\_width} コールバック]
+%<*en>
 This callback is called when \LuaTeX-ja is trying to encapsule a
             \textbf{JAchar} \textit{glyph\_node}, to adjust its
             dimension and position.
+%</en>
+%<*ja>
+このコールバックは \LuaTeX-ja が \textbf{JAchar} の寸法と位置を調節するために
+その \textit{glyph\_node} をカプセル化しようとする際に呼び出される.
+%</ja>
 \begin{lstlisting}[numbers=left]
 function (<table> shift_info, <table> jfont_info, <number> char_class)
   return <table> new_shift_info
 end
 \end{lstlisting}
 
+%<*en>
 The argument \verb+shift_info+ and the returned \verb+new_shift_info+ have
 \texttt{down} and \texttt{left} fields, which are the amount of shifting
             down/left the character in a scaled-point.
+%</en>
+%<*ja>
+引数 \verb+shift_info+ と戻り値の \verb+new_shift_info+ は
+\texttt{down} と \texttt{left} のフィールドを持ち,これらの値は
+文字の下/左へのシフト量(スケールド・ポイント単位)である.
+%</ja>
 
+%<*en>
+A good example is \Pkg{test/valign.lua}.
+After loading this file, the vertical position of glyphs is automatically
+adjusted; the ratio $(\hbox{height}:\hbox{depth})$ of glyphs is adjusted
+to be that of letters in the character class~0. For example, suppose that
+\begin{itemize}
+\item The setting of the JFM: $(\hbox{height})=88x$, $(\hbox{depth})=12x$
+  (the standard values of Japanese OpenType fonts);
+\item The value of the real font: $(\hbox{height})=28y$, $(\hbox{depth})=5y$
+  (the standard values of Japanese TrueType fonts).
+\end{itemize}
+Then, the position of glyphs is shifted up by
+\[
+ \frac{88x}{88x+12x} (28y+5y) - 28y = \frac{26}{825}y= 0.03\dot1\dot5y.
+\]
+%</en>
 %<*ja>
 良い例が\Pkg{test/valign.lua}である.このファイルが読み込まれた状態では,
             JFM内で規定された文字クラス0の文字における$(\hbox{高
@@ -2297,7 +2552,7 @@ The argument \verb+shift_info+ and the returned \verb+new_shift_info+ have
 \[
  \frac{88x}{88x+12x} (28y+5y) - 28y = \frac{26}{825}y= 0.03\dot1\dot5y
 \]
\81 ã\81\91ä¸\8aã\81«ã\81\9aã\82\89ã\81\95ã\82\8cã\82\8bã\81\93ã\81¨ã\81«ã\81ªã\82\8bï¼\8c
\81 ã\81\91ä¸\8aã\81«ã\81\9aã\82\89ã\81\95ã\82\8cã\82\8bã\81\93ã\81¨ã\81«ã\81ªã\82\8bï¼\8e
 %</ja>
 \end{list}
 
@@ -2801,7 +3056,7 @@ This problem is resolved by using
 %<ja>\section{和文文字直後の改行}
 \label{sec-lbreak}
 %<en>\subsection{Reference: Behavior in \pTeX}
-%<ja>\subsection{参考: \pTeX の挙動}
+%<ja>\subsection{参考: \pTeX の動作}
 %<*en>
 In~\pTeX, a line break after a Japanese character doesn't emit a space,
 since words are not separated by spaces in Japanese writings. However,
@@ -2881,7 +3136,7 @@ after `beginning/ending of a group' characters.
 
 
 %<en>\subsection{Behavior in \LuaTeX-ja}
-%<ja>\subsection{\LuaTeX-ja の挙動}
+%<ja>\subsection{\LuaTeX-ja の動作}
 %<*en>
 States in the input processor of \LuaTeX\ is the same as that of \TeX,
 and they can't be customized by any callbacks. Hence, we can only use
@@ -3024,8 +3279,8 @@ with the \textit{id} of it:
       The \textit{id} is \textit{id\_math}.
 \item A \textit{glyph\_node}~$p$ with nodes which relate with it:
 \begin{enumerate}
-\item A kern for the italic correction of~$p$. 
-\item An accent attached to $p$ by \verb+\accent+. 
+\item A kern for the italic correction of~$p$.
+\item An accent attached to $p$ by \verb+\accent+.
 \end{enumerate}
 \[
 \overbrace{%
@@ -3036,7 +3291,7 @@ with the \textit{id} of it:
 \end{array}\right\}\longrightarrow
 \Node{kern}{$\mathit{subtype}=2$}}^{\text{(a)}}
 \longrightarrow
-\Node{glyph}{$p$}\longrightarrow 
+\Node{glyph}{$p$}\longrightarrow
 \overbrace{%
 \Node{kern}{italic corr.}}^{\text{(b)}}
 \]
@@ -3196,7 +3451,7 @@ $g$は「文字コード\texttt{'boxbdd'}の文字」と\textit{Np}の間に入
 のようになっている.間の(a)に相当する部分には,何のノードもない場合ももちろんあり得る.
 そうして,JFMグルー挿入後には,この2クラスタ間は次のようになる:
 \[
- \Node{cluster}{\textit{Nq}}\longrightarrow\Node{kern}{左空白}\longrightarrow 
+ \Node{cluster}{\textit{Nq}}\longrightarrow\Node{kern}{左空白}\longrightarrow
 \overbrace{
 \Node{penalty}{$p+x$}\longrightarrow \cdots\longrightarrow \Node{whatsit}{}}^{(a)}
 \longrightarrow \Node{glue or kern}{右空白}\longrightarrow \Node{cluster}{\textit{Np}}
@@ -3283,7 +3538,7 @@ JFM由来の値だけを用いる.もし両者で使われているJFMが異
 
 $a$は禁則処理用に\textit{Nq}と\textit{Np}の間に加えられるべきペナルティ量である.
 \begin{description}
-\item[P-normal~{[PN]}] 
+\item[P-normal~{[PN]}]
 \textit{Nq}と\textit{Np}の間の(a)部分にペナルティ(\textit{penalty\_node})があれば処理は簡単である:
 それらの各ノードにおいて,ペナルティ値を($\pm 10000$を無限大として扱いつつ)$a$だけ増加させればよい.
 また,$10000 + (-10000) = 0$としている.
@@ -3336,7 +3591,7 @@ kern&\gkf{E}{\OB}{PS}\\
 \begin{quote}
 Here {\small\gkf{E}{M→K}{PN}} means that
 \begin{enumerate}
-\item To determine the `right-space', \LuaTeX-ja first attempts by the method `\textsf{JFM-origin~[M]}'. 
+\item To determine the `right-space', \LuaTeX-ja first attempts by the method `\textsf{JFM-origin~[M]}'.
 If this attempt fails, \LuaTeX-ja use the method `\textsf{\Param{kanjiskip}~[K]}'.
 \item The `left space' between \textit{Nq}~and~\textit{Np} is determined by the method `\textsf{line-end~[E]}'.
 \item \LuaTeX-ja adopts the method `\textsf{P-normal~[PN]}' to adjust the penalty between two clusters for \emph{kinsoku shori}.
@@ -3435,7 +3690,7 @@ If this attempt fails, \LuaTeX-ja use the method `\textsf{\Param{kanjiskip}~[K]}
 \end{itemize}
 
 \begin{description}
-\item[P-allow~{[PA]}] 
+\item[P-allow~{[PA]}]
 \textit{Nq}と\textit{Np}の間の(a)部分にペナルティがあれば,\textsf{P-normal~[PN]}と同様に,
 それらの各ノードにおいてペナルティ値を$a$だけ増加させる.
 
@@ -3448,7 +3703,7 @@ If this attempt fails, \LuaTeX-ja use the method `\textsf{\Param{kanjiskip}~[K]}
 \item 「左空白」がkernとしてきっちり定義されている時.
 \end{itemize}
 
-\item[P-suppress~{[PS]}] 
+\item[P-suppress~{[PS]}]
 \textit{Nq}と\textit{Np}の間の(a)部分にペナルティがあれば,\textsf{P-normal~[PN]}と同様に,
 それらの各ノードにおいてペナルティ値を$a$だけ増加させる.
 
@@ -3466,7 +3721,7 @@ If this attempt fails, \LuaTeX-ja use the method `\textsf{\Param{kanjiskip}~[K]}
 このとき,$a$,即ち「あ」の\Param{postbreakpenalty}がいかなる値であっても,
 この2クラスタ間は最終的に
 \begin{equation}
- \overbrace{\Node{glyph}{`あ'}}^{\mathit{Nq}}\longrightarrow 
+ \overbrace{\Node{glyph}{`あ'}}^{\mathit{Nq}}\longrightarrow
 \Node{kern}{右空白}\longrightarrow \overbrace{\Node{glue}{1\,pt}}^{\mathit{Np}}
 \label{eq-gref}
 \end{equation}
@@ -3474,7 +3729,7 @@ If this attempt fails, \LuaTeX-ja use the method `\textsf{\Param{kanjiskip}~[K]}
 \Param{postbreakpenalty}は($a$は)殆どの場合が非負の値と考えられ,そのような場合では
 \eqref{eq-gref}と
 \[
- \overbrace{\Node{glyph}{`あ'}}^{\mathit{Nq}}\longrightarrow 
+ \overbrace{\Node{glyph}{`あ'}}^{\mathit{Nq}}\longrightarrow
 \Node{penalty}{$a$}\longrightarrow
 \Node{kern}{右空白}\longrightarrow \overbrace{\Node{glue}{1\,pt}}^{\mathit{Np}}
 \]
@@ -3537,4 +3792,10 @@ $\mathit{Nq}.\mathit{tail}$は無意味なので,
 \end{itemize}
 
 \section{psft}
+
+\begin{thebibliography}{99}
+  \addcontentsline{toc}{section}{\refname}
+\bibitem{texbytopic}
+Victor Eijkhout,  \emph{\TeX\ by Topic, A \TeX nician's Reference}, Addison-Wesley, 1992.
+\end{thebibliography}
 \end{document}