%#! lualatex -shell-escape manual.ins
-%<en>\documentclass[a4paper,titlepage]{article}
-%<ja>\documentclass[a4paper,titlepage]{ltjsarticle}
-\usepackage[margin=20mm,footskip=5mm]{geometry}
+%<*en>
+\documentclass[a4paper,titlepage]{article}
+\usepackage[margin=25mm,footskip=5mm]{geometry}
+%</en>
+%<*ja>
+\documentclass[a4paper,titlepage]{ltjsarticle}
+\usepackage[margin=25mm, footskip=5mm]{geometry}
+%</ja>
\usepackage{amsmath,amssymb,xcolor,pict2e,multienum,amsthm,float}
-\usepackage{booktabs,listings,lltjlisting,showexpl,multicol}
+\usepackage{booktabs,listings,showexpl,multicol}
\usepackage{luatexja-otf}
\usepackage{luatexja-fontspec}
\usepackage[unicode]{hyperref}
\DeclareRobustCommand\epTeX{\ensuremath{\varepsilon}-\kern-.125em\pTeX}
\ltjsetparameter{jacharrange={-3}}
+\ltjdefcharrange{6}{`■}
\theoremstyle{definition}
%<en>\newtheorem{defn}{Definition}
%<ja>\newtheorem{defn}{定義}
\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}
`variation'.
%</en>
%<*ja>
-\item 和文フォントは「実際の」フォント,和文フォントメトリック(JFM と呼ぶ),そ
+\item 和文フォントは(小塚明朝,IPA明朝などの)実際のフォント,和文フォントメトリック(JFM と呼ぶ),そ
して `variation' と呼ばれる文字列の組である.
%</ja>
%<*ja>
\item ソースアーカイブをダウンロードする.
- 現時点では,\LuaTeX-ja の公式リリースはないので,レポジトリからアーカイブを
- 取得しなければならない.
- 次のようにすることで,Git レポジトリを取得することができる:
+ 現時点では,\LuaTeX-ja の公式リリースはまだない.そのため,Git レポジトリを
+ 次のようにすることで取得する必要がある:
%</ja>
\begin{verbatim}
$ git clone git://git.sourceforge.jp/gitroot/luatex-ja/luatexja.git
or download the archive of HEAD in \texttt{master} branch from
%</en>
%<*ja>
- ã\82\82ã\81\97ã\81\8fã\81¯ï¼\8c\texttt{master} ã\83\96ã\83©ã\83³ã\83\81ã\81® HEAD ã\82¢ã\83¼ã\82«ã\82¤ã\83\96ã\82\92以ä¸\8bã\81\8bã\82\89ã\83\80ã\82¦ã\83³ã\83ã\83¼ã\83\89ã\81\99ã\82\8bã\81\93ã\81¨ã\81\8cã\81§ã\81\8dã\82\8b:
+ ã\82\82ã\81\97ã\81\8fã\81¯ï¼\8c\texttt{master} ã\83\96ã\83©ã\83³ã\83\81ã\81® HEAD ã\81®ã\82¢ã\83¼ã\82«ã\82¤ã\83\96ã\82\92以ä¸\8bã\81\8bã\82\89ã\83\80ã\82¦ã\83³ã\83ã\83¼ã\83\89ã\81\97ã\81¦ã\82\82ã\82\88ã\81\84:
%</ja>
\begin{flushleft}
\url{http://git.sourceforge.jp/view?p=luatex-ja/luatexja.git;a=snapshot;h=HEAD;sf=tgz}.
Note that the forefront of development may not be in \texttt{master} branch.
%</en>
%<*ja>
-開発中の最新の成果は \texttt{master} ブランチには含まれていないかもしれないことに注意.
+\texttt{master} ブランチはたまにしか更新されない.
+最新の開発中のコードは \texttt{master} ブランチには含まれていない場合がかなり多いので注意.
%</ja>
%<*en>
\item Extract the archive. You will see \texttt{src/} and several other sub-directories.
%</en>
%<*ja>
-\item アーカイブを展開する.\texttt{src/} をはじめとしたいくつかのディレクトリができる.
+\item 後者の方法でアーカイブ取得したならば,それをを展開する.
+ \texttt{src/} をはじめとしたいくつかのディレクトリができるが,
+ 動作には \texttt{src/} 以下の内容だけで十分.
%</ja>
%<*en>
%</en>
%<*ja>
\item \texttt{src/} の中身全てを自分の \texttt{TEXMF} ツリーにコピーする.
+ シンボリックリンクが利用できる環境で,かつレポジトリを直接取得したのであれば,コピーではなく
+ リンクを貼るのが適切だろう.
%</ja>
%<*en>
\item If \texttt{mktexlsr} is needed to update the file name database, make it so.
%</en>
%<*ja>
-\item もし \texttt{mktexlsr} を実行する必要があればそうする.
+\item 必要があれば,\texttt{mktexlsr} を実行する.
%</ja>
\end{enumerate}
encodings, such as EUC-JP or Shift-JIS, are not supported.
%</en>
%<*ja>
-\item 原稿のソースファイルの文字コードは UTF-8 でなければならない.
- EUC-JP や Shift-JIS は使用できない.
+\item 原稿のソースファイルの文字コードは UTF-8 固定である.
+ 従来日本語の文字コードとして用いられてきた EUC-JP や Shift-JIS は使用できません.
%</ja>
%<*en>
\item `Ryumin-Light' と `GothicBBB-Medium' は PDF ファイルに埋め込まずに
名前参照のみで用いることが広く受け入れられており,この場合 PDF リーダーが
適切な外部フォントで代用する(例えば,Adobe Reader では Ryumin-Light は
- 小塚明朝で代替される).そこで,これらをデフォルトのフォントと
+ 小塚明朝で代替される).そこで,これらを引き続きデフォルトのフォントと
して採用する.
%</ja>
%</en>
%<*ja>
\item 欧文フォントの文字は和文フォントの文字よりも,同じ文字サイズでも
- ä¸\80è\88¬ã\81«å°\8fã\81\95ã\81\84ï¼\8eã\81\9dã\81\93ã\81§ï¼\8cこれらの和文フォントの実際のサイズは指定された値よりも
+ ä¸\80è\88¬ã\81«å°\8fã\81\95ã\81\8fã\83\87ã\82¶ã\82¤ã\83³ã\81\95ã\82\8cã\81¦ã\81\84ã\82\8bï¼\8eã\81\9dã\81\93ã\81§ï¼\8cæ¨\99æº\96ã\81§ã\81¯これらの和文フォントの実際のサイズは指定された値よりも
小さくなるように設定されており,具体的には指定の 0.962216 倍にスケールされる.
+ この 0.962216 という数値も,p\TeX におけるスケーリングを踏襲した値である.
%</ja>
\end{itemize}
\CID{7652}飾区の\CID{13706}野家,
葛飾区の吉野家
\end{LTXexample}
-%lltjlisting.sty要修正?:↑「森」の直後で改行.
+%lltjp-listings.sty要修正?:↑「森」の直後で改行.
%<en>\subsection{Changing Fonts}
%</en>
%<*ja>
\paragraph{意見:数式モード中の和文文字}
-\pTeX では数式中での和文文字の使用がサポートされていたので,
-以下のようなソースが存在した:
+\pTeX では,特に何もしないでも数式中に和文文字を記述することができた.そのため,
+以下のようなソースが見られた:
%</ja>
\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}\,\}$.
+\[ 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
($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}\,\}$.
+$5\in 素:=\{\,p\in\mathbb N:\text{$p$ is a prime}\,\}$.
\end{LTXexample}
%BUG?: \{\}がなければ「素」がでない.上の段落の「よって」もでてない.
%<*en>
%<*en>
\paragraph{NFSS2}
-For \LaTeXe, \LuaTeX-ja simply adopted the font selection system from that
-of \pLaTeXe\ (in \texttt{plfonts.dtx}).
+For \LaTeXe, \LuaTeX-ja adopted most of the font selection system of \pLaTeXe\ (in \texttt{plfonts.dtx}).
%</en>
%<*ja>
\paragraph{NFSS2}
-\LaTeXe については,\LuaTeX-ja では単にフォント選択システムを \pLaTeXe\ (\texttt{plfonts.dtx})
-ã\81\8bã\82\89採用している.
+\LaTeXe については,\LuaTeX-ja ではフォント選択システムを \pLaTeXe\ (\texttt{plfonts.dtx})
+ã\81®å¤§é\83¨å\88\86ã\82\92採用している.
%</ja>
\begin{itemize}
%<*en>
fonts, \emph{or both}. For detail, see Subsection~\ref{ssub-nfsspat}.
%</en>
%<*ja>
- ここで,\verb+\fontencoding{<encoding>}+は,引数により和文側か欧文側かの
- どちらかが切り替わる.例えば,\verb+\fontencoding{JY3}+は和文フォントの
- エンコーディングを\texttt{JY3}に変更し,\verb+\fontencoding{T1}+ は欧文
- フォント側を\texttt{T1}へと変更する.
- \verb+\fontfamily+も引数により和文側,欧文側,\textbf{あるいは両方}のフォ
- ントファミリが切り替わる.詳細は\ref{ssub-nfsspat}節を参照すること.
+ ここで,\verb+\fontencoding{<encoding>}+は,引数により和文側か欧文
+ 側かのどちらかのエンコーディングを変更する.例えば,
+ \verb+\fontencoding{JY3}+は和文フォントのエンコーディングを
+ \texttt{JY3}に変更し,\verb+\fontencoding{T1}+ は欧文フォント側を
+ \texttt{T1}へと変更する.\verb+\fontfamily+も引数により和文側,欧文
+ 側,\textbf{あるいは両方}のフォントファミリを変更する.詳細は
+ \ref{ssub-nfsspat}節を参照すること.
%</ja>
%<*en>
%</ja>
\end{itemize}
+\subsection{fontspec}
%<*en>
-\paragraph{fontspec}
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}
和文フォントについては全ての和文文字のグリフがほぼ等幅であるのが普通であるため,
\verb+\setmonojfont+ コマンドは存在しないことに注意.また,これらの和文用の7つのコマ
ンドでは Kerning feature はデフォルトでは off となっている.これはこの
-feature が \textbf{JAglue} と衝突するためである(\ref{para-kern} 節を見よ).
+feature が \textbf{JAglue} と衝突するためである(\ref{para-kern} 節を参照).
+%</ja>
+
+%<*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
+\Pkg{xunicode} package. Hence we have to patch it, using the following patch, for example:
+%</en>
+%<*ja>
+\paragraph{注意}
+\Pkg{luatexja-fontspec}パッケージでは,内部で \Pkg{xunicode} パッケージの再読み込みを
+行っているが, \textbf{\TeX\ Live\ 2011 他に含まれている \Pkg{xunicode} パッケージ
+(2011/09/09,~v0.981) ではその再読み込みがうまく動作せず},例えば
+以下のようなパッチを当てる必要がある:
+%</ja>
+\begin{lstlisting}
+--- 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
++
++\fi
+ \newif\iftipaonetoken
++\expandafter\ifx\csname ReloadXunicode\endcsname\relax
++
+ \def\tipalasttoken{!@! do nothing with this !@!}
+ \def\tipacatchonechar#1{\begingroup
+ \def\textipa##1{##1}% prevent recursion
+\end{lstlisting}
+%<*ja>
+なお,上流で v0.984 (2011/10/14) でこの問題は修正されているそうです.
%</ja>
+
%<en>\section{Changing Parameters}
%<ja>\section{パラメータの変更}
\LuaTeX-ja には多くのパラメータが存在する.そして \LuaTeX の振る舞いのために,
その多くは \TeX のレジスタにではなく,\LuaTeX-ja 独自の方法で保持されている.
そのため,これらのパラメータを設定・取得するためには \verb+\ltjsetparameter+ と
-\verb+\ltjgetparameter+ ã\82\92ç\94¨ã\81\84ã\81ªã\81\91ã\82\8cã\81°ã\81ªã\82\89ã\81ªã\81\84.
+\verb+\ltjgetparameter+ ã\82\92ç\94¨ã\81\84ã\82\8bå¿\85è¦\81ã\81\8cã\81\82ã\82\8b.
%</ja>
%<en>\subsection{Editing the range of \textbf{JAchar}s}
and the character `漢' to the range number~100.
%</en>
%<*ja>
-\textbf{JAchar} の範囲を設定するためには,まず文字範囲に0より大きく217より小さい
-自然数を割り当てる必要がある.これには \verb+\ltjdefcharrange+ プリミティブを用いる.
-ä¾\8bã\81\88ã\81°ï¼\8c次ã\81®ã\82\88ã\81\86ã\81«æ\9b¸ã\81\8fã\81\93ã\81¨ã\81§è¿½å\8a å¤\9aè¨\80èª\9eé\9d¢ (SMP) ã\81«ã\81\82ã\82\8bå\85¨ã\81¦ã\81®æ\96\87å\97ã\81¨ `æ¼¢' ã\81®ç¯\84å\9b²ç\95ªå\8f·ã\81\8c
-100に設定される.
+\textbf{JAchar} の範囲を設定するためには,まず各文字に0より大きく217より小さい index を
+割り当てる必要がある.これには \verb+\ltjdefcharrange+ プリミティブを用いる.
+例えば,次のように書くことで追加多言語面 (SMP) にある全ての文字と `漢' が
+「100番の文字範囲」に属する設定される.
%</ja>
\begin{lstlisting}
\ltjdefcharrange{100}{"10000-"1FFFF,`漢}
not do this in the middle of a document.
%</en>
%<*ja>
-ã\81\93ã\81®æ\96\87å\97ç¯\84å\9b²ã\81¸ã\81®ç\95ªå\8f·ã\81®å\89²ã\82\8aå½\93ã\81¦ã\81¯ã\81\84ã\81¤ã\82\82ã\82°ã\83ã\83¼ã\83\90ã\83«ã\81§ã\81\82ã\82\8aï¼\8cã\81\97ã\81\9fã\81\8cã\81£ã\81¦æ\96\87æ\9b¸ã\81®é\80\94ä¸ã\81§
+この文字範囲の割り当てはいつもグローバルであり,したがって文書の途中で
この操作をするべきではない.
%</ja>
boundary between \textbf{JAchar}s and \textbf{ALchar}s. For example,
\Param{xkanjiskip} should not be inserted after opening parenthesis
(\textit{e.g.}, compare `(あ' and `(\hskip\ltjgetparameter{xkanjiskip}あ').
+\LuaTeX-ja can control whether \Param{xkanjiskip} can be inserted
+before/after a character, by changing \Param{jaxspmode} for \textbf{JAchar}s and
+\Param{alxspmode} parameters \textbf{ALchar}s respectively.
%</en>
%<*ja>
\Param{xkanjiskip} がすべての \textbf{JAchar} と \textbf{ALchar} の境界に
挿入されるのは望ましいことではない.例えば,\Param{xkanjiskip} は開き括弧の
後には挿入されるべきではない(`(あ' と `(\hskip\ltjgetparameter{xkanjiskip}あ' を
比べてみよ).
-%</ja>
-
-%<*en>
-\LuaTeX-ja can control whether \Param{xkanjiskip} can be inserted
-before/after a character, by changing \Param{jaxspmode} for \textbf{JAchar}s and
-\Param{alxspmode} parameters \textbf{ALchar}s respectively.
-%</en>
-%<*ja>
\LuaTeX-ja では \Param{xkanjiskip} をある文字の前/後に挿入するかどうかを,
\textbf{JAchar} に対しては \Param{jaxspmode} を,\textbf{ALchar} に対しては
\Param{alxspmode} をそれぞれ変えることで制御することができる.
The second argument \texttt{preonly} means `the insertion of
\Param{xkanjiskip} is allowed before this character, but not after'.
the other possible values are \texttt{postonly}, \texttt{allow} and \texttt{
-inhibit}. For the compatibility with \pTeX, natural numbers between
-0~and~3 are also allowed as the second argument\footnote{But we don't
-recommend this: since numbers 1~and~2 have opposite meanings in
-\Param{jaxspmode} and \Param{alxspmode}.}.
+inhibit}. ...
%</en>
%<*ja>
-2つ目のの引数の \texttt{preonly} は「\Param{xkanjiskip} の挿入はこの文字の前でのみ
-許され,後では許さない」ことを意味する.他に指定可能な値は \texttt{postonly},
-\texttt{allow}, \texttt{inhibit} である.\pTeX との互換性のために,
-0から3の自然数を2つ目の引数として指定することも可能である\footnote{しかし,
-これは推奨されない:なぜならば 1 と 2 は \Param{jaxspmode} と \Param{alxspmode} で
-逆の意味になるから.}.
+2つ目の引数の \texttt{preonly} は「\Param{xkanjiskip} の挿入はこの文字の
+前でのみ許され,後では許さない」ことを意味する.他に指定可能な値は
+\texttt{postonly}, \texttt{allow}, \texttt{inhibit} である.
+
+なお,現行の
+仕様では,\Param{jaxspmode}, \Param{alxspmode} はテーブルを共有しており,
+上のソースの1行目を次のように変えても同じことになる:
+\begin{verbatim}
+\ltjsetparameter{alxspmode={`あ,preonly}, jaxspmode={`\!,postonly}}
+\end{verbatim}
+また,これら2パラメータには数値で値を指定することもできる(第\ref{part-ref}部を参照).
%</ja>
%<*en>
コントロールシーケンスを <jfont\_cs> で表す.
%</ja>
-%<en>\paragraph{Prefix \texttt{psft}}
-%<ja>\paragraph{\texttt{psft} プレフィックス}
-%<*en>
-Besides \texttt{file:}\ and \texttt{name:}\ prefixes, \texttt{psft:}\
-can be used a prefix in \verb+\jfont+ (and~\verb+\font+) primitive.
-Using this prefix, you can specify a `name-only' Japanese font which
-will be not embedded to PDF. Typical use of this prefix is to specify
-the `standard' Japanese fonts, namely, `Ryumin-Light' and
-`GothicBBB-Medium'. For kerning or other information, that of Kozuka
-Mincho Pr6N Regular (this is a font by Adobe Inc., and included in
-Japanese Font Packs for Adore Reader) will be used.
-%</en>
-%<*ja>
-\texttt{file:} と \texttt{name:} のプレフィックスに加えて,
-\verb+\jfont+ プリミティブ(と \verb+\font+ プリミティブ)では
-\texttt{psft:} プレフィックス用いることができる.
-このプレフィックスを用いることで,PDF には埋め込まれない「名前だけの」
-和文フォントを指定することができる.典型的な使い方は「標準的な」和文フォント,
-つまり `Ryumin-Light' と `GothicBBB-Medium' を指定することである.
-この場合,カーニング他の情報は小塚明朝 Pr6N Regular
-(Adobe 社によるフォントで,Adobe Reader の日本語フォントパックに含まれている)
-が用いられる.
-%</ja>
-
\paragraph{JFM}
%<*en>
As noted in Introduction, a JFM has measurements of characters and
\begin{list}{}{\def\makelabel{\ttfamily}\def\{{\char`\{}\def\}{\char`\}}}
\item[jfm=<name>]
%<*en>
-Specify the name of JFM. A file named \texttt{jfm-<name>.lua} will be searched
-and/or loaded.
+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 followings are JFMs shipped with \LuaTeX-ja:
+The following JFMs are shipped with \LuaTeX-ja:
%</en>
%<*ja>
-JFM ã\81®å\90\8då\89\8dã\82\92æ\8c\87å®\9aã\81\99ã\82\8bï¼\8eã\83\95ã\82¡ã\82¤ã\83«å\90\8dã\81\8c \texttt{jfm-<name>.lua} ã\81®ã\82\82ã\81®ã\82\92æ\8e¢ã\81\97,
-もし存在すればそれを読み込む.
+JFM ã\81®å\90\8då\89\8dã\82\92æ\8c\87å®\9aã\81\99ã\82\8bï¼\8eã\82\82ã\81\97以å\89\8dã\81«æ\8c\87å®\9aã\81\95ã\82\8cã\81\9fJFMã\81\8cèªã\81¿è¾¼ã\81¾ã\82\8cã\81¦ã\81\84ã\81ªã\81\91ã\82\8cã\81°,
+\texttt{jfm-<name>.lua} を読み込む.
以下の JFM が \LuaTeX-ja には同梱されている:
%</ja>
%<*en>
\item[\tt jfm-ujis.lua] A standard JFM in \LuaTeX-ja. This JFM is
based on \verb+upnmlminr-h.tfm+, a metric for UTF/OTF package that
- is used in \upTeX. When you use the \Pkg{luatexja-otf} package, please use this JFM.
+ is used in \upTeX. When you use the \Pkg{luatexja-otf} package, you should use this JFM.
%</en>
%<*ja>
\item[\tt jfm-ujis.lua] \LuaTeX-ja の標準 JFM である.この JFM は \upTeX で
用いられる UTF/OTF パッケージ用のメトリックである \verb+upnmlminr-h.tfm+ を
- 元にしている.\Pkg{luatexja-otf} パッケージを使うときはこの JFM を指定して
- 下さい.
+ 元にしている.\Pkg{luatexja-otf} パッケージを使うときはこの JFM を指定するべきである.
%</ja>
%<*en>
\item[\tt jfm-jis.lua] A counterpart for \verb+jis.tfm+, `JIS font
%</ja>
\end{description}
-\item[jfmvar=<string>] Sometimes there is a need that
+\item[jfmvar=<string>] Sometimes there is a need that ...
\end{list}
\begin{table}[t]
\toprule
&\tt jfm-ujis.lua&\tt jfm-jis.lua&\tt jfm-min.lua\\
\midrule
-%<en>Example~1
-%<ja>例1
+%<en>Example~1\footnotemark
+%<ja>例1\footnotemark
&\r{ujis}&\r{jis}&\r{min}\\
%<en>Example~2
%<ja>例2
\end{center}
\ltjsetparameter{jacharrange={-3}}
\end{table}
+\footnotetext{from: 乙部厳己, min10フォントについて.
+\texttt{http://argent.shinshu-u.ac.jp/\~{\ }otobe/tex/files/min10.pdf}.}
%<en>\paragraph{Note: kern feature}
%<ja>\paragraph{注意:kern feature}
\end{itemize}
+%<en>\subsection{Prefix \texttt{psft}}
+%<ja>\subsection{\texttt{psft} プレフィックス}
+%<*en>
+Besides \texttt{file:}\ and \texttt{name:}\ prefixes, \texttt{psft:}\
+can be used a prefix in \verb+\jfont+ (and~\verb+\font+) primitive.
+Using this prefix, you can specify a `name-only' Japanese font which
+will be not embedded to PDF. Typical use of this prefix is to specify
+the `standard' Japanese fonts, namely, `Ryumin-Light' and
+`GothicBBB-Medium'. For kerning or other information, that of Kozuka
+Mincho Pr6N Regular (this is a font by Adobe Inc., and included in
+Japanese Font Packs for Adore Reader) will be used.
+
+...
+
+%</en>
+%<*ja>
+\texttt{file:} と \texttt{name:} のプレフィックスに加えて,
+\verb+\jfont+ プリミティブ(と \verb+\font+ プリミティブ)では
+\texttt{psft:} プレフィックス用いることができる.
+このプレフィックスを用いることで,PDF には埋め込まれない「名前だけの」
+和文フォントを指定することができる.典型的な使い方は「標準的な」和文フォント,
+つまり `Ryumin-Light' と `GothicBBB-Medium' を指定することである.
+この場合,カーニング他の情報は小塚明朝 Pr6N Regular
+(Adobe 社によるフォントで,Adobe Reader の日本語フォントパックに含まれている)
+が用いられる.
+
+... cid key
+%</ja>
+
+
+
%<en>\subsection{Structure of JFM file}
%<ja>\subsection{JFM ファイルの構造}
A JFM file is a Lua script which has only one function call:
\begin{LTXexample}
\jfont\g=psft:Ryumin-Light:jfm=test \g
\parindent1\zw\noindent{}◆◆◆◆◆
-\par{}「◆◆←二分下がり
-\par{}【◆◆←全角下がり
-\par{}〔◆◆←全角二分下がり
+\par 「◆◆←二分下がり
+\par 【◆◆←全角下がり
+\par 〔◆◆←全角二分下がり
\end{LTXexample}
\end{itemize}
\ltjsetparameter{jacharrange={-3}}
\item[\Param{yjabaselineshift}\,=<dimen>$^\ast$]\
\item[\Param{yalbaselineshift}\,=<dimen>$^\ast$] [\verb+\ybaselineshift+]
-\item[\Param{jaxspmode}\,=\{<chr\_code>,<mode>\}] [\verb+\inhibitxspcode+]
+\item[\Param{jaxspmode}\,=\{<chr\_code>,<mode>\}]
Setting whether inserting \Param{xkanjiskip} is allowed before/after a \textbf{JAchar} whose character code is <chr\_code>.
The followings are allowed for <mode>:
\begin{description}
\item[0, \texttt{inhibit}] Insertion of \Param{xkanjiskip} is inhibited before the character, nor after the character.
-\item[2, \texttt{preonly}] Insertion of \Param{xkanjiskip} is allowed before the character, but not after.
-\item[1, \texttt{postonly}] Insertion of \Param{xkanjiskip} is allowed after the character, but not before.
+\item[1, \texttt{preonly}] Insertion of \Param{xkanjiskip} is allowed before the character, but not after.
+\item[2, \texttt{postonly}] Insertion of \Param{xkanjiskip} is allowed after the character, but not before.
\item[3, \texttt{allow}] Insertion of \Param{xkanjiskip} is allowed before the character and after the character.
This is the default value.
\end{description}
+This parameter is similar to the \verb+\inhibitxspcode+ primitive of \pTeX, but not compatible with \verb+\inhibitxspcode+.
+
\item[\Param{alxspmode}\,=\{<chr\_code>,<mode>\}] [\verb+\xspcode+]
before the character and after the character.
This is the default value.
\end{description}
-Note that parameters \Param{jaxspmode} and \Param{alxspmode} use a common table.
+Note that parameters \Param{jaxspmode} and \Param{alxspmode} use a common table, hence these two parameters are synonyms of each other.
\item[\Param{autospacing}\,=<bool>$^\ast$] [\verb+\autospacing+]
\item[\Param{autoxspacing}\,=<bool>$^\ast$] [\verb+\autoxspacing+]
\begin{LTXexample}
\jfont\g=psft:Ryumin-Light:jfm=test \g
-あウあ\inhibitglue{}ウ\inhibitglue\par
-あ\par\inhibitglue{}あ
-\par\inhibitglue\hrule{}あoff\inhibitglue ice
+\fbox{\hbox{あウあ\inhibitglue ウ}}
+\inhibitglue\par\noindent あ1
+\par\inhibitglue\noindent あ2
+\par\noindent\inhibitglue あ3
+\par\inhibitglue\hrule あoff\inhibitglue ice
\end{LTXexample}
With the help of this example, we remark the specification of \verb+\inhibitglue+:
\item[reDeclareMathAlphabet\{<unified-cmd>\}\{<al-cmd>\}\{<ja-cmd>\}]
和文・欧文の数式用フォントファミリを一度に変更する命令を作成する.
-具体的には,欧文数式用フォントファミリ変更の命令<al-cmd>と,和文数式用フォ
- ントファミリ変更の命令<ja-cmd>の2つを同時に行う命令として
+具体的には,欧文数式用フォントファミリ変更の命令<al-cmd> (\verb+\mathrm+等)と,和文数式用フォ
+ ントファミリ変更の命令<ja-cmd>(\verb+\mathmc+等)の2つを同時に行う命令として
<unified-cmd>を(再)定義する.実際の使用では<unified-cmd>と
- <al-cmd>ã\81«å\90\8cã\81\98ã\82\82ã\81®ã\82\92æ\8c\87å®\9aã\81\99ã\82\8bï¼\8cã\81\99ã\81ªã\82\8fã\81¡ï¼\8c<al-cmd>ã\81«和文側も変
+ <al-cmd>ã\81«å\90\8cã\81\98ã\82\82ã\81®ã\82\92æ\8c\87å®\9aã\81\99ã\82\8bï¼\8cã\81\99ã\81ªã\82\8fã\81¡ï¼\8c<al-cmd>ã\81§和文側も変
更させるようにするのが一般的と思われる.
-本コマンドの使用については,\pLaTeX 配布中の\texttt{plfonts.dtx}に詳しく
- 注意点が述べられているので,そちらを参照されたい.
+{\let\item=\origitem
+本命令は
+\begin{center}\tt
+<unified-cmd>\{<arg>\}\quad$\longrightarrow$\quad
+(<al-cmd>を1段展開したもの)\{<ja-cmd>を1段展開したもの)\{<arg>\}\}
+\end{center}
+と定義を行うので,使用には注意が必要である:
+\begin{itemize}
+\item <al-cmd>,~<ja-cmd>は既に定義されていなければならない.\verb+\reDeclareMathAlphabet+後に
+両命令の内容を再定義しても,<unified-cmd>の内容にそれは反映されない.
+\item <al-cmd>,~<ja-cmd>に\verb+\@mathrm+などと \texttt{@} をつけた命令を指定した時の動作は保証できない.
+\end{itemize}}
\item[DeclareRelationFont\{<ja-encoding>\}\{<ja-family>\}\{<ja-series>\}\{<ja-shape>\}\\
\hfill\{<al-encoding>\}\{<al-family>\}\{<al-series>\}\{<al-shape>\}]
\item State~$M$: 行中.
\item State~$K$: 行中(和文文字の後).
\end{itemize}
-また,状態遷移は,図~\ref{fig-ptexipro} のようになっており,図中の数字は
+また,状態遷移は,図\ref{fig-ptexipro} のようになっており,図中の数字は
カテゴリーコードを表している.最初の3状態は\TeX の入力処理部と同じであり,
図中から状態$K$と「$j$」と書かれた矢印を取り除けば,\TeX の入力処理部と同
じものになる.
%<ja>\section{JFM グルーの挿入,\Param{kanjiskip} と \Param{xkanjiskip}}
%<en>\subsection{Overview}
%<ja>\subsection{概要}
-%<*en>
-NOT COMPLETED
-%</en>
-%<*ja>
+
\LuaTeX-ja における和文処理グルーの挿入方法は,\pTeX のそれとは全く異なる.
\pTeX では次のような仕様であった:
\begin{itemize}
3種類を一度に挿入することになっている.これは,\LuaTeX において欧文の合字・
カーニング処理がノードベースになったことに対応する変更である.
-\LuaTeX-jaにおける\textbf{JAglue}挿入処理では,下の図\ref{fig-clu}のよう
-ã\81«ã\80\8cå¡\8aã\80\8dã\82\92å\8d\98ä½\8dã\81«ã\81\97ã\81¦è¡\8cã\82\8fã\82\8cã\82\8bï¼\8e大é\9b\91æ\8a\8aã\81«ã\81\84ã\81\86ã\81¨ï¼\8cã\80\8cå¡\8a」は文字とそれに付随す
+\LuaTeX-jaにおける\textbf{JAglue}挿入処理では,次節で定義する
+ã\80\8cã\82¯ã\83©ã\82¹ã\82¿ã\80\8dã\82\92å\8d\98ä½\8dã\81«ã\81\97ã\81¦è¡\8cã\82\8fã\82\8cã\82\8bï¼\8e大é\9b\91æ\8a\8aã\81«ã\81\84ã\81\86ã\81¨ï¼\8cã\80\8cã\82¯ã\83©ã\82¹ã\82¿」は文字とそれに付随す
るノード達(アクセント位置補正用のkernや,イタリック補正)をまとめたもの
-であり,2つの塊の間には,ペナルティ,\verb+\vadjust+,whatsitなど,行組版
-には関係しないものがある.そのため,……
-%</ja>
+であり,2つのクラスタの間には,ペナルティ,\verb+\vadjust+,whatsitなど,行組版
+には関係しないものがある.
-% \begin{figure}[!tb]
-% \unitlength=10mm
-% \end{figure}
-%<en>\subsection{Definition of a `cluster'}
+%<en>\subsection{definition of a `cluster'}
%<ja>\subsection{「クラスタ」の定義}
\begin{defn}
-A \emph{cluster} is a list of nodes in one of the following forms, with the \textit{id} of it:
+A \emph{cluster} is a list of consecutive nodes in one of the following forms,
+with the \textit{id} of it:
\begin{enumerate}
\item Nodes whose value of\ \verb+\ltj@icflag+ is in $[3,15)$. These
nodes come from a hbox which is already packaged, by unpackaging
(\verb+\unhbox+).
The \textit{id} is \textit{id\_pbox}.
-\item A inline math formula, including two \textit{math\_node}s at the boundary of it:
-HOGE
+\item A inline math formula, including two \textit{math\_node}s at the boundary of it.
The \textit{id} is \textit{id\_math}.
-\item A \textit{glyph\_node} with nodes which relate with it:
-HOGE
+\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+.
+\end{enumerate}
+\[
+\overbrace{%
+ \Node{kern}{$\mathit{subtype}=2$}\longrightarrow
+\left\{\begin{array}{c}
+\Node{glyph}{accent}\\\noalign{\medskip}
+\Node{hbox}{accent (shifted vert.)}
+\end{array}\right\}\longrightarrow
+\Node{kern}{$\mathit{subtype}=2$}}^{\text{(a)}}
+\longrightarrow
+\Node{glyph}{$p$}\longrightarrow
+\overbrace{%
+\Node{kern}{italic corr.}}^{\text{(b)}}
+\]
+
The \textit{id} is \textit{id\_jglyph} or
\textit{id\_glyph}, according to whether the \textit{glyph\_node}
represents a Japanese character or not.
-\item An box-like node, that is, an hbox, an vbox and an rule (\verb+\vrule+).
+\item An box-like node, that is, an hbox, an vbox, an rule (\verb+\vrule+) and an \textit{unset\_node}.
The \textit{id} is \textit{id\_hlist} if the node is an
hbox which is not shifted vertically, or \textit{id\_box\_like}
otherwise.
\item A glue, a kern whose subtype is not 2~(\textit{accent}), and a discretionary break.
The \textit{id} is \textit{id\_glue}, \textit{id\_kern}
and \textit{id\_disc}, respectively.
-%Just a node which will \dots, \textit{i.e.}, a node which is \emph{not} one of the following:
-%\textit{ins\_node}, \textit{mark\_node}, \textit{adjust\_node}, \textit{whatsit\_node}
-%and \textit{penalty\_node}.
\end{enumerate}
We denote a cluster by \textit{Np}, \textit{Nq} and \textit{Nr}.
\end{defn}
-Internally, a cluster is represented by a table $\textit{Np}$ with the following fields.
+以降は日本語.
+
+次に,$\mathit{Np}.\mathit{id}$の意味を述べるとともに,
+「先頭の文字」を表す\textit{glyph\_node}~$\mathit{Np}.\mathit{head}$と,
+「最後の文字」を表す\textit{glyph\_node}~$\mathit{Np}.\mathit{tail}$を次のように定義する.
+
\begin{description}
-\def\makelabel#1{\textbf{\textit{#1}}}
-\item[first, last] The first/last node of the cluster.
-\item[id] The \textit{id} in above definition.
-\item[nuc]
-
-% jachar
-\item[auto\_kspc, auto\_xspc]
-\item[xspc\_before, xspc\_after]
-
-% alchar, jachar
-\item[pre, post]
-\item[char]
-\item[class]
-\item[lend]
-\item[met, var]
+\item[\textit{id\_jglyph}] 和文文字.\\
+$\mathit{Np}.\mathit{head}$, $\mathit{Np}.\mathit{tail}$は,その和文文字を表している
+\textit{glyph\_node}そのものである.
+\item[\textit{id\_glyph}] 和文文字を表していない\textit{glyph\_node}~$p$.\\
+多くの場合,$p$は欧文文字を格納しているが,`ffi'などの合字によって作られた
+\textit{glyph\_node}である可能性もある.
+前者の場合,$\mathit{Np}.\mathit{head}$,~$\mathit{Np}.\mathit{tail} = p$である.
+一方,後者の場合,
+\begin{itemize}
+\item $\mathit{Np}.\mathit{head}$は,
+合字の構成要素の先頭→(その\textit{glyph\_node}における)合字の構成要素の先頭→……
+と再帰的に検索していってたどり着いた\textit{glyph\_node}である.
+\item $\mathit{Np}.\mathit{last}$は,同様に末尾→末尾→と検索してたどり着いた\textit{glyph\_node}である.
+\end{itemize}
+
+
+\item[\textit{id\_math}] インライン数式.\\
+便宜的に,$\mathit{Np}.\mathit{head}$, $\mathit{Np}.\mathit{tail}$ともに
+「文字コード$-1$の欧文文字」とおく.
+\item[\textit{id\_hlist}] 縦方向にシフトされていない hbox.\\
+この場合,$\mathit{Np}.\mathit{head}$, $\mathit{Np}.\mathit{tail}$はそれぞれ$p$の内容を表すリストの,
+先頭・末尾のノードである.
+\begin{itemize}
+\item 状況によっては,\TeX ソースで言うと
+\begin{verbatim}
+\hbox{\hbox{abc}...\hbox{\lower1pt\hbox{xyz}}}
+\end{verbatim}
+のように,$p$の内容が別の hbox で開始・終了している可能性も十分あり得る.そのような場合,
+$\mathit{Np}.\mathit{head}$, $\mathit{Np}.\mathit{tail}$の算出は,\textbf{垂直方向にシフトされていない} hbox の
+場合だけ内部を再帰的に探索する.例えば上の例では,$\mathit{Np}.\mathit{head}$は文字「a」を表すノードであり,
+一方$\mathit{Np}.\mathit{tail}$は垂直方向にシフトされた hbox,\verb+\lower1pt\hbox{xyz}+に対応するノードである.
+\item また,先頭にアクセント付きの文字がきたり,末尾にイタリック補正用の kern が
+来ることもあり得る.この場合は,クラスタの定義のところにもあったように,それらは無視して算出を行う.
+\item 最初・最後のノードが合字によって作られた\textit{glyph\_node}のときは,それぞれに対して\textit{id\_glyph}%
+と同様に再帰的に構成要素をたどっていく.
+\end{itemize}
+\item[\textit{id\_pbox}] 「既に処理された」ノードのリスト.\\
+\textit{id\_hlist}と同じ方法で$\mathit{Np}.\mathit{head}$, $\mathit{Np}.\mathit{tail}$を算出する,
+\item[\textit{id\_disc}] discretionary break (\verb+\discretionary{pre}{post}{nobreak}+).\\
+\textit{id\_hlist}と同じ方法で$\mathit{Np}.\mathit{head}$, $\mathit{Np}.\mathit{tail}$を算出するが,
+第3引数の \texttt{nobreak}(行分割が行われない時の内容)を使う.言い換えれば,ここで行分割が発生した時の状況は
+全く考慮に入れない.
+\item[\textit{id\_box\_like}] \textit{id\_hlist}とならないboxや,rule.\\
+この場合は,$\mathit{Np}.\mathit{head}$, $\mathit{Np}.\mathit{tail}$のデータは利用されないので,2つの算出は無意味である.
+敢えて明示するならば,$\mathit{Np}.\mathit{head}$, $\mathit{Np}.\mathit{tail}$は共にnil値である.
+\item[他] 以上にない\textit{id}に対しても,$\mathit{Np}.\mathit{head}$, $\mathit{Np}.\mathit{tail}$の算出は無意味.
\end{description}
+
+\subsection{クラスタ間のグルー:概観}
+
+
\end{document}