OSDN Git Service

Update the manual.
[luatex-ja/luatexja.git] / doc / luatexja.dtx
index 25536a1..b1ca377 100644 (file)
@@ -5,7 +5,11 @@
 %<ja> \documentclass[a4paper,titlepage]{ltjsarticle}
 %<zh> \documentclass[a4paper,titlepage]{ltjsarticle}
 
+%%%%%%%%
 \makeatletter
+%%%%%%%%
+
+%%%%%%%% record loaded packages
 \let\ltjpkglist\empty
 \newif\if@real@append@list
 \def\@append@newentry#1#2{{%
   \ifx\@tempa\@tempb\@real@append@listfalse\fi}
 \def\@addtofilelist#1{\@append@newentry\ltjpkglist{#1}}
 \let\@listfiles\empty
-\makeatother
 
 %<*en>
-\usepackage[margin=25mm,footskip=5mm]{geometry}
-\usepackage{mathptmx}
+\usepackage[margin=25mm,footskip=6mm]{geometry}
+\parskip=\smallskipamount
 %</en>
 %<*ja>
-\usepackage[textwidth=45\zw, lines=45, footskip=5mm]{geometry}
+\usepackage[textwidth=45\zw, lines=45, footskip=6mm]{geometry}
 \advance\leftmargini-1\zw\advance\leftmarginii-1\zw
 %</ja>
 %<*zh>
-\usepackage[margin=25mm, footskip=5mm]{geometry}
+\usepackage[textwidth=45\zw, lines=45, footskip=6mm]{geometry}
 \advance\leftmargini-1\zw\advance\leftmarginii-1\zw
 \def\postpartname{编}
 \DeclareYokoKanjiEncoding{ZH}{}{}
 \SetSymbolFont{songti}{bold}{ZH}{hei}{m}{n}
 \DeclareSymbolFontAlphabet{\mathsong}{songti}
 \DeclareMathAlphabet{\mathhei}{ZH}{hei}{m}{n}
-\makeatletter
 \DeclareRobustCommand\songfamily{\not@math@alphabet\songfamily\mathsong\kanjifamily\songdefault\selectfont}
 \DeclareRobustCommand\heifamily{\not@math@alphabet\heifamily\mathhei\kanjifamily\heidefault\selectfont}
 \DeclareRobustCommand\minchofamily{\not@math@alphabet\minchofamily\mathhei\kanjifamily\minchodefault\selectfont}
 \DeclareRobustCommand\rmfamily{\not@math@alphabet\rmfamily\mathrm\romanfamily\rmdefault\kanjifamily\songdefault\selectfont}
 \DeclareRobustCommand\sffamily{\not@math@alphabet\sffamily\mathsf\romanfamily\sfdefault\kanjifamily\heidefault\selectfont}
-\makeatother
 %</zh>
 
-\usepackage{amsmath,amssymb,xcolor,pict2e,multienum,amsthm,float}
-\usepackage{booktabs,listings,showexpl,multicol,metalogo}
-\usepackage{luatexja-otf}
-\usepackage[jis2004]{luatexja-preset}
+\usepackage{amsmath,tikz,pict2e,multienum,float}
+\usepackage{booktabs,multicol}
+
+%%%%%%%% listings
+\usepackage{listings,showexpl}
+\lstset{
+  basicstyle=\ttfamily\small, pos=r, breaklines=true,
+  numbers=none, rframe={}, basewidth=0.5em, numberstyle=\tiny, numbersep=0.5em,
+  explpreset={numberstyle=\tiny, numbers=left, numbersep=1em}
+}
+% Suppress output from showexpl to stdout.
+\let\SX@Info\relax
+
+%%%%%%%% hyperref
 \usepackage{hyperref}
+%<*en>
+\title{The \LuaTeX-ja package}
+\author{The \LuaTeX-ja project team}
+%</en>
+%<*ja>
+\title{\LuaTeX-jaパッケージ}
+\author{\LuaTeX-jaプロジェクトチーム}
+%</ja>
+%<*zh>
+\title{\LuaTeX-ja宏包}
+\author{\LuaTeX-ja项目团队}
+%</zh>
 \hypersetup{%
        unicode,
        colorlinks,
        pdftitle={LuaTeX-ja宏包}
 %</zh>
 }
-\usepackage[all]{xy}
-%<ja> \SelectTips{cm}{}
+
+%%%%%%%% definition env.
+\usepackage{amsthm}
+\theoremstyle{definition}
+%<en>\newtheorem{defn}{Definition}
+%<ja>\newtheorem{defn}{定義}
+%<zh>\newtheorem{defn}{定义}
+
+%%%%%%%% fonts
+\usepackage{luatexja-otf}
+\usepackage[jis2004]{luatexja-preset}
+%<!en>\usepackage{amssymb}
 %<*en>
+\usepackage{unicode-math}
 \setmainfont[Ligatures=TeX]{TeX Gyre Termes}
 \setsansfont[Ligatures=TeX]{TeX Gyre Heros}
