OSDN Git Service

Update the manual.
[luatex-ja/luatexja.git] / doc / luatexja.dtx
index 3b6e4cd..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>
@@ -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→辻
 
@@ -1469,8 +1485,8 @@ featureが\textbf{JAglue}と衝突するためである(\ref{para-kern}節を
 %<*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.
-Internally, \Pkg{luatexja-preset} loads \Pkg{luatexja-fontspec}.
+\Pkg{otf} package and a part of \Pkg{PXchfon} package by Takayuki Yato,
+and loads \Pkg{luatexja-fontspec} internally.
 %</en>
 %<*ja>
 よく使われている和文フォント設定を一行で指定できるようにしたのが
@@ -1484,13 +1500,13 @@ Internally, \Pkg{luatexja-preset} loads \Pkg{luatexja-fontspec}.
 \begin{list}{}{\def\makelabel{\ttfamily}\def\{{\char`\{}\def\}{\char`\}}\advance\leftmargin1\zw}
 \item[deluxe]
 %<*en>
-Specifying this option enables us to use mincho with two weights,
-gothic with three weights, and round gothic
-(\verb+\mgfamily+, because round gothic is called \textit{maru gothic} in Japanese).
-Gothic has the weights regular, bold and heavy, and one can use the heavy gothic
-by changing family (\verb+\gtebfamily+).
-Since \Pkg{fontspec} package can handle only regular (\verb+\mdseries+) and
-bold (\verb+\bfseries+), this incomplete implementation is provided.
+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ウェイトと,
@@ -1501,7 +1517,7 @@ bold (\verb+\bfseries+), this incomplete implementation is provided.
 %</ja>
 \item[expert]
 %<*en>
-Use horizontal kana characters and define \verb+\rubyfamily+ to use kana
+Use horizontal kana alternates, and define a control sequence \verb+\rubyfamily+ to use kana
 characters designed for ruby.
 %</en>
 %<*ja>
@@ -1530,8 +1546,8 @@ Use JIS2004 glyphs if possible.
 %</ja>
 \item[jis]
 %<*en>
-Use JFM of \texttt{jfm-jis.lua}. When not specifying this option,
-standard \texttt{jfm-ujis.lua} is used.
+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}とする.このオプションがない時は
@@ -1542,10 +1558,10 @@ standard \texttt{jfm-ujis.lua} is used.
 %<en>\paragraph{Kozuka fonts}
 %<ja>\paragraph{小塚フォント}
 %<*en>
-When using single weight, we specify Kozuka Gothic M as gothic
-because Kozuka Gothic R looks thin.
-There is not Kozuka Round Gothic, therefore Kozuka Gothic H is alternatively
-specified as round gothic.
+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>
 まず,小塚フォントを用いる設定を述べる.
@@ -1559,11 +1575,11 @@ specified as round gothic.
 &\tt kozuka4&\tt kozuka6&\tt kozuka6n\\
 \midrule
 %<*en>
-\bf mincho regular&Kozuka Mincho Pro R&Kozuka Mincho ProVI R&Kozuka Mincho Pr6N R\\
+\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 regular\\
-  single weight
+\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\\
@@ -1572,7 +1588,7 @@ specified as round gothic.
 &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\\
-(round gothic)
+(rounded gothic)
 &Kozuka Gothic Pro H&Kozuka Gothic ProVI H&Kozuka Gothic Pr6N H\\
 %</en>
 %<*ja>
@@ -1613,17 +1629,17 @@ Settings for Hiragino fonts:
 &\tt hiragino&\tt hiraginon\\
 \midrule
 %<*en>
-\bf mincho regular&
+\bf mincho medium&
 Hiragino Mincho Pro W3&Hiragino Mincho Pr6N W3\\
 \bf mincho bold&
 Hiragino Mincho Pro W6&Hiragino Mincho Pr6N W6\\
-\bf gothic regular&
+\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 round gothic&
+\bf rounded gothic&
 Hiragino Maru Gothic Pro W4&Hiragino Maru Gothic ProN W4\\
 %</en>
 %<*ja>
@@ -1655,17 +1671,17 @@ Settings for Morisawa fonts:
 &\tt morisawa4&\tt morisawa6n\\
 \midrule
 %<*en>
-\bf mincho regular&
+\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 regular&
+\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 round gothic&
+\bf rounded gothic&
 Jun Pro 101&Jun Pr6N 101\\
 %</en>
 %<*ja>
@@ -1689,9 +1705,10 @@ Jun Pro 101&Jun Pr6N 101\\
 %<en>\paragraph{Settings for single weight}
 %<ja>\paragraph{単ウェイト用設定}
 %<*en>
-Next, we describe settings for single weight.
-These four settings use a same font for regular and bold fonts,
-and gothic font is also used for round gothic font.
+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設定では「細字」「太字」の区別はない.
@@ -1718,10 +1735,10 @@ and gothic font is also used for round gothic font.
 \end{tabular}
 \end{center}
 
-%<en>\paragraph{Use HG fonts}
+%<en>\paragraph{Using HG fonts}
 %<ja>\paragraph{HGフォントの利用}
 %<*en>
-In addition to the above, HG fonts bundled with Microsoft Office are also available.
+We can use HG~fonts bundled with Microsoft Office for realizing multiple weights in Japanese fonts.
 %</en>
 %<*ja>
 すぐ前に書いた単ウェイト用設定を,Microsoft Office等に付属するHGフォントを使って
@@ -1733,23 +1750,23 @@ In addition to the above, HG fonts bundled with Microsoft Office are also availa
 &\tt ipa-dx&\tt ipaex-dx&\tt ms-dx\\
 \midrule
 %<*en>
-\bf mincho regular
+\bf mincho medium
 &IPAMincho&IPAexMincho&MS Mincho\\\midrule
 \bf mincho bold&
 \multicolumn{3}{c}{HG Mincho E}\\\midrule
-\bf Gothic regular\\
-  single weight
+\bf Gothic medium\\
+~~without \texttt{deluxe}
 &IPAGothic&IPAexGothic&MS Gothic\\
-  {\tt jis2004}
+~~with {\tt jis2004}
 &IPAGothic&IPAexGothic&MS Gothic\\
 \cmidrule(lr){1-4}
- otherwise&
+~~otherwise&
 \multicolumn{3}{c}{HG Gothic M}\\\midrule
 \bf gothic bold&
 \multicolumn{3}{c}{HG Gothic E}\\\midrule
-\gt gothic heavy&
+\bf gothic heavy&
 \multicolumn{3}{c}{HG Soei Kaku Gothic UB}\\\midrule
-\gt round gothic&
+\bf rounded gothic&
 \multicolumn{3}{c}{HG Maru Gothic PRO}\\
 %</en>
 %<*ja>
@@ -1776,14 +1793,13 @@ In addition to the above, HG fonts bundled with Microsoft Office are also availa
 \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
+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] font name (\texttt{HGMinchoE}, etc.),
-\item[{\tt 90jis}] file name (\texttt{hgrme.ttc}, \texttt{hgrge.ttc}, \texttt{hgrsgu.ttc}, \texttt{hgrsmp.ttf}),
-\item[{\tt jis2004}] file name (\texttt{hgrme04.ttc}, \texttt{hgrge04.ttc}, \texttt{hgrsgu04.ttc}, \texttt{hgrsmp04.ttf}),
+\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}
-respectively.
 %</en>
 %<*ja>
 なお,HG明朝E・HGゴシックE・HG創英角ゴシックUB・HG丸ゴシック体PROの4つについては,内部で
@@ -1841,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}
@@ -4998,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,
@@ -5052,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 の入力処理部の状態遷移.}