OSDN Git Service

Use everysel package for patching \selectfont.
[luatex-ja/luatexja.git] / doc / luatexja.dtx
index c9bbbbd..ed343fe 100644 (file)
@@ -47,7 +47,7 @@
 %</ja>
 
 \usepackage{amsmath,array,tikz,pict2e,multienum,float}
-\usepackage{booktabs,multicol}
+\usepackage{booktabs,multicol,luatexja-ruby}
 
 %%%%%%%% listings
 
 \usepackage{luatexja-otf}
 %<ja>\usepackage{lmodern}
 \directlua{luatexja.otf.enable_ivs()}
+\usepackage[match]{luatexja-fontspec}
 \usepackage[kozuka-pr6n]{luatexja-preset}
+\setmonojfont{KozGoPr6N-Regular.otf}
 %<*ja>
 \def\emph#1{\textbf{\textgt{#1}}}
 \def\headfont{\normalfont\bfseries\gtfamily}
 \setmathfont{xits-math.otf}
 \frenchspacing
 %</en>
-\DeclareRobustCommand\ttfamily
-        {\not@math@alphabet\ttfamily\mathtt
-         \romanfamily\ttdefault\ttjfam\selectfont}
-\newjfontfamily\ttjfam{KozGoPr6N-Regular.otf}
-
 
 %%%%%%%% logo
 \usepackage{metalogo}
 
 \catcode`\<=13
 \def<#1>{{\normalfont\rm\itshape$\langle$#1\/$\rangle$}}
+\let\LARG=<
 \maketitle
 
 \tableofcontents
@@ -932,7 +930,7 @@ Okumura), namely, \Pkg{ltjclasses} and \Pkg{ltjsclasses}.
 日本語文書を組版するためには,\texttt{article.cls}, \texttt{book.cls}といった
 欧文用のクラスファイルではなく,和文用のクラスファイルを用いた方がよい.
 現時点では,\Pkg{jclasses}(\pLaTeX の標準クラス)と\Pkg{jsclasses}
-ï¼\88奥æ\9d\91æ\99´å½¦æ°\8fã\81«ã\82\88ã\82\8bã\82¯ã\83©ã\82¹ã\83\95ã\82¡ã\82¤ã\83«)に対応するものとして,\Pkg{ltjclasses},
+ï¼\88奥æ\9d\91æ\99´å½¦æ°\8fã\81«ã\82\88ã\82\8bã\80\8c\pLaTeXe æ\96°ã\83\89ã\82­ã\83¥ã\83¡ã\83³ã\83\88ã\82¯ã\83©ã\82¹ã\80\8d)に対応するものとして,\Pkg{ltjclasses},
 \Pkg{ltjsclasses}がそれぞれ用意されている.
 %</ja>
 
@@ -940,7 +938,7 @@ Okumura), namely, \Pkg{ltjclasses} and \Pkg{ltjsclasses}.
 %<ja>\section{フォントの変更}
 
 \subsection{plain \TeX~and~\LaTeXe}
-\label{ssub-chgfnt}
+\label{ssec-chgfnt}
 
 \paragraph{plain \TeX}
 %<*en>
@@ -1014,7 +1012,7 @@ auto select&\verb+\fontencoding+&\verb+\fontfamily+&---&---&\verb+\usefont+\\
       alphabetic fonts to \texttt{T1}.
       \verb+\fontfamily+ also changes the current Japanese font family, 
       the current alphabetic font family, \emph{or both}. 
-      For the detail, see Subsection~\ref{ssub-nfsspat}.
+      For the detail, see Subsection~\ref{ssec-nfsspat}.
 %</en>
 %<*ja>
       ここで,\verb+\fontencoding{+<encoding>\verb+}+ は,引数により和文側か欧文
@@ -1023,7 +1021,7 @@ auto select&\verb+\fontencoding+&\verb+\fontfamily+&---&---&\verb+\usefont+\\
       \texttt{JY3}に変更し,\verb+\fontencoding{T1}+ は欧文フォント側を
       \texttt{T1}へと変更する.\verb+\fontfamily+ も引数により和文側,欧文
       側,\emph{あるいは両方}のフォントファミリを変更する.詳細は
-      \ref{ssub-nfsspat}節を参照すること.
+      \ref{ssec-nfsspat}節を参照すること.
 %</ja>
 
 %<*en>
@@ -1046,7 +1044,7 @@ auto select&\verb+\fontencoding+&\verb+\fontfamily+&---&---&\verb+\usefont+\\
 %<*ja>
 仮名書体を使う場合など,複数の和文フォントを組み合わせて使いたい場合は
 \ref{ssec-altfont}節の \verb+\ltjdeclarealtfont+ と,その\LaTeX 版の\ 
-\verb+\DeclareAlternateKanjiFont+(\ref{ssub-nfsspat}節)を参照せよ.
+\verb+\DeclareAlternateKanjiFont+(\ref{ssec-nfsspat}節)を参照せよ.
 %</ja>
 \end{itemize}
 
@@ -1114,13 +1112,21 @@ this chapter. For the method, please see Subsection~\ref{ssec-math}.
 \label{ssec-fontspec}
 %<*en>
 To coexist with the \Pkg{fontspec} package, it is needed to load
-\Pkg{luatexja-fontspec} package in the preamble. This additional
-package automatically loads \Pkg{luatexja} and \Pkg{fontspec}
+\Pkg{luatexja-fontspec} package in the preamble, as follows:
+\begin{quote}
+\ttfamily \textbackslash usepackage[<options>]\{luatexja-fontspec\}
+\end{quote}
+This \Pkg{luatexja-fontspec} package 
+automatically loads \Pkg{luatexja} and \Pkg{fontspec}
 package, if needed.
 %</en>
 %<*ja>
-\Pkg{fontspec}パッケージと同様の機能を和文フォントに対しても用いるためには,
-\Pkg{luatexja-fontspec}パッケージをプリアンブルで読み込む必要がある.このパッケージ
+\Pkg{fontspec}パッケージと同様の機能を和文フォントに対しても用いる場合,
+\Pkg{luatexja-fontspec}パッケージを読み込む:
+\begin{quote}
+\ttfamily \textbackslash usepackage[<options>]\{luatexja-fontspec\}
+\end{quote}
+このパッケージ
 は必要ならば自動で\Pkg{luatexja}パッケージと\Pkg{fontspec}パッケージを読み込む.
 %</ja>
 
@@ -1132,20 +1138,21 @@ counterparts of original commands in the \Pkg{fontspec} package:
 \Pkg{luatexja-fontspec}パッケージでは,以下の7つのコマンドを\Pkg{fontspec}
 パッケージの元のコマンドに対応するものとして定義している:
 %</ja>
-
 %<*en>
 \begin{center}\small
 \begin{tabular}{ccccc}
 \toprule
 Japanese fonts
-&\verb+\jfontspec+&\verb+\setmainjfont+&\verb+\setsansjfont+&\verb+\newjfontfamily+\\
+&\verb+\jfontspec+&\verb+\setmainjfont+&\verb+\setsansjfont+&\verb+\setmonojfont+$^*$\\
 alphabetic fonts
-&\verb+\fontspec+&\verb+\setmainfont+&\verb+\setsansfont+&\verb+\newfontfamily+\\
+&\verb+\fontspec+&\verb+\setmainfont+&\verb+\setsansfont+&\verb+\setmonofont+\\
 \midrule
 Japanese fonts
-&\verb+\newjfontface+&\verb+\defaultjfontfeatures+&\verb+\addjfontfeatures+\\
+&\verb+\newjfontfamily+&\verb+\newjfontface+
+&\verb+\defaultjfontfeatures+&\verb+\addjfontfeatures+\\
 alphabetic fonts
-&\verb+\newfontface+&\verb+\defaultfontfeatures+&\verb+\addfontfeatures+\\
+&\verb+\newfontfamily+&\verb+\newfontface+
+&\verb+\defaultfontfeatures+&\verb+\addfontfeatures+\\
 \bottomrule
 \end{tabular}
 \end{center}
@@ -1172,31 +1179,54 @@ alphabetic fonts
 \end{tabular}
 \end{center}
 %</ja>
-\begin{LTXexample}[width=0.4\textwidth]
-\fontspec[Numbers=OldStyle]{LMSans10-Regular}
-\jfontspec[CJKShape=NLC]{KozMinPr6N-Regular}
-JIS~X~0213:2004→辻
+%<*en>
+The package option of \Pkg{luatexja-fontspec} are the followings:
+\begin{list}{}{\def\makelabel{\ttfamily}\def\{{\char`\{}\def\}{\char`\}}\advance\leftmargin1\zw}
+ \item[match] If this option is specified, usual family-changing commands such as
+\verb+\rmfamily+,~\verb+\textrm+, \verb+\sffamily+,~\dots\ also change Japanese font family.
 
-\jfontspec[CJKShape=JIS1990]{KozMinPr6N-Regular}
-JIS~X~0208:1990→辻
-\end{LTXexample}
+Note that \emph{\texttt{\textup{\textbackslash setmonojfont}} is defined 
+if and only if this \texttt{\textup{match}} option is specified}.
 
-%<*en>
-Note that there is no command named \verb+\setmonojfont+, since it is
-popular for Japanese fonts that nearly all Japanese glyphs have same
+ \item[pass=<opts>] 
+Specify options <opts> which will be passed to the \Pkg{fontspec} package.
+\end{list} 
+The reason that \verb+\setmonojfont+ is not defined by default is that
+it is popular for Japanese fonts that nearly all Japanese glyphs have same
 widths.  Also note that kerning information in a font is not used
-(that is, \texttt{kern} feature is set off) by default in these seven commands.
+(that is, \texttt{kern} feature is set off) by default in these seven (or~eight) commands.
 This is because of the compatibility with previous versions of \LuaTeX-ja
 (see \ref{para-kern}).
 %</en>
 %<*ja>
-和文フォントについては全ての和文文字のグリフがほぼ等幅であるのが普通であるため,
-\verb+\setmonojfont+ コマンドは存在しないことに注意.また,これらの和文用の7つのコマ
-ンドではフォント内のペアカーニング情報は標準では使用されない,
+\Pkg{luatexja-fontspec} パッケージのオプションは以下の通りである:
+\begin{list}{}{\def\makelabel{\ttfamily}\def\{{\char`\{}\def\}{\char`\}}\advance\leftmargin1\zw}
+ \item[match] このオプションが指定されると,「\pLaTeXe 新ドキュメントクラス」のように\
+\verb+\rmfamily+, \verb+\textrm{...}+, \verb+\sffamily+ 等が
+欧文フォントだけでなく和文フォントも変更するようになる.
+
+\emph{なお,{\tt \textbackslash setmonojfont} はこの \texttt{match} オプションが
+指定された時のみ定義される.}この命令は標準の「タイプライタ体に対応する和文フォント」を指定する.
+
+ \item[pass=<opts>] 
+\Pkg{fontspec} パッケージに渡すオプション <opts> を指定する.
+\end{list}
+標準で \verb+\setmonojfont+ コマンドが定義されないのは,
+和文フォントではほぼ全ての和文文字のグリフが等幅であるのが伝統的であったことによる.
+また,これらの和文用のコマンドではフォント内のペアカーニング情報は標準では使用されない,
 言い換えれば \texttt{kern} featureは標準では無効化となっている.
 これは以前のバージョンの\LuaTeX-jaとの互換性のためである(\ref{para-kern}節を参照).
 %</ja>
 
+\begin{LTXexample}[width=0.4\textwidth]
+\fontspec[Numbers=OldStyle]{LMSans10-Regular}
+\jfontspec[CJKShape=NLC]{KozMinPr6N-Regular}
+JIS~X~0213:2004→辻
+
+\jfontspec[CJKShape=JIS1990]{KozMinPr6N-Regular}
+JIS~X~0208:1990→辻
+\end{LTXexample}
+
 %<en>\subsection{Presets}
 %<ja>\subsection{プリセット設定}
 \label{ssec-preset}
@@ -1615,7 +1645,7 @@ If you want to use these functions, load \Pkg{luatexja-otf} package.
 
 これら3オプションについては,
 \Pkg{luatexja-preset} パッケージにプリセットを使う時に一緒に指定するか,
-あるいは対応する内容を\ref{ssub-chgfnt}節,\ref{ssub-nfsspat}節 (NFSS2) や
+あるいは対応する内容を\ref{ssec-chgfnt}節,\ref{ssec-nfsspat}節 (NFSS2) や
 \ref{ssec-fontspec}節 (\Pkg{fontspec}) の方法で手動で指定する必要がある.
 %</ja>
 
@@ -2176,7 +2206,7 @@ For the detail, see Table~\ref{table-kcat}.
 \small
 \caption{\texttt{\textbackslash kcatcode} in \upTeX}
 \label{table-kcat}
-\medskip
+%<en>\medskip
 
 \noindent\hfill
 \begin{tabular}{ccccc}
@@ -2541,46 +2571,60 @@ JFMの名前を指定する.もし以前に指定されたJFMが読み込ま
 %</en>
 %<*ja>
 \item[\tt jfm-jis.lua] \pTeX で広く用いられている「JISフォントメトリック」
-  \verb+jis.tfm+ に相当するJFMである.\texttt{jfm-ujis.lua}とこの
-  \texttt{jfm-jis.lua}の主な違いは,\texttt{jfm-ujis.lua}ではほとんどの文字が
-  正方形状であるのに対し,\texttt{jfm-jis.lua}では横長の長方形状である.
+  \verb+jis.tfm+ に相当するJFMである.\texttt{jfm-ujis.lua} とこの
+  \texttt{jfm-jis.lua} の主な違いは,\texttt{jfm-ujis.lua} ではほとんどの文字が
+  正方形状であるのに対し,\texttt{jfm-jis.lua} では横長の長方形状であることと,
+  \texttt{jfm-ujis.lua} では「?」「!」の直後に半角空白が挿入されることである.
 %</ja>
 %<*en>
 \item[\tt jfm-min.lua] A counterpart for \verb+min10.tfm+, which is one
-  of the default Japanese font metric shipped with \pTeX. There
-  are notable difference between this JFM and other 2~JFMs, as
-  shown in Table~\ref{tab-difjfm}.
+  of the default Japanese font metric shipped with \pTeX. 
 %</en>
-%<*ja>
+%<*ja> 
 \item[\tt jfm-min.lua] \pTeX に同梱されているデフォルトの和文用TFM
-  である \verb+min10.tfm+ に相当するJFMである.このJFMと他の2つのJFMの間には
-  表\ref{tab-difjfm}に示すような特筆すべき違いがある.
+  である \verb+min10.tfm+ に相当する.
 %</ja>
 \end{description}
-
 %<*en>
-\item[jfmvar=<string>] Sometimes there is a need that \ldots.
+The difference among these three~JFMs is  shown in Table~\ref{tab-difjfm}.
 %</en>
 %<*ja>
-\item[jfmvar=<string>] 標準では,JFMとサイズが同じで,
-  実フォントだけが異なる2つの和文フォントは「区別されない」.例えば
-下の例において,最初の「)」と「【」の実フォントは異なるが,
-JFMもサイズも同じなので,普通に「)【」と入力した時と同じように半角空きとなる.
-
-しかし,時には……
-
+これら3つのJFMの違いは表\ref{tab-difjfm}に示した.
 %</ja>
+
+\begin{figure}
 \begin{LTXexample}[width=0.3\textwidth]
 \ltjsetparameter{differentjfm=both}
 \jfont\F=file:KozMinPr6N-Regular.otf:jfm=ujis
 \jfont\G=file:KozGoPr6N-Medium.otf:jfm=ujis
 \jfont\H=file:KozGoPr6N-Medium.otf:jfm=ujis;jfmvar=hoge
-
 \F ){\G 【】}( % halfwidth space
    ){\H 『』}( % fullwidth space
 
+ほげ,{\G 「ほげ」}(ほげ)\par
+ほげ,{\H 「ほげ」}(ほげ)% pTeX-like
+
 \ltjsetparameter{differentjfm=paverage}
 \end{LTXexample}
+\caption{Example of \texttt{jfmvar} key}
+\label{fig:jfmvar}
+\end{figure}
+
+%<*en>
+\item[jfmvar=<string>] Sometimes there is a need that \ldots.
+%</en>
+%<*ja>
+\item[jfmvar=<string>] 標準では,JFMとサイズが同じで,
+  実フォントだけが異なる2つの和文フォントは「区別されない」.例えば
+図\ref{fig:jfmvar}において,最初の「)」と「【」の実フォントは異なるが,
+JFMもサイズも同じなので,普通に「)【」と入力した時と同じように半角空きとなる.
+
+しかし,JFMとサイズが同じであっても,\texttt{jfmvar} キーの異なる
+2つの和文フォント,例えば図\ref{fig:jfmvar}で言う \verb+\F+ と \verb+\H+,
+は「区別される」.異なる和文フォントに異なる \texttt{jfmvar} キーを割り当て,
+かつ\Param{differentjfm}パラメータを \texttt{both} に設定すれば,
+\pTeX と似た状況で組版されることになる.
+%</ja>
 \end{list}
 
 \begin{figure}
@@ -2623,7 +2667,7 @@ because of the compatibility with previous versions of \LuaTeX-ja.
 図\ref{fig:kern-jfm}を参照.
 \begin{itemize}
  \item \emph{\texttt{\textbackslash jfont} や,
-NFSS2用の命令(\ref{ssub-chgfnt}節,\ref{ssub-nfsspat}節)における指定では
+NFSS2用の命令(\ref{ssec-chgfnt}節,\ref{ssec-nfsspat}節)における指定では
 カーニング情報は標準で使用する}ことになっているようである.
 言い換えれば,カーニング情報を使用しない設定にするには,面倒でも
 \begin{verbatim}
@@ -3050,8 +3094,8 @@ Furthermore, the glyph is shifted according to values of fields
 \medskip
 
 \caption{%
-%<en>The position of the real glyph.
-%<ja>「実際の」グリフの位置
+%<en>The position of the real glyph
+%<ja>「実際の」グリフの位置
 }
 \label{fig-pos}
 \end{figure}
@@ -3357,6 +3401,7 @@ you can set both \verb+\fam+ and \verb+\jfam+ to the same value.
 %<en>\caption{Commands for Japanese math fonts}
 %<ja>\caption{和文数式フォントに対する命令}
 \label{tab-math}
+%<en>\medskip
 \centering
 \def\{{\char`\{}\def\}{\char`\}}\small
 \begin{tabular}{ll}
@@ -4250,30 +4295,19 @@ are typeset by \verb+\piyo+.
 
 %<en>\subsection{Patch for NFSS2}
 %<ja>\subsection{NFSS2へのパッチ}
-\label{ssub-nfsspat}
+\label{ssec-nfsspat}
 
 \begin{figure}[!tb]
-\begin{lstlisting}[numberstyle=\tiny, numbers=left, numbersep=1em]
-\DeclareKanjiFamily{JY3}{edm}{}
-\DeclareFontShape{JY3}{edm}{m}{n}    {<-> s*KozMinPr6N-Regular:jfm=ujis;-kern}{}
-\DeclareFontShape{JY3}{edm}{m}{green}{<-> s*KozMinPr6N-Regular:jfm=ujis;-kern;color=007F00}{}
-\DeclareFontShape{JY3}{edm}{m}{blue} {<-> s*KozMinPr6N-Regular:jfm=ujis;-kern;color=0000FF}{}
-\DeclareAlternateKanjiFont{JY3}{edm}{m}{n}{JY3}{edm}{m}{green}{"4E00-"67FF,{-2}-{-2}}
-\DeclareAlternateKanjiFont{JY3}{edm}{m}{n}{JY3}{edm}{m}{blue}{ "6800-"9FFF}
-{\kanjifamily{edm}\selectfont
-日本国民は、正当に選挙された国会における代表者を通じて行動し、……}
-\end{lstlisting}
-\begin{quote}
+\begin{LTXexample}[pos=b]
 \DeclareKanjiFamily{JY3}{edm}{}
-\DeclareFontShape{JY3}{edm}{m}{n}    {<-> s*KozMinPr6N-Regular:jfm=ujis;-kern}{}
-\DeclareFontShape{JY3}{edm}{m}{green}{<-> s*KozMinPr6N-Regular:jfm=ujis;-kern;color=007F00}{}
-\DeclareFontShape{JY3}{edm}{m}{blue} {<-> s*KozMinPr6N-Regular:jfm=ujis;-kern;color=0000FF}{}
+\DeclareFontShape{JY3}{edm}{m}{n}    {<-> s*KozMinPr6N-Regular:jfm=ujis;}{}
+\DeclareFontShape{JY3}{edm}{m}{green}{<-> s*KozMinPr6N-Regular:jfm=ujis;color=007F00}{}
+\DeclareFontShape{JY3}{edm}{m}{blue} {<-> s*KozMinPr6N-Regular:jfm=ujis;color=0000FF}{}
 \DeclareAlternateKanjiFont{JY3}{edm}{m}{n}{JY3}{edm}{m}{green}{"4E00-"67FF,{-2}-{-2}}
 \DeclareAlternateKanjiFont{JY3}{edm}{m}{n}{JY3}{edm}{m}{blue}{ "6800-"9FFF}
-
 {\kanjifamily{edm}\selectfont
 日本国民は、正当に選挙された国会における代表者を通じて行動し、……}
-\end{quote}
+\end{LTXexample}
 %<ja>\caption{\texttt{\textbackslash DeclareAlternateKanjiFont} の使用例}
 %<en>\caption{An example of \texttt{\textbackslash DeclareAlternateKanjiFont}}
 \label{fig:altkanji}
@@ -4283,13 +4317,13 @@ are typeset by \verb+\piyo+.
 Japanese patch for NFSS2 in \LuaTeX-ja
 is based on \texttt{plfonts.dtx} which plays the same role in \pLaTeXe.
 We will describe
-commands which are not described in Subsection~\ref{ssub-chgfnt}.
+commands which are not described in Subsection~\ref{ssec-chgfnt}.
 %</en>
 %<*ja>
 \LuaTeX-jaのNFSS2への日本語パッチは
 \pLaTeXe で同様の役割を果たす \texttt{plfonts.dtx} をベースに,
 和文エンコーディングの管理等をLuaで書きなおしたものである.
-ここでは\ref{ssub-chgfnt}節で述べていなかった命令について
+ここでは\ref{ssec-chgfnt}節で述べていなかった命令について
 記述しておく.
 %</ja>
 
@@ -4527,7 +4561,7 @@ In this case, the default family for font substitution is used for
 \item[DeclareAlternateKanjiFont\{<base-encoding>\}\{<base-family>\}\{<base-series>\}\{<base-shape>\}\\
   \null\hfill\{<alt-encoding>\}\{<alt-family>\}\{<alt-series>\}\{<alt-shape>\}\{<range>\}]
 %<*ja>
-\ref{ssec-altfont}節の
+\ref{ssec-altfont}節の\
 \verb+\ltjdeclarealtfont+ と同様に,前半の4引数の和文フォント(基底フォント)のうち<range>中の文字を
 第5--第8引数の和文フォントを使って組むように指示する.使用例を図\ref{fig:altkanji}に載せた.
 
@@ -4605,6 +4639,7 @@ by \verb+\input+.
 \verb+\input+ で読み込み可能である.
 %</ja>
 \subsection{\texttt{luatexja-fontspec.sty}}
+\label{ssec-fontspec2}
 %<*en>
 As described in Subsection~\ref{ssec-fontspec}, this optional package
 provides the counterparts for several commands defined in the
@@ -4651,6 +4686,60 @@ will not be embedded in the output PDF file. See Subsection~\ref{ssec-psft}.
 これを指定することで,PDFに埋め込まれない「名前だけ」のフォントを指定することが
 できる.\ref{ssec-psft}節を参照.
 %</ja>
+
+
+\begin{figure}[!tb]
+\begin{LTXexample}[pos=b]
+\jfontspec[
+  AltFont={
+    {Range="4E00-"67FF, Color=007F00},
+    {Range="6800-"9EFF, Color=0000FF},
+    {Range="3040-"306F, Font=KozGoPr6N-Regular},
+  }
+]{KozMinPr6N-Regular}
+日本国民は、正当に選挙された国会における代表者を通じて行動し、われらとわれらの子孫のために、
+諸国民との協和による成果と、わが国全土にわたつて自由のもたらす恵沢を確保し、……
+\end{LTXexample}
+%<ja>\caption{\texttt{AltFont} の使用例}
+%<en>\caption{An example of \texttt{AltFont}}
+\label{fig:altkanji-fontspec}
+\end{figure}
+
+\item[AltFont]\ 
+
+%<*en>
+As \verb+\ltjdeclarealtfont+~(Subsection~\ref{ssec-altfont}) and
+\verb+\DeclareAlternateKanjiFont+~(Subsection~\ref{ssec-nfsspat}),
+with this key, one can typeset some Japanese characters 
+by a different font and/or using different features.
+The \texttt{AltFont} feature takes a comma-separated list of comma-separated lists,
+as the following:
+%</en>
+%<*ja>
+\ref{ssec-altfont}節の \verb+\ltjdeclarealtfont+ や,
+\ref{ssec-nfsspat}節の \verb+\DeclareAlternateKanjiFont+ と同様に,
+このキーを用いると一部の文字を異なったフォントやfont featureを使って組むことができる.
+\texttt{AltFont} に指定する値は,次のように二重のコンマ区切りリストである:
+%</ja>
+\begin{lstlisting}[escapechar=\#]
+AltFont = {
+  ...
+  { Range=#\LARG range>#, #\LARG features>#},
+  { Range=#\LARG range>#, Font=#\LARG font~name>#, #\LARG features># },
+  { Range=#\LARG range>#, Font=#\LARG font~name># },
+  ...
+}
+\end{lstlisting}
+%<*en>
+Each sublist should have the \texttt{Range} key
+(sublist which does not contain \texttt{Range} key is simply ignored).
+A demonstrartion is shown in Figure~\ref{fig:altkanji-fontspec}.
+%</en>
+%<*ja>
+各部分リストには \texttt{Range} キーが必須である(含まれない部分リストは
+単純に無視される).
+指定例は図\ref{fig:altkanji-fontspec}に示した.
+%</ja>
 \end{list}
 
 %<*ja>
@@ -4659,7 +4748,6 @@ will not be embedded in the output PDF file. See Subsection~\ref{ssec-psft}.
 %</ja>
 
 
-
 \subsection{\texttt{luatexja-otf.sty}}
 \label{ssec-ltjotf}
 %<*en>
@@ -4904,15 +4992,113 @@ for making the difference obvious.
 \item[\textsf{adjust}\,=<bool>] \verb+\ltjsetparameter+ で指定可能な追加パラメータであり,
 <bool>が\textit{true}なら \verb+\ltjenableadjust+ を,
 そうでなければ \verb+\ltjdisableadjust+ を実行する.
-
-
 \end{list}
+%</ja>
+
+\subsection{\texttt{luatexja-ruby.sty}}
+%<*en>
+This addon package provides functionality of ``ruby'' (\emph{furigana}) annotations 
+using callbacks of \LuaTeX-ja. 
+There is no detailed manual of \Pkg{luatexja-ruby.sty} in English.
+(Japanese manual is another PDF file, \url{luatexja-ruby.pdf}.) 
+%</en>
+%<*ja>
+この追加パッケージは,\LuaTeX-jaの機能を利用したルビ(振り仮名)の組版機能を提供する.
+前後の文字種に応じた前後への自動進入や,
+行頭形・行中形・行末形の自動的な使い分けが特徴である.
 
+ルビ組版に設定可能な項目や注意事項が多いため,本追加パッケージの詳細な説明は
+使用例と共に \url{luatexja-ruby.pdf}\ という別ファイルに載せている.
+この節では簡単な使用方法のみ述べる.
+%</ja>
 
+\begin{description}
+%<*en>
+ \item[Group-ruby]
+By default, ruby characters (the second argument of \verb+\ruby+)
+are attached to base characters (the first argument), as one object.
+This type of ruby is called \emph{group-ruby}.
+%</en>
+%<*ja>
+ \item[グループルビ] 標準ではグループルビの形で組まれる.第1引数に親文字,
+第2引数にルビを記述する.
+%</ja>
+\begin{LTXexample}[width=0.3\textwidth]
+東西線\ruby{妙典}{みようでん}駅は……\\
+東西線の\ruby{妙典}{みようでん}駅は……\\
+東西線の\ruby{妙典}{みようでん}という駅……\\
+東西線\ruby{葛西}{かさい}駅は……
+\end{LTXexample}
+%<*en> 
+As the above example, ruby hangover is allowed on the Hiragana before/after 
+its base characters.
+%</en>
+%<ja> この例のように,標準では前後の平仮名にルビ全角までかかるようになっている.
 
+%<*en>
+\item[Mono-ruby]
+To attach ruby characters to each base characters (\emph{mono-ruby}),
+one should use \verb+\ruby+ multiple times:
+%</en>
+%<*ja>
+ \item[モノルビ] 親文字を1文字にするとモノルビとなる.
+2文字以上の熟語をモノルビの形で組みたい場合は,面倒でも
+その数だけ \verb+\ruby+ を書く必要がある.
+%</ja>
+\begin{LTXexample}[width=0.3\textwidth]
+東西線の\ruby{妙}{みよう}\ruby{典}{でん}駅は……
+\end{LTXexample}
 
+%<*en>
+ \item[Jukugo-ruby]
+Vertical bar~\verb+|+ denotes a boundary of \emph{groups}.
+%</en>
+%<*ja>
+ \item[熟語ルビ] 引数内の縦棒 \verb+|+ はグループの区切りを表し,
+複数グループのルビは熟語ルビとして組まれる.
+\cite{x4051}にあるように,
+どのグループでも「親文字」が対応するルビ以上の長さの場合は
+各グループごとに,そうでないときは全体をまとめて1つのグループルビとして組まれる.
+\cite{jlreq}で規定されている組み方とは異なるので注意.
+%</ja>
+\begin{LTXexample}
+\ruby{妙|典}{みよう|でん}\
+\ruby{葛|西}{か|さい}\
+\ruby{神楽|坂}{かぐら|ざか}
+\end{LTXexample}
+%<*en>
+If there are multiple groups in one \verb+\ruby+ call,
+A linebreak between two groups is allowed.
+%</en>
+%<ja> 複数ルビではグループとグループの間で改行が可能である.
+\begin{LTXexample}[width=0.3\textwidth]
+\vbox{\hsize=6\zw\noindent
+  \hbox to 2.5\zw{}\ruby{京|急|蒲|田}{けい|きゆう|かま|た}
+  \hbox to 2.5\zw{}\ruby{京|急|蒲|田}{けい|きゆう|かま|た}
+  \hbox to   3\zw{}\ruby{京|急|蒲|田}{けい|きゆう|かま|た}
+}
+\end{LTXexample}
+\end{description}
 
+%<*en>
+If the width of ruby characters are longer than that of base characters,
+\verb+\ruby+ automatically selects the appropriate form
+among the line-head form, the line-middle form, and the line-end form.
+%</en>
+%<*ja>
+また,ルビ文字のほうが親文字よりも長い場合は,自動的に
+行頭形・行中形・行末形のいずれか適切なものを選択する.
 %</ja>
+\begin{LTXexample}[width=0.3\textwidth]
+\vbox{\hsize=8\zw\noindent
+\null\kern3\zw ……を\ruby{承}{うけたまわ}る
+     \kern1\zw ……を\ruby{承}{うけたまわ}る\\
+\null\kern5\zw ……を\ruby{承}{うけたまわ}る
+}
+\end{LTXexample}
+
+
+
 
 
 
@@ -5053,15 +5239,15 @@ assigned to this attribute:
 \begin{description}
 \item[\textit{italic} (1)]
 %<*en>
-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{\hyperlink{fld:xks}{xkanjiskip}}.
+Kerns from italic correction (\verb+\/+), or from kerning information of a Japanese font.
+These kerns are ``ignored'' in the insertion process of \textbf{JAglue},
+unlike explicit \verb+\kern+.
 %</en>
 %<*ja>
-イタリック補正(\verb+\/+)によるグルー.このグルーの由来の区別(\verb+\kern+ か
-\hskip\ltjgetparameter{xkanjiskip}
-\verb+\/+ か)は\Param{\hyperlink{fld:xks}{xkanjiskip}}の挿入過程において必要になる.
+イタリック補正(\verb+\/+)によるカーン,
+または \Pkg{luaotfload} によって挿入されたフォントのカーニング情報由来のカーン.
+これらのカーンは通常の \verb+\kern+ とは異なり,
+\textbf{JAglue}の挿入処理においては透過する.
 %</ja>
 
 \item[\textit{packed} (2)]
@@ -6226,6 +6412,7 @@ $a$は禁則処理用に\textit{Nq}と\textit{Np}の間に加えられるべき
 %<en>\caption{Summary of JFM glues}
 %<ja>\caption{JFM グルーの概要}
 \label{tab-jfmglue}
+%<en>\medskip
 \begin{center}
 \small
 \begin{tabular}{c|cccccc}
@@ -6551,7 +6738,7 @@ Consider the following input:
 例えば次のような入力を考えよう:
 %</ja>
 \begin{verbatim*}
-\begin{lstlisting}[escapechar=`\#]
+\begin{lstlisting}[escapechar=\#]
 #\ほげ xぴよ#
 \end{lstlisting}
 \end{verbatim*}
@@ -6582,7 +6769,7 @@ instead of ``\verb+\ほげ+''.
 しかし,\Pkg{lltjp-listings} が実際にロードされるのは \verb+\begin{document}+\ 
 のところであるので,プリアンブル内ではこれらの追加キーは使用できない.
 
-\texttt{ivsraw}は,ブール値の値をとるキーであり,標準ではfalseである.
+\texttt{vsraw}は,ブール値の値をとるキーであり,標準ではfalseである.
 \begin{itemize}
  \item trueの場合は,異体字セレクタは「直前の文字に続けて」出力される.
 もしもIVSサポート(\ref{ssec-ltjotf}節)が有効になっていた場合は,
@@ -6614,7 +6801,9 @@ instead of ``\verb+\ほげ+''.
 }}}
 \lstset{vscmd=\IVSB}
 \end{lstlisting}
-\end{itemize} 
+\end{itemize}
+既定の出力命令を復活させたい場合は\ \verb+vsraw=\ltjlistingsvsstdcmd+\ 
+とすれば良い.
 %</ja>
 
 %<en>\subsection{Class of Characters}
@@ -6915,7 +7104,7 @@ JFM中にある文字クラス$n$の定義の
 %</ja>
 
 %<*ja>
-\section{IVS対応(未完)}
+\section{IVS対応}
 \verb+luatexja.otf.enable_ivs()+ を実行し,IVS対応を有効にした状態では,
 \verb+pre_linebreak_filter+ や \verb+hpack_filter+ コールバックには
 次の4つが順に実行される状態となっている:
@@ -6959,6 +7148,7 @@ OpenTypeフォントでもTrueTypeフォントでもIVS情報が格納されて
 %%% to_table を使わなくしたことで,メモリ使用量は減った
 IVS情報をキャッシュに保存することで2回目以降の実行時間を節約している.
 
+
 \section{複数フォントの「合成」(未完)}
 
 \section{\LuaTeX-jaにおけるキャッシュ}