+\setmathfont{xits-math.otf}
 \frenchspacing
 %</en>
-\def\labelenumii{(\arabic{enumii})}
 
+%%%%%%%% logo
+\usepackage{metalogo}
 \DeclareRobustCommand\eTeX{\ensuremath{\varepsilon}-\kern-.125em\TeX}
 \DeclareRobustCommand\LuaTeX{Lua\TeX}
 \DeclareRobustCommand\pdfTeX{pdf\TeX}
 \DeclareRobustCommand\pLaTeXe{p\kern-.05em\LaTeXe}
 \DeclareRobustCommand\epTeX{\ensuremath{\varepsilon}-\kern-.125em\pTeX}
 
-\theoremstyle{definition}
-%<en>\newtheorem{defn}{Definition}
-%<ja>\newtheorem{defn}{定義}
-%<zh>\newtheorem{defn}{定义}
-
+%%%%%%%% other macros
 \newenvironment{cslist}{%
   \leftskip2em\parindent=0pt\def\makelabel##1{{\tt\char92##1}}
   \def\{{\char`\{}\def\}{\char`\}}
   \def\item[##1]{\par\smallskip\par\hskip-\leftskip\makelabel{##1}\par}
 }{}
 
-\makeatletter
+\def\labelenumii{(\arabic{enumii})}
 \long\def\@makecaption#1#2{%
   \vskip\abovecaptionskip
   \sbox\@tempboxa{{\small #1. #2}}%
     \hb@xt@\hsize{\hfil\box\@tempboxa\hfil}%
   \fi
   \vskip\belowcaptionskip}
-% Suppress output from showexpl to stdout.
-\let\SX@Info\relax
+
+%%%%%%%%
 \makeatother
+%%%%%%%%
 
 \def\Node#1#2{\,\vcenter{\hbox{\fboxsep=1pt\fbox{\vbox{\small\halign{\hfil##\hfil\cr
   #1\mathstrut\cr\noalign{\hrule height.4pt}\strut#2\cr}}}}\,}}
 
-%<*en>
-\title{The \LuaTeX-ja package}
-\author{The \LuaTeX-ja project team}
-%</en>
-%<*ja>
-\title{\LuaTeX-jaパッケージ}
-\author{\LuaTeX-jaプロジェクトチーム}
-%</ja>
-%<*zh>
-\title{\LuaTeX-ja宏包}
-\author{\LuaTeX-ja项目团队}
-%</zh>
-\lstset{
-  basicstyle=\ttfamily\small, pos=r, breaklines=true,
-  numbers=none, rframe={}, basewidth=0.5em
-}
-
-\parskip=\smallskipamount
 \protected\def\Param#1{\textsf{#1}} % parameter name
 \protected\def\Pkg#1{\underline{\smash{\texttt{#1}}}} % packages/classes
 
+
 \begin{document}
 \catcode`\<=13
 \def<#1>{{\normalfont\rm\itshape$\langle$#1$\rangle$}}
@@ -547,7 +563,7 @@ We say `alphabetic fonts' for fonts used in \textbf{ALchar}, and `Japanese fonts
       means a package or a class of \LaTeX.
 %</en>
 %<*ja>
-\item ä¸\8bç·\9aä»\98ã\81\8dã\81®ã\82¿ã\82¤ã\83\97ã\83©ã\82¤ã\82¿ä½\93ã\81§æ\9b¸ã\81\8bã\82\8cã\81\9f語(例:\Pkg{fontspec})は\LaTeX の
+\item ä¸\8bç·\9aä»\98ã\81\8dã\82¿ã\82¤ã\83\97ã\83©ã\82¤ã\82¿ä½\93ã\81®語(例:\Pkg{fontspec})は\LaTeX の
       パッケージやクラスを表す.
 %</ja>
 %<*zh>
@@ -1117,94 +1133,6 @@ Okumura), namely, \Pkg{ltjclasses} and \Pkg{ltjsclasses}.
 \subsection{plain \TeX~and~\LaTeXe}
 \label{ssub-chgfnt}
 
-%<*en>
-\paragraph{Remark: Japanese Characters in Math Mode}
-Since \pTeX\ supports Japanese characters in math mode, there are
-sources like the following:
-%</en>
-%<*ja>
-\paragraph{意見:数式モード中の和文文字}
-\pTeX では,特に何もしないでも数式中に和文文字を記述することができた.そのため,
-以下のようなソースが見られた:
-%</ja>
-%<*zh>
-\paragraph{注记:数学模式下的日文字符}
-\pTeX 支持在数学模式下的日文字符,如以下源码:
-%</zh>
-
-\begin{LTXexample}
-$f_{高温}$~($f_{\text{high temperature}}$).
-\[ y=(x-1)^2+2\quad よって\quad y>0 \]
-$5\in 素:=\{\,p\in\mathbb N:\text{$p$ is a prime}\,\}$.
-\end{LTXexample}
-%<*en>
-We (the project members of \LuaTeX-ja) think that using
-Japanese characters in math mode are allowed if and only if these are used as identifiers.
-In this point of view,
-%</en>
-%<*ja>
-\LuaTeX-jaプロジェクトでは,数式モード中での和文文字はそれらが識別子として用いられる
-ときのみ許されると考えている.
-この観点から,
-%</ja>
-%<*zh>
-我们(\LuaTeX-ja项目成员)认为在数学模式下使用日文字符,只有在这些字符充当标识符时才是正确的。在这点下:
-%</zh>
-\begin{itemize}
-%<*en>
-\item The lines 1~and~2 above are not correct, since `高温' in above is used as a textual label, and
-`よって' is used as a conjunction.
-%</en>
-%<*ja>
-\item 上記数式のうち1, 2行目は正しくない.なぜならば`高温'が意味のあるラベルと
-      して,`よって'が接続詞として用いられているからである.
-%</ja>
-%<*zh>
-\item 第1行和第2行是不正确的,因为“高温”的作用为文本标签,“よって”用作为连词。
-%</zh>
-%<*en>
-\item However, the line~3 is correct, since `素' is used as an identifier.
-%</en>
-%<*ja>
-\item しかしながら,3行目は`素'が識別子として用いられているので正しい.
-%</ja>
-%<*zh>
-\item 不过,第3行是正确的,因为“素”是作为标识符的。
-%</zh>
-\end{itemize}
-%<*en>
-Hence, in our opinion, the above input should be corrected as:
-%</en>
-%<*ja>
-したがって,\LuaTeX-jaプロジェクトの意見としては,上記の入力は次のように直されるべき
-である:
-%</ja>
-%<*zh>
-那么,根据我们的观点,上述输入应当校正为:
-%</zh>
-\begin{LTXexample}
-$f_{\text{高温}}$~%
-($f_{\text{high temperature}}$).
-\[ y=(x-1)^2+2\quad
-  \mathrel{\text{よって}}\quad y>0 \]
-$5\in 素:=\{\,p\in\mathbb N:\text{$p$ is a prime}\,\}$.
-\end{LTXexample}
-%BUG?: \{\}がなければ「素」がでない.上の段落の「よって」もでてない.
-%<*en>
-We also believe that using Japanese characters as identifiers is rare,
-hence we don't describe how to change Japanese fonts in math mode in
-this chapter. For the method, please see Subsection~\ref{ssec-math}.
-%</en>
-%<*ja>
-また\LuaTeX-jaプロジェクトでは,和文文字が識別子として用いられることはほとんどない
-と考えており,したがってこの節では数式モード中の和文フォントを変更する方法については
-記述しない.この方法については\ref{ssec-math}節を参照のこと.
-%</ja>
-%<*zh>
-我们也认为使用日文字符作为标识符的情况极为少见,所以我们不在此章节描述如何在数学模式下改变日文字体。
-关于此方法,请参见\ref{ssec-math}。
-%</zh>
-
 \paragraph{plain \TeX}
 %<*en>
 To change Japanese fonts in plain \TeX, you must use the primitive
@@ -1353,6 +1281,94 @@ auto select&\verb+\fontencoding+&\verb+\fontfamily+&---&---&\verb+\usefont+\\
 %</zh>
 \end{itemize}
 
+%<*en>
+\paragraph{Remark: Japanese Characters in Math Mode}
+Since \pTeX\ supports Japanese characters in math mode, there are
+sources like the following:
+%</en>
+%<*ja>
+\paragraph{注意:数式モード中の和文文字}
+\pTeX では,特に何もしないでも数式中に和文文字を記述することができた.そのため,
+以下のようなソースが見られた:
+%</ja>
+%<*zh>
+\paragraph{注记:数学模式下的日文字符}
+\pTeX 支持在数学模式下的日文字符,如以下源码:
+%</zh>
+
+\begin{LTXexample}
+$f_{高温}$~($f_{\text{high temperature}}$).
+\[ y=(x-1)^2+2\quad よって\quad y>0 \]
+$5\in 素:=\{\,p\in\mathbb N:\text{$p$ is a prime}\,\}$.
+\end{LTXexample}
+%<*en>
+We (the project members of \LuaTeX-ja) think that using
+Japanese characters in math mode are allowed if and only if these are used as identifiers.
+In this point of view,
+%</en>
+%<*ja>
+\LuaTeX-jaプロジェクトでは,数式モード中での和文文字はそれらが識別子として用いられる
+ときのみ許されると考えている.
+この観点から,
+%</ja>
+%<*zh>
+我们(\LuaTeX-ja项目成员)认为在数学模式下使用日文字符,只有在这些字符充当标识符时才是正确的。在这点下:
+%</zh>
+\begin{itemize}
+%<*en>
+\item The lines 1~and~2 above are not correct, since `高温' in above is used as a textual label, and
+`よって' is used as a conjunction.
+%</en>
+%<*ja>
+\item 上記数式のうち1, 2行目は正しくない.なぜならば`高温'が意味のあるラベルと
+      して,`よって'が接続詞として用いられているからである.
+%</ja>
+%<*zh>
+\item 第1行和第2行是不正确的,因为“高温”的作用为文本标签,“よって”用作为连词。
+%</zh>
+%<*en>
+\item However, the line~3 is correct, since `素' is used as an identifier.
+%</en>
+%<*ja>
+\item しかしながら,3行目は`素'が識別子として用いられているので正しい.
+%</ja>
+%<*zh>
+\item 不过,第3行是正确的,因为“素”是作为标识符的。
+%</zh>
+\end{itemize}
+%<*en>
+Hence, in our opinion, the above input should be corrected as:
+%</en>
+%<*ja>
+したがって,\LuaTeX-jaプロジェクトの意見としては,上記の入力は次のように直されるべき
+である:
+%</ja>
+%<*zh>
+那么,根据我们的观点,上述输入应当校正为:
+%</zh>
+\begin{LTXexample}
+$f_{\text{高温}}$~%
+($f_{\text{high temperature}}$).
+\[ y=(x-1)^2+2\quad
+  \mathrel{\text{よって}}\quad y>0 \]
+$5\in 素:=\{\,p\in\mathbb N:\text{$p$ is a prime}\,\}$.
+\end{LTXexample}
+%BUG?: \{\}がなければ「素」がでない.上の段落の「よって」もでてない.
+%<*en>
+We also believe that using Japanese characters as identifiers is rare,
+hence we don't describe how to change Japanese fonts in math mode in
+this chapter. For the method, please see Subsection~\ref{ssec-math}.
+%</en>
+%<*ja>
+また\LuaTeX-jaプロジェクトでは,和文文字が識別子として用いられることはほとんどない
+と考えており,したがってこの節では数式モード中の和文フォントを変更する方法については
+記述しない.この方法については\ref{ssec-math}節を参照のこと.
+%</ja>
+%<*zh>
+我们也认为使用日文字符作为标识符的情况极为少见,所以我们不在此章节描述如何在数学模式下改变日文字体。
+关于此方法,请参见\ref{ssec-math}。
+%</zh>
+
 \subsection{fontspec}
 \label{ssec-fontspec}
 %<*en>
@@ -1436,7 +1452,7 @@ alphabetic fonts
 %</zh>
 
 \begin{LTXexample}
-\fontspec[Numbers=OldStyle]{TeX Gyre Termes}
+\fontspec[Numbers=OldStyle]{LMSans10-Regular}
 \jfontspec{IPAexMincho}
 JIS~X~0213:2004→辻
 
@@ -1462,40 +1478,120 @@ featureが\textbf{JAglue}と衝突するためである(\ref{para-kern}節を
 另注意,出格特性在这7个命令中默认关闭,因为此特性会与\textbf{JAglue}冲突(参见\ref{para-kern})。
 %</zh>
 
-
-\subsection{プリセット設定}
+%<en>\subsection{Preset}
+%<ja>\subsection{プリセット設定}
 \label{ssec-preset}
 
+%<*en>
+To use standard Japanese font settings easily, one can load \Pkg{luatexja-preset}
+package with several options. This package provides functions in a part of
+\Pkg{otf} package and a part of \Pkg{PXchfon} package by Takayuki Yato,
+and loads \Pkg{luatexja-fontspec} internally.
+%</en>
+%<*ja>
 よく使われている和文フォント設定を一行で指定できるようにしたのが
 \Pkg{luatexja-preset}パッケージである.このパッケージは,
 \Pkg{otf}パッケージの一部機能と八登崇之氏による\Pkg{PXchfon}パッケージの一部機能とを
 合わせたような格好をしており,内部で\Pkg{luatexja-fontspec}を読み込んでいる.
+%</ja>
 
-\paragraph{一般的なオプション}
+%<en>\paragraph{General options}
+%<ja>\paragraph{一般的なオプション}
 \begin{list}{}{\def\makelabel{\ttfamily}\def\{{\char`\{}\def\}{\char`\}}\advance\leftmargin1\zw}
-\item[deluxe] 明朝体2ウェイト・ゴシック体3ウェイトと,
+\item[deluxe]
+%<*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}, 
+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
+bold (\verb+\bfseries+).
+%</en>
+%<*ja>
+明朝体2ウェイト・ゴシック体3ウェイトと,
 丸ゴシック体 (\verb+\mgfamily+) を使用可能とする.
 ゴシック体は細字・太字・極太の3ウェイトがあるが,極太ゴシック体はファミリの切り替え (\verb+\gtebfamily+) %
 で実現している.\Pkg{fontspec}では通常 (\verb+\mdseries+) と太字 (\verb+\bfseries+) しか扱えないために
 このような中途半端な実装になっている.
-\item[expert] 横組専用仮名を用いる.また,\verb+\rubyfamily+ でルビ用仮名が使用可能となる.
-\item[bold] 明朝の太字をゴシック体の太字とする.
-\item[90jis] 出来る限り90JISの字形を使う.
-\item[jis2004] 出来る限りJIS2004の字形を使う.
-\item[jis] 用いるJFMを \texttt{jfm-jis.lua} とする.このオプションがない時は
-\LuaTeX-ja標準の \texttt{jfm-ujis.lua} が用いられる.
+%</ja>
+\item[expert]
+%<*en>
+Use horizontal kana alternates, and define a control sequence \verb+\rubyfamily+ to use kana
+characters designed for ruby.
+%</en>
+%<*ja>
+横組専用仮名を用いる.また,\verb+\rubyfamily+ でルビ用仮名が使用可能となる.
+%</ja>
+\item[bold]
+%<*en>
+Use bold gothic as bold mincho.
+%</en>
+%<*ja>
+明朝の太字をゴシック体の太字とする.
+%</ja>
+\item[90jis]
+%<*en>
+Use 90JIS glyphs if possible.
+%</en>
+%<*ja>
+出来る限り90JISの字形を使う.
+%</ja>
+\item[jis2004]
+%<*en>
+Use JIS2004 glyphs if possible.
+%</en>
+%<*ja>
+出来る限りJIS2004の字形を使う.
+%</ja>
+\item[jis]
+%<*en>
+Use the JFM \texttt{jfm-jis.lua}, instead of the default JFM of 
+\LuaTeX-ja, \texttt{jfm-ujis.lua}.
+%</en>
+%<*ja>
+用いるJFMを\texttt{jfm-jis.lua}とする.このオプションがない時は
+\LuaTeX-ja標準の\texttt{jfm-ujis.lua}が用いられる.
+%</ja>
 \end{list}
 
-\paragraph{小塚フォント}
+%<en>\paragraph{Kozuka fonts}
+%<ja>\paragraph{小塚フォント}
+%<*en>
+When using single weight, we adopt Kozuka~Gothic~M as \textit{gothic},
+because we think that Kozuka~Gothic~R looks thin.
+There is not `Kozuka Maru Gothic', therefore Kozuka~Gothic~H is used
+as a substitute for \textit{rounded gothic}.
+%</en>
+%<*ja>
 まず,小塚フォントを用いる設定を述べる.
 単ウェイト時のゴシック体は小塚ゴシックRでは細いように感じるので,
 小塚ゴシックMに変更している.
 さらに,丸ゴシック体はないので便宜上小塚ゴシックHで代用している.
+%</ja>
 \begin{center}\small
 \begin{tabular}{llll}
 \toprule
 &\tt kozuka4&\tt kozuka6&\tt kozuka6n\\
 \midrule
+%<*en>
+\bf mincho medium&Kozuka Mincho Pro R&Kozuka Mincho ProVI R&Kozuka Mincho Pr6N R\\
+\bf mincho bold&Kozuka Mincho Pro B&Kozuka Mincho ProVI B&Kozuka Mincho Pr6N B\\
+\midrule
+\bf gothic medium\\
+  without \texttt{deluxe}
+&Kozuka Gothic Pro M&Kozuka Gothic ProVI M&Kozuka Gothic Pr6N M\\
+  multiple weights
+&Kozuka Gothic Pro R&Kozuka Gothic ProVI R&Kozuka Gothic Pr6N R\\
+\midrule
+\bf gothic bold
+&Kozuka Gothic Pro B&Kozuka Gothic ProVI B&Kozuka Gothic Pr6N B\\
+\bf gothic heavy
+&Kozuka Gothic Pro H&Kozuka Gothic ProVI H&Kozuka Gothic Pr6N H\\
+(rounded gothic)
+&Kozuka Gothic Pro H&Kozuka Gothic ProVI H&Kozuka Gothic Pr6N H\\
+%</en>
+%<*ja>
 \gt 明朝体細字&小塚明朝Pro~R&小塚明朝ProVI~R&小塚明朝Pr6N~R\\
 \gt 明朝体太字&小塚明朝Pro~B&小塚明朝ProVI~B&小塚明朝Pr6N~B\\
 \midrule
@@ -1511,13 +1607,20 @@ featureが\textbf{JAglue}と衝突するためである(\ref{para-kern}節を
 &小塚ゴシックPro~H&小塚ゴシックProVI~H&小塚ゴシックPr6N~H\\
 \inhibitglue(丸ゴシック体)\inhibitglue
 &小塚ゴシックPro~H&小塚ゴシックProVI~H&小塚ゴシックPr6N~H\\
+%</ja>
 \bottomrule
 \end{tabular}
 \end{center}
 
-\paragraph{モリサワ・ヒラギノ}
+%<en>\paragraph{Hiragino and Morisawa}
+%<ja>\paragraph{ヒラギノ・モリサワ}
+%<*en>
+Settings for Hiragino fonts:
+%</en>
+%<*ja>
 モリサワ・ヒラギノ用の設定はそのようなことは行っていない.
 まずヒラギノフォントから:
+%</ja>
 % これらは持っているわけではないので,フォント名が
 % 異なっているかもしれません.確認お願いします.
 \begin{center}\small
@@ -1525,6 +1628,21 @@ featureが\textbf{JAglue}と衝突するためである(\ref{para-kern}節を
 \toprule
 &\tt hiragino&\tt hiraginon\\
 \midrule
+%<*en>
+\bf mincho medium&
+Hiragino Mincho Pro W3&Hiragino Mincho Pr6N W3\\
+\bf mincho bold&
+Hiragino Mincho Pro W6&Hiragino Mincho Pr6N W6\\
+\bf gothic medium&
+Hiragino Kaku Gothic Pro W3&Hiragino Kaku Gothic ProN W3\\
+\bf gothic bold&
+Hiragino Kaku Gothic Pro W6&Hiragino Kaku Gothic ProN W6\\
+\bf gothic heavy&
+Hiragino Kaku Gothic Std W8&Hiragino Kaku Gothic StdN W8\\
+\bf rounded gothic&
+Hiragino Maru Gothic Pro W4&Hiragino Maru Gothic ProN W4\\
+%</en>
+%<*ja>
 \gt 明朝体細字&
 ヒラギノ明朝体Pro~W3&ヒラギノ明朝体Pr6N~W3\\
 \gt 明朝体太字&
@@ -1537,16 +1655,36 @@ featureが\textbf{JAglue}と衝突するためである(\ref{para-kern}節を
 ヒラギノ角ゴStd~W8&ヒラギノ角ゴStdN~W8\\
 \gt 丸ゴシック体&
 ヒラギノ丸ゴPro~W4&ヒラギノ丸ゴProN~W4\\
+%</ja>
 \bottomrule
 \end{tabular}
 \end{center}
-
+%<*en>
+Settings for Morisawa fonts:
+%</en>
+%<*ja>
 次はモリサワフォントを用いる設定である:
+%</ja>
 \begin{center}\small
 \begin{tabular}{lll}
 \toprule
 &\tt morisawa4&\tt morisawa6n\\
 \midrule
+%<*en>
+\bf mincho medium&
+Ryumin Pro L-KL&Ryumin Pr6N L-KL\\
+\bf mincho bold&
+Futo Min A101 Pro Bold&Futo Min A101 Pr6N Bold\\
+\bf gothic medium&
+Chu Gothic BBB Pro Med&Chu Gothic BBB Pr6N Med\\
+\bf gothic bold&
+Futo Go B101 Pro Bold&Futo Go B101 Pr6N Bold\\
+\bf gothic heavy&
+Midashi Go Pro MB31&Midashi Go Pr6N MB31\\
+\bf rounded gothic&
+Jun Pro 101&Jun Pr6N 101\\
+%</en>
+%<*ja>
 \gt 明朝体細字&
 リュウミンPro~L-KL&リュウミンPr6N~L-KL\\
 \gt 明朝体太字&
@@ -1559,34 +1697,79 @@ featureが\textbf{JAglue}と衝突するためである(\ref{para-kern}節を
 見出ゴPro~MB31&見出ゴPr6N~MB31\\
 \gt 丸ゴシック体&
 じゅんPro 101&じゅんPr6N 101\\
+%</ja>
 \bottomrule
 \end{tabular}
 \end{center}
 
-\paragraph{単ウェイト用設定}
+%<en>\paragraph{Settings for single weight}
+%<ja>\paragraph{単ウェイト用設定}
+%<*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, 
+if \texttt{deluxe} option is also specified).
+%</en>
+%<*ja>
 次に,単ウェイト用の設定を述べる.この4設定では「細字」「太字」の区別はない.
 また,丸ゴシック体はゴシック体と同じフォントを用いる.
+%</ja>
 \begin{center}\small
 \begin{tabular}{lllll}
 \toprule
 &\tt noembed&\tt ipa&\tt ipaex&\tt ms\\
 \midrule
+%<*en>
+\bf mincho&Ryumin-Light (non-embedded)
+&IPAMincho&IPAexMincho&MS Mincho\\
+\bf gothic&GothicBBB-Medium (non-embedded)
+&IPAGothic&IPAexGothic&MS Gothic\\
+%</en>
+%<*ja>
 \gt 明朝体&Ryumin-Light(非埋込)
 &IPA明朝&IPAex明朝&MS明朝\\
 \gt ゴシック体&GothicBBB-Medium(非埋込)
 &IPAゴシック&IPAexゴシック&MSゴシック\\
+%</ja>
 \bottomrule
 \end{tabular}
 \end{center}
 
-\paragraph{HGフォントの利用}
+%<en>\paragraph{Using HG fonts}
+%<ja>\paragraph{HGフォントの利用}
+%<*en>
+We can use HG~fonts bundled with Microsoft Office for realizing multiple weights in Japanese fonts.
+%</en>
+%<*ja>
 すぐ前に書いた単ウェイト用設定を,Microsoft Office等に付属するHGフォントを使って
 多ウェイト化した設定もある.
+%</ja>
 \begin{center}\small
 \begin{tabular}{llll}
 \toprule
 &\tt ipa-dx&\tt ipaex-dx&\tt ms-dx\\
 \midrule
+%<*en>
+\bf mincho medium
+&IPAMincho&IPAexMincho&MS Mincho\\\midrule
+\bf mincho bold&
+\multicolumn{3}{c}{HG Mincho E}\\\midrule
+\bf Gothic medium\\
+~~without \texttt{deluxe}
+&IPAGothic&IPAexGothic&MS Gothic\\
+~~with {\tt jis2004}
+&IPAGothic&IPAexGothic&MS Gothic\\
+\cmidrule(lr){1-4}
+~~otherwise&
+\multicolumn{3}{c}{HG Gothic M}\\\midrule
+\bf gothic bold&
+\multicolumn{3}{c}{HG Gothic E}\\\midrule
+\bf gothic heavy&
+\multicolumn{3}{c}{HG Soei Kaku Gothic UB}\\\midrule
+\bf rounded gothic&
+\multicolumn{3}{c}{HG Maru Gothic PRO}\\
+%</en>
+%<*ja>
 \gt 明朝体細字
 &IPA明朝&IPAex明朝&MS明朝\\\midrule
 \gt 明朝体太字&
@@ -1605,9 +1788,20 @@ featureが\textbf{JAglue}と衝突するためである(\ref{para-kern}節を
 \multicolumn{3}{c}{HG創英角ゴシックUB}\\\midrule
 \gt 丸ゴシック体&
 \multicolumn{3}{c}{HG丸ゴシック体PRO}\\
+%</ja>
 \bottomrule
 \end{tabular}
 \end{center}
+%<*en>
+Note that HG~Mincho~E, HG~Gothic~E, HG Soei Kaku Gothic UB and HG Maru Gothic PRO
+are internally specified by:
+\begin{description}
+\item[default] by font name (\texttt{HGMinchoE}, etc.).
+\item[{\tt 90jis}] by filename (\texttt{hgrme.ttc}, \texttt{hgrge.ttc}, \texttt{hgrsgu.ttc}, \texttt{hgrsmp.ttf}).
+\item[{\tt jis2004}] by filename (\texttt{hgrme04.ttc}, \texttt{hgrge04.ttc}, \texttt{hgrsgu04.ttc}, \texttt{hgrsmp04.ttf}).
+\end{description}
+%</en>
+%<*ja>
 なお,HG明朝E・HGゴシックE・HG創英角ゴシックUB・HG丸ゴシック体PROの4つについては,内部で
 \begin{description}
 \item[標準] フォント名(\texttt{HGMinchoE} など)
@@ -1617,6 +1811,7 @@ featureが\textbf{JAglue}と衝突するためである(\ref{para-kern}節を
 \texttt{hgrme04.ttc}, \texttt{hgrge04.ttc}, \texttt{hgrsgu04.ttc}, \texttt{hgrsmp04.ttf})
 \end{description}
 として指定を行っているので注意すること.
+%</ja>
 
 
 %<*en>
@@ -1662,12 +1857,14 @@ If you want to use these functions, load \Pkg{luatexja-otf} package.
 \item[\texttt{expert}] 仮名が横組・縦組専用のものに切り替わり,ルビ用仮名も扱えるようになる.
 \item[\texttt{bold}] ゴシック体を標準で太いウェイトのものに設定する.
 \end{description}
-これらは,\Pkg{otf}パッケージが文書中で使用する
-和文用TFMを自前の物に置き換えていることで可能になっている.
+しかしこれらのオプションは\Pkg{luatexja-otf}パッケージには存在しない.
+\Pkg{otf}パッケージが文書中で使用する和文用TFMを自前の物に置き換えていたのに対し,
+\Pkg{luatexja-otf}パッケージでは,そのようなことは行わないからである.
 
-一方,\Pkg{luatexja-otf}パッケージでは,文書中で使用する和文用JFMを置き換えることはしない.
-そのため,上に述べた3つのオプションと同等のことを実現するには,\ref{ssub-chgfnt}節 (NFSS2) や
-\ref{ssec-fontspec}節 (\Pkg{fontspec}) によって\textbf{事前に}設定しておかなければならない.
+これら3オプションについては,
+\Pkg{luatexja-preset} パッケージにプリセットを使う時に一緒に指定するか,
+あるいは対応する内容を\ref{ssub-chgfnt}節 (NFSS2) や
+\ref{ssec-fontspec}節 (\Pkg{fontspec}) の方法で手動で指定する必要がある.
 %</ja>
 
 %<en>\section{Changing Parameters}
@@ -4819,8 +5016,8 @@ This problem is resolved by using
 %<zh>\section{日文字符后断行}
 \label{sec-lbreak}
 %<en>\subsection{Reference: Behavior in \pTeX}
-%<ja>\subsection{参考:\pTeX の動作}
-%<zh>\subsection{参考:\pTeX 行为}
+%<ja>\subsection{参考\pTeX の動作}
+%<zh>\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,
@@ -4873,39 +5070,72 @@ after `beginning/ending of a group' characters.
 %</ja>
 
 \begin{figure}[!tb]
-\let\sp\textvisiblespace
-\begin{gather*}
- \xymatrix{&&
-   {\text{scan a cs}}\ar@(r,ul)[dr]&\\
-\ar[r]&
-   *++[o][F-]{N}\ar[ur]^0\ar[dd]_{d,\ g}\ar[u]^{5\ (\texttt{\char92par})}
-     \ar@{->}@(d,l)[ddrr]_(0.45){j}&&
-   *++[o][F-]{S}\ar@(l,dr)[ul]^0\ar@(l,ur)[ddll]_{d,\ g}\ar[u]_{5}
-     \ar@{->}@(r,r)[dd]^{j}\\&\\&
-   *++[o][F-]{M}\ar[uuur]^0\ar@(r,dl)[uurr]_(0.55){10\ (\sp)}
-     \ar[d]_{5\ ({\sp})}\ar@{->}@(dr,dl)[rr]_{j}&&
-   *++[o][F-]{K}\ar@{->}@(ul,d)[uuul]^0\ar@{->}[ll]^{d}
-     \ar@{->}@(ur,dr)[uu]^{10\ (\sp)}\ar@{->}[d]_5\\
-   &&&
- }\\
- d:=\{3,4,6,7,8,11,12,13\},\quad g:=\{1,2\},\quad j:=(\text{Japanese characters})
-\end{gather*}
+\let\sp\textvisiblespace\small
+\begin{minipage}{.6\textwidth}%
+\begin{center}
+\unitlength=6.5mm\sf\mathversion{bold}
+\begin{tikzpicture}[
+  ->, auto, shorten >=1pt
+]
+\node [shape=rectangle, font=\scriptsize] (init) at (2,7) {start};
+\node [shape=circle,draw, fill=blue!20] (newline) at (4,7) {$N$};
+\node [shape=circle,draw, fill=blue!20] (midline) at (4,4) {$M$};
+\node [shape=circle,draw, fill=blue!20] (skipspc) at (8,7) {$S$};
+\node [shape=circle,draw, fill=red!20]  (kanji) at (8,4) {$K$};
+\node [shape=rectangle,draw, fill=green!20] (scanacs) at (6,8) {scan a c.s.};
+\node (endk) at (8,2.5) {} ;
+\node (endm) at (4,2.5) {} ;
+\node (ends) at (8,8.5) {} ;
+\node (endn) at (4,8.5) {} ;
+\begin{scope}[font=\scriptsize]
+\path (newline) edge [bend right]    node [left]{G, O} (midline)
+      (init)    edge                 node {} (newline)
+      (midline) edge [bend right=10] node {10} (skipspc)
+      (skipspc) edge [bend right]    node [left,right=10,above=7]{G, O} (midline)
+      (skipspc) edge [loop right]    node {10} (skipspc)
+      (newline) edge [loop right]    node {10} (newline)
+      (scanacs) edge [bend left]     node [left=3,below]{$(*)$} (skipspc)
+      (scanacs) edge [bend right]    node [right=30,above=20]{$(*)$} (midline)
+      (midline) edge                 node {5\ [\sp]} (endm)
+      (midline) edge [loop left]     node {G, O} (midline)
+      (skipspc) edge                 node [right] {5} (ends)
+      (newline) edge                 node {5 [{\tt\char92par}]} (endn);
+\begin{scope}[red]
+\path (newline) edge [bend right]    node [right=25,below=3]{J} (kanji)
+      (midline) edge                 node [below]{J} (kanji)
+      (kanji)   edge [bend left]     node {O} (midline)
+      (kanji)   edge                 node {10} (skipspc)
+      (kanji)   edge [loop right]    node {G, J} (kanji)
+      (skipspc) edge [bend left]     node {J} (kanji)
+      (kanji)   edge                 node {5} (endk)
+;
+\end{scope}
+\end{scope}
+\end{tikzpicture}
+\end{center}
+\end{minipage}%
+\begin{minipage}{.4\textwidth}
+\begin{description}
+\item[\textsf{G}] Beginning of group (usually \verb+{+)\\
+ and ending of group (usually \verb+}+).
+\item[\textsf{J}] Japanese 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}]}] 
+emits a space, or~\verb+\par+.
+\end{description}
+\end{minipage}
 \begin{itemize}
-%<*en>
-\item Numbers represent category codes.
-%</en>
-%<*ja>
-\item 数字はカテゴリーコードを表わしている.
-%</ja>
-%<*en>
-\item Category codes 9~(ignored), 14~(comment)~and~15~(invalid) are omitted in the above diagram.
-%</en>
-%<*ja>
-\item カテゴリーコード9(無視する文字),14(コメント文字),15(無効文字)は上の図では省かれている.
-%</ja>
-%<*zh>
-\item
-%</zh>
+\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.}). 
+These paths are not shown in the above diagram.
+
+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.}
 %<ja>\caption{\pTeX の入力処理部の状態遷移.}