OSDN Git Service

Corrected a typo.
[luatex-ja/luatexja.git] / doc / luatexja.dtx
1 %<*!showexpl>
2 %#! lualatex -shell-escape
3
4 %<en>\documentclass[a4paper,titlepage]{article}
5 %<ja>\documentclass[a4paper,titlepage]{ltjsarticle}
6 %<zh>\documentclass[a4paper,titlepage]{ltjsarticle}
7
8 %%%%%%%%
9 \makeatletter
10 %%%%%%%%
11
12 %%%%%%%% record loaded packages
13 \let\ltjpkglist\empty
14 \newif\if@real@append@list
15 \def\@append@newentry#1#2{{%
16   \@real@append@listtrue \def\@tempa{#2}%
17   \let\@pkglist\@append@newentry@pkglist#1%
18   \if@real@append@list
19     \let\@pkglist=\relax\xdef#1{#1\@pkglist{#2}}%
20   \fi}}
21 \def\@append@newentry@pkglist#1{%
22   \def\@tempb{#1}%
23   \ifx\@tempa\@tempb\@real@append@listfalse\fi}
24 \def\@addtofilelist#1{\@append@newentry\ltjpkglist{#1}}
25 \let\@listfiles\empty
26
27 %<*en>
28 \usepackage[margin=25mm,footskip=6mm]{geometry}
29 \usepackage{luatexja-adjust}\ltjdisableadjust
30 \parskip=\smallskipamount
31 %</en>
32 %<*ja>
33 \usepackage[textwidth=45\zw, lines=45, footskip=6mm]{geometry}
34 \usepackage{luatexja-adjust}
35 \advance\leftmargini-1\zw\advance\leftmarginii-1\zw
36 %</ja>
37 %<*zh>
38 \usepackage[textwidth=45\zw, lines=45, footskip=6mm]{geometry}
39 \usepackage{luatexja-adjust}\ltjdisableadjust
40 \advance\leftmargini-1\zw\advance\leftmarginii-1\zw
41 \def\postpartname{编}
42 \DeclareYokoKanjiEncoding{ZH}{}{}
43 \DeclareKanjiEncodingDefaults{}{}
44 \DeclareErrorKanjiFont{ZH}{song}{m}{n}{10}
45 \DeclareKanjiSubstitution{ZH}{song}{m}{n}
46 \newcommand\songdefault{song}
47 \newcommand\heidefault{hei}
48 \newcommand\minchodefault{mincho}
49 \renewcommand\kanjiencodingdefault{ZH}
50 \renewcommand\kanjifamilydefault{\songdefault}
51 \renewcommand\kanjiseriesdefault{\mddefault}
52 \renewcommand\kanjishapedefault{\updefault}
53 \DeclareKanjiFamily{ZH}{song}{}
54 \DeclareFontShape{ZH}{song}{m}{n}{<->name:AdobeSongStd-Light:jfm=jis}{}
55 \DeclareFontShape{ZH}{song}{m}{it}{<->ssub*song/m/n}{}
56 \DeclareFontShape{ZH}{song}{bx}{n}{<->ssub*hei/m/n}{}
57 \DeclareKanjiFamily{ZH}{hei}{}
58 \DeclareFontShape{ZH}{hei}{m}{n}{<->name:SimHei:jfm=jis}{}
59 \DeclareFontShape{ZH}{hei}{bx}{n}{<->ssub*hei/m/n}{}
60 \DeclareKanjiFamily{ZH}{mincho}{}
61 \DeclareFontShape{ZH}{mincho}{m}{n}{<->psft:KozMinPr6N-Regular:cid=Adobe-Japan1-6;jfm=jis}{}
62 \fontencoding{ZH}\selectfont
63 \DeclareTextFontCommand{\textsong}{\songfamily}
64 \DeclareTextFontCommand{\texthei}{\heifamily}
65 \DeclareTextFontCommand{\textmincho}{\minchofamily}
66 \DeclareOldFontCommand{\song}{\normalfont\songfamily}{}
67 \DeclareOldFontCommand{\hei}{\normalfont\heifamily}{}
68 \DeclareOldFontCommand{\mincho}{\normalfont\minchofamily}{}
69 \DeclareSymbolFont{songti}{ZH}{song}{m}{n}
70 \jfam\symsongti
71 \SetSymbolFont{songti}{bold}{ZH}{hei}{m}{n}
72 \DeclareSymbolFontAlphabet{\mathsong}{songti}
73 \DeclareMathAlphabet{\mathhei}{ZH}{hei}{m}{n}
74 \DeclareRobustCommand\songfamily{\not@math@alphabet\songfamily\mathsong\kanjifamily\songdefault\selectfont}
75 \DeclareRobustCommand\heifamily{\not@math@alphabet\heifamily\mathhei\kanjifamily\heidefault\selectfont}
76 \DeclareRobustCommand\minchofamily{\not@math@alphabet\minchofamily\mathhei\kanjifamily\minchodefault\selectfont}
77 \DeclareRobustCommand\rmfamily{\not@math@alphabet\rmfamily\mathrm\romanfamily\rmdefault\kanjifamily\songdefault\selectfont}
78 \DeclareRobustCommand\sffamily{\not@math@alphabet\sffamily\mathsf\romanfamily\sfdefault\kanjifamily\heidefault\selectfont}
79 %</zh>
80
81 \usepackage{amsmath,tikz,pict2e,multienum,float}
82 \usepackage{booktabs,multicol}
83
84 %%%%%%%% listings
85 \usepackage{listings,showexpl}
86 \lstset{
87   basicstyle=\ttfamily\small, pos=r, breaklines=true,
88   numbers=none, rframe={}, basewidth=0.5em, numberstyle=\tiny, numbersep=0.5em,
89   explpreset={numberstyle=\tiny, numbers=left, numbersep=1em}
90 }
91 % Suppress output from showexpl to stdout.
92 \let\SX@Info\relax
93
94 %%%%%%%% hyperref
95 \usepackage{hyperref}
96 %<*en>
97 \title{The \LuaTeX-ja package}
98 \author{The \LuaTeX-ja project team}
99 %</en>
100 %<*ja>
101 \title{\LuaTeX-jaパッケージ}
102 \author{\LuaTeX-jaプロジェクトチーム}
103 %</ja>
104 %<*zh>
105 \title{\LuaTeX-ja宏包}
106 \author{\LuaTeX-ja项目团队}
107 %</zh>
108 \hypersetup{%
109         unicode,
110         colorlinks,
111         allbordercolors=1 1 1,
112         allcolors=blue,
113 %<*en>
114         pdfauthor={The LuaTeX-ja project team},
115         pdftitle={The LuaTeX-ja package}
116 %</en>
117 %<*ja>
118         pdfauthor={LuaTeX-jaプロジェクトチーム},
119         pdftitle={LuaTeX-jaパッケージ}
120 %</ja>
121 %<*zh>
122         pdfauthor={LuaTeX-ja项目团队},
123         pdftitle={LuaTeX-ja宏包}
124 %</zh>
125 }
126
127 %%%%%%%% definition env.
128 \usepackage{amsthm}
129 \theoremstyle{definition}
130 %<en>\newtheorem{defn}{Definition}
131 %<ja>\newtheorem{defn}{定義}
132 %<zh>\newtheorem{defn}{定义}
133
134 %%%%%%%% fonts
135 \usepackage{luatexja-otf}
136 \usepackage[jis2004]{luatexja-preset}
137 %<!en>\usepackage{amssymb}
138 %<*en>
139 \usepackage{unicode-math}
140 \setmainfont[Ligatures=TeX]{TeX Gyre Termes}
141 \setsansfont[Ligatures=TeX]{TeX Gyre Heros}
142 \setmathfont{xits-math.otf}
143 \frenchspacing
144 %</en>
145
146 %%%%%%%% logo
147 \usepackage{metalogo}
148 \DeclareRobustCommand\eTeX{\ensuremath{\varepsilon}-\kern-.125em\TeX}
149 \DeclareRobustCommand\LuaTeX{Lua\TeX}
150 \DeclareRobustCommand\pdfTeX{pdf\TeX}
151 \DeclareRobustCommand\pTeX{p\kern-.15em\TeX}
152 \DeclareRobustCommand\upTeX{up\kern-.15em\TeX}
153 \DeclareRobustCommand\pLaTeX{p\kern-.05em\LaTeX}
154 \DeclareRobustCommand\pLaTeXe{p\kern-.05em\LaTeXe}
155 \DeclareRobustCommand\epTeX{\ensuremath{\varepsilon}-\kern-.125em\pTeX}
156
157 %%%%%%%% other macros
158 \newenvironment{cslist}{%
159   \leftskip2em\parindent=0pt\def\makelabel##1{{\tt\char92##1}}
160   \def\{{\char`\{}\def\}{\char`\}}
161   \let\origitem=\item
162   \def\item[##1]{\par\smallskip\par\hskip-\leftskip\makelabel{##1}\par}
163 }{}
164
165 \def\labelenumii{(\arabic{enumii})}
166 \long\def\@makecaption#1#2{%
167   \vskip\abovecaptionskip
168   \sbox\@tempboxa{{\small #1. #2}}%
169   \ifdim \wd\@tempboxa >\hsize
170     {\small #1. #2}\par
171   \else
172     \global \@minipagefalse
173     \hb@xt@\hsize{\hfil\box\@tempboxa\hfil}%
174   \fi
175   \vskip\belowcaptionskip}
176
177 %%%%%%%%
178 \makeatother
179 %%%%%%%%
180
181 \def\Node#1#2{\,\vcenter{\hbox{\fboxsep=1pt\fbox{\vbox{\small\halign{\hfil##\hfil\cr
182   #1\mathstrut\cr\noalign{\hrule height.4pt}\strut#2\cr}}}}\,}}
183
184 \protected\def\Param#1{\textsf{#1}} % parameter name
185 \protected\def\Pkg#1{\underline{\smash{\texttt{#1}}}} % packages/classes
186
187
188 \begin{document}
189 \catcode`\<=13
190 \def<#1>{{\normalfont\rm\itshape$\langle$#1$\rangle$}}
191 \maketitle
192
193 \tableofcontents
194 \bigskip
195
196 %<*en>
197 \textbf{This documentation is far from complete. It may have many
198 grammatical (and contextual) errors.} Also, several parts
199 (especially, Section~\ref{sec-jfmglue}) are written in Japanese only.
200 %</en>
201 %<*ja>
202 \textbf{\large 本ドキュメントはまだまだ未完成です.}
203 %</ja>
204 %<*zh>
205 \textbf{\large 本文档尚未完成。}
206 %</zh>
207
208 \clearpage
209 %<en>\part{User's manual}
210 %<ja>\part{ユーザーズマニュアル}
211 %<zh>\part{用户手册}
212
213 %<en>\section{Introduction}
214 %<ja>\section{はじめに}
215 %<zh>\section{引言}
216
217
218 %<*en>
219 The \LuaTeX-ja package is a macro package for typesetting high-quality
220 Japanese documents when using \LuaTeX.
221 %</en>
222 %<*ja>
223 \LuaTeX-jaパッケージは,次世代標準\TeX である\LuaTeX の上で,\pTeX と同等
224 /それ以上の品質の日本語組版を実現させようとするマクロパッケージである.
225 %</ja>
226 %<*zh>
227 \LuaTeX-ja宏包是应用于下一代标准\TeX 引擎亦即\LuaTeX 引擎上的高质量日语文档排版宏包。
228 %</zh>
229
230 %<en>\subsection{Backgrounds}
231 %<ja>\subsection{背景}
232 %<zh>\section{背景}
233
234
235 %<*en>
236 Traditionally, ASCII \pTeX, an extension of \TeX, and its derivatives
237 are used to typeset Japanese documents in \TeX. \pTeX\ is an engine
238 extension of \TeX: so it can produce high-quality Japanese documents
239 without using very complicated macros. But this point is a mixed
240 blessing: \pTeX\ is left behind from other extensions of \TeX,
241 especially \eTeX\ and \pdfTeX, and from changes about
242 Japanese processing in computers (\textit{e.g.}, the UTF-8 encoding).
243 %</en>
244 %<*ja>
245 従来,「\TeX を用いて日本語組版を行う」といったとき,エンジンとしては
246 ASCII \pTeX やそれの拡張物が用いられることが一般的であった.\pTeX は\TeX
247 のエンジン拡張であり,(少々仕様上不便な点はあるものの)商業印刷の分野に
248 も用いられるほどの高品質な日本語組版を可能としている.だが,それは弱点に
249 もなってしまった:\pTeX という(組版的に)満足なものがあったため,海外で
250 行われている数々の\TeX の拡張――例えば\eTeX や\pdfTeX ――や,TrueType,
251 OpenType, Unicodeといった計算機で日本語を扱う際の状況の変化に追従すること
252 を怠ってしまったのだ.
253 %</ja>
254 %<*zh>
255 一般情况下,\TeX 下的日语文档输出,是ASCII \pTeX(\TeX 的一个扩展)及其衍生
256 软件来完成的。\pTeX 作为\TeX 的一个扩展引擎,在生成高质量的日语文档时,规避
257 了繁杂的宏编写。但是在和同时期的引擎相比之下,\pTeX 的处境未免有些尴尬:\pTeX
258 已经远远落后于\eTeX 和pdf\TeX,此外也没有跟上计算机上对日文处理的演进(比如,
259 UTF-8编码,TrueType字体,OpenType字体)。
260 %</zh>
261
262 %<*en>
263 Recently extensions of \pTeX, namely \upTeX\ (Unicode-implementation
264 of \pTeX) and \epTeX\ (merging of \pTeX\ and
265 \eTeX\ extension), have developed to fill those gaps to some
266 extent, but gaps still exist.
267 %</en>
268 %<*ja>
269 ここ数年,若干状況は改善されてきた.現在手に入る大半の\pTeX バイナリでは
270 外部UTF-8入力が利用可能となり,さらにUnicode化を推進し,\pTeX の内部処理
271 までUnicode化した\upTeX も開発されている.また,\pTeX に\eTeX 拡張をマー
272 ジした\epTeX も登場し,\TeX\ Live\ 2011では\pLaTeX が\epTeX の上で動作す
273 るようになった.だが,\pdfTeX 拡張(PDF直接出力やmicro-typesetting)を
274 \pTeX に対応させようという動きはなく,海外とのgapは未だにあるのが現状であ
275 る.
276 %</ja>
277 %<*zh>
278 最近开发的\pTeX 扩展,即\upTeX(Unicode下的\pTeX 实现)和\epTeX(\pTeX 和
279 \eTeX 的融合版本),虽然在部分情况上弥补了上述的差距,但是差距依然存在。
280 %</zh>
281
282 %<*en>
283 However, the appearance of \LuaTeX\ changed the whole situation. With
284 using Lua `callbacks', users can customize the internal processing of
285 \LuaTeX. So there is no need to modify sources of engines to
286 support Japanese typesetting: to do this, we only have to write Lua
287 scripts for appropriate callbacks.
288 %</en>
289 %<*ja>
290 しかし,\LuaTeX の登場で,状況は大きく変わることになった.Luaコードで
291 `callback'を書くことにより,\LuaTeX の内部処理に割り込みをかけることが可
292 能となった.これは,エンジン拡張という真似をしなくても,Luaコードとそれに
293 関する\TeX マクロを書けば,エンジン拡張とほぼ同程度のことができるようになっ
294 たということを意味する.\LuaTeX-jaは,このアプローチによってLuaコード・
295 \TeX マクロによって日本語組版を\LuaTeX の上で実現させようという目的で開発
296 が始まったパッケージである.
297 %</ja>
298 %<*zh>
299 不过,\LuaTeX 的出现改变了整个状况。用户可以通过使用Lua语言的“callback”来
300 调整\LuaTeX 的内部处理机制。所以,没有必要去通过修改引擎的源代码来支持日文
301 排版,相反,我们需要做的仅仅是编写其当处理callback的Lua脚本。
302 %</zh>
303
304 %<en>\subsection{Major Changes from \pTeX}
305 %<ja>\subsection{\pTeX からの主な変更点}
306 %<zh>\subsection{与\pTeX 的差异所在}
307
308 %<*en>
309 The \LuaTeX-ja package is under much influence of \pTeX\ engine. The initial
310 target of development was to implement features of \pTeX. However,
311 \emph{\LuaTeX-ja is not a just porting of \pTeX; unnatural
312 specifications/behaviors of \pTeX\ were not adopted}.
313 %</en>
314 %<*ja>
315 \LuaTeX-jaは,\pTeX に多大な影響を受けている.初期の開発目標は,\pTeX の機
316 能をLuaコードにより実装することであった.しかし,開発が進むにつれ,\pTeX
317 の完全な移植は不可能であり,また\pTeX における実装がいささか不可解になっ
318 ているような状況も発見された.そのため,\textbf{\LuaTeX-jaは,もはや
319 \pTeX の完全な移植は目標とはしない.\pTeX における不自然な仕様・挙動があ
320 れば,そこは積極的に改める.}
321 %</ja>
322 %<*zh>
323 \LuaTeX-ja宏包在设计上,受\pTeX 影响很大。最初开发的主要议题是实现\pTeX 的特性。
324 不过,{\bf\LuaTeX-ja不是简简单单的移植\pTeX,很多不自然的特征和现象都被移出了。}
325 %</zh>
326
327 %<*en>
328 The followings are major changes from \pTeX:
329 %</en>
330 %<*ja>
331 以下は \pTeX からの主な変更点である.
332 %</ja>
333 %<*zh>
334 下面列举出了一些和\pTeX 的差异:
335 %</zh>
336
337 \begin{itemize}
338 %<*en>
339 \item A Japanese font is a tuple of a `real' font, a Japanese font
340       metric (\textbf{JFM}, for short), and an optional string called
341       `variation'.
342 %</en>
343 %<*ja>
344 \item 和文フォントは(小塚明朝,IPA明朝などの)実際のフォント,和文フォン
345       トメトリック(JFMと呼ぶ\footnote{混乱を防ぐため,p\TeX の意味での
346       JFM (\texttt{min10.tfm}) などは本ドキュメントでは\textbf{和文用
347       TFM}とよぶことにする.}),そして`variation'と呼ばれる文字列の組で
348       ある.
349 %</ja>
350 %<*zh>
351 \item 一个日文字体是由三部分构成的元组:实际的字体(如小塚明
352       朝,IPA明朝),日文字体测度(\textbf{JFM})和变体字串。
353 %</zh>
354
355 %<*en>
356 \item In \pTeX, a line break after Japanese character is ignored (and
357       doesn't yield a space), since line breaks (in source files) are
358       permitted almost everywhere in Japanese texts. However, \LuaTeX-ja
359       doesn't have this function completely, because of a specification
360       of \LuaTeX.
361 %</en>
362 %<*ja>
363 \item 日本語の文書中では改行はほとんどどこでも許されるので,\pTeX では和文文字
364       直後の改行は無視される(スペースが入らない)ようになっていた.しかし,
365       \LuaTeX-ja では \LuaTeX の仕様のためにこの機能は完全には実装されていない.
366 %</ja>
367 %<*zh>
368 \item \pTeX 中,日文字符之后的断行并不允许(也不产生空格),其他在源码中的断行
369       是可以随处允许的。不过,因为\LuaTeX 的特殊关系,\LuaTeX-ja并没有这个功能。
370 %</zh>
371
372 %<*en>
373 \item The insertion process of glues/kerns between two Japanese
374       characters and between a Japanese character and other characters
375       (we refer glues/kerns of both kinds as \textbf{JAglue}) is rewritten from
376       scratch.
377 %</en>
378 %<*ja>
379 \item 2つの和文文字の間や,和文文字と欧文文字の間に入るグルー/カーン
380       (両者をあわせて\textbf{JAglue}と呼ぶ)の挿入処理が0から書き直されている.
381 %</ja>
382 %<*zh>
383 \item 插在日文字符和其他字符言之间的胶/出格(我们将此称为\textbf{JAglue})是重新实现的。
384 %</zh>
385
386 \begin{itemize}
387 %<*en>
388 \item As \LuaTeX's internal character handling is `node-based'
389       (\textit{e.g.}, \verb+of{}fice+ doesn't prevent ligatures), the
390       insertion process of \textbf{JAglue} is now `node-based'.
391 %</en>
392 %<*ja>
393 \item \LuaTeX の内部での文字の扱いが「ノードベース」になっているように(例えば,
394       \verb+of{}fice+ で合字は抑制されない),\textbf{JAglue}の挿入処理も
395       「ノードベース」である.
396 %</ja>
397 %<*zh>
398 \item 在\LuaTeX 中,内部的字符处理是“基于node的”(例如:\verb!of{}fice!不会避免合字),
399       \textbf{JAglue}的插入处理,现在也是“基于node的”。
400 %</zh>
401
402 %<*en>
403 \item Furthermore, nodes between two characters which have no effects in
404       line break (\textit{e.g.}, \verb+\special+ node) and kerns from
405       italic correction are ignored in the insertion process.
406 %</en>
407 %<*ja>
408 \item さらに,2つの文字の間にある行末では効果を持たないノード(例えば \verb+\special+ ノード)や,
409   イタリック補正に伴い挿入されるカーンは挿入処理中では無視される.
410 %</ja>
411 %<*zh>
412 \item 此外,两个字符之间的node在断行时不起作用的(例如,\verb!\special!node),还有
413       意大利体校正带来的出格在插入处理中也是被忽略的。
414 %</zh>
415
416 %<*en>
417 \item \emph{Caution: due to above two points, many methods which did for the
418       dividing the process of the insertion of \textbf{JAglue} in \pTeX\ are not
419       effective anymore.} In concrete terms, the following two methods are not effective anymore:
420 %</en>
421 %<*ja>
422 \item \textbf{注意:上の2つの変更により,従来\textbf{JAglue}の挿入処理を分断するのに
423       使われていたいくつかの方法は用いることができない.具体的には,次の方法はもはや無効である:}
424 %</ja>
425 %<*zh>
426 \item \textbf{警告:鉴于以上两点,在\pTeX 中分割\textbf{JAglue}处理的多种方法不再生效。}
427      明确地说,下列两种方法不再生效:
428 %</zh>
429 \begin{verbatim}
430   ちょ{}っと  ちょ\/っと
431 \end{verbatim}
432 %<*en>
433       If you want to do so, please put an empty hbox between it instead:
434 %</en>
435 %<*ja>
436       もし同じことをやりたければ,空の水平ボックスを間に挟めばよい:
437 %</ja>
438 %<*zh>
439       如果想得到此种结果,请使用空盒子替代:
440 %</zh>
441 \begin{verbatim}
442   ちょ\hbox{}っと
443 \end{verbatim}
444
445
446 %<*en>
447 \item In the process, two Japanese fonts which only differ in their `real'
448       fonts are identified.
449 %</en>
450 %<*ja>
451 \item 処理中では,2つの和文フォントは,「実際の」フォントのみが異なる場合に同一視
452       される.
453 %</ja>
454 %<*zh>
455 \item 处理过程中,两个在“真实”字体上具区别的日文字体可以被识别出来。
456 %</zh>
457 \end{itemize}
458
459 %<*ja>
460 \item \LuaTeX-jaでは,\pTeX と同様に漢字・仮名を制御綴内に用いることができ,
461 \verb+\西暦+ などが正しく動作するようにしている.
462 但し,制御綴中に使える和文文字が\pTeX・\upTeX と全く同じではないことに注意すること.
463 %</ja>
464
465 %<*en>
466 \item At the present, vertical typesetting (\emph{tategaki}), is not
467       supported in \LuaTeX-ja.
468 %</en>
469 %<*ja>
470 \item 現時点では,縦書きは\LuaTeX-jaではサポートされていない.
471 %</ja>
472 %<*zh>
473 \item 当下,\LuaTeX-ja并不支持直行排版。
474 %</zh>
475
476 \end{itemize}
477
478 %<*en>
479 For detailed information, see Part~\ref{part-imp}.
480 %</en>
481 %<*ja>
482 詳細については第\ref{part-imp}部を参照.
483 %</ja>
484 %<*zh>
485 详细的描述,请参见第\ref{part-imp}编。
486 %</zh>
487
488 %<en>\subsection{Notations}
489 %<ja>\subsection{用語と記法}
490 %<zh>\subsection{一些约定}
491
492
493 %<*en>
494 In this document, the following terms and notations are used:
495 %</en>
496 %<*ja>
497 本ドキュメントでは,以下の用語と記法を用いる:
498 %</ja>
499 %<*zh>
500 在本文档中,有下面一些约定:
501 %</zh>
502
503 \begin{itemize}
504 %<*en>
505 \item Characters are divided into two types:
506 %</en>
507 %<*ja>
508 \item 文字は2種類に分けられる:
509 %</ja>
510 %<*zh>
511 \item 字符被分为两种类型:
512 %</zh>
513 \begin{itemize}
514 %<*en>
515 \item \textbf{JAchar}: standing for Japanese characters such as
516       Hiragana, Katakana, Kanji and other punctuation marks for
517       Japanese.
518 %</en>
519 %<*ja>
520 \item \textbf{JAchar}: ひらがな,カタカナ,漢字,和文用の約物といった和文文字の
521       ことを指す.
522 %</ja>
523 %<*zh>
524 \item \textbf{JAchar}:表示日文字符,如平假名,片假名,汉字,日文标点。
525 %</zh>
526
527 %<*en>
528 \item \textbf{ALchar}: standing for all other characters like alphabets.
529 %</en>
530 %<*ja>
531 \item \textbf{ALchar}: アルファベットを始めとする,その他全ての文字を指す.
532 %</ja>
533 %<*zh>
534 \item \textbf{ALchar}:代表其他字母字符。
535 %</zh>
536 \end{itemize}
537
538 %<*en>
539 We say `alphabetic fonts' for fonts used in \textbf{ALchar}, and `Japanese fonts' for fonts used in \textbf{JAchar}.
540 %</en>
541 %<*ja>
542 そして,\textbf{ALchar}の出力に用いられるフォントを「欧文フォント」と呼び,
543 \textbf{JAchar}の出力に用いられるフォントを「和文フォント」と呼ぶ.
544 %</ja>
545 %<*zh>
546 我们将用于\textbf{ALchar}的字体称为“字母字体”,用于\textbf{JAchar}的字体称为“日文字体”。
547 %</zh>
548
549 %<*en>
550 \item A word in a sans-serif font (like \Param{prebreakpenalty})
551       means an internal parameter for Japanese typesetting, and it
552       is used as a key in \verb+\ltjsetparameter+ command.
553 %</en>
554 %<*ja>
555 \item サンセリフ体で書かれた語(例:\Param{prebreakpenalty})は日本語組版用の
556       パラメータを表し,これらは \verb+\ltjsetparameter+ コマンドのキーとして
557       用いられる.
558 %</ja>
559 %<*zh>
560 \item 用无衬线字体表示的词(如:\Param{prebreakpenalty})表示
561       日文排版中的内部便利iang,并用做\verb!\ltjsetparameter!命令一个键。
562 %</zh>
563
564 %<*en>
565 \item A word in typewriter font with underline (like \Pkg{fontspec})
566       means a package or a class of \LaTeX.
567 %</en>
568 %<*ja>
569 \item 下線付きタイプライタ体の語(例:\Pkg{fontspec})は\LaTeX の
570       パッケージやクラスを表す.
571 %</ja>
572 %<*zh>
573 \item 用下划线表示的词(如:\Pkg{fontspec})表示\LaTeX 的宏包或者文档类。
574 %</zh>
575
576 %<*en>
577 \item The word `primitive' is used not only for primitives in \LuaTeX,
578       but also for control sequences that defined in the core module of
579       \LuaTeX-ja.
580 %</en>
581 %<*ja>
582 \item 「プリミティブ」という語を,\LuaTeX のプリミティブだけではなく \LuaTeX-ja
583       のコアモジュールで定義されたコントロールシーケンスに対しても用いる.
584 %</ja>
585 %<*zh>
586 \item “primitive”,该词在本文档中不仅表示\LuaTeX 的基本控制命令,也包括\LuaTeX-ja的相关的基本控制命令
587 %</zh>
588
589 %<*en>
590 \item In this document, natural numbers start from~0.
591 %</en>
592 %<*ja>
593 \item 本ドキュメントでは,自然数は0から始まる.
594 %</ja>
595 %<*zh>
596 \item 所有的自然数从0开始
597 %</zh>
598 \end{itemize}
599
600 %<en>\subsection{About the project}
601 %<ja>\subsection{プロジェクトについて}
602 %<zh>\subsection{关于本项目}
603
604 %<*en>
605 \paragraph{Project Wiki} Project Wiki is under construction.
606 %</en>
607 %<*ja>
608 \paragraph{プロジェクトWiki} プロジェクトWikiは構築中である.
609 %</ja>
610 %<*zh>
611 \paragraph{项目wiki} 本项目wiki正在编写中。
612 %</zh>
613
614 %<*en>
615 \begin{itemize}
616 \item \url{http://sourceforge.jp/projects/luatex-ja/wiki/FrontPage%28en%29} (English)
617 \item \url{http://sourceforge.jp/projects/luatex-ja/wiki/FrontPage} (Japanese)
618 \item \url{http://sourceforge.jp/projects/luatex-ja/wiki/FrontPage%28zh%29} (Chinese)
619 \end{itemize}
620 %</en>
621 %<*ja>
622 \begin{itemize}
623 \item \url{http://sourceforge.jp/projects/luatex-ja/wiki/FrontPage}(日本語)
624 \item \url{http://sourceforge.jp/projects/luatex-ja/wiki/FrontPage%28en%29}(英語)
625 \item \url{http://sourceforge.jp/projects/luatex-ja/wiki/FrontPage%28zh%29}(中国語)
626 \end{itemize}
627 %</ja>
628 %<*zh>
629 \begin{itemize}
630 \item \url{http://sourceforge.jp/projects/luatex-ja/wiki/FrontPage}(日语)
631 \item \url{http://sourceforge.jp/projects/luatex-ja/wiki/FrontPage%28en%29}(英语)
632 \item \url{http://sourceforge.jp/projects/luatex-ja/wiki/FrontPage%28zh%29}(汉语)
633 \end{itemize}
634 %</zh>
635 %<*en>
636 This project is hosted by SourceForge.JP.
637 %</en>
638 %<*ja>
639 本プロジェクトはSourceForge.JPのサービスを用いて運営されている.
640 %</ja>
641 %<*zh>
642 本项目由SourceForge.JP托管。
643 %</zh>
644
645 %<en>\paragraph{Members}\
646 %<ja>\paragraph{開発メンバー}\
647 %<zh>\paragraph{开发者}\
648
649 %<*en>
650 \begin{multienumerate}
651 \def\labelenumi{$\bullet$}
652 \mitemxxx{Hironori KITAGAWA}{Kazuki MAEDA}{Takayuki YATO}
653 \mitemxxx{Yusuke KUROKI}{Noriyuki ABE}{Munehiro YAMAMOTO}
654 \mitemxxx{Tomoaki HONDA}{Shuzaburo SAITO}{MA Qiyuan}
655 \end{multienumerate}
656 %</en>
657 %<*ja>
658 \begin{multienumerate}
659 \def\labelenumi{$\bullet$}
660 \mitemxxx{北川 弘典}{前田 一貴}{八登 崇之}
661 \mitemxxx{黒木 裕介}{阿部 紀行}{山本 宗宏}
662 \mitemxxx{本田 知亮}{齋藤 修三郎}{馬 起園}
663 \end{multienumerate}
664 %</ja>
665 %<*zh>
666 \begin{multienumerate}
667 \def\labelenumi{$\bullet$}
668 \mitemxxx{北川 弘典}{前田 一贵}{八登 崇之}
669 \mitemxxx{黒木 裕介}{阿部 纪行}{山本 宗宏}
670 \mitemxxx{本田 知亮}{斋藤 修三郎}{马 起园}
671 \end{multienumerate}
672 %</zh>
673
674 % \paragraph{Acknowledgments} -- 挿入するならここ
675
676 \clearpage
677 %<en>\section{Getting Started}
678 %<ja>\section{使い方}
679 %<zh>\section{使用}
680 %<en>\subsection{Installation}
681 %<ja>\subsection{インストール}
682 %<zh>\subsection{安装}
683
684 %<*en>
685 To install the \LuaTeX-ja\ package, you will need:
686 %</en>
687 %<*ja>
688 \LuaTeX-jaパッケージのインストールには,次のものが必要である.
689 %</ja>
690 %<*zh>
691 安装\LuaTeX-ja之前,需要如下:
692 %</zh>
693 \begin{itemize}
694 %<*en>
695 \item \LuaTeX\ (version 0.65.0-beta or later) and its supporting packages.\\
696 If you are using \TeX~Live~2011 or current W32\TeX, you don't have to worry.
697 %</en>
698 %<*ja>
699 \item \LuaTeX(バージョン 0.65.0-beta 以降)とその支援パッケージ.
700       \TeX~Live~2011やW32\TeX の最新版ならば問題ない.
701 %</ja>
702 %<*zh>
703 \item \LuaTeX(版本号为大于0.65)和相关支持宏包。\\
704 如果用户使用的是\TeX Live2011以及最新版本的W32\TeX,可不考虑此项。
705 %</zh>
706 %<*en>
707 \item The source archive of \LuaTeX-ja, of course\texttt{:)}
708 %</en>
709 %<*ja>
710 \item \LuaTeX-jaのソースアーカイブ(もちろん\texttt{:)}).
711 %</ja>
712 %<*zh>
713 \item \LuaTeX-ja的源码(当然喽\texttt{:)})。
714 %</zh>
715 %<*en>
716 \item The \Pkg{xunicode} package, which version is \emph{just v0.981 (2011/09/09)}.\\
717 If you have the \Pkg{fontspec} package, this \Pkg{xunicode} package must be exist.
718 But be careful about the version; other versions may not work correctly with \LuaTeX-ja.
719 %</en>
720 %<*ja>
721 \item \Pkg{xunicode}パッケージ(\textbf{2011/09/09,~v0.981}).\\
722 \Pkg{fontspec}パッケージが導入されていればこのパッケージも導入されているはずであるが,
723 このv0.981以外のバージョンでは\LuaTeX-ja上で正しく動作しない危険性がある.
724 %</ja>
725 %<*zh>
726 \Pkg{xunicode}宏包,当前版本必须为\textit{v0.981(2011/09/09)}。\\
727 如果你使用\Pkg{fontspec}宏包,\Pkg{xunicode}就必须存在。但是请注意该包的
728 版本,其他版本可能不会正常工作。
729 %</zh>
730 \end{itemize}
731
732 %<*en>
733 The installation methods are as follows:
734 %</en>
735 %<*ja>
736 インストール方法は以下のようになる:
737 %</ja>
738 %<*zh>
739 安装方法如下:
740 %</zh>
741 \begin{enumerate}
742 %<*en>
743 \item Download the source archive, by one of the following method.
744       At the present, \LuaTeX-ja has no \emph{stable} release.
745
746 \begin{itemize}
747 \item Copy the Git repository:
748 \begin{verbatim}
749 $ git clone git://git.sourceforge.jp/gitroot/luatex-ja/luatexja.git
750 \end{verbatim}
751 \item Download the \texttt{tar.gz} archive of HEAD in the \texttt{master} branch from
752 \begin{flushleft}
753 \url{http://git.sourceforge.jp/view?p=luatex-ja/luatexja.git;a=snapshot;h=HEAD;sf=tgz}.
754 \end{flushleft}
755 \item Now \LuaTeX-ja is available from the following archive and distributions:
756   \begin{itemize}
757   \item CTAN (in the \texttt{macros/luatex/generic/luatexja} directory)
758   \item MiK\TeX\ (in \texttt{luatexja.tar.lzma})
759   \item \TeX\ Live (in \texttt{texmf-dist/tex/luatex/luatexja})
760   \item W32\TeX\ (in \texttt{luatexja.tar.xz})
761   \end{itemize}
762   These are based on the \texttt{master} branch.
763 \end{itemize}
764
765 Note that the \texttt{master} branch, and hence the archive in CTAN, are not updated frequently;
766 the forefront of development is not the \texttt{master} branch.
767 %</en>
768 %<*ja>
769 \item ソースアーカイブを以下のいずれかの方法で取得する.現在公開されているのはあくまでも
770       開発版であって,安定版でないことに注意.
771
772 \begin{itemize}
773 \item Gitリポジトリの内容をコピーする:
774 \begin{verbatim}
775 $ git clone git://git.sourceforge.jp/gitroot/luatex-ja/luatexja.git
776 \end{verbatim}
777 \item \texttt{master}ブランチのスナップショット(\texttt{tar.gz}形式)をダウンロードする.
778 \begin{flushleft}
779 \url{http://git.sourceforge.jp/view?p=luatex-ja/luatexja.git;a=snapshot;h=HEAD;sf=tgz}.
780 \end{flushleft}
781 \item 今や,\LuaTeX-jaは以下のアーカイブ,およびディストリビューションにも収録されている:
782   \begin{itemize}
783   \item CTAN (\texttt{macros/luatex/generic/luatexja})
784   \item MiK\TeX\ (\texttt{luatexja.tar.lzma})
785   \item \TeX\ Live (\texttt{texmf-dist/tex/luatex/luatexja})
786   \item W32\TeX\ (\texttt{luatexja.tar.xz})
787   \end{itemize}
788   これらは\texttt{master}ブランチの内容を元にしている.
789 \end{itemize}
790
791 \texttt{master}ブランチ(従って,CTAN内のアーカイブも)はたまにしか更新されないことに注意.
792 主な開発は\texttt{master}の外で行われ,比較的まとまってきたらそれを\texttt{master}に
793 反映させることにしている.
794 %</ja>
795 %<*zh>
796 \item 按照如下方法下载源码归档。现在,\LuaTeX-ja没有稳定版本。
797
798 \begin{itemize}
799 \item 复制Git仓库:
800 \begin{verbatim}
801 $ git clone git://git.sourceforge.jp/gitroot/luatex-ja/luatexja.git
802 \end{verbatim}
803 \item 下载\texttt{master} HEAD版本的\texttt{tar.gz}归档:
804 \begin{flushleft}
805 \url{http://git.sourceforge.jp/view?p=luatex-ja/luatexja.git;a=snapshot;h=HEAD;sf=tgz}.
806 \end{flushleft}
807 \item 现在\LuaTeX-ja可以在下列仓库和发行版中获取::
808   \begin{itemize}
809   \item CTAN ( \texttt{macros/luatex/generic/luatexja})
810   \item MiK\TeX\ (\texttt{luatexja.tar.lzma})
811   \item \TeX\ Live (\texttt{texmf-dist/tex/luatex/luatexja})
812   \item W32\TeX\ (\texttt{luatexja.tar.xz})
813   \end{itemize}
814   这些版本都基于\texttt{master}分支。
815 \end{itemize}
816
817 注意\texttt{master}分支和CTAN仓库中的版本,升级并不频繁。
818 前段开发并未在\texttt{master}分支。
819 %</zh>
820
821 %<*en>
822 \item Extract the archive. You will see \texttt{src/} and several other sub-directories.
823 But only the contents in \texttt{src/} are needed to work \LuaTeX-ja.
824 %</en>
825 %<*ja>
826 \item 「Gitリポジトリをコピー」以外の方法でアーカイブを取得したならば,それを展開する.
827       \texttt{src/}をはじめとしたいくつかのディレクトリができるが,
828       動作には\texttt{src/}以下の内容だけで十分.
829 %</ja>
830 %<*zh>
831 \item 解压归档。你会看到\texttt{src/}和其他相关文件夹。
832 但是只有\texttt{src/}文件夹下的相关文件是\LuaTeX-ja运行所必须的。
833 %</zh>
834
835 %<*en>
836 \item Copy all the contents of \texttt{src/} into one of your \texttt{TEXMF} tree.
837       \texttt{TEXMF/tex/luatex/luatexja/} is an example location.
838       If you cloned entire Git repository, making a symbolic link of \texttt{src/}
839       instead copying is also good.
840 %</en>
841 %<*ja>
842 \item \texttt{src/}の中身を自分の\texttt{TEXMF}ツリーにコピーする.
843       場所の例としては,例えば\texttt{TEXMF/tex/luatex/luatexja/}がある.
844       シンボリックリンクが利用できる環境で,かつリポジトリを直接取得したのであれば,
845       (更新を容易にするために)コピーではなくリンクを貼ることを勧める.
846 %</ja>
847 %<*zh>
848 \item 复制\texttt{src/}文件夹下内容至\texttt{TEXMF}数下。
849 \texttt{TEXMF/tex/luatex/luatexja/}为例。
850 如果你复制了整个Git仓库,为\texttt{src/}制作软链接来替代复制也是可以的。
851 %</zh>
852
853 %<*en>
854 \item If \texttt{mktexlsr} is needed to update the file name database, make it so.
855 %</en>
856 %<*ja>
857 \item 必要があれば,\texttt{mktexlsr}を実行する.
858 %</ja>
859 %<*zh>
860 \item 如有必要,执行\texttt{mktexlsr}。
861 %</zh>
862 \end{enumerate}
863
864 %<en>\subsection{Cautions}
865 %<ja>\subsection{注意点}
866 %<zh>\subsection{注意}
867
868
869 \begin{itemize}
870 %<*en>
871 \item The encoding of your source file must be UTF-8. No other
872       encodings, such as EUC-JP or Shift-JIS, are not supported.
873 %</en>
874 %<*ja>
875 \item 原稿のソースファイルの文字コードはUTF-8固定である.
876       従来日本語の文字コードとして用いられてきたEUC-JPやShift-JISは使用できない.
877 %</ja>
878 %<*zh>
879 \item 源文档编码必须是UTF-8。其他的编码,如EUC-JP和Shift-JIS都不被支持。
880 %</zh>
881 \end{itemize}
882
883 %<en>\subsection{Using in plain \TeX}
884 %<ja>\subsection{plain \TeX で使う}
885 %<zh>\subsection{plain \TeX 下使用}
886 \label{ssec-plain}
887
888 %<*en>
889 To use \LuaTeX-ja in plain \TeX, simply put the following at the beginning of the document:
890 %</en>
891 %<*ja>
892 \LuaTeX-jaを plain \TeX で使うためには,単に次の行をソースファイルの冒頭に追加すればよい:
893 %</ja>
894 %<*zh>
895 在plain \TeX 下使用\LuaTeX-ja相当简易,在文档开头放置一行:
896 %</zh>
897 \begin{verbatim}
898 \input luatexja.sty
899 \end{verbatim}
900 %<*en>
901 This does minimal settings (like \texttt{ptex.tex}) for typesetting Japanese documents:
902 %</en>
903 %<*ja>
904 これで(\texttt{ptex.tex}のように)日本語組版のための最低限の設定がなされる:
905 %</ja>
906 %<*zh>
907 这里做出了做小的日文文档排版设定(如\texttt{ptex.tex}):
908 %</zh>
909
910 \begin{itemize}
911 %<*en>
912 \item The following 6~Japanese fonts are preloaded:
913 \begin{center}\small
914 \begin{tabular}{ccccc}
915 \toprule
916 \textbf{classification}&\textbf{font name}&\bf `10\,pt'&\bf`7\,pt'&\bf`5\,pt'\\\midrule
917 \emph{mincho}&Ryumin-Light    &\verb+\tenmin+&\verb+\sevenmin+&\verb+\fivemin+\\
918 \emph{gothic}&GothicBBB-Medium&\verb+\tengt+ &\verb+\sevengt+ &\verb+\fivegt+\\
919 \bottomrule
920 \end{tabular}
921 \end{center}
922 %</en>
923 %<*ja>
924 \item 以下の6つの和文フォントが定義される:
925 \begin{center}\small
926 \begin{tabular}{ccccc}
927 \toprule
928 \textbf{字体}&\textbf{フォント名}&\bf `10\,pt'&\bf`7\,pt'&\bf`5\,pt'\\\midrule
929 明朝体&Ryumin-Light    &\verb+\tenmin+&\verb+\sevenmin+&\verb+\fivemin+\\
930 ゴシック体&GothicBBB-Medium&\verb+\tengt+ &\verb+\sevengt+ &\verb+\fivegt+\\
931 \bottomrule
932 \end{tabular}
933 \end{center}
934 %</ja>
935 %<*zh>
936 \item 提前加载了六种日文字体,如下:
937 \begin{center}\small
938 \begin{tabular}{ccccc}
939 \toprule
940 \textbf{字体}&\textbf{字体名}&\bf `10\,pt'&\bf`7\,pt'&\bf`5\,pt'\\\midrule
941 明朝体&Ryumin-Light    &\verb+\tenmin+&\verb+\sevenmin+&\verb+\fivemin+\\
942 哥特体&GothicBBB-Medium&\verb+\tengt+ &\verb+\sevengt+ &\verb+\fivegt+\\
943 \bottomrule
944 \end{tabular}
945 \end{center}
946 %</zh>
947 \begin{itemize}
948 %<*en>
949 \item It is widely accepted that the font `Ryumin-Light' and
950       `GothicBBB-Medium' aren't embedded into PDF files, and PDF reader
951       substitute them by some external Japanese fonts (\textit{e.g.},
952       Kozuka Mincho is used for Ryumin-Light in Adobe Reader). We adopt this custom to
953       the default setting.
954 %</en>
955 %<*ja>
956 \item `Ryumin-Light'と`GothicBBB-Medium'はPDFファイルに埋め込まずに
957       名前参照のみで用いることが広く受け入れられており,この場合PDFリーダーが
958       適切な外部フォントで代用する(例えば,Adobe ReaderではRyumin-Lightは
959       小塚明朝で代替される).そこで,これらを引き続きデフォルトのフォントと
960       して採用する.
961 %</ja>
962 %<*zh>
963 \item 广为接受的“Ryumin-Light”和“GothicBBB-Medium”字体不嵌入PDF文件,
964 而PDF阅读器则会使用外部日文字体替代(例如,在Adobe Reader中使用
965 Kozuka Mincho字体替代Ryumin-Light)。我们使用默认设定。
966 %</zh>
967
968 %<*en>
969 \item A character in an alphabetic font is generally smaller than a
970       Japanese font in the same size. So actual size specification of
971       these Japanese fonts is in fact smaller than that of alphabetic
972       fonts, namely scaled by 0.962216.
973 %</en>
974 %<*ja>
975 \item 欧文フォントの文字は和文フォントの文字よりも,同じ文字サイズでも
976       一般に小さくデザインされている.そこで,標準ではこれらの和文フォントの実際のサイズは指定された値よりも
977       小さくなるように設定されており,具体的には指定の0.962216倍にスケールされる.
978       この0.962216という数値も,\pTeX におけるスケーリングを踏襲した値である.
979 %</ja>
980 %<*zh>
981 \item 一般情况下,相同大小日文字体比西文字体要大一下。所以实际的日文字体尺寸需哟小于西文字
982 体,即使用一个缩放率:0.962216。
983 %</zh>
984 \end{itemize}
985
986 %<*en>
987 \item The amount of glue that are inserted between a \textbf{JAchar} and
988       an \textbf{ALchar} (the parameter \Param{xkanjiskip}) is set to
989 %</en>
990 %<*ja>
991 \item \textbf{JAchar}と\textbf{ALchar}の間に入るグルー(\Param{xkanjiskip})の
992       量は次のように設定されている:
993 %</ja>
994 %<*zh>
995 \item 在\textbf{JAchar}和\textbf{ALchar}之间插入的胶(\textsf{xkanjiskip}参数)大小为:
996 %</zh>
997 \[
998  (0.25\cdot 0.962216\cdot 10\,\mathrm{pt})^{+1\,\text{pt}}_{-1\,\text{pt}}
999  = 2.40554\,\mathrm{pt}^{+1\,\text{pt}}_{-1\,\text{pt}}.
1000 \]
1001 \end{itemize}
1002
1003 %<en>\subsection{Using in \LaTeX}
1004 %<ja>\subsection{\LaTeX で使う}
1005 %<zh>\subsection{\LaTeX 下使用}
1006 \label{ssec-ltx}
1007
1008 \paragraph{\LaTeXe}
1009
1010 %<*en>
1011 Using in \LaTeXe\ is basically same. To set up the minimal environment
1012 for Japanese, you only have to load \texttt{luatexja.sty}:
1013 %</en>
1014 %<*ja>
1015 \LaTeXe を用いる場合も基本的には同じである.日本語組版のための最低限の環境を
1016 設定するためには,\texttt{luatexja.sty}を読み込むだけでよい:
1017 %</ja>
1018 %<*zh>
1019 在\LaTeXe 下使用基本相同。设定日文的最小环境,你只需加载\texttt{luatexja.sty}:
1020 %</zh>
1021 \begin{verbatim}
1022 \usepackage{luatexja}
1023 \end{verbatim}
1024 %<*en>
1025 It also does minimal settings (counterparts in \pLaTeX\ are \texttt{
1026 plfonts.dtx} and \texttt{pldefs.ltx}):
1027 %</en>
1028 %<*ja>
1029 これで\pLaTeX の\texttt{plfonts.dtx}と\texttt{pldefs.ltx}に相当する最低限の設定が
1030 なされる:
1031 %</ja>
1032 %<*zh>
1033 这些做了最小的设定(作用相当于\pLaTeX 中的\texttt{plfonts.dtx}和\texttt{pldefs.ltx}):
1034 %</zh>
1035
1036 \begin{itemize}
1037 %<*en>
1038 \item \texttt{JY3} is the font encoding for Japanese fonts (in horizontal direction).\\
1039 When vertical typesetting is supported by \LuaTeX-ja in the future, \texttt{JT3} will be used for vertical fonts.
1040 %</en>
1041 %<*ja>
1042 \item \texttt{JY3}は和文フォント用のフォントエンコーディングである(横書き用).\\
1043 将来的に,\LuaTeX-jaで縦書きがサポートされる際には,\texttt{JT3}を縦書き用として
1044 用いる予定である.
1045 %</ja>
1046 %<*zh>
1047 \item \texttt{JY3}是日文字体编码(在水平方向)。\\
1048 在将来\LuaTeX-ja要支持直行排版的时候,\texttt{JT3}会用于直行字体。
1049 %</zh>
1050
1051 %<*en>
1052 \item Two font families \texttt{mc} and \texttt{gt} are defined:
1053 \begin{center}\small
1054 \begin{tabular}{ccccc}
1055 \toprule
1056 \textbf{classification}&\textbf{family}&\verb+\mdseries+&\verb+\bfseries+&\textbf{scale}\\\midrule
1057 \emph{mincho}&\tt mc&Ryumin-Light    &GothicBBB-Medium&0.962216\\
1058 \emph{gothic}&\tt gt&GothicBBB-Medium&GothicBBB-Medium&0.962216\\
1059 \bottomrule
1060 \end{tabular}
1061 \end{center}
1062 Remark that the bold series in both family are same as the medium series of \emph{gothic} family.
1063 This is a convention in \pLaTeX. This is a trace that there were only 2~fonts (these are Ryumin-Light
1064 and GothicBBB-Medium) in early years of DTP.
1065 %</en>
1066 %<*ja>
1067 \item 2つのフォントファミリ\texttt{mc}と\texttt{gt}が定義されている:
1068 \begin{center}\small
1069 \begin{tabular}{ccccc}
1070 \toprule
1071 \textbf{字体}&\textbf{ファミリ}&\verb+\mdseries+&\verb+\bfseries+&\textbf{スケール}\\\midrule
1072 明朝体&\tt mc&Ryumin-Light    &GothicBBB-Medium&0.962216\\
1073 ゴシック体&\tt gt&GothicBBB-Medium&GothicBBB-Medium&0.962216\\
1074 \bottomrule
1075 \end{tabular}
1076 \end{center}
1077 どちらのファミリにおいても,そのboldシリーズはゴシック体のmediumシリーズで
1078 あることに注意.これは初期のDTPにおいて和文フォントが2つ(それがちょうど\
1079 Ryumin-Light, GothicBBB-Mediumだった)しか利用できなかった時の名残であり,\pLaTeX{}
1080 での標準設定とも同じである.
1081 %</ja>
1082 %<*zh>
1083 \item 定义了两个字体族:\texttt{mc}!和\texttt{gt}:\\
1084 \begin{center}\small
1085         \begin{tabular}{ccccc}
1086         \hline
1087         \textbf{字体}&\textbf{字体族}&\verb!\mdseries!&\verb!\bfseries!&缩放率\\
1088         \hline
1089         \textit{mincho}&\verb!mc!&Ryumin-Light&GothicBBB-Medium&0.962216\\
1090         \textit{gothic}&\verb!gt!&GothicBBB-Medium&GothicBBB-Medium&0.962216\\
1091         \hline
1092         \end{tabular}
1093 \end{center}
1094 注意的是两个字体族的粗体系列同为中等系列的\textbf{哥特}族。这\pLaTeX 中的规定。在近些年
1095 中的DTP实务中有仅使用2个字体的趋向(是为Ryumin-Light和GothicBBB-Medium)。
1096 %</zh>
1097
1098 %<*en>
1099 \item Japanese characters in math mode are typeset by the font family \texttt{mc}.
1100 %</en>
1101 %<*ja>
1102 \item 数式モード中の和文文字は\texttt{mc}ファミリで出力される.
1103 %</ja>
1104 %<*zh>
1105 \item 在数学模式下,日文字符使用\verb!mc!字体族来排印。
1106 %</zh>
1107 \end{itemize}
1108
1109 %<*en>
1110 However, above settings are not sufficient for Japanese-based
1111 documents. To typeset Japanese-based documents, you are better to use
1112 class files other than \texttt{article.cls}, \texttt{book.cls}, and so on.  At
1113 the present, we have the counterparts of \Pkg{jclasses} (standard
1114 classes in \pLaTeX) and \Pkg{jsclasses} (classes by Haruhiko
1115 Okumura), namely, \Pkg{ltjclasses} and \Pkg{ltjsclasses}.
1116 %</en>
1117 %<*ja>
1118 しかしながら,上記の設定は日本語の文書にとって十分とは言えない.
1119 日本語文書を組版するためには,\texttt{article.cls}, \texttt{book.cls}といった
1120 欧文用のクラスファイルではなく,和文用のクラスファイルを用いた方がよい.
1121 現時点では,\Pkg{jclasses}(\pLaTeX の標準クラス)と\Pkg{jsclasses}
1122 (奥村晴彦氏によるクラスファイル)に対応するものとして,\Pkg{ltjclasses},
1123 \Pkg{ltjsclasses}がそれぞれ用意されている.
1124 %</ja>
1125 %<*zh>
1126 不过,上述设定并不能满足排版基于日文的文档。为了排印基于日文的文
1127 档,你最好不要使用\texttt{article.cls},\texttt{book.cls}等文档类文件。
1128 现在,我们有相当于\Pkg{jclasses}(\pLaTeX 标准文档类)和\Pkg{jsclasses}
1129 (奥村晴彦)的文档类,即\Pkg{ltjclasses}和\Pkg{ltjsclasses}。
1130 %</zh>
1131
1132 %<en>\section{Changing Fonts}
1133 %<ja>\section{フォントの変更}
1134 %<zh>\section{字体更改}
1135
1136 \subsection{plain \TeX~and~\LaTeXe}
1137 \label{ssub-chgfnt}
1138
1139 \paragraph{plain \TeX}
1140 %<*en>
1141 To change Japanese fonts in plain \TeX, you must use the primitive
1142 \verb+\jfont+. So please see Subsection~\ref{ssec-jfont}.
1143 %</en>
1144 %<*ja>
1145 plain \TeX で和文フォントを変更するためには,\verb+\jfont+ プリミティブを直接用いる.
1146 \ref{ssec-jfont}節を参照.
1147 %</ja>
1148 %<*zh>
1149 在plain \TeX 下改变日文字体,你必须使用基本语句\verb!\jfont!。请参见\ref{ssec-jfont}。
1150 %</zh>
1151
1152 \paragraph{\LaTeXe\ (NFSS2)}
1153 %<*en>
1154 For \LaTeXe, \LuaTeX-ja adopted most of the font selection system of \pLaTeXe\ (in \texttt{plfonts.dtx}).
1155 %</en>
1156 %<*ja>
1157 \LaTeXe については,\LuaTeX-jaではフォント選択システムを\pLaTeXe\ (\texttt{plfonts.dtx})
1158 の大部分をそのまま採用している.
1159 %</ja>
1160 %<*zh>
1161 对于\LaTeXe,\LuaTeX-ja采用了\pLaTeXe 中(即\texttt{plfonts.dtx})大部分字体选择系统。
1162 %</zh>
1163 \begin{itemize}
1164 %<*en>
1165 \item Two control sequences \verb+\mcdefault+ and \verb+\gtdefault+ are
1166       used to specify the default font families for \emph{mincho} and
1167       \emph{gothic}, respectively. Default values: \texttt{mc} for
1168       \verb+\mcdefault+ and \texttt{gt} for \verb+\gtdefault+.
1169 %</en>
1170 %<*ja>
1171 \item 2つのコントロールシーケンス \verb+\mcdefault+ と \verb+\gtdefault+ がそれぞ
1172       れ明朝体とゴシック体のデフォルトのフォントファミリを指定するために用いられる.
1173       初期値:\verb+\mcdefault+ は\texttt{mc},\verb+\gtdefault+ は\texttt{gt}.
1174 %</ja>
1175 %<*zh>
1176 \item \verb!\mcdefault!和\verb!\gtdefault!控制语句用来分别控制默认的\textit{mincho}和\textit{gothic}字体族。
1177         默认值:\texttt{mc}用于\verb!\mcdefault!,\texttt{gt}用于\verb!\gtdefault!。
1178 %</zh>
1179 %<*en>
1180 \item Commands \verb+\fontfamily+, \verb+\fontseries+,
1181       \verb+\fontshape+ and \verb+\selectfont+ can be used to change
1182       attributes of Japanese fonts.
1183 %</en>
1184 %<*ja>
1185 \item \verb+\fontfamily+, \verb+\fontseries+, \verb+\fontshape+, そして
1186       \verb+\selectfont+ が和文フォントの属性を変更するために使用できる.
1187 %</ja>
1188 %<*zh>
1189 \item 命令\verb!\fontfamily!,\verb!\fontseries!,\verb!\fontshape!个\verb!\selectfont!用来改变日文字体属性。
1190 %</zh>
1191
1192 %<*en>
1193 \begin{center}\small
1194 \begin{tabular}{cccccc}
1195 \toprule
1196 &\textbf{encoding}&\textbf{family}&\textbf{series}&\textbf{shape}&\textbf{selection}\\\midrule
1197 alphabetic fonts
1198 &\verb+\romanencoding+&\verb+\romanfamily+&\verb+\romanseries+&\verb+\romanshape+
1199 &\verb+\useroman+\\
1200 Japanese fonts
1201 &\verb+\kanjiencoding+&\verb+\kanjifamily+&\verb+\kanjiseries+&\verb+\kanjishape+
1202 &\verb+\usekanji+\\
1203 both&---&--&\verb+\fontseries+&\verb+\fontshape+&---\\
1204 auto select&\verb+\fontencoding+&\verb+\fontfamily+&---&---&\verb+\usefont+\\
1205 \bottomrule
1206 \end{tabular}
1207 \end{center}
1208 %</en>
1209 %<*ja>
1210 \begin{center}\small
1211 \begin{tabular}{cccccc}
1212 \toprule
1213 &\textbf{エンコーディング}&\textbf{ファミリ}&\textbf{シリーズ}&\textbf{シェープ}&\textbf{選択}\\\midrule
1214 欧文
1215 &\verb+\romanencoding+&\verb+\romanfamily+&\verb+\romanseries+&\verb+\romanshape+
1216 &\verb+\useroman+\\
1217 和文
1218 &\verb+\kanjiencoding+&\verb+\kanjifamily+&\verb+\kanjiseries+&\verb+\kanjishape+
1219 &\verb+\usekanji+\\
1220 両方&---&--&\verb+\fontseries+&\verb+\fontshape+&---\\
1221 自動選択&\verb+\fontencoding+&\verb+\fontfamily+&---&---&\verb+\usefont+\\
1222 \bottomrule
1223 \end{tabular}
1224 \end{center}
1225 %</ja>
1226 %<*zh>
1227 \begin{center}\small
1228 \begin{tabular}{cccccc}
1229 \toprule
1230 &\textbf{编码}&\textbf{族}&\textbf{系列}&\textbf{形状}&\textbf{选择}\\\midrule
1231 西文字体
1232 &\verb+\romanencoding+&\verb+\romanfamily+&\verb+\romanseries+&\verb+\romanshape+
1233 &\verb+\useroman+\\
1234 日文字体
1235 &\verb+\kanjiencoding+&\verb+\kanjifamily+&\verb+\kanjiseries+&\verb+\kanjishape+
1236 &\verb+\usekanji+\\
1237 两者&---&--&\verb+\fontseries+&\verb+\fontshape+&---\\
1238 自动选择&\verb+\fontencoding+&\verb+\fontfamily+&---&---&\verb+\usefont+\\
1239 \bottomrule
1240 \end{tabular}
1241 \end{center}
1242 %</zh>
1243
1244 %<*en>
1245       \verb+\fontencoding{<encoding>}+ changes the encoding of alphabetic fonts
1246       or Japanese fonts depending on the argument. For example,
1247       \verb+\fontencoding{JY3}+ changes the encoding of Japanese fonts to
1248       \texttt{JY3} and \verb+\fontencoding{T1}+ changes the encoding of
1249       alphabetic fonts to \texttt{T1}.
1250       \verb+\fontfamily+ also changes the family of Japanese fonts, alphabetic
1251       fonts, \emph{or both}. For detail, see Subsection~\ref{ssub-nfsspat}.
1252 %</en>
1253 %<*ja>
1254       ここで,\verb+\fontencoding{<encoding>}+ は,引数により和文側か欧文
1255       側かのどちらかのエンコーディングを変更する.例えば,
1256       \verb+\fontencoding{JY3}+ は和文フォントのエンコーディングを
1257       \texttt{JY3}に変更し,\verb+\fontencoding{T1}+ は欧文フォント側を
1258       \texttt{T1}へと変更する.\verb+\fontfamily+ も引数により和文側,欧文
1259       側,\textbf{あるいは両方}のフォントファミリを変更する.詳細は
1260       \ref{ssub-nfsspat}節を参照すること.
1261 %</ja>
1262 %<*zh>
1263       \verb!\fontencoding{<encoding>}!依赖于参数以改变西文字体或者日文字体。
1264       例如,\verb!\fontencoding{JY3}!改变当前日文字体至\texttt{JY3},
1265       \verb!\fontencoding{T1}!改变西文字体至\texttt{T1}。
1266       \verb!\fontfamily!也会改变日文字体或西文字体的族,抑或二者。
1267       细节详见\ref{ssub-nfsspat}。
1268 %</zh>
1269
1270 %<*en>
1271 \item For defining a Japanese font family, use
1272       \verb+\DeclareKanjiFamily+ instead of
1273       \verb+\DeclareFontFamily+. However, in the present implementation,
1274       using \verb+\DeclareFontFamily+ doesn't cause any problem.
1275 %</en>
1276 %<*ja>
1277 \item 和文フォントファミリの定義には \verb+\DeclareFontFamily+ の
1278       代わりに \verb+\DeclareKanjiFamily+ を用いる.しかし,現在の
1279       実装では \verb+\DeclareFontFamily+ を用いても問題は生じない.
1280 %</ja>
1281 %<*zh>
1282 \item 对于定义日文字体族,使用\verb!\DeclareKanjiFamily!代替\verb!\DeclareFontFamily!。
1283       不过,在现在的实现中,使用\verb!\DeclareFontFamily!不会引起任何问题。
1284 %</zh>
1285 \end{itemize}
1286
1287 %<*en>
1288 \paragraph{Remark: Japanese Characters in Math Mode}
1289 Since \pTeX\ supports Japanese characters in math mode, there are
1290 sources like the following:
1291 %</en>
1292 %<*ja>
1293 \paragraph{注意:数式モード中の和文文字}
1294 \pTeX では,特に何もしないでも数式中に和文文字を記述することができた.そのため,
1295 以下のようなソースが見られた:
1296 %</ja>
1297 %<*zh>
1298 \paragraph{注记:数学模式下的日文字符}
1299 \pTeX 支持在数学模式下的日文字符,如以下源码:
1300 %</zh>
1301
1302 \begin{LTXexample}
1303 $f_{高温}$~($f_{\text{high temperature}}$).
1304 \[ y=(x-1)^2+2\quad よって\quad y>0 \]
1305 $5\in 素:=\{\,p\in\mathbb N:\text{$p$ is a prime}\,\}$.
1306 \end{LTXexample}
1307 %<*en>
1308 We (the project members of \LuaTeX-ja) think that using
1309 Japanese characters in math mode are allowed if and only if these are used as identifiers.
1310 In this point of view,
1311 %</en>
1312 %<*ja>
1313 \LuaTeX-jaプロジェクトでは,数式モード中での和文文字はそれらが識別子として用いられる
1314 ときのみ許されると考えている.
1315 この観点から,
1316 %</ja>
1317 %<*zh>
1318 我们(\LuaTeX-ja项目成员)认为在数学模式下使用日文字符,只有在这些字符充当标识符时才是正确的。在这点下:
1319 %</zh>
1320 \begin{itemize}
1321 %<*en>
1322 \item The lines 1~and~2 above are not correct, since `高温' in above is used as a textual label, and
1323 `よって' is used as a conjunction.
1324 %</en>
1325 %<*ja>
1326 \item 上記数式のうち1, 2行目は正しくない.なぜならば`高温'が意味のあるラベルと
1327       して,`よって'が接続詞として用いられているからである.
1328 %</ja>
1329 %<*zh>
1330 \item 第1行和第2行是不正确的,因为“高温”的作用为文本标签,“よって”用作为连词。
1331 %</zh>
1332 %<*en>
1333 \item However, the line~3 is correct, since `素' is used as an identifier.
1334 %</en>
1335 %<*ja>
1336 \item しかしながら,3行目は`素'が識別子として用いられているので正しい.
1337 %</ja>
1338 %<*zh>
1339 \item 不过,第3行是正确的,因为“素”是作为标识符的。
1340 %</zh>
1341 \end{itemize}
1342 %<*en>
1343 Hence, in our opinion, the above input should be corrected as:
1344 %</en>
1345 %<*ja>
1346 したがって,\LuaTeX-jaプロジェクトの意見としては,上記の入力は次のように直されるべき
1347 である:
1348 %</ja>
1349 %<*zh>
1350 那么,根据我们的观点,上述输入应当校正为:
1351 %</zh>
1352 \begin{LTXexample}
1353 $f_{\text{高温}}$~%
1354 ($f_{\text{high temperature}}$).
1355 \[ y=(x-1)^2+2\quad
1356   \mathrel{\text{よって}}\quad y>0 \]
1357 $5\in 素:=\{\,p\in\mathbb N:\text{$p$ is a prime}\,\}$.
1358 \end{LTXexample}
1359 %BUG?: \{\}がなければ「素」がでない.上の段落の「よって」もでてない.
1360 %<*en>
1361 We also believe that using Japanese characters as identifiers is rare,
1362 hence we don't describe how to change Japanese fonts in math mode in
1363 this chapter. For the method, please see Subsection~\ref{ssec-math}.
1364 %</en>
1365 %<*ja>
1366 また\LuaTeX-jaプロジェクトでは,和文文字が識別子として用いられることはほとんどない
1367 と考えており,したがってこの節では数式モード中の和文フォントを変更する方法については
1368 記述しない.この方法については\ref{ssec-math}節を参照のこと.
1369 %</ja>
1370 %<*zh>
1371 我们也认为使用日文字符作为标识符的情况极为少见,所以我们不在此章节描述如何在数学模式下改变日文字体。
1372 关于此方法,请参见\ref{ssec-math}。
1373 %</zh>
1374
1375 \subsection{fontspec}
1376 \label{ssec-fontspec}
1377 %<*en>
1378 To coexist with the \Pkg{fontspec} package, it is needed to load
1379 \Pkg{luatexja-fontspec} package in the preamble. This additional
1380 package automatically loads \Pkg{luatexja} and \Pkg{fontspec}
1381 package, if needed.
1382 %</en>
1383 %<*ja>
1384 \Pkg{fontspec}パッケージと同様の機能を和文フォントに対しても用いるためには,
1385 \Pkg{luatexja-fontspec}パッケージをプリアンブルで読み込む必要がある.このパッケージ
1386 は必要ならば自動で\Pkg{luatexja}パッケージと\Pkg{fontspec}パッケージを読み込む.
1387 %</ja>
1388 %<*zh>
1389 为与\Pkg{fontspec}宏包共存,需要在导言区中使用\Pkg{luatexja-fontspec}宏包。
1390 这个附加宏包会自动加载\Pkg{luatexja}和\Pkg{fontspec}。
1391 %</zh>
1392
1393 %<*en>
1394 In \Pkg{luatexja-fontspec} package, the following 7~commands are defined as
1395 counterparts of original commands in the \Pkg{fontspec} package:
1396 %</en>
1397 %<*ja>
1398 \Pkg{luatexja-fontspec}パッケージでは,以下の7つのコマンドを\Pkg{fontspec}
1399 パッケージの元のコマンドに対応するものとして定義している:
1400 %</ja>
1401 %<*zh>
1402 在\Pkg{luatexja-fontspec}中,定义了如下七条命令,这些命令和\Pkg{fontspec}的相关命令对比如下:
1403 %</zh>
1404 %<*en>
1405 \begin{center}\small
1406 \begin{tabular}{ccccc}
1407 \toprule
1408 Japanese fonts
1409 &\verb+\jfontspec+&\verb+\setmainjfont+&\verb+\setsansjfont+&\verb+\newjfontfamily+\\
1410 alphabetic fonts
1411 &\verb+\fontspec+&\verb+\setmainfont+&\verb+\setsansfont+&\verb+\newfontfamily+\\
1412 \midrule
1413 Japanese fonts
1414 &\verb+\newjfontface+&\verb+\defaultjfontfeatures+&\verb+\addjfontfeatures+\\
1415 alphabetic fonts
1416 &\verb+\newfontface+&\verb+\defaultfontfeatures+&\verb+\addfontfeatures+\\
1417 \bottomrule
1418 \end{tabular}
1419 \end{center}
1420 %</en>
1421 %<*ja>
1422 \begin{center}\small
1423 \begin{tabular}{cccc}
1424 \toprule
1425 和文
1426 &\verb+\jfontspec+&\verb+\setmainjfont+&\verb+\setsansjfont+\\
1427 欧文
1428 &\verb+\fontspec+&\verb+\setmainfont+&\verb+\setsansfont+\\
1429 \midrule
1430 和文
1431 &\verb+\newjfontfamily+&\verb+\newjfontface+&\verb+\defaultjfontfeatures+\\
1432 欧文
1433 &\verb+\newfontfamily+&\verb+\newfontface+&\verb+\defaultfontfeatures+\\
1434 \midrule
1435 和文
1436 &\verb+\addjfontfeatures+\\
1437 欧文
1438 &\verb+\addfontfeatures+\\
1439 \bottomrule
1440 \end{tabular}
1441 \end{center}
1442 %</ja>
1443 %<*zh>
1444 \begin{center}\small
1445 \begin{tabular}{ccccc}
1446 \toprule
1447 日文字体&\verb+\jfontspec+&\verb+\setmainjfont+&\verb+\setsansjfont+&\verb+\newjfontfamily+\\
1448 西文字体&\verb+\fontspec+&\verb+\setmainfont+&\verb+\setsansfont+&\verb+\newfontfamily+\\
1449 \midrule
1450 日文字体&\verb+\newjfontface+&\verb+\defaultjfontfeatures+&\verb+\addjfontfeatures+&\\
1451 西文字体&\verb+\newfontface+&\verb+\defaultfontfeatures+&\verb+\addfontfeatures+&\\
1452 \bottomrule
1453 \end{tabular}
1454 \end{center}
1455 %</zh>
1456
1457 \begin{LTXexample}
1458 \fontspec[Numbers=OldStyle]{LMSans10-Regular}
1459 \jfontspec{IPAexMincho}
1460 JIS~X~0213:2004→辻
1461
1462 \addjfontfeatures{CJKShape=JIS1990}
1463 JIS~X~0208:1990→辻
1464 \end{LTXexample}
1465
1466 %<*en>
1467 Note that there is no command named \verb+\setmonojfont+, since it is
1468 popular for Japanese fonts that nearly all Japanese glyphs have same
1469 widths.  Also note that the kerning feature is set off by default in
1470 these 7~commands, since this feature and \textbf{JAglue} will clash (see
1471 \ref{para-kern}).
1472 %</en>
1473 %<*ja>
1474 和文フォントについては全ての和文文字のグリフがほぼ等幅であるのが普通であるため,
1475 \verb+\setmonojfont+ コマンドは存在しないことに注意.また,これらの和文用の7つのコマ
1476 ンドではKerning featureはデフォルトではoffとなっている.これはこの
1477 featureが\textbf{JAglue}と衝突するためである(\ref{para-kern}節を参照).
1478 %</ja>
1479 %<*zh>
1480 请注意并没有\verb!\setmonofont!命令,因为流行的日文字体几乎全部是等宽的。
1481 另注意,出格特性在这7个命令中默认关闭,因为此特性会与\textbf{JAglue}冲突(参见\ref{para-kern})。
1482 %</zh>
1483
1484 %<en>\subsection{Preset}
1485 %<ja>\subsection{プリセット設定}
1486 \label{ssec-preset}
1487
1488 %<*en>
1489 To use standard Japanese font settings easily, one can load \Pkg{luatexja-preset}
1490 package with several options. This package provides functions in a part of
1491 \Pkg{otf} package and a part of \Pkg{PXchfon} package by Takayuki Yato,
1492 and loads \Pkg{luatexja-fontspec} internally.
1493 %</en>
1494 %<*ja>
1495 よく使われている和文フォント設定を一行で指定できるようにしたのが
1496 \Pkg{luatexja-preset}パッケージである.このパッケージは,
1497 \Pkg{otf}パッケージの一部機能と八登崇之氏による\Pkg{PXchfon}パッケージの一部機能とを
1498 合わせたような格好をしており,内部で\Pkg{luatexja-fontspec}を読み込んでいる.
1499 %</ja>
1500
1501 %<en>\paragraph{General options}
1502 %<ja>\paragraph{一般的なオプション}
1503 \begin{list}{}{\def\makelabel{\ttfamily}\def\{{\char`\{}\def\}{\char`\}}\advance\leftmargin1\zw}
1504 \item[deluxe]
1505 %<*en>
1506 Specifying this option enables us to use \textit{mincho} with two weights (medium~and~bold),
1507 \textit{gothic} with three weights (medium,~bold and~heavy), and \textit{rounded gothic}%
1508 \footnote{Provided by \texttt{\char92mgfamily},
1509 because \textit{rounded gothic} is called \textit{maru gothic} (丸ゴシック) in Japanese.}.
1510 The heavy weight of \textit{gothic} can be used by ``changing the family'' \verb+\gtebfamily+.
1511 This is because \Pkg{fontspec} package can handle only medium (\verb+\mdseries+) and
1512 bold (\verb+\bfseries+).
1513 %</en>
1514 %<*ja>
1515 明朝体2ウェイト・ゴシック体3ウェイトと,
1516 丸ゴシック体 (\verb+\mgfamily+) を使用可能とする.
1517 ゴシック体は細字・太字・極太の3ウェイトがあるが,極太ゴシック体はファミリの切り替え (\verb+\gtebfamily+) %
1518 で実現している.\Pkg{fontspec}では通常 (\verb+\mdseries+) と太字 (\verb+\bfseries+) しか扱えないために
1519 このような中途半端な実装になっている.
1520 %</ja>
1521 \item[expert]
1522 %<*en>
1523 Use horizontal kana alternates, and define a control sequence \verb+\rubyfamily+ to use kana
1524 characters designed for ruby.
1525 %</en>
1526 %<*ja>
1527 横組専用仮名を用いる.また,\verb+\rubyfamily+ でルビ用仮名が使用可能となる.
1528 %</ja>
1529 \item[bold]
1530 %<*en>
1531 Use bold gothic as bold mincho.
1532 %</en>
1533 %<*ja>
1534 明朝の太字をゴシック体の太字とする.
1535 %</ja>
1536 \item[90jis]
1537 %<*en>
1538 Use fonts with 90JIS glyphs if possible.
1539 %</en>
1540 %<*ja>
1541 出来る限り90JISの字形を採用しているフォントを使う.
1542 %</ja>
1543 \item[jis2004]
1544 %<*en>
1545 Use fonts with JIS2004 glyphs if possible.
1546 %</en>
1547 %<*ja>
1548 出来る限りJIS2004の字形を採用しているフォントを使う.
1549 %</ja>
1550 \item[jis]
1551 %<*en>
1552 Use the JFM \texttt{jfm-jis.lua}, instead of \texttt{jfm-ujis.lua}, which is the default JFM of
1553 \LuaTeX-ja.
1554 %</en>
1555 %<*ja>
1556 用いるJFMを(JISフォントメトリック類似の)\texttt{jfm-jis.lua}にする.このオプションがない時は
1557 \LuaTeX-ja標準の\texttt{jfm-ujis.lua}が用いられる.
1558 %</ja>
1559 \end{list}
1560
1561 %<en>\paragraph{Kozuka fonts}
1562 %<ja>\paragraph{小塚フォント}
1563 %<*en>
1564 When using single weight, we adopt Kozuka~Gothic~M as \textit{gothic},
1565 because we think that Kozuka~Gothic~R looks thin.
1566 There is not `Kozuka Maru Gothic', therefore Kozuka~Gothic~H is used
1567 as a substitute for \textit{rounded gothic}.
1568 %</en>
1569 %<*ja>
1570 まず,小塚フォントを用いる設定を述べる.
1571 単ウェイト時のゴシック体は小塚ゴシックRでは細いように感じるので,
1572 小塚ゴシックMに変更している.
1573 さらに,丸ゴシック体はないので便宜上小塚ゴシックHで代用している.
1574 %</ja>
1575 \begin{center}\small
1576 \begin{tabular}{llll}
1577 \toprule
1578 &\tt kozuka4&\tt kozuka6&\tt kozuka6n\\
1579 \midrule
1580 %<*en>
1581 \bf mincho medium&Kozuka Mincho Pro R&Kozuka Mincho ProVI R&Kozuka Mincho Pr6N R\\
1582 \bf mincho bold&Kozuka Mincho Pro B&Kozuka Mincho ProVI B&Kozuka Mincho Pr6N B\\
1583 \midrule
1584 \bf gothic medium\\
1585   without \texttt{deluxe}
1586 &Kozuka Gothic Pro M&Kozuka Gothic ProVI M&Kozuka Gothic Pr6N M\\
1587   multiple weights
1588 &Kozuka Gothic Pro R&Kozuka Gothic ProVI R&Kozuka Gothic Pr6N R\\
1589 \midrule
1590 \bf gothic bold
1591 &Kozuka Gothic Pro B&Kozuka Gothic ProVI B&Kozuka Gothic Pr6N B\\
1592 \bf gothic heavy
1593 &Kozuka Gothic Pro H&Kozuka Gothic ProVI H&Kozuka Gothic Pr6N H\\
1594 (rounded gothic)
1595 &Kozuka Gothic Pro H&Kozuka Gothic ProVI H&Kozuka Gothic Pr6N H\\
1596 %</en>
1597 %<*ja>
1598 \gt 明朝体細字&小塚明朝Pro~R&小塚明朝ProVI~R&小塚明朝Pr6N~R\\
1599 \gt 明朝体太字&小塚明朝Pro~B&小塚明朝ProVI~B&小塚明朝Pr6N~B\\
1600 \midrule
1601 \gt ゴシック体細字\\
1602  単ウェイト時
1603 &小塚ゴシックPro~M&小塚ゴシックProVI~M&小塚ゴシックPr6N~M\\
1604  多ウェイト時
1605 &小塚ゴシックPro~R&小塚ゴシックProVI~R&小塚ゴシックPr6N~R\\
1606 \midrule
1607 \gt ゴシック体太字
1608 &小塚ゴシックPro~B&小塚ゴシックProVI~B&小塚ゴシックPr6N~B\\
1609 \gt ゴシック体極太
1610 &小塚ゴシックPro~H&小塚ゴシックProVI~H&小塚ゴシックPr6N~H\\
1611 \inhibitglue(丸ゴシック体)\inhibitglue
1612 &小塚ゴシックPro~H&小塚ゴシックProVI~H&小塚ゴシックPr6N~H\\
1613 %</ja>
1614 \bottomrule
1615 \end{tabular}
1616 \end{center}
1617
1618 %<en>\paragraph{Hiragino and Morisawa}
1619 %<ja>\paragraph{ヒラギノ・モリサワ}
1620 %<*en>
1621 Settings for Hiragino fonts:
1622 %</en>
1623 %<*ja>
1624 まずヒラギノフォントから:
1625 %</ja>
1626 % これらは持っているわけではないので,フォント名が
1627 % 異なっているかもしれません.確認お願いします.
1628 \begin{center}\small
1629 \begin{tabular}{lll}
1630 \toprule
1631 &\tt hiragino&\tt hiraginon\\
1632 \midrule
1633 %<*en>
1634 \bf mincho medium&
1635 Hiragino Mincho Pro W3&Hiragino Mincho Pr6N W3\\
1636 \bf mincho bold&
1637 Hiragino Mincho Pro W6&Hiragino Mincho Pr6N W6\\
1638 \bf gothic medium&
1639 Hiragino Kaku Gothic Pro W3&Hiragino Kaku Gothic ProN W3\\
1640 \bf gothic bold&
1641 Hiragino Kaku Gothic Pro W6&Hiragino Kaku Gothic ProN W6\\
1642 \bf gothic heavy&
1643 Hiragino Kaku Gothic Std W8&Hiragino Kaku Gothic StdN W8\\
1644 \bf rounded gothic&
1645 Hiragino Maru Gothic Pro W4&Hiragino Maru Gothic ProN W4\\
1646 %</en>
1647 %<*ja>
1648 \gt 明朝体細字&
1649 ヒラギノ明朝体Pro~W3&ヒラギノ明朝体Pr6N~W3\\
1650 \gt 明朝体太字&
1651 ヒラギノ明朝体Pro~W6&ヒラギノ明朝体Pr6N~W6\\
1652 \gt ゴシック体細字&
1653 ヒラギノ角ゴPro~W3&ヒラギノ角ゴProN~W3\\
1654 \gt ゴシック体太字&
1655 ヒラギノ角ゴPro~W6&ヒラギノ角ゴProN~W6\\
1656 \gt ゴシック体極太&
1657 ヒラギノ角ゴStd~W8&ヒラギノ角ゴStdN~W8\\
1658 \gt 丸ゴシック体&
1659 ヒラギノ丸ゴPro~W4&ヒラギノ丸ゴProN~W4\\
1660 %</ja>
1661 \bottomrule
1662 \end{tabular}
1663 \end{center}
1664 %<*en>
1665 Settings for Morisawa fonts:
1666 %</en>
1667 %<*ja>
1668 次はモリサワフォントを用いる設定である:
1669 %</ja>
1670 \begin{center}\small
1671 \begin{tabular}{lll}
1672 \toprule
1673 &\tt morisawa4&\tt morisawa6n\\
1674 \midrule
1675 %<*en>
1676 \bf mincho medium&
1677 Ryumin Pro L-KL&Ryumin Pr6N L-KL\\
1678 \bf mincho bold&
1679 Futo Min A101 Pro Bold&Futo Min A101 Pr6N Bold\\
1680 \bf gothic medium&
1681 Chu Gothic BBB Pro Med&Chu Gothic BBB Pr6N Med\\
1682 \bf gothic bold&
1683 Futo Go B101 Pro Bold&Futo Go B101 Pr6N Bold\\
1684 \bf gothic heavy&
1685 Midashi Go Pro MB31&Midashi Go Pr6N MB31\\
1686 \bf rounded gothic&
1687 Jun Pro 101&Jun Pr6N 101\\
1688 %</en>
1689 %<*ja>
1690 \gt 明朝体細字&
1691 リュウミンPro~L-KL&リュウミンPr6N~L-KL\\
1692 \gt 明朝体太字&
1693 太ミンA101~Pro~Bold&太ミンA101~Pr6N~Bold\\
1694 \gt ゴシック体細字&
1695 中ゴシックBBB~Pro~Med&中ゴシックBBB~Pr6N~Med\\
1696 \gt ゴシック体太字&
1697 太ゴB101~Pro~Bold&太ゴB101~Pr6N~Bold\\
1698 \gt ゴシック体極太&
1699 見出ゴPro~MB31&見出ゴPr6N~MB31\\
1700 \gt 丸ゴシック体&
1701 じゅんPro 101&じゅんPr6N 101\\
1702 %</ja>
1703 \bottomrule
1704 \end{tabular}
1705 \end{center}
1706
1707 %<en>\paragraph{Settings for single weight}
1708 %<ja>\paragraph{単ウェイト用設定}
1709 %<*en>
1710 Next, we describe settings for using only single weight.
1711 In four settings below, we use same fonts for medium and bold (and heavy) weights.
1712 (Hence \verb+\mcfamily\bfseries+ and \verb+\mcfamily\mdseries+ yields same Japanese fonts,
1713 if \texttt{deluxe} option is also specified).
1714 %</en>
1715 %<*ja>
1716 次に,単ウェイト用の設定を述べる.この4設定では「細字」「太字」の区別はない.
1717 また,丸ゴシック体はゴシック体と同じフォントを用いる.
1718 %</ja>
1719 \begin{center}\small
1720 \begin{tabular}{lllll}
1721 \toprule
1722 &\tt noembed&\tt ipa&\tt ipaex&\tt ms\\
1723 \midrule
1724 %<*en>
1725 \bf mincho&Ryumin-Light (non-embedded)
1726 &IPAMincho&IPAexMincho&MS Mincho\\
1727 \bf gothic&GothicBBB-Medium (non-embedded)
1728 &IPAGothic&IPAexGothic&MS Gothic\\
1729 %</en>
1730 %<*ja>
1731 \gt 明朝体&Ryumin-Light(非埋込)
1732 &IPA明朝&IPAex明朝&MS明朝\\
1733 \gt ゴシック体&GothicBBB-Medium(非埋込)
1734 &IPAゴシック&IPAexゴシック&MSゴシック\\
1735 %</ja>
1736 \bottomrule
1737 \end{tabular}
1738 \end{center}
1739
1740 %<en>\paragraph{Using HG fonts}
1741 %<ja>\paragraph{HGフォントの利用}
1742 %<*en>
1743 We can use HG~fonts bundled with Microsoft Office for realizing multiple weights in Japanese fonts.
1744 %</en>
1745 %<*ja>
1746 すぐ前に書いた単ウェイト用設定を,Microsoft Office等に付属するHGフォントを使って
1747 多ウェイト化した設定もある.
1748 %</ja>
1749 \begin{center}\small
1750 \begin{tabular}{llll}
1751 \toprule
1752 &\tt ipa-dx&\tt ipaex-dx&\tt ms-dx\\
1753 \midrule
1754 %<*en>
1755 \bf mincho medium
1756 &IPAMincho&IPAexMincho&MS Mincho\\\midrule
1757 \bf mincho bold&
1758 \multicolumn{3}{c}{HG Mincho E}\\\midrule
1759 \bf Gothic medium\\
1760 ~~without \texttt{deluxe}
1761 &IPAGothic&IPAexGothic&MS Gothic\\
1762 ~~with {\tt jis2004}
1763 &IPAGothic&IPAexGothic&MS Gothic\\
1764 \cmidrule(lr){1-4}
1765 ~~otherwise&
1766 \multicolumn{3}{c}{HG Gothic M}\\\midrule
1767 \bf gothic bold&
1768 \multicolumn{3}{c}{HG Gothic E}\\\midrule
1769 \bf gothic heavy&
1770 \multicolumn{3}{c}{HG Soei Kaku Gothic UB}\\\midrule
1771 \bf rounded gothic&
1772 \multicolumn{3}{c}{HG Maru Gothic PRO}\\
1773 %</en>
1774 %<*ja>
1775 \gt 明朝体細字
1776 &IPA明朝&IPAex明朝&MS明朝\\\midrule
1777 \gt 明朝体太字&
1778 \multicolumn{3}{c}{HG明朝E}\\\midrule
1779 \gt ゴシック体細字\\
1780  単ウェイト時
1781 &IPAゴシック&IPAexゴシック&MSゴシック\\
1782  {\tt jis2004}指定時
1783 &IPAゴシック&IPAexゴシック&MSゴシック\\
1784 \cmidrule(lr){1-4}
1785  それ以外の時&
1786 \multicolumn{3}{c}{HGゴシックM}\\\midrule
1787 \gt ゴシック体太字&
1788 \multicolumn{3}{c}{HGゴシックE}\\\midrule
1789 \gt ゴシック体極太&
1790 \multicolumn{3}{c}{HG創英角ゴシックUB}\\\midrule
1791 \gt 丸ゴシック体&
1792 \multicolumn{3}{c}{HG丸ゴシック体PRO}\\
1793 %</ja>
1794 \bottomrule
1795 \end{tabular}
1796 \end{center}
1797 %<*en>
1798 Note that HG~Mincho~E, HG~Gothic~E, HG Soei Kaku Gothic UB and HG Maru Gothic PRO
1799 are internally specified by:
1800 \begin{description}
1801 \item[default] by font name (\texttt{HGMinchoE}, etc.).
1802 \item[{\tt 90jis}] by filename (\texttt{hgrme.ttc}, \texttt{hgrge.ttc}, \texttt{hgrsgu.ttc}, \texttt{hgrsmp.ttf}).
1803 \item[{\tt jis2004}] by filename (\texttt{hgrme04.ttc}, \texttt{hgrge04.ttc}, \texttt{hgrsgu04.ttc}, \texttt{hgrsmp04.ttf}).
1804 \end{description}
1805 %</en>
1806 %<*ja>
1807 なお,HG明朝E・HGゴシックE・HG創英角ゴシックUB・HG丸ゴシック体PROの4つについては,内部で
1808 \begin{description}
1809 \item[標準] フォント名(\texttt{HGMinchoE} など)
1810 \item[{\tt 90jis}指定時] ファイル名 (%
1811 \texttt{hgrme.ttc}, \texttt{hgrge.ttc}, \texttt{hgrsgu.ttc}, \texttt{hgrsmp.ttf})
1812 \item[{\tt jis2004}指定時] ファイル名 (%
1813 \texttt{hgrme04.ttc}, \texttt{hgrge04.ttc}, \texttt{hgrsgu04.ttc}, \texttt{hgrsmp04.ttf})
1814 \end{description}
1815 として指定を行っているので注意すること.
1816 %</ja>
1817
1818
1819 %<*en>
1820 \subsection{\texttt{\char92 CID}, \texttt{\char92 UTF} and macros in \Pkg{otf} package}
1821 Under \pLaTeX, \Pkg{otf} package (developed by Shuzaburo Saito) is
1822 used for typesetting characters which is in Adobe-Japan1-6 CID but not
1823 in JIS~X~0208. Since this package is widely used, \LuaTeX-ja
1824 supports some of functions in \Pkg{otf} package.
1825 If you want to use these functions, load \Pkg{luatexja-otf} package.
1826 %</en>
1827 %<*ja>
1828 \subsection{\texttt{\char92 CID}, \texttt{\char92 UTF}と\Pkg{otf}パッケージのマクロ}
1829 \pLaTeX では,JIS~X~0208にないAdobe-Japan1-6の文字を出力するために,
1830 齋藤修三郎氏による\Pkg{otf}パッケージが用いられていた.このパッケージは
1831 広く用いられているため,\LuaTeX-jaにおいても\Pkg{otf}パッケージの機能の
1832 一部をサポートしている.これらの機能を用いるためには\Pkg{luatexja-otf}パッケージ
1833 を読み込めばよい.
1834 %</ja>
1835 %<*zh>
1836 \subsection{\Pkg{otf}包中的\texttt{\char92CID},\texttt{\char92UTF}及其他宏}
1837 \pLaTeX 下,\underline{\texttt{otf}}宏包(斋藤修三郎开发)是用来排印存在
1838 于Adobe-Japan1-6但不存在于JIS X 0208中的字符。
1839 该包已经广泛使用,\LuaTeX-ja支持部分\Pkg{otf}包中的部分功能。
1840 如果你想使用这些功能,加载\Pkg{luatexja-otf}宏包。
1841 \bgroup
1842 \fontencoding{JY3}\selectfont
1843 %</zh>
1844
1845 \begin{LTXexample}
1846 森\UTF{9DD7}外と内田百\UTF{9592}とが\UTF{9AD9}島屋に行く。
1847
1848 \CID{7652}飾区の\CID{13706}野家,
1849 葛飾区の吉野家
1850 \end{LTXexample}
1851 %<*zh>
1852 \egroup
1853 %</zh>
1854
1855 %<*ja>
1856 \Pkg{otf}パッケージでは,それぞれ次のようなオプションが存在した:
1857 \begin{description}
1858 \item[\texttt{deluxe}] 明朝体・ゴシック体各2ウェイトと,丸ゴシック体を扱えるようになる.
1859 \item[\texttt{expert}] 仮名が横組・縦組専用のものに切り替わり,ルビ用仮名も扱えるようになる.
1860 \item[\texttt{bold}] ゴシック体を標準で太いウェイトのものに設定する.
1861 \end{description}
1862 しかしこれらのオプションは\Pkg{luatexja-otf}パッケージには存在しない.
1863 \Pkg{otf}パッケージが文書中で使用する和文用TFMを自前の物に置き換えていたのに対し,
1864 \Pkg{luatexja-otf}パッケージでは,そのようなことは行わないからである.
1865
1866 これら3オプションについては,
1867 \Pkg{luatexja-preset} パッケージにプリセットを使う時に一緒に指定するか,
1868 あるいは対応する内容を\ref{ssub-chgfnt}節 (NFSS2) や
1869 \ref{ssec-fontspec}節 (\Pkg{fontspec}) の方法で手動で指定する必要がある.
1870 %</ja>
1871
1872 %<en>\section{Changing Parameters}
1873 %<ja>\section{パラメータの変更}
1874 %<zh>\section{变量更改}
1875
1876 %<*en>
1877 There are many parameters in \LuaTeX-ja. And due to the behavior of \LuaTeX,
1878 most of them are not stored as internal register of \TeX, but as an
1879 original storage system in \LuaTeX-ja. Hence, to assign or acquire those
1880 parameters, you have to use commands \verb+\ltjsetparameter+ and
1881 \verb+\ltjgetparameter+.
1882 %</en>
1883 %<*ja>
1884 \LuaTeX-jaには多くのパラメータが存在する.そして\LuaTeX の仕様のために,
1885 その多くは\TeX のレジスタにではなく,\LuaTeX-ja独自の方法で保持されている.
1886 そのため,これらのパラメータを設定・取得するためには \verb+\ltjsetparameter+ と \verb+\ltjgetparameter+ を
1887 用いる必要がある.
1888 %</ja>
1889 %<*zh>
1890 \LuaTeX-ja包含大量的参数,以控制排版细节。
1891 设定这些参数需要使用命令:\verb!\ltjsetparameter!和\verb!\ltjgetparameter!命令。
1892 %</zh>
1893
1894 %<en>\subsection{Editing the range of \textbf{JAchar}s}
1895 %<ja>\subsection{\textbf{JAchar}の範囲の設定}
1896 %<zh>\subsection{\textbf{JAchar}范围设定}
1897 \label{ssec-setrange}
1898
1899 %<*en>
1900 To edit the range of \textbf{JAchar}s, you have to assign a non-zero
1901 natural number which is less than 217 to the character range first. This
1902 can be done by using \verb+\ltjdefcharrange+ primitive. For example, the
1903 next line assigns whole characters in Supplementary Ideographic Plane
1904 and the character `漢' to the range number~100.
1905 %</en>
1906 %<*ja>
1907 \textbf{JAchar}の範囲を設定するためには,まず各文字に0より大きく217より小さいindexを
1908 割り当てる必要がある.これには \verb+\ltjdefcharrange+ プリミティブを用いる.
1909 例えば,次のように書くことで追加漢字面(SIP)にある全ての文字と`漢'が
1910 「100番の文字範囲」に属するように設定される.
1911 %</ja>
1912 %<*zh>
1913 在设定\textbf{JAchar}之前,需要分配一个小于217的自然数。
1914 这个可以由\verb!\ltjdefcharrange!基本语句来完成。例如,
1915 下面就分配了整个表意文字补充平面和汉字“漢”为100。
1916 %</zh>
1917 \begin{lstlisting}
1918 \ltjdefcharrange{100}{"20000-"2FFFF,`漢}
1919 \end{lstlisting}
1920 %<*en>
1921 This assignment of numbers to ranges are always global, so you should
1922 not do this in the middle of a document.
1923 %</en>
1924 %<*ja>
1925 この文字範囲の割り当ては常にグローバルであり,したがって文書の途中で
1926 この操作をするべきではない.
1927 %</ja>
1928 %<*zh>
1929 范围数的分配是全局的,故你不可在文档中使用。
1930 %</zh>
1931
1932 %<*en>
1933 If some character has been belonged to some non-zero numbered range,
1934 this will be overwritten by the new setting. For example, whole SIP
1935 belong to the range~4 in the default setting of \LuaTeX-ja, and if you
1936 specify the above line, then SIP will belong to the range~100 and be
1937 removed from the range~4.
1938 %</en>
1939 %<*ja>
1940 もし指定されたある文字がある非零番号の範囲に属していたならば,これは新しい設定で
1941 上書きされる.例えば,SIPは全て\LuaTeX-jaのデフォルトでは4番の文字範囲に
1942 属しているが,上記の指定を行えばSIPは100番に属すようになり,4番からは除かれる.
1943 %</ja>
1944 %<*zh>
1945 如果某些字符被改变为新的非零数范围,将会被新设定重写。
1946 例如,整个SIP在\LuaTeX-ja默认设定中属于范围4,如果你使用如上设定,
1947 SIP将会被设定为范围100,且从范围4种移除。
1948 %</zh>
1949
1950 %<*en>
1951 After assigning numbers to ranges, the \textsf{jacharrange} parameter can
1952 be used to customize which character range will be treated as ranges of
1953 \textbf{JAchar}s, as the following line (this is just the default
1954 setting of \LuaTeX-ja):
1955 %</en>
1956 %<*ja>
1957 文字範囲に番号を割り当てた後は,\textsf{jacharrange}パラメータが\textbf{JAchar}と
1958 して扱われる文字の範囲を設定するために用いられる.例えば,以下は\LuaTeX-jaの
1959 初期設定である:
1960 %</ja>
1961 %<*zh>
1962 分配了范围数之后,\textsf{jacharrange}参数将用于设定字符范围为\textbf{JAchar},
1963 如下(为\LuaTeX-ja默认设定):
1964 %</zh>
1965 \begin{verbatim}
1966 \ltjsetparameter{jacharrange={-1, +2, +3, -4, -5, +6, +7, +8}}
1967 \end{verbatim}
1968 %<*en>
1969 The argument to \textsf{jacharrange} parameter is a list of integer.
1970 Negative integer $-n$ in the list means that `the characters that belong to
1971 range~$n$ are treated as \textbf{ALchar}', and positive integer $+n$ means
1972 that `the characters that belong to range~$n$ are treated as \textbf{JAchar}'.
1973 %</en>
1974 %<*ja>
1975 \textsf{jacharrange}パラメータには整数のリストを与える.
1976 リスト中の負の整数$-n$は「文字範囲$n$に属する文字は\textbf{ALchar}として
1977 扱われる」ことを意味し,正の整数$+n$は\textbf{JAchar}として扱うことを意味する.
1978 %</ja>
1979 %<*zh>
1980 \textsf{jacharrange}参数的变量未整数数组。
1981 负数$-n$在数组中表示“字符范围$n$中的字符被视作\textbf{ALchar}”,
1982 正数$+n$则表示“字符范围$n$被视作\textbf{JAchar}”。
1983 %</zh>
1984
1985 %<*en>
1986 \paragraph{Default Setting}
1987 \LuaTeX-ja predefines eight character ranges for convenience. They are
1988 determined from the following data:
1989 %</en>
1990 %<*ja>
1991 \paragraph{初期設定}
1992 \LuaTeX-jaでは8つの文字範囲を設定している.これらは以下のデータに基づいて決定して
1993 いる.
1994 %</ja>
1995 %<*zh>
1996 \paragraph{默认设定}
1997 \LuaTeX-ja默认设定了8个字符范围。如下设定:
1998 %</zh>
1999 \begin{itemize}
2000 %<*en>
2001 \item Blocks in Unicode~6.0.
2002 %</en>
2003 %<*ja>
2004 \item Unicode~6.0のブロック.
2005 %</ja>
2006 %<*zh>
2007 \item Unicode~6.0区块
2008 %</zh>
2009 %<*en>
2010 \item The \texttt{Adobe-Japan1-UCS2} mapping between a CID Adobe-Japan1-6 and Unicode.
2011 %</en>
2012 %<*ja>
2013 \item \texttt{Adobe-Japan1-UCS2}によるAdobe-Japan1-6のCIDとUnicodeの間の
2014       マッピング.
2015 %</ja>
2016 %<*zh>
2017 \item 在CID Adobe-Japan1-6和Unicode之间的映射\texttt{Adobe-Japan1-UCS2}。
2018 %</zh>
2019 %<*en>
2020 \item The \Pkg{PXbase} bundle for \upTeX\ by Takayuki Yato.
2021 %</en>
2022 %<*ja>
2023 \item 八登崇之氏による\upTeX 用の\Pkg{PXbase}バンドル.
2024 %</ja>
2025 %<*zh>
2026 \item 八登崇之的\Pkg{PXbase}宏包(\upTeX 下使用)。
2027 %</zh>
2028 \end{itemize}
2029
2030 %<*en>
2031 Now we describe these eight ranges. The alphabet `J' or `A' after the
2032 number shows whether characters in the range is treated as
2033 \textbf{JAchar}s or not by default. These settings are similar to the
2034 \texttt{prefercjk} settings defined in \texttt{PXbase} bundle.
2035 %</en>
2036 %<*ja>
2037 以下ではこれら8つの文字範囲について記述する.番号のあとのアルファベット`J'と`A'
2038 はデフォルトで\textbf{JAchar}か\textbf{ALchar}かを表している.これらの設定は
2039 \texttt{PXbase}バンドルで定義されている\texttt{prefercjk}と類似のものである.
2040 %</ja>
2041 %<*zh>
2042 现在我们描述8个字符范围。在数字后的“J”和“A”表明代表\textbf{JAchar}或者未跟随默认设定。
2043 这些设定类似于\texttt{PXbase}中的\texttt{prefercjk}设定。
2044 %</zh>
2045 \begin{description}
2046 %<*en>
2047 \item[Range~8${}^{\text{J}}$] Symbols in the intersection of the upper half of ISO~8859-1
2048          (Latin-1 Supplement) and JIS~X~0208 (a basic character set for Japanese). This character range
2049          consists of the following characters:
2050 %</en>
2051 %<*ja>
2052 \item[範囲8${}^{\text{J}}$] ISO~8859-1の上位領域(ラテン1補助)と
2053                              JIS~X~0208の共通部分にある記号.この文字範囲は
2054                              以下の文字で構成される:
2055 %</ja>
2056 %<*zh>
2057 \item[范围8${}^\text{J}$] ISO 8859-1(Latin-1补充)的上半部和JIS X 0208(日文基本字符集)的重叠部分,包含下列字符:
2058 %</zh>
2059 \begin{multicols}{2}
2060 \begin{itemize}
2061 \def\ch#1#2{\item \char"#1\ (\texttt{U+00#1}, #2)}%"
2062 %<*en>
2063 \ch{A7}{Section Sign}
2064 \ch{A8}{Diaeresis}
2065 \ch{B0}{Degree sign}
2066 \ch{B1}{Plus-minus sign}
2067 \ch{B4}{Spacing acute}
2068 \ch{B6}{Paragraph sign}
2069 \ch{D7}{Multiplication sign}
2070 \ch{F7}{Division Sign}
2071 %</en>
2072 %<*ja>
2073 \ch{A7}{節記号}
2074 \ch{A8}{トレマ}
2075 \ch{B0}{度}
2076 \ch{B1}{正又は負符号}
2077 \ch{B4}{アキュート・アクセント}
2078 \ch{B6}{段落記号}
2079 \ch{D7}{乗算記号}
2080 \ch{F7}{除算記号}
2081 %</ja>
2082 %<*zh>
2083 \ch{A7}{分节符}
2084 \ch{A8}{分音符}
2085 \ch{B0}{温度符号}
2086 \ch{B1}{加减符号}
2087 \ch{B4}{置位尖音}
2088 \ch{B6}{段落符号}
2089 \ch{D7}{乘号}
2090 \ch{F7}{除号}
2091 %</zh>
2092 \end{itemize}
2093 \end{multicols}
2094
2095 %<*en>
2096 \item[Range~1${}^{\text{A}}$] Latin characters that some of them are included in Adobe-Japan1-6.
2097 This range consist of the following Unicode ranges, \emph{except characters in the range~8 above}:
2098 %</en>
2099 %<*ja>
2100 \item[範囲1${}^{\text{A}}$] ラテン文字.一部はAdobe-Japan1-6にも含まれている.
2101                              この範囲は以下のUnicodeのブロックから構成されている.
2102                              \textbf{ただし,範囲8は除く.}
2103 %</ja>
2104 %<*zh>
2105 \item[范围1${}^\text{A}$] 包含于Adobe-Japan1-6中的拉丁字符,此范围包含下列
2106   Unicode区域,但\textbf{不包括上述提到过的范围8}:
2107 %</zh>
2108 \begin{multicols}{2}
2109 \begin{itemize}
2110 %<*en>
2111 \item \texttt{U+0080}--\texttt{U+00FF}: Latin-1 Supplement
2112 \item \texttt{U+0100}--\texttt{U+017F}: Latin Extended-A
2113 \item \texttt{U+0180}--\texttt{U+024F}: Latin Extended-B
2114 \item \texttt{U+0250}--\texttt{U+02AF}: IPA Extensions
2115 \item \texttt{U+02B0}--\texttt{U+02FF}: Spacing Modifier Letters
2116 \item \texttt{U+0300}--\texttt{U+036F}: Combining Diacritical Marks
2117 \item \texttt{U+1E00}--\texttt{U+1EFF}: Latin Extended Additional
2118 %</en>
2119 %<*ja>
2120 \item \texttt{U+0080}--\texttt{U+00FF}: ラテン1補助
2121 \item \texttt{U+0100}--\texttt{U+017F}: ラテン文字拡張A
2122 \item \texttt{U+0180}--\texttt{U+024F}: ラテン文字拡張B
2123 \item \texttt{U+0250}--\texttt{U+02AF}: IPA拡張(国際音声記号)
2124 \item \texttt{U+02B0}--\texttt{U+02FF}: 前進を伴う修飾文字
2125 \item \texttt{U+0300}--\texttt{U+036F}: 合成可能な識別記号
2126 \item \texttt{U+1E00}--\texttt{U+1EFF}: ラテン文字拡張追加
2127 %</ja>
2128 %<*zh>
2129 \item \texttt{U+0080}--\texttt{U+00FF}: 拉丁字母补充-1
2130 \item \texttt{U+0100}--\texttt{U+017F}: 拉丁字母扩充-A
2131 \item \texttt{U+0180}--\texttt{U+024F}: 拉丁字母扩充-B
2132 \item \texttt{U+0250}--\texttt{U+02AF}: 国际音标扩充
2133 \item \texttt{U+02B0}--\texttt{U+02FF}: 进格修饰符元
2134 \item \texttt{U+0300}--\texttt{U+036F}: 组合音标附加符号
2135 \item \texttt{U+1E00}--\texttt{U+1EFF}: 拉丁字母扩充附加
2136 %</zh>
2137 \par\
2138 \end{itemize}
2139 \end{multicols}
2140 %<*en>
2141 \item[Range~2${}^{\text{J}}$] Greek and Cyrillic letters. JIS~X~0208 (hence most of Japanese
2142            fonts) has some of these characters.
2143 %</en>
2144 %<*ja>
2145 \item[範囲2${}^{\text{J}}$] ギリシャ文字とキリル文字.JIS~X~0208(したがってほとんどの
2146                              和文フォント)はこれらの文字を持つ.
2147 %</ja>
2148 %<*zh>
2149 \item[范围2${}^\text{J}$] 希腊文和西里尔字母,使用JIS X 0208的大部分日文字体包含这些字符:
2150 %</zh>
2151 \begin{multicols}{2}
2152 \begin{itemize}
2153 %<*en>
2154 \item \texttt{U+0370}--\texttt{U+03FF}: Greek and Coptic
2155 \item \texttt{U+0400}--\texttt{U+04FF}: Cyrillic
2156 \item \texttt{U+1F00}--\texttt{U+1FFF}: Greek Extended
2157 %</en>
2158 %<*ja>
2159 \item \texttt{U+0370}--\texttt{U+03FF}: ギリシア文字及びコプト文字
2160 \item \texttt{U+0400}--\texttt{U+04FF}: キリル文字
2161 \item \texttt{U+1F00}--\texttt{U+1FFF}: キリル文字補助
2162 %</ja>
2163 %<*zh>
2164 \item \texttt{U+0370}--\texttt{U+03FF}: 希腊字母
2165 \item \texttt{U+0400}--\texttt{U+04FF}: 西里尔字母
2166 \item \texttt{U+1F00}--\texttt{U+1FFF}: 希腊文扩充
2167 %</zh>
2168 \\\
2169 \end{itemize}
2170 \end{multicols}
2171 %<*en>
2172 \item[Range~3${}^{\text{J}}$] Punctuations and Miscellaneous symbols. The block list is
2173            indicated in Table~\ref{table-rng3}.
2174 %</en>
2175 %<*ja>
2176 \item[範囲3${}^{\text{J}}$] 句読点と記号類.ブロックのリストは表\ref{table-rng3}%
2177                              に示してある.
2178 %</ja>
2179 %<*zh>
2180 \item[范围3${}^\text{J}$] 标点以及杂项符号,参见表\ref{table-rng3}。
2181 %</zh>
2182 \begin{table}[!tb]
2183 %<*en>
2184 \caption{Unicode blocks in predefined character range~3.}
2185 %</en>
2186 %<*ja>
2187 \caption{文字範囲3に指定されているUnicodeブロック.}
2188 %</ja>
2189 %<*zh>
2190 \caption{字符范围3定义的Unicode范围}
2191 %</zh>
2192 \label{table-rng3}
2193 \catcode`\"=13\def"#1#2#3#4{\texttt{U+#1#2#3#4}}%"
2194 \begin{center}\small
2195 \begin{tabular}{llll}
2196 %<*en>
2197 "2000--"206F&General Punctuation&
2198 "2070--"209F&Superscripts and Subscripts\\
2199 "20A0--"20CF&Currency Symbols&
2200 "20D0--"20FF&Comb.\ Diacritical Marks for Symbols\\
2201 "2100--"214F&Letterlike Symbols&
2202 "2150--"218F&Number Forms\\
2203 "2190--"21FF&Arrows&
2204 "2200--"22FF&Mathematical Operators\\
2205 "2300--"23FF&Miscellaneous Technical&
2206 "2400--"243F&Control Pictures\\
2207 "2500--"257F&Box Drawing&
2208 "2580--"259F&Block Elements\\
2209 "25A0--"25FF&Geometric Shapes&
2210 "2600--"26FF&Miscellaneous Symbols\\
2211 "2700--"27BF&Dingbats&
2212 "2900--"297F&Supplemental Arrows-B\\
2213 "2980--"29FF&Misc.\ Mathematical Symbols-B&
2214 "2B00--"2BFF&Miscellaneous Symbols and Arrows\\
2215 "E000--"F8FF&Private Use Area&
2216 %</en>
2217 %<*ja>
2218 "2000--"206F&一般句読点&
2219 "2070--"209F&上付き・下付き\\
2220 "20A0--"20CF&通貨記号&
2221 "20D0--"20FF&記号用ダイアクリティカルマーク(合成可能)\\
2222 "2100--"214F&文字様記号&
2223 "2150--"218F&数字に準じるもの\\
2224 "2190--"21FF&矢印&
2225 "2200--"22FF&数学記号(演算子)\\
2226 "2300--"23FF&その他の技術用記号&
2227 "2400--"243F&制御機能用記号\\
2228 "2500--"257F&罫線素片&
2229 "2580--"259F&ブロック要素\\
2230 "25A0--"25FF&幾何学模様&
2231 "2600--"26FF&その他の記号\\
2232 "2700--"27BF&装飾記号&
2233 "2900--"297F&補助矢印B\\
2234 "2980--"29FF&その他の数学記号B&
2235 "2B00--"2BFF&その他の記号及び矢印\\
2236 "E000--"F8FF&私用領域(外字領域)&
2237 %</ja>
2238 %<*zh>
2239 "2000--"206F&一般标点符号&
2240 "2070--"209F&上标及下标\\
2241 "20A0--"20CF&货币符号&
2242 "20D0--"20FF& 符号用组合附加符号\\
2243 "2100--"214F&类字母符号&
2244 "2150--"218F&数字形式\\
2245 "2190--"21FF&箭头符号&
2246 "2200--"22FF&数学运算符号\\
2247 "2300--"23FF&杂项技术符号&
2248 "2400--"243F&控制图像\\
2249 "2500--"257F&制表符&
2250 "2580--"259F&区块元素\\
2251 "25A0--"25FF&几何形状&
2252 "2600--"26FF&杂项符号\\
2253 "2700--"27BF&什锦符号&
2254 "2900--"297F&补充性箭头-B\\
2255 "2980--"29FF&混合数学符号-B&
2256 "2B00--"2BFF&杂项符号和箭头符号\\
2257 "E000--"F8FF&私用区域&
2258 %</zh>
2259 \end{tabular}
2260 \end{center}
2261 \end{table}
2262 %<*en>
2263 \item[Range~4${}^{\text{A}}$] Characters usually not in Japanese fonts. This range consists
2264            of almost all Unicode blocks which are not in other
2265            predefined ranges. Hence, instead of showing the block list,
2266            we put the definition of this range itself:
2267 %</en>
2268 %<*ja>
2269 \item[範囲4${}^{\text{A}}$] 通常和文フォントには含まれていない文字.
2270                              この範囲は他の範囲にないほとんど全てのUnicodeブロック
2271                              で構成されている.したがって,ブロックのリストを示す
2272                              代わりに,範囲の定義そのものを示す:
2273 %</ja>
2274 %<*zh>
2275 \item[范围4${}^\text{A}$] 通常情况下不包含于日文字体的部分。本范围包含有其他
2276 范围尚未涵盖部分。故,我们直接给出定义:
2277 %</zh>
2278 \begin{lstlisting}
2279 \ltjdefcharrange{4}{%
2280    "500-"10FF, "1200-"1DFF, "2440-"245F, "27C0-"28FF, "2A00-"2AFF,
2281   "2C00-"2E7F, "4DC0-"4DFF, "A4D0-"A82F, "A840-"ABFF, "FB50-"FE0F,
2282   "FE20-"FE2F, "FE70-"FEFF, "FB00-"FB4F, "10000-"1FFFF} % non-Japanese
2283 \end{lstlisting}
2284 %<*en>
2285 \item[Range~5${}^{\text{A}}$] Surrogates and Supplementary Private Use Areas.
2286 %</en>
2287 %<*ja>
2288 \item[範囲5${}^{\text{A}}$] 代用符号と補助私用領域.
2289 %</ja>
2290 %<*zh>
2291 \item[范围5${}^\text{A}$] 代替以及补充私有使用区域。
2292 %</zh>
2293 %<*en>
2294 \item[Range~6${}^{\text{J}}$] Characters used in Japanese. The block list is indicated in Table~\ref{table-rng6}.
2295 %</en>
2296 %<*ja>
2297 \item[範囲6${}^{\text{J}}$] 日本語で用いられる文字.ブロックのリストは
2298                              表\ref{table-rng6}に示す.
2299 %</ja>
2300 %<*zh>
2301 \item[范围6${}^\text{J}$] 日文字符。
2302 %</zh>
2303 \begin{table}[!tb]
2304 %<*en>
2305 \caption{Unicode blocks in predefined character range~6.}
2306 %</en>
2307 %<*ja>
2308 \caption{文字範囲6に指定されているUnicodeブロック.}
2309 %</ja>
2310 %<*zh>
2311 \caption{字符范围6定义的Unicode范围}
2312 %</zh>
2313 \label{table-rng6}
2314 \catcode`\"=13\def"#1#2#3#4{\texttt{U+#1#2#3#4}}%"
2315 \begin{center}\small
2316 \begin{tabular}{llll}
2317 %<*en>
2318 "2460--"24FF&Enclosed Alphanumerics&
2319 "2E80--"2EFF&CJK Radicals Supplement\\
2320 "3000--"303F&CJK Symbols and Punctuation&
2321 "3040--"309F&Hiragana\\
2322 "30A0--"30FF&Katakana&
2323 "3190--"319F&Kanbun\\
2324 "31F0--"31FF&Katakana Phonetic Extensions&
2325 "3200--"32FF&Enclosed CJK Letters and Months\\
2326 "3300--"33FF&CJK Compatibility&
2327 "3400--"4DBF&CJK Unified Ideographs Extension A\\
2328 "4E00--"9FFF&CJK Unified Ideographs&
2329 "F900--"FAFF&CJK Compatibility Ideographs\\
2330 "FE10--"FE1F&Vertical Forms&
2331 "FE30--"FE4F&CJK Compatibility Forms\\
2332 "FE50--"FE6F&Small Form Variants&
2333 "{20}000--"{2F}FFF&(Supplementary Ideographic Plane)
2334 %</en>
2335 %<*ja>
2336 "2460--"24FF&囲み英数字&
2337 "2E80--"2EFF&CJK部首補助\\
2338 "3000--"303F&CJKの記号及び句読点&
2339 "3040--"309F&平仮名\\
2340 "30A0--"30FF&片仮名&
2341 "3190--"319F&漢文用記号(返り点)\\
2342 "31F0--"31FF&片仮名拡張&
2343 "3200--"32FF&囲みCJK文字・月\\
2344 "3300--"33FF&CJK互換用文字&
2345 "3400--"4DBF&CJK統合漢字拡張A\\
2346 "4E00--"9FFF&CJK統合漢字&
2347 "F900--"FAFF&CJK互換漢字\\
2348 "FE10--"FE1F&縦書き形&
2349 "FE30--"FE4F&CJK互換形\\
2350 "FE50--"FE6F&小字形&
2351 "{20}000--"{2F}FFF&(追加漢字面)
2352 %</ja>
2353 %<*zh>
2354 "2460--"24FF&圈状字母数字&
2355 "2E80--"2EFF&CJK部首补充\\
2356 "3000--"303F&CJK标点符号&
2357 "3040--"309F&平假名\\
2358 "30A0--"30FF&片假名&
2359 "3190--"319F&汉文标注号\\
2360 "31F0--"31FF&片假名音标补充&
2361 "3200--"32FF&圈状CJK字母及月份\\
2362 "3300--"33FF&CJK兼容&
2363 "3400--"4DBF&CJK统一表意文字扩充A\\
2364 "4E00--"9FFF&CJK统一表意文字&
2365 "F900--"FAFF&CJK兼容表意文字\\
2366 "FE10--"FE1F&直行标点&
2367 "FE30--"FE4F&CJK兼容形式\\
2368 "FE50--"FE6F&小写变体&
2369 "{20}000--"{2F}FFF&(补充字符)
2370 %</zh>
2371 \end{tabular}
2372 \end{center}
2373 \end{table}
2374 %<*en>
2375 \item[Range~7${}^{\text{J}}$] Characters used in CJK languages, but not included in  Adobe-Japan1-6.
2376 The block list is indicated in Table~\ref{table-rng7}.
2377 %</en>
2378 %<*ja>
2379 \item[範囲7${}^{\text{J}}$] CJK言語で用いられる文字のうち,Adobe-Japan1-6に
2380                             含まれていないもの.
2381                             ブロックのリストは表\ref{table-rng7}に示す.
2382 %</ja>
2383 %<*zh>
2384 \item[范围7${}^\text{J}$] 不包含于Adobe-Japan1-6的CJK字符,参见表\ref{table-rng7}。
2385 %</zh>
2386 \begin{table}[!tb]
2387 %<*en>
2388 \caption{Unicode blocks in predefined character range~7.}
2389 %</en>
2390 %<*ja>
2391 \caption{文字範囲7に指定されているUnicodeブロック.}
2392 %</ja>
2393 %<*zh>
2394 \caption{字符范围7定义的Unicode范围}
2395 %</zh>
2396 \label{table-rng7}
2397 \catcode`\"=13\def"#1#2#3#4{\texttt{U+#1#2#3#4}}%"
2398 \begin{center}\small
2399 \begin{tabular}{llll}
2400 %<*en>
2401 "1100--"11FF&Hangul Jamo&
2402 "2F00--"2FDF&Kangxi Radicals\\
2403 "2FF0--"2FFF&Ideographic Description Characters&
2404 "3100--"312F&Bopomofo\\
2405 "3130--"318F&Hangul Compatibility Jamo&
2406 "31A0--"31BF&Bopomofo Extended\\
2407 "31C0--"31EF&CJK Strokes&
2408 "A000--"A48F&Yi Syllables\\
2409 "A490--"A4CF&Yi Radicals&
2410 "A830--"A83F&Common Indic Number Forms\\
2411 "AC00--"D7AF&Hangul Syllables&
2412 "D7B0--"D7FF&Hangul Jamo Extended-B
2413 %</en>
2414 %<*ja>
2415 "1100--"11FF&ハングル字母&
2416 "2F00--"2FDF&康熙部首\\
2417 "2FF0--"2FFF&漢字構成記述文字&
2418 "3100--"312F&注音字母 (注音符号)\\
2419 "3130--"318F&ハングル互換字母&
2420 "31A0--"31BF&注音字母拡張\\
2421 "31C0--"31EF&CJKの筆画&
2422 "A000--"A48F&イ文字\\
2423 "A490--"A4CF&イ文字部首&
2424 "A830--"A83F&共通インド数字に準じるもの\\
2425 "AC00--"D7AF&ハングル音節文字&
2426 "D7B0--"D7FF&ハングル字母拡張B
2427 %</ja>
2428 %<*zh>
2429 "1100--"11FF&谚文字母&
2430 "2F00--"2FDF&康熙部首\\
2431 "2FF0--"2FFF&汉字结构描述字符&
2432 "3100--"312F&注音字母\\
2433 "3130--"318F&谚文兼容字母&
2434 "31A0--"31BF&注音字母扩充\\
2435 "31C0--"31EF&CJK笔划&
2436 "A000--"A48F&彝文音节\\
2437 "A490--"A4CF&彝文字母&
2438 "A830--"A83F&一般印度数字\\
2439 "AC00--"D7AF&谚文音节&
2440 "D7B0--"D7FF&谚文字母扩充-B
2441 %</zh>
2442 \end{tabular}
2443 \end{center}
2444 \end{table}
2445 \end{description}
2446
2447
2448 %<en>\subsection{\Param{kanjiskip} and \Param{xkanjiskip}}
2449 %<ja>\subsection{\Param{kanjiskip}と\Param{xkanjiskip}}
2450 %<zh>\subsection{\Param{kanjiskip}和\Param{xkanjiskip}}
2451 \label{subs-kskip}
2452
2453 %<*en>
2454 \textbf{JAglue} is divided into the following three categories:
2455 %</en>
2456 %<*ja>
2457 \textbf{JAglue}は以下の3つのカテゴリに分類される:
2458 %</ja>
2459 %<*zh>
2460 \textbf{JAglue}分为以下三个范畴:
2461 %</zh>
2462 \begin{itemize}
2463 %<*en>
2464 \item Glues/kerns specified in JFM. If \verb+\inhibitglue+ is issued
2465       around a Japanese character, this glue will not be inserted at the
2466       place.
2467 %</en>
2468 %<*ja>
2469 \item JFMで指定されたグルー/カーン.もし \verb+\inhibitglue+ が和文文字の周りで
2470       発行されていれば,このグルーは挿入されない.
2471 %</ja>
2472 %<*zh>
2473 \item JFM设定的胶或出格值。如果在一个日文字符附近使用\verb!\inhibitglue!,则胶便不会插入。
2474 %</zh>
2475 %<*en>
2476 \item The default glue which inserted between two \textbf{JAchar}s (\Param{%
2477       kanjiskip}).
2478 %</en>
2479 %<*ja>
2480 \item デフォルトで2つの\textbf{JAchar}の間に挿入されるグルー(\Param{kanjiskip}).
2481 %</ja>
2482 %<*zh>
2483 \item 两个\textbf{JAchar}之间默认插入的胶(\Param{kanjiskip})。
2484 %</zh>
2485 %<*en>
2486 \item The default glue which inserted between a \textbf{JAchar} and an
2487       \textbf{ALchar} (\Param{xkanjiskip}).
2488 %</en>
2489 %<*ja>
2490 \item デフォルトで\textbf{JAchar}と\textbf{ALchar}の間に挿入されるグルー(\Param{xkanjiskip}).
2491 %</ja>
2492 %<*zh>
2493 \item \textbf{JAchar}和\textbf{ALchar}之间默认插入的胶(\Param{xkanjiskip})。
2494 %</zh>
2495 \end{itemize}
2496 %<*en>
2497 The value (a skip) of \Param{kanjiskip} or \Param{xkanjiskip} can be
2498 changed as the following.
2499 %</en>
2500 %<*ja>
2501 \Param{kanjiskip}や\Param{xkanjiskip}の値は以下のようにして変更可能である.
2502 %</ja>
2503 %<*zh>
2504 \Param{kanjiskip}和\Param{xkanjiskip}的设定如下所示:
2505 %</zh>
2506 \begin{lstlisting}
2507 \ltjsetparameter{kanjiskip={0pt plus 0.4pt minus 0.4pt},
2508                  xkanjiskip={0.25\zw plus 1pt minus 1pt}}
2509 \end{lstlisting}
2510
2511 %<*en>
2512 It may occur that JFM contains the data of `ideal width of \Param{kanjiskip}'
2513 and/or `ideal width of \Param{xkanjiskip}'.
2514 To use these data from JFM, set the value of \Param{kanjiskip} or
2515 \Param{xkanjiskip} to \verb+\maxdimen+.
2516 %</en>
2517 %<*ja>
2518 JFMは「望ましい\Param{kanjiskip}の値」や「望ましい\Param{xkanjiskip}の値」を
2519 持っていることがある.
2520 これらのデータを使うためには,\Param{kanjiskip}や\Param{xkanjiskip}の
2521 値を \verb+\maxdimen+ の値に設定すればよい.
2522 %</ja>
2523 %<*zh>
2524 当JFM包含“\Param{kanjiskip}理想宽度”和/或“\Param{xkanjiskip}理想宽度”数据时,
2525 上述设定产生作用。如果想用JFM中的数据,请设定\Param{kanjiskip}或\textsf{xkanjiskip}为\verb!\maxdimen!。
2526 %</zh>
2527
2528 %<en>\subsection{Insertion Setting of \Param{xkanjiskip}}
2529 %<ja>\subsection{\Param{xkanjiskip} の挿入設定}
2530 %<zh>\subsection{\Param{xkanjiskip}插入设定}
2531
2532 %<*en>
2533 It is not desirable that \Param{xkanjiskip} is inserted into every
2534 boundary between \textbf{JAchar}s and \textbf{ALchar}s. For example,
2535 \Param{xkanjiskip} should not be inserted after opening parenthesis
2536 (\textit{e.g.}, compare `(あ' and `(\hskip\ltjgetparameter{xkanjiskip}あ').
2537 \LuaTeX-ja can control whether \Param{xkanjiskip} can be inserted
2538 before/after a character, by changing \Param{jaxspmode} for \textbf{JAchar}s and
2539 \Param{alxspmode} parameters \textbf{ALchar}s respectively.
2540 %</en>
2541 %<*ja>
2542 \Param{xkanjiskip}がすべての\textbf{JAchar}と\textbf{ALchar}の境界に
2543 挿入されるのは望ましいことではない.例えば,\Param{xkanjiskip}は開き括弧の
2544 後には挿入されるべきではない(`(あ'と`(\hskip\ltjgetparameter{xkanjiskip}あ'を
2545 比べてみよ).
2546 \LuaTeX-jaでは\Param{xkanjiskip}をある文字の前/後に挿入するかどうかを,
2547 \textbf{JAchar}に対しては\Param{jaxspmode}を,\textbf{ALchar}に対しては
2548 \Param{alxspmode}をそれぞれ変えることで制御することができる.
2549 %</ja>
2550 %<*zh>
2551 并不是在所有的\textbf{JAchar}和\textbf{ALchar}周围插入\textsf{xkanjiskip}都是合适的。
2552 比如,在开标点之后插入\Param{xkanjiskip}并不合适[如,比较“(あ”和“(\hskip\ltjgetparameter{xkanjiskip}あ”]。
2553 \LuaTeX-ja可以通过设定\textbf{JAchar}的\Param{jaxspmode}以及\textbf{ALchar}的\Param{alxspmode}来控制
2554 \Param{xkanjiskip}在字符前后的插入。
2555 %</zh>
2556 \begin{LTXexample}
2557 \ltjsetparameter{jaxspmode={`あ,preonly}, alxspmode={`\!,postonly}}
2558 pあq い!う
2559 \end{LTXexample}
2560
2561 %<*en>
2562 The second argument \texttt{preonly} means `the insertion of
2563 \Param{xkanjiskip} is allowed before this character, but not after'.
2564 the other possible values are \texttt{postonly}, \texttt{allow} and \texttt{
2565 inhibit}.
2566 %</en>
2567 %<*ja>
2568 2つ目の引数の \texttt{preonly}は「\Param{xkanjiskip}の挿入はこの文字の
2569 前でのみ許され,後では許さない」ことを意味する.他に指定可能な値は
2570 \texttt{postonly}, \texttt{allow}, \texttt{inhibit}である.
2571 %</ja>
2572 %<*zh>
2573 第二个参数\textsf{preonly}表示的含义为“允许在该字符前插入\textsf{xkanjiskip},但不允许在该字符之后插入”。
2574 其他参数还有\textsf{postonly},\textsf{allow}和\textsf{inhibit}。
2575 %</zh>
2576
2577 %<*en>
2578 \Param{jaxspmode} and \Param{alxspmode} use a same table to store the parameters
2579 on the current version. Therefore, line 1 in the code above can be rewritten
2580 as follows:
2581 %</en>
2582 %<*ja>
2583 なお,現行の
2584 仕様では,\Param{jaxspmode}, \Param{alxspmode}はテーブルを共有しており,
2585 上のコードの1行目を次のように変えても同じことになる:
2586 %</ja>
2587 %<*zh>
2588 当前版本的\Param{jaxspmode}和\Param{alxspmode}使用相同的的表保存参数。
2589 因此,上一行可被写作:
2590 %</zh>
2591 \begin{verbatim}
2592 \ltjsetparameter{alxspmode={`あ,preonly}, jaxspmode={`\!,postonly}}
2593 \end{verbatim}
2594 %<*en>
2595 One can use also numbers to specify these two parameters (see Subsection~\ref{ssec-param}).
2596 %</en>
2597 %<*ja>
2598 また,これら2パラメータには数値で値を指定することもできる(\ref{ssec-param}節を参照).
2599 %</ja>
2600 %<*zh>
2601 你也可以使用数字来定义两个参数(参见\ref{ssec-param})。
2602 %</zh>
2603
2604 %<*en>
2605 If you want to enable/disable all insertions of \Param{kanjiskip} and
2606 \Param{xkanjiskip}, set \Param{autospacing} and \Param{autoxspacing}
2607 parameters to \texttt{true}/\texttt{false}, respectively.
2608 %</en>
2609 %<*ja>
2610 もし全ての\Param{kanjiskip}と\Param{xkanjiskip}の挿入を有効化/無効化
2611 したければ,それぞれ\Param{autospacing}と\Param{autoxspacing}を
2612 \texttt{true}/\texttt{false}に設定すればよい.
2613 %</ja>
2614 %<*zh>
2615 如果你想要启用/屏蔽所有的\Param{kanjiskip}和\Param{xkanjiskip}插入,设定
2616 \Param{autospacing}和\Param{autoxspcing}为\texttt{ture}/\texttt{false}即可。
2617 %</zh>
2618
2619 %<en>\subsection{Shifting Baseline}
2620 %<ja>\subsection{ベースラインの移動}
2621 %<zh>\subsection{基线浮动}
2622 %<*en>
2623 To make a match between a Japanese font and an alphabetic font, sometimes
2624 shifting of the baseline of one of the pair is needed. In \pTeX, this is achieved
2625 by setting \verb+\ybaselineshift+ to a non-zero length (the
2626 baseline of alphabetic fonts is shifted below). However, for documents
2627 whose main language is not Japanese, it is good to shift the baseline of
2628 Japanese fonts, but not that of alphabetic fonts.
2629 Because of this, \LuaTeX-ja can independently set the shifting amount
2630 of the baseline of alphabetic fonts (\Param{yalbaselineshift}
2631 parameter) and that of Japanese fonts (\Param{yjabaselineshift}
2632 parameter).
2633 %</en>
2634 %<*ja>
2635 和文フォントと欧文フォントを合わせるためには,時々どちらかのベースラインの移動が
2636 必要になる.\pTeX ではこれは \verb+\ybaselineshift+ を非零の長さに設定することで
2637 なされていた(欧文フォントのベースラインが下がる).しかし,日本語が主ではない
2638 文書に対しては,欧文フォントではなく和文フォントのベースラインを移動した方がよい.
2639 このため,\LuaTeX-jaでは欧文フォントのベースラインのシフト量
2640 (\Param{yalbaselineshift}パラメータ)と和文フォントのベースラインのシフト量
2641 (\Param{yjabaselineshift}パラメータ)を独立に設定できるようになっている.
2642 %</ja>
2643 %<*zh>
2644 为了确保日文字体和西文字体能够对其,有时需要浮动其中一者的基线。
2645 在\pTeX 中,此项设定由设定\verb!\yabaselineshift!为非零长度(西文字体基线应向下浮动)。
2646 不过,如果文档的中主要语言不是日文,那么最好上浮日文字体的基线,西文字体不变。
2647 如上所述,\LuaTeX-ja可以独立设定西文字体的基线(\Param{yabaselineshift}参数)和日文字体的基线(\Param{yjabaselineshift}参数)。
2648 %</zh>
2649
2650 \begin{LTXexample}
2651 \vrule width 150pt height 0.4pt depth 0pt\hskip-120pt
2652 \ltjsetparameter{yjabaselineshift=0pt, yalbaselineshift=0pt}abcあいう
2653 \ltjsetparameter{yjabaselineshift=5pt, yalbaselineshift=2pt}abcあいう
2654 \end{LTXexample}
2655 %<*en>
2656 Here the horizontal line in above is the baseline of a line.
2657 %</en>
2658 %<*ja>
2659 上の例において引かれている水平線がベースラインである.
2660 %</ja>
2661 %<*zh>
2662 上述水平线为此行基线。
2663 %</zh>
2664
2665 %<*en>
2666 There is an interesting side-effect: characters in different size can be
2667 vertically aligned center in a line, by setting two parameters appropriately.
2668 The following is an example (beware the value is not well tuned):
2669 %</en>
2670 %<*ja>
2671 この機能には面白い使い方がある:2つのパラメータを適切に設定することで,サイズの
2672 異なる文字を中心線に揃えることができるのだ.
2673 以下は一つの例である(値はあまり調整されていないことに注意):
2674 %</ja>
2675 %<*zh>
2676 这里还有一个有趣的副作用:不同大小的字符可以通过适当调整这两个参数而在一行中垂直居中。
2677 下面是一个例子(注意,参数值并没有刻意调整):
2678 %</zh>
2679 \begin{LTXexample}
2680 xyz漢字
2681 {\scriptsize
2682   \ltjsetparameter{yjabaselineshift=-1pt,
2683     yalbaselineshift=-1pt}
2684   XYZひらがな
2685 }abcかな
2686 \end{LTXexample}
2687
2688
2689 %<en>\part{Reference}
2690 %<ja>\part{リファレンス}
2691 %<zh>\part{参考指南}
2692 \label{part-ref}
2693 %<en>\section{Font Metric and Japanese Font}
2694 %<ja>\section{フォントメトリックと和文フォント}
2695 %<zh>\section{字体测度和日文字体}
2696 %<en>\subsection{\texttt{\char92jfont} primitive}
2697 %<ja>\subsection{\texttt{\char92jfont}プリミティブ}
2698 %<zh>\subsection{\texttt{\char92jfont}基本语句}
2699 \label{ssec-jfont}
2700
2701 %<*en>
2702 To load a font as a Japanese font, you must use the
2703 \verb+\jfont+ primitive instead of~\verb+\font+, while
2704 \verb+\jfont+ admits the same syntax used in~\verb+\font+.
2705 \LuaTeX-ja automatically loads \Pkg{luaotfload} package,
2706 so TrueType/OpenType fonts with features can be used for Japanese fonts:
2707 %</en>
2708 %<*ja>
2709 フォントを和文フォントとして読み込むためには,\verb+\jfont+ プリミティブを
2710 \verb+\font+ プリミティブの代わりに用いる.
2711 \verb+\jfont+ プリミティブの文法は \verb+\font+ と同じである.
2712 \LuaTeX-jaは\Pkg{luaotfload}パッケージを自動的に読み込むので,
2713 TrueType/OpenTypeフォントにfeatureを指定したものを和文フォントとして用いる
2714 ことができる:
2715 %</ja>
2716 %<*zh>
2717 为了加载日文字体,需要使用\verb!\jfont!基本语句替代\verb!\font!,前者支持后者所有相同句法。
2718 \LuaTeX-ja自动加载\Pkg{luaotfload}宏包,故TrueType/OpenType字体的特性可以使用于日文字体:
2719 %</zh>
2720 \begin{LTXexample}
2721 \jfont\tradgt={file:ipaexg.ttf:script=latn;%
2722   +trad;-kern;jfm=ujis} at 14pt
2723 \tradgt{}当/体/医/区
2724 \end{LTXexample}
2725
2726 %<*en>
2727 Note that the defined control sequence
2728 (\verb+\tradgt+ in the example above) using \verb+\jfont+ is not a
2729 \textit{font\_def} token, hence the input like \verb+\fontname\tradgt+
2730 causes a error.  We denote control sequences which are defined in
2731 \verb+\jfont+ by <jfont\_cs>.
2732 %</en>
2733 %<*ja>
2734 なお,\verb+\jfont+ で定義されたコントロールシーケンス(上の例だと \verb+\tradgt+)
2735 は\textit{font\_def}トークンではないので,\verb+\fontname\tradgt+ のような
2736 入力はエラーとなることに注意する.以下では \verb+\jfont+ で定義された
2737 コントロールシーケンスを<jfont\_cs>で表す.
2738 %</ja>
2739 %<*zh>
2740 注意定义的控制序列(上例中的\verb!\tradgt!)使用的\verb!\jfont!并不是一个\textit{font\_def}标记,
2741 故类似\verb!\fontname\tradgt!输入会引起错误。
2742 我们将定义\verb!\jfont!采用<jfont\_cs>。
2743 %</zh>
2744
2745 \paragraph{JFM}
2746 %<*en>
2747 As noted in Introduction, a JFM has measurements of characters and
2748 glues/kerns that are automatically inserted for Japanese
2749 typesetting. The structure of JFM will be described in the next
2750 subsection. At the calling of \verb+\jfont+ primitive, you must specify
2751 which JFM will be used for this font by the following keys:
2752 %</en>
2753 %<*ja>
2754 「はじめに」の節で述べたように,JFMは文字と和文組版で自動的に挿入される
2755 グルー/カーンの寸法情報を持っている.JFMの構造は次の小節で述べる.
2756 \verb+\jfont+ プリミティブの呼び出しの際には,どのJFMを用いるのかを以下のキーで
2757 指定する必要がある:
2758 %</ja>
2759 %<*zh>
2760 在引言中已提及此项,所谓JFM是字符亮度和日文排版中自动插入的胶/出格。
2761 JFM的结构将在下节进行描述。在使用\verb!\jfont!基本语句时,必须设定JFM如下两个键:
2762 %</zh>
2763
2764 \begin{list}{}{\def\makelabel{\ttfamily}\def\{{\char`\{}\def\}{\char`\}}\advance\leftmargin1\zw}
2765 \item[jfm=<name>]
2766 %<*en>
2767 Specify the name of JFM. If specified JFM has not been loaded, \LuaTeX-ja search and load
2768 a file named \texttt{jfm-<name>.lua}.
2769
2770 The following JFMs are shipped with \LuaTeX-ja:
2771 %</en>
2772 %<*ja>
2773 JFMの名前を指定する.もし以前に指定されたJFMが読み込まれていなければ,
2774 \texttt{jfm-<name>.lua}を読み込む.
2775
2776 以下のJFMが\LuaTeX-jaには同梱されている:
2777 %</ja>
2778 %<*zh>
2779 设定JFM名称。设定的JFM如未加载,\LuaTeX-ja会搜寻并加载一个命名为\texttt{jfm-}<\textit{name}>\texttt{.lua}的文件。
2780
2781 \LuaTeX-ja提供如下JFM:
2782 %</zh>
2783 \begin{description}
2784 %<*en>
2785 \item[\tt jfm-ujis.lua] A standard JFM in \LuaTeX-ja. This JFM is
2786   based on \verb+upnmlminr-h.tfm+, a metric for UTF/OTF package that
2787   is used in \upTeX. When you use the \Pkg{luatexja-otf} package, you should use this JFM.
2788 %</en>
2789 %<*ja>
2790 \item[\tt jfm-ujis.lua] \LuaTeX-jaの標準JFMである.このJFMは\upTeX で
2791   用いられるUTF/OTFパッケージ用の和文用TFMである \verb+upnmlminr-h.tfm+ を
2792   元にしている.\Pkg{luatexja-otf}パッケージを使うときはこのJFMを指定するべきである.
2793 %</ja>
2794 %<*zh>
2795 \item[\tt jfm-ujis.lua] \LuaTeX-ja标准JFM。次JFM基于\upTeX 使用的UTF/OTF宏包的\verb!upnmlminr-h.tfm!。
2796 如果你使用\Pkg{luatexja-otf}宏包,你将会用到此JFM。
2797 %</zh>
2798 %<*en>
2799 \item[\tt jfm-jis.lua] A counterpart for \verb+jis.tfm+, `JIS font
2800   metric' which is widely used in \pTeX. A major difference of
2801   \texttt{jfm-ujis.lua} and this \texttt{jfm-jis.lua} is that
2802   most characters under \texttt{jfm-ujis.lua} are square-shaped,
2803   while that under \texttt{jfm-jis.lua} are horizontal
2804   rectangles.
2805 %</en>
2806 %<*ja>
2807 \item[\tt jfm-jis.lua] \pTeX で広く用いられている「JISフォントメトリック」
2808   \verb+jis.tfm+ に相当するJFMである.\texttt{jfm-ujis.lua}とこの
2809   \texttt{jfm-jis.lua}の主な違いは,\texttt{jfm-ujis.lua}ではほとんどの文字が
2810   正方形状であるのに対し,\texttt{jfm-jis.lua}では横長の長方形状である.
2811 %</ja>
2812 %<*zh>
2813 \item[\tt jfm-jis.lua] 相当于\pTeX 使用的\verb!jis.tfm!(“JIS font metric”)。
2814   \texttt{jfm-ujis.lua}和\texttt{jfm-jis.lua}主要区别是:
2815   \texttt{jfm-ujis.lua}下的大部分字符是方形,
2816   \texttt{jfm-jis.lua}下则为长方形。
2817 %</zh>
2818 %<*en>
2819 \item[\tt jfm-min.lua] A counterpart for \verb+min10.tfm+, which is one
2820   of the default Japanese font metric shipped with \pTeX. There
2821   are notable difference between this JFM and other 2~JFMs, as
2822   shown in Table~\ref{tab-difjfm}.
2823 %</en>
2824 %<*ja>
2825 \item[\tt jfm-min.lua] \pTeX に同梱されているデフォルトの和文用TFM
2826   である \verb+min10.tfm+ に相当するJFMである.このJFMと他の2つのJFMの間には
2827   表\ref{tab-difjfm}に示すような特筆すべき違いがある.
2828 %</ja>
2829 %<*zh>
2830 \item[\tt jfm-min.lua] 相当于\pTeX 中默认的\verb!min10.tfm!。
2831   这个JFM与其他2个JFM的区别如表\ref{tab-difjfm}所示。
2832 %</zh>
2833 \end{description}
2834
2835 \item[jfmvar=<string>] Sometimes there is a need that \ldots.
2836 \end{list}
2837
2838 \begin{table}[t]
2839 %<en>\caption{Differences between JFMs shipped with \LuaTeX-ja}
2840 %<ja>\caption{\LuaTeX-ja に同梱されている JFM の違い}
2841 %<zh>\caption{\LuaTeX-ja下不同JFM表现}
2842 \label{tab-difjfm}
2843 \ltjsetparameter{jacharrange={+3}}
2844 \begin{center}\small
2845 \def\r#1{{\jfont\g=psft:Ryumin-Light:jfm=#1 at 14.43324pt \g
2846 \setbox0=\vtop{\hsize=7\zw\noindent ◆◆◆◆◆◆◆
2847 ある日モモちゃんがお使いで迷子になって泣きました.}\copy0
2848 \vrule height 0pt depth \dp0}}
2849 \def\s#1{{\jfont\g=psft:Ryumin-Light:jfm=#1 at 14.43324pt \g
2850 \setbox0=\vtop{\hsize=7\zw\noindent ちょっと!何}\copy0}}
2851 \def\t#1{{\jfont\g=psft:Ryumin-Light:jfm=#1 at 19.24432pt \g
2852 \setbox0=\hbox{漢}%
2853 \vrule width 0.4pt height\ht0 depth\dp0\kern-.2pt\copy0
2854 \kern-\wd0\vrule width\wd0height .2pt depth .2pt
2855 \kern-\wd0\raise\ht0\hbox{\vrule width\wd0height .2pt depth .2pt}%
2856 \kern-\wd0\lower\dp0\hbox{\vrule width\wd0height .2pt depth .2pt}%
2857 \kern-.2pt\vrule width 0.4pt height\ht0 depth \dp0}}
2858 \begin{tabular}{rccc}
2859 \toprule
2860 &\tt jfm-ujis.lua&\tt jfm-jis.lua&\tt jfm-min.lua\\
2861 \midrule
2862 %<en>Example~1\cite{min10}
2863 %<ja>例1\cite{min10}
2864 %<zh>例1\cite{min10}
2865 &\r{ujis}&\r{jis}&\r{min}\\
2866 %<en>Example~2
2867 %<ja>例2
2868 %<zh>例2
2869 &\s{ujis}&\s{jis}&\s{min}\\
2870 Bounding Box&\t{ujis}&\t{jis}&\t{min}\\
2871 \bottomrule
2872 \end{tabular}
2873 \end{center}
2874 \ltjsetparameter{jacharrange={-3}}
2875 \end{table}
2876
2877 %<en>\paragraph{Note: kern feature}
2878 %<ja>\paragraph{注意:kern feature}
2879 %<zh>\paragraph{注意:kern feature}
2880 \label{para-kern}
2881 %<*en>
2882 Some fonts have information for inter-glyph spacing. However, this
2883 information is not well-compatible with \LuaTeX-ja.  More concretely,
2884 this kerning space from this information are inserted \emph{before} the
2885 insertion process of \textbf{JAglue}, and this causes incorrect spacing
2886 between two characters when both a glue/kern from the data in the font
2887 and it from JFM are present.
2888 %</en>
2889 %<*ja>
2890 いくつかのフォントはグリフ間のスペースについての情報を持っている.しかし,
2891 この情報は\LuaTeX-ja とはあまり相性がよくない.具体的には,この情報に基づいて挿入
2892 されるカーニングスペースは\textbf{JAglue}の挿入過程の\textbf{前に}挿入され,
2893 JFMに基づくグルー/カーンも挿入される場合には2文字間の意図しないスペースの原因と
2894 なる.
2895 %</ja>
2896 %<*zh>
2897 一些字体具有内部字形间距信息。但是,这些信息在\LuaTeX-ja下并不良好兼容。
2898 仔细些说,出格间距是在\textbf{JAglue}插入\textbf{之前}而先行插入的,
2899 这就造成了字体数据中和JFM中的胶/出格在两个字符间插入出错。
2900 %</zh>
2901 \begin{itemize}
2902 %<*en>
2903 \item You should specify \texttt{-kern} in
2904   \verb+jfont+ primitive, when you want to use other font features,
2905   such as \texttt{script=...}\,.
2906 %</en>
2907 %<*ja>
2908 \item  \texttt{script=...}といったfeatureを使いたい場合には,\verb+\jfont+
2909   プリミティブに\texttt{-kern}を指定するべきである.
2910 %</ja>
2911 %<*zh>
2912 \item 当你想使用其他字体特性如\texttt{script=...}的时候,可以在\verb!jfont!基本语句中设置\texttt{-kern}
2913 %</zh>
2914 %<*en>
2915 \item If you want to use Japanese fonts in proportional width, and use
2916       information from this font, use \texttt{jfm-prop.lua} for its JFM, and\ldots.
2917 %</en>
2918 %<*ja>
2919 \item もしプロポーショナル幅の和文フォントをそのフォントの情報に基づいて使いたい
2920   ならば,\texttt{jfm-prop.lua}をJFMとして指定し,……
2921 %</ja>
2922 %<*zh>
2923 \item 如果你想使用比例宽度的日文字体,并且使用此字体信息,使用\texttt{jfm-prop.lua}为其JFM,……
2924 %</zh>
2925 TODO: kanjiskip?
2926 \end{itemize}
2927
2928
2929 %<en>\subsection{Prefix \texttt{psft}}
2930 %<ja>\subsection{\texttt{psft}プリフィックス}
2931 %<zh>\subsection{\texttt{psft}前缀}
2932 \label{ssec-psft}
2933 %<*en>
2934 Besides \texttt{file:}\ and \texttt{name:}\ prefixes, one can use \texttt{psft:}\
2935 prefix in \verb+\jfont+ (and~\verb+\font+) primitive,
2936 to specify a `name-only' Japanese font which
2937 will not be embedded to PDF. Typical use of this prefix is to specify
2938 the `standard' Japanese fonts, namely, `Ryumin-Light' and
2939 `GothicBBB-Medium'.
2940 %</en>
2941 %<*ja>
2942 \texttt{file:}と\texttt{name:}のプリフィックスに加えて,
2943 \verb+\jfont+ プリミティブ(と \verb+\font+ プリミティブ)では
2944 \texttt{psft:}プリフィックスを用いることができる.
2945 このプリフィックスを用いることで,PDFには埋め込まれない「名前だけの」
2946 和文フォントを指定することができる.「標準的な」和文フォント,
2947 つまり`Ryumin-Light'と`GothicBBB-Medium'の指定でこのプリフィックスが使われる.
2948 %</ja>
2949 %<*zh>
2950 除使用\texttt{file:}和\texttt{name:}外,我们还可以在\verb!\jfont!(以及\verb!\font!)
2951 中使用\texttt{psft:}来设定一个“名义上”的并不嵌入PDF中的日文字体。
2952 此前缀的典型使用是定义“标准”日文字体,即“Ryumin-Light”和“GothicBBB-Medium”。
2953 \paragraph{\texttt{cid}键} 默认使用\texttt{psft:}前缀定义的字体是为Adobe-Japan1-6 CID字体。
2954 也可以使用\texttt{cid}键来使用其他的CID字体,如中文和韩文。
2955 %</zh>
2956
2957 %<en>\paragraph{\texttt{cid} key}
2958 %<ja>\paragraph{\texttt{cid}キー}
2959 \label{para-cid}
2960
2961 %<*en>
2962 The default font defined by using \texttt{psft:} prefix is for Japanese typesetting;
2963 it is Adobe-Japan1-6 CID-keyed font.
2964 One can specify \texttt{cid} key to use other CID-keyed non-embedded fonts
2965 for Chinese or Korean typesetting.
2966 \begin{lstlisting}[numbers=left]
2967 \jfont\testJ={psft:Ryumin-Light:cid=Adobe-Japan1-6;jfm=jis}     % Japanese
2968 \jfont\testD={psft:Ryumin-Light:jfm=jis}                        % default value is Adobe-Japan1-6
2969 \jfont\testC={psft:AdobeMingStd-Light:cid=Adobe-CNS1-5;jfm=jis} % Traditional Chinese
2970 \jfont\testG={psft:SimSun:cid=Adobe-GB1-5;jfm=jis}              % Simplified Chinese
2971 \jfont\testK={psft:Batang:cid=Adobe-Korea1-2;jfm=jis}           % Korean
2972 \end{lstlisting}
2973 Note that the code above specifies \texttt{jfm-jis.lua}, which is for Japanese fonts,
2974 as JFM for Chinese and Korean fonts.
2975 %</en>
2976 %<*ja>
2977 標準で\texttt{psft:}プリフィックスで定義されるフォントは日本語用のもので
2978 あり,Adobe-Japan1-6のCIDに対応したものとなる.しかし,\LuaTeX-jaは中国語
2979 の組版にも威力を発揮することが分かり,日本語フォントでない非埋込フォント
2980 の対応も必要となった.そのために追加されたのが\texttt{cid}キーである.
2981
2982 \texttt{cid}キーに値を指定すると,そのCIDを持った非埋込フォントを定義することができる:
2983 \begin{lstlisting}[numbers=left]
2984 \jfont\testJ={psft:Ryumin-Light:cid=Adobe-Japan1-6;jfm=jis}     % 日本語
2985 \jfont\testD={psft:Ryumin-Light:jfm=jis}                        % 無指定時は Adobe-Japan1-6
2986 \jfont\testC={psft:AdobeMingStd-Light:cid=Adobe-CNS1-5;jfm=jis} % 中国語繁体字
2987 \jfont\testG={psft:SimSun:cid=Adobe-GB1-5;jfm=jis}              % 中国語簡体字
2988 \jfont\testK={psft:Batang:cid=Adobe-Korea1-2;jfm=jis}           % 韓国語
2989 \end{lstlisting}
2990 上のコードでは中国語・韓国語用フォントに対してもJFMに
2991 日本語用の\texttt{jfm-jis.lua}を指定しているので注意されたい.
2992 %</ja>
2993
2994 %<*en>
2995 At present, \LuaTeX-ja supports only 4 values written in the sample code above.
2996 Specifying other values, e.g.,
2997 %</en>
2998 %<*ja>
2999 今のところ,\LuaTeX-jaは上のサンプルコード中に書いた4つの値しかサポートしていない.
3000 %</ja>
3001 \begin{lstlisting}
3002 \jfont\test={psft:Ryumin-Light:cid=Adobe-Japan2;jfm=jis}
3003 \end{lstlisting}
3004 %<*en>
3005 occurs the following error:
3006 %</en>
3007 %<*ja>
3008 のようにそれら以外の値を指定すると,
3009 %</ja>
3010 \begin{lstlisting}[numbers=left]
3011 ! Package luatexja Error: bad cid key `Adobe-Japan2'.
3012
3013 See the luatexja package documentation for explanation.
3014 Type  H <return>  for immediate help.
3015 <to be read again>
3016                    \par
3017 l.78
3018
3019 ? h
3020 I couldn't find any non-embedded font information for the CID
3021 `Adobe-Japan2'. For now, I'll use `Adobe-Japan1-6'.
3022 Please contact the LuaTeX-ja project team.
3023 ?
3024 \end{lstlisting}
3025 %<*ja>
3026 というエラーが出る.
3027 %</ja>
3028
3029 %<en>\subsection{Structure of JFM file}
3030 %<ja>\subsection{JFMファイルの構造}
3031 %<zh>\subsection{JFM结构}
3032
3033 %<*en>
3034 A JFM file is a Lua script which has only one function call:
3035 %</en>
3036 %<*ja>
3037 JFMファイルはただ一つの関数呼び出しを含むLuaスクリプトである:
3038 %</ja>
3039 %<*zh>
3040 JFM文件为下列函数调用的Lua脚本:
3041 %</zh>
3042 \begin{verbatim}
3043 luatexja.jfont.define_jfm { ... }
3044 \end{verbatim}
3045 %<*en>
3046 Real data are stored in the table which indicated above by
3047 \verb+{ ... }+.  So, the rest of this subsection are devoted to describe the
3048 structure of this table.  Note that all lengths in a JFM file are
3049 floating-point numbers in design-size unit.
3050 %</en>
3051 %<*ja>
3052 実際のデータは上で \verb+{ ... }+ で示されたテーブルの中に格納されている.
3053 以下ではこのテーブルの構造について記す.
3054 なお,JFMファイル中の長さは全てdesign-sizeを単位とする浮動小数点数であることに
3055 注意する.
3056 %</ja>
3057 %<*zh>
3058 实际的数据保存在表中,即如上的\verb!{ ... }!。
3059 以下部分描述表结构。
3060 请注意,在JFM中的所有长度都是按照以design-size为单位的浮点数。
3061 %</zh>
3062
3063 \begin{list}{}{\def\makelabel{\ttfamily}\def\{{\char`\{}\def\}{\char`\}}\advance\leftmargin1\zw}
3064
3065 \item[dir=<direction>]
3066 %<en>(required)
3067 %<ja>(必須)
3068 %<zh>(必须)
3069
3070 %<en>The direction of JFM. At the present, only \texttt{'yoko'} is supported.
3071 %<ja>JFMの書字方向.現時点では\texttt{'yoko'}のみがサポートされる.
3072 %<zh>JFM的方向,现在只支持\texttt{yoko}(水平)。
3073
3074 \item[zw=<length>]
3075 %<en>(required)
3076 %<ja>(必須)
3077 %<zh>(必须)
3078
3079 %<en>The amount of the length of the `full-width'.
3080 %<ja>「全角幅」の長さ.
3081 %<zh>“全角”长度。
3082
3083 \item[zh=<length>]
3084 %<en>(required)
3085 %<ja>(必須)
3086 %<zh>(必须)
3087
3088 %<en>The amount of the length of the `full-height' (height + depth).
3089 %<ja>「全角高さ」(height + depth)の長さ.
3090 %<zh>“全角高度”(height + depth)长度。
3091
3092 \item[kanjiskip=\{<natural>, <stretch>, <shrink>\}]
3093 %<en>(optional)
3094 %<ja>(任意)
3095 %<zh>(可选)
3096
3097 %<*en>
3098 This field specifies the `ideal' amount of \Param{kanjiskip}. As noted
3099              in Subsection~\ref{subs-kskip}, if the parameter
3100              \Param{kanjiskip} is \verb+\maxdimen+, the value specified
3101              in this field is actually used (if this field is not specified in
3102              JFM, it is regarded as 0\,pt). Note that <stretch> and <shrink>
3103              fields are in design-size unit too.
3104 %</en>
3105 %<*ja>
3106 「理想的な」\Param{kanjiskip}の量を指定する.\ref{subs-kskip}節で述べたように,
3107 もし\Param{kanjiskip}が \verb+\maxdimen+ の値ならば,このフィールドで指定された
3108 値が実際には用いられる(もしこのフィールドがJFMで指定されていなければ,
3109 0\,ptであるものとして扱われる).<stretch>と<shrink>のフィールドもdesign-size
3110 が単位であることに注意せよ.
3111 %</ja>
3112 %<*zh>
3113 这部分为“理想长度”\Param{kanjiskip}。\ref{subs-kskip}节有详述,如果参数\Param{kanjiskip}
3114 为\verb!\maxdimen!,则值设定将会被使用(若再JFM中未设定,则被视为0\,pt)。
3115 请注意,<stretch>和<shrink>的长度均为design-size单位。
3116 %</zh>
3117
3118 \item[xkanjiskip=\{<natural>, <stretch>, <shrink>\}]
3119 %<en>(optional)
3120 %<ja>(任意)
3121 %<zh>(可选)
3122
3123 %<*en>
3124 Like the \Param{kanjiskip} field, this field specifies the `ideal'
3125              amount of \Param{xkanjiskip}.
3126 %</en>
3127 %<*ja>
3128 \Param{kanjiskip}フィールドと同様に,\Param{xkanjiskip}の「理想的な」量を
3129 指定する.
3130 %</ja>
3131 %<*zh>
3132 和\Param{kanjiskip}类似,此部分设定\Param{xkanjiskip}的“理想长度”。
3133 %</zh>
3134 \end{list}
3135
3136 %<*en>
3137 \paragraph{Character classes}
3138 Besides from above fields, a JFM file have several sub-tables those
3139 indices are natural numbers.  The table indexed by~$i\in\omega$ stores
3140 information of `character class'~$i$. At least, the character class~0 is
3141 always present, so each JFM file must have a sub-table whose index is
3142 \texttt{[0]}.  Each sub-table (its numerical index is denoted by $i$) has
3143 the following fields:
3144 %</en>
3145 %<*ja>
3146 \paragraph{文字クラス}
3147 上記のフィールドに加えて,JFMファイルはそのインデックスが自然数であるいくつかの
3148 サブテーブルを持つ.インデックスが$i\in\omega$であるテーブルは「文字クラス」$i$の
3149 情報を格納する.少なくとも,文字クラス0は常に存在するので,JFMファイルはインデックス
3150 が\texttt{[0]}のサブテーブルを持たなければならない.それぞれのサブテーブル
3151 (そのインデックスを$i$で表わす)は以下のフィールドを持つ:
3152 %</ja>
3153 %<*zh>
3154 \paragraph{Character classes}
3155 除了上面涉及到的内容,JFM文件中还有几个以自然数进行声明的次级表。
3156 这些表依靠满足$i\in\omega$的“字符类”$i$来索引。
3157 一般,最少需要的是字符类0,故每一个JFM文件必须有次级表索引为\texttt{[0]}。
3158 %</zh>
3159
3160 \begin{list}{}{\def\makelabel{\ttfamily}\def\{{\char`\{}\def\}{\char`\}}\advance\leftmargin1\zw}
3161 \item[chars=\{<character>, ...\}]
3162 %<en>(required except character class~0)
3163 %<ja>(文字クラス0を除いて必須)
3164 %<zh>(字符类0外必须)
3165
3166 %<*en>
3167 This field is a list of characters which are in this character
3168              type~$i$. This field is optional if $i=0$, since all
3169              \textbf{JAchar} which do not belong  any character classes other
3170              than 0 are in the character class 0
3171              (hence, the character class~0 contains most of
3172              \textbf{JAchar}s). In the list, character(s) can be specified in the following form:
3173 \begin{itemize}
3174 \item a Unicode code point
3175 \item the character itself (as a Lua string, like \verb+'あ'+)
3176 \item a string like \verb+'あ*'+ (the character followed by an asterisk)
3177 \item several ``imaginary'' characters (We will describe these later.)
3178 \end{itemize}
3179 %</en>
3180 %<*ja>
3181 このフィールドは文字クラス$i$に属する文字のリストである.このフィールドは$i=0$の
3182 場合には任意である(文字クラス0には,0以外の文字クラスに属するものを
3183 除いた全ての\textbf{JAchar}が属するから).このリスト中で文字を指定するには,以下の方法がある:
3184 \begin{itemize}
3185 \item Unicode におけるコード番号
3186 \item 「\verb+'あ'+」のような,文字それ自体
3187 \item 「\verb+'あ*'+」のような,文字それ自体の後にアスタリスクをつけたもの
3188 \item いくつかの「仮想的な文字」(後に説明する)
3189 \end{itemize}
3190 %</ja>
3191 %<*zh>
3192 这部分为字符集$i$的字符列表。当$i=0$时不需要设定此部分,因为不在字符集0种的\textbf{JAchar}
3193 字符都包含在字符集0中(也就是字符集0包含大多数的\textbf{JAchar})。在这个字符列表中,每一个
3194 字符据可以使用其编码,或者字符本身(长度为1的字符串)。另外还有部分“假想字符”可在此列表中
3195 使用。我们会在下面描述。
3196 %</zh>
3197
3198 \item[width=<length>, height=<length>, depth=<length>, italic=<length>]
3199 %<en>(required)
3200 %<ja>(必須)
3201 %<zh>(必须)
3202
3203 %<*en>
3204 Specify width of characters in character class~$i$, height, depth and
3205 the amount of italic correction. All characters in character class~$i$ are regarded that its width, height and depth are
3206 as values of these fields.
3207 But there is one exception: if \texttt{'prop'} is specified in \texttt{width} field, width of a character becomes that of its `real' glyph
3208 %</en>
3209 %<*ja>
3210 文字クラス$i$に属する文字の幅,高さ,深さ,イタリック補正の量を指定する.
3211 文字クラス$i$に属する全ての文字は,その幅,高さ,深さがこのフィールドで指定した
3212 値であるものとして扱われる.
3213 しかし,例外が一つある:もし\texttt{'prop'}が\texttt{width}フィールドに
3214 指定された場合,文字の幅はその「実際の」グリフの幅となる.
3215 %</ja>
3216 %<*zh>
3217 设定字符类$i$的宽度,高度和深度以及意大利体校正。在字符集$i$中,所有字符的宽度,高度
3218 和深度的值为上述设定之值。不过还有例外,如果\texttt{'prop'}设定了\texttt{width}部分,那么
3219 字符的宽度则为其“真实”字形宽度。
3220 %</zh>
3221
3222 \item[left=<length>, down=<length>, align=<align>]\
3223
3224 %<*en>
3225 These fields are for adjusting the position of the `real' glyph. Legal
3226              values of \texttt{align} field are \texttt{'left'},
3227              \texttt{'middle'} and \texttt{'right'}. If one of these
3228              3~fields are omitted, \texttt{left} and \texttt{down} are
3229              treated as~0, and \texttt{align} field is treated as
3230              \texttt{'left'}.
3231 The effects of these 3~fields are indicated in Figure~\ref{fig-pos}.
3232 %</en>
3233 %<*ja>
3234 これらのフィールドは「実際の」グリフの位置を調整するためにある.
3235 \texttt{align}フィールドに指定できる値は\texttt{'left'}, \texttt{'middle'},
3236 \texttt{'right'}のいずれかである.もしこれら3つのフィールドのうちの1つが省かれた
3237 場合,\texttt{left}と\texttt{down}は0,\texttt{align}フィールドは
3238 \texttt{'left'}であるものとして扱われる.
3239 これら3つのフィールドの意味については図\ref{fig-pos}で説明する.
3240 %</ja>
3241 %<*zh>
3242 此部分为“真实”字形对齐位置。\texttt{align}的合法值为\texttt{'left'},
3243 \texttt{'middle'}和\texttt{'right'}。如此三项被省略,则\texttt{left}和
3244 \texttt{down}被视作0,\texttt{align}被视作\texttt{'left'}。
3245 此部分三个域的作用,请参见图\ref{fig-pos}。
3246 %</zh>
3247
3248 %<*en>
3249 In most cases, \texttt{left} and \texttt{down} fields are~0, while
3250 it is not uncommon that the \texttt{align} field is \texttt{'middle'} or \texttt{'right'}.
3251 For example, setting the \texttt{align} field to \texttt{'right'} is practically needed
3252 when the current character class is the class for opening delimiters'.
3253 %</en>
3254 %<*ja>
3255 多くの場合,\texttt{left}と\texttt{down}は0である一方,
3256 \texttt{align}フィールドが\texttt{'middle'}や\texttt{'right'}であることは
3257 珍しいことではない.
3258 例えば,\texttt{align}フィールドを\texttt{'right'}に指定することは,
3259 文字クラスが開き括弧類であるときに実際必要である.
3260 %</ja>
3261 %<*zh>
3262 在大多数情况下,\texttt{left}和\texttt{down}域为0,但是在\texttt{align}域为
3263 \texttt{'middle'}或者\texttt{'right'}时则是不正常的。例如,必须设定\texttt{align}
3264 为\texttt{'right'}时,则当前字符类必须为开定界符。
3265 %</zh>
3266 \begin{figure}[!tb]
3267 \begin{minipage}{0.4\textwidth}%
3268 \begin{center}\unitlength=10pt\small
3269 \begin{picture}(15,12)(-1,-4)
3270 \color{black!10!white}% real glyph :step1
3271 \put(0,0){\vrule width 12\unitlength height 8\unitlength depth 3\unitlength}
3272
3273 \color{red!20!white}% real glyph :step1
3274 \put(-1,-1.5){\vrule width 6\unitlength height 7\unitlength depth 2.5\unitlength}
3275
3276 \color{red}% real glyph
3277 \thicklines
3278 \put(-1,-1.5){\vector(0,1){7}\vector(0,-1){2.5}\vector(1,0){6}}
3279 \put(5,-1.5){\line(0,1){7}\line(0,-1){2.5}}
3280 \put(-1,5.5){\line(1,0){6}}
3281 \put(-1,-4){\line(1,0){6}}
3282
3283 \color{green!20!white}% real glyph :step1
3284 \put(3,0){\vrule width 6\unitlength height 7\unitlength depth 2.5\unitlength}
3285
3286 \color{black}% real glyph :step1
3287 \thicklines
3288 \put(0,0){\vector(0,1){8}\line(0,-1){3}\vector(1,0){12}}
3289 \put(12,0){\line(0,1){8}\vector(0,-1){3}}
3290 \put(0,8){\line(1,0){12}}
3291 \put(0,-3){\line(1,0){12}}
3292 \put(0.2,4){\makebox(0,0)[l]{\texttt{height}}}
3293 \put(12.2,-1.5){\makebox(0,0)[l]{\texttt{depth}}}
3294 \put(6,0.2){\makebox(0,0)[b]{\texttt{width}}}
3295
3296 \color{green!50!black}% real glyph :step1
3297 \thicklines
3298 \put(3,0){\vector(0,1){7}\vector(0,-1){2.5}\vector(1,0){6}}
3299 \put(9,0){\line(0,1){7}\line(0,-1){2.5}}
3300 \put(3,7){\line(1,0){6}}
3301 \put(3,-2.5){\line(1,0){6}}
3302 \newsavebox{\eqdist}
3303 \savebox{\eqdist}(0,0)[b]{%
3304   \thinlines
3305   \put(-0.08,0.2){\line(0,-1){0.4}}%
3306   \put(0.08,0.2){\line(0,-1){0.4}}}
3307 \put(1.5,0){\usebox{\eqdist}}
3308 \put(10.5,0){\usebox{\eqdist}}
3309
3310 \color{blue}% shifted
3311 \thicklines
3312 \put(3,-1.5){\vector(-1,0){4}}
3313 \put(1,-1.7){\makebox(0,0)[t]{\texttt{left}}}
3314 \put(3,0){\vector(0,-1){1.5}}
3315 \put(3.2,-0.75){\makebox(0,0)[l]{\texttt{down}}}
3316 \end{picture}
3317 \end{center}
3318 \end{minipage}%
3319 \begin{minipage}{0.6\textwidth}%
3320 %<*en>
3321 Consider a node containing Japanese character whose value of the \texttt{align}
3322 field is \texttt{'middle'}.
3323 %</en>
3324 %<*ja>
3325 \texttt{align}フィールドの値が\texttt{'middle'}である和文文字を含むノードを
3326 考えよう.
3327 %</ja>
3328 %<*zh>
3329 假定一个node包含日语字符,且其值为\texttt{align}的\texttt{'middle'}。
3330 %</zh>
3331 \begin{itemize}
3332 \item
3333 %<*en>
3334 The black rectangle is a frame of the node.
3335 Its width, height and depth are specified by JFM.
3336 %</en>
3337 %<*ja>
3338 黒色の長方形はノードの枠である.
3339 その幅,高さ,深さはJFMによって指定される.
3340 %</ja>
3341 %<*zh>
3342 黑色长方形为node框。其宽度,高度,深度均为JFM所设定。
3343 %</zh>
3344 \item
3345 %<*en>
3346 Since the \texttt{align} field is \texttt{'middle'},
3347 the `real' glyph is centered horizontally (the green rectangle).
3348 %</en>
3349 %<*ja>
3350 \texttt{align}フィールドは\texttt{middle}なので,「実際の」グリフは
3351 水平方向の中心に配置される(緑色の長方形).
3352 %</ja>
3353 %<*zh>
3354 因\texttt{align}被设定为\texttt{middle},故“真实”字形为水平居中(绿长方形中)。
3355 %</zh>
3356 \item
3357 %<*en>
3358 Furthermore, the glyph is shifted according to values of fields
3359       \texttt{left} and \texttt{down}. The ultimate position of the real
3360       glyph is indicated by the red rectangle.
3361 %</en>
3362 %<*ja>
3363 さらに,グリフは\texttt{left}と\texttt{down}の値に従ってシフトされる.
3364 最終的な実際のグリフの位置は赤色の長方形で示された位置になる.
3365 %</ja>
3366 %<*zh>
3367 此外,字形移位由\texttt{left}和\texttt{down}决定。最终字形位置为红长方形所示。
3368 %</zh>
3369 \end{itemize}
3370 \end{minipage}
3371 \medskip
3372
3373 \caption{%
3374 %<en>The position of the `real' glyph.
3375 %<ja>「実際の」グリフの位置.
3376 %<zh>“真实”字形位置
3377 }
3378 \label{fig-pos}
3379 \end{figure}
3380
3381 \item[kern={\{[$j$]=<kern>, ...\}}]
3382
3383 \item[glue={\{[$j$]=\{<width>, <stretch>, <shrink>, [<priority>]\}, ...\}}]
3384 %<*ja>
3385 文字クラス$i$の文字と$j$の文字の間に挿入されるkernやglueの量を指定する.
3386
3387              <priority>は\texttt{luatexja-adjust.sty} による優先順位付き
3388              行長調整(\ref{ssec-adj}節)が有効なときのみ意味を持つ.
3389 このフィールドは省略可能であり,行調整処理におけるこのglueの優先
3390              度を$-2$から$+2$の間の整数で指定する.<priority>の省略時の値
3391              は0であり,範囲外の値が指定されたときの動作は未定義である).
3392
3393 %</ja>
3394
3395 \item[end\_stretch=<kern>]
3396 \item[end\_shrink=<kern>]
3397 %<*ja>
3398 これらのフィールドは省略可能である.
3399 優先順位付き行長調整が有効であり,かつ現在の文字クラスの文字が行
3400              末に来た時に,行長を詰める調整・伸ばす調整のた
3401              めにこの文字と行末の間に挿入可能なカーンの大きさを指定する.
3402 %</ja>
3403
3404 \end{list}
3405
3406 %<*ja>
3407 \paragraph{文字クラスの決定}
3408 文字クラスの決定は少々複雑である.ここでは例を用いて説明しよう.
3409
3410
3411 たとえば,次の内容を一部に含んだ \texttt{jfm-test.lua} を考えよう:
3412 \begin{lstlisting}
3413    [0] = {
3414       chars = { '漢', 'ヒ*' },
3415       align = 'left', left = 0.0, down = 0.0,
3416       width = 1.0, height = 0.88, depth = 0.12, italic=0.0,
3417    },
3418    [2000] = {
3419       chars = { '。', '、*', 'ヒ' },
3420       align = 'left', left = 0.0, down = 0.0,
3421       width = 0.5, height = 0.88, depth = 0.12, italic=0.0,
3422    },
3423 \end{lstlisting}
3424 句点「。」の幅は二分であるので
3425 \begin{LTXexample}
3426 \jfont\a=psft:Ryumin-Light:jfm=test;+vert
3427 \setbox0\hbox{\a 。\inhibitglue 漢}
3428 \the\wd0
3429 \end{LTXexample}
3430 では,全角二分(15.0\,pt)とならなければおかしいが,上の実行結果では20\,ptとなっている.
3431 それは以下の事情によるものである:
3432 \begin{enumerate}
3433 \item \verb+vert+ featureによって句点が縦書き用のグリフと置き換わる(\Pkg{luaotfload} による処理).
3434 \item しかしこのグリフは「文字コード」U+F0000以降とみなされている
3435 (実際にいくらになるかは,フォントによって異なる).
3436 \item よって,文字クラス0とみなされるため,結果として「。」の幅は全角だと認識されてしまう.
3437 \end{enumerate}
3438
3439 一方,「\texttt{'、*'}」のようにアスタリスクつきの指定があると,
3440 状況は異なってくる.
3441 \begin{LTXexample}
3442 \jfont\a=psft:Ryumin-Light:jfm=test;+vert
3443 \a 漢、\inhibitglue 漢
3444 \end{LTXexample}
3445 ここで,読点「、」の文字クラスは,以下のようにして決まる.
3446 \begin{enumerate}
3447 \item とりあえず句点の時と同じように,\Pkg{luaotfload} によって縦書き用読点のグリフに置き換わる.
3448 \item 置換後のグリフの「文字コード」はU+F0000以降であり,
3449 そのままでは文字クラスは0と判定される.
3450 \item ところが,JFMには「\texttt{'、*'}」指定があるので,置換前の横書き用読点のグリフ「、」(文字コードはU+3001)によって文字クラスを判定する.
3451 \item 結果として,上の出力例中の読点の文字クラスは2000となる.
3452 \end{enumerate}
3453
3454 なお,置換後のグリフで判定した文字クラスの値が0でなければ,そちらをそのまま作用する.
3455 \begin{LTXexample}
3456 \jfont\a=psft:Ryumin-Light:jfm=test;+hwid
3457 \a 漢ヒひ
3458 \end{LTXexample}
3459 上の例では,
3460 \texttt{hwid} featureにより,「ヒ」が半角の「ヒ」に置き換わるが,
3461 文字クラスは「ヒ」の属する0\textbf{ではなく},「ヒ」の属する2000となる.
3462 %</ja>
3463
3464 %<ja>\paragraph{仮想的な文字}
3465 %<!ja>\paragraph{Imaginary characters}
3466 %<*en>
3467 As described before, you can specify several `imaginary characters' in
3468 \texttt{chars} field. The most of these characters are regarded as the
3469 characters of class 0 in \pTeX.
3470 As a result, \LuaTeX-ja can control typesetting finer than \pTeX.
3471 The following is the list of `imaginary characters':
3472 %</en>
3473 %<*ja>
3474 上で説明した通り,\texttt{chars}フィールド中にはいくつかの「特殊文字」も
3475 指定可能である.これらは,大半が\pTeX のJFMグルーの挿入処理ではみな「文字
3476 クラス0の文字」として扱われていた文字であり,その結果として\pTeX より細か
3477 い組版調整ができるようになっている.以下でその一覧を述べる:
3478 %</ja>
3479 %<*zh>
3480 如上所述,你可以在\texttt{chars}中设定多个“假想字符”。这些字符中的多数字符在
3481 \pTeX 中式被视作字符集0中字符。故此,\LuaTeX-ja可以比\pTeX 做得更好。
3482 下列为“假想字符”列表:
3483 %</zh>
3484 \begin{list}{}{\def\makelabel{\ttfamily}\def\{{\char`\{}\def\}{\char`\}}\advance\leftmargin1\zw}
3485 %%\item['lineend']
3486 %%%<en>An ending of a line.
3487 %%%<ja>行の終端を表す.
3488 %%%<zh>行尾结束字符。
3489
3490 \item['diffmet']
3491 %<en>Used at a boundary between two \textbf{JAchar}s whose JFM or size is different.
3492 %<ja>JFMやサイズが異なる2つの\textbf{JAchar}の間の境界として用いられる.
3493 %<zh>用于两个不同大小或不同JFM的两个\textbf{JAchar}间边界。
3494
3495 \item['boxbdd']
3496 %<en>The beginning/ending of a horizontal box, and the beginning of a noindented paragraph.
3497 %<ja>水平ボックスの先頭と末尾,及びインデントされていない(\verb+\noindent+ で開始された)段落の先頭を表す.
3498 %<zh>水平合字结束或结尾,以及未缩进段落开头。
3499
3500 \item['parbdd']
3501 %<en>The beginning of an (indented) paragraph.
3502 %<ja>通常の(\verb+\noindent+ で開始されていない)段落の先頭.
3503 %<zh>缩进段落开头。
3504
3505 \item['jcharbdd']
3506 %<en>A boundary between \textbf{JAchar} and anything else (such as \textbf{ALchar}, kern, glue,\,\ldots).
3507 %<ja>和文文字と「その他のもの」(欧文文字,glue,kern等)との境界.
3508 %<zh>日文字符和其他(如\textbf{ALchar},胶,出格等)边界。
3509
3510 \item[$-1$]
3511 %<en>The left/right boundary of an inline math formula.
3512 %<ja>行中数式と地の文との境界.
3513 %<zh>行中数学式的左/右边界。
3514 \end{list}
3515
3516 %<en>\paragraph{Porting JFM from \pTeX}
3517 %<ja>\paragraph{\pTeX 用和文用TFMの移植}
3518 %<zh>\paragraph{\pTeX 下使用的TFM移植}
3519
3520 % ToDo: English version.
3521
3522 %<*en>
3523 \ldots
3524 %</en>
3525
3526 %<*ja>
3527 以下に,\pTeX 用に作られた和文用TFMを\LuaTeX-ja用に移植する場合の注意点を挙げておく.
3528 \begin{itemize}
3529 \item 実際に出力される和文フォントのサイズがdesign sizeとなる.
3530 このため,例えば$1\,\textrm{zw}$がdesign sizeの0.962216倍であるJISフォン
3531       トメトリック等を移植する場合は,
3532 \begin{itemize}
3533 \item JFM中の全ての数値を$1/0.962216$倍しておく.
3534 \item \TeX ソース中で使用するところで,サイズ指定を0.962216倍にする.
3535       \LaTeX でのフォント宣言なら,例えば次のように:
3536 \begin{verbatim}
3537 \DeclareFontShape{JY3}{mc}{m}{n}{<-> s*[0.962216] psft:Ryumin-Light:jfm=jis}{}
3538 \end{verbatim}
3539 \end{itemize}
3540 \item 上に述べた特殊文字は,\texttt{'boxbdd'}を除き文字クラスを全部0とする
3541       (JFM中に単に書かなければよい).
3542 \item \texttt{'boxbdd'}については,それのみで一つの文字クラスを形成し,その
3543       文字クラスに関してはグルー/カーンの設定はしない.
3544
3545 これは,\pTeX では,
3546       水平ボックスの先頭・末尾とインデントされていない(\verb+\noindent+ で開始さ
3547       れた)段落の先頭にはJFMグルーは入らないという仕様を実現させるためである.
3548 \item \pTeX の組版を再現させようというのが目的であれば以上の注意を守れば十分である.
3549
3550 ところで,\pTeX では通常の段落の先頭にJFMグルーが残るという仕様があるので,
3551       段落先頭の開き括弧は全角二分下がりになる.全角下がりを実現させるに
3552       は,段落の最初に手動で \verb+\inhibitglue+ を追加するか,あるいは
3553       \ \verb+\everypar+ のハックを行い,それを自動化させるしかなかった.
3554
3555 一方,\LuaTeX-jaでは,\texttt{'parbdd'}によって,それがJFM側で調整できるよ
3556 うになった.例えば,\LuaTeX-ja同梱のJFMのように,\texttt{'boxbdd'}と同じ文字クラスに
3557 \texttt{'parbdd'}を入れれば全角下がりとなる.
3558
3559 \begin{LTXexample}
3560 \jfont\g=psft:Ryumin-Light:jfm=test \g
3561 \parindent1\zw\noindent{}◆◆◆◆◆
3562 \par 「◆◆←二分下がり
3563 \par 【◆◆←全角下がり
3564 \par 〔◆◆←全角二分下がり
3565 \end{LTXexample}
3566 \end{itemize}
3567
3568 但し,\verb+\everypar+ を利用している場合にはこの仕組みは正しく動かない.
3569 そのような例としては箇条書き中の \verb+\item+ で始まる段落があり,\Pkg{ltjsclasses}では
3570 人工的に「\texttt{'parbdd'}の意味を持つ」whatsitノードを作ることによって対処している%
3571 \footnote{\texttt{no\_runtime/ltjsclasses.dtx} を参照されたい.
3572 JFM側で一部の対処ができることにより,\Pkg{jsclasses}のようにif文の判定はしていない.}
3573 %</ja>
3574 %<*zh>
3575 下面,给出用于\pTeX 使用的JFM移植到\LuaTeX-ja过程中需要注意的几点。
3576 %</zh>
3577
3578
3579 %<en>\subsection{Math Font Family}
3580 %<ja>\subsection{数式フォントファミリ}
3581 %<zh>\subsection{数学字体族}
3582 \label{ssec-math}
3583
3584 %<*en>
3585 \TeX\ handles fonts in math formulas by 16~font families\footnote{Omega,
3586 Aleph, \LuaTeX~and $\varepsilon$-\kern-.125em(u)\pTeX\ can handles 256~families, but
3587 an external package is needed to support this in plain \TeX\ and
3588 \LaTeX.}, and each family has three fonts:
3589 \verb+\textfont+, \verb+\scriptfont+ and \verb+\scriptscriptfont+.
3590 %</en>
3591 %<*ja>
3592 \TeX\ は数式フォントを16のファミリ\footnote{Omega, Aleph, \LuaTeX,そして
3593   $\varepsilon$-\kern-.125em(u)\pTeX\ では256の数式ファミリを扱うことができるが,
3594   これをサポートするためにplain \TeX と\LaTeX では外部パッケージを読み込む必要が
3595   ある.}で管理し,それぞれのファミリは3つのフォントを持っている:\verb+\textfont+, \verb+\scriptfont+ そして \verb+\scriptscriptfont+ である.
3596 %</ja>
3597
3598 %<*en>
3599 \LuaTeX-ja's handling of Japanese fonts in math formulas is similar;
3600 Table~\ref{tab-math} shows counterparts to \TeX's primitives for math
3601 font families. There is no relation between the value of
3602 \verb+\fam+ and that of \verb+\jfam+; with appropriate settings,
3603 you can set both \verb+\fam+ and \verb+\jfam+ to the same value.
3604 %</en>
3605 %<*ja>
3606 \LuaTeX-jaの数式中での和文フォントの扱いも同様である.
3607 表\ref{tab-math}は数式フォントファミリに対する \TeX のプリミティブと対応する
3608 ものを示している.\verb+\fam+ と \verb+\jfam+ の値の間には関係はなく,
3609 適切な設定の下では \verb+\fam+ と \verb+\jfam+ の両方に同じ値を設定することができる.
3610 %</ja>
3611
3612 \begin{table}[!tb]
3613 %<en>\caption{Primitives for Japanese math fonts.}
3614 %<ja>\caption{和文数式フォントに対するプリミティブ.}
3615 %<zh>\caption{日语数学字体基本语句}
3616 \label{tab-math}
3617 \begin{center}
3618 \def\{{\char`\{}\def\}{\char`\}}\small
3619 \begin{tabular}{ll}
3620 \toprule
3621 %<en>\bf Japanese fonts&\bf alphabetic fonts\\
3622 %<ja>\bf 和文フォント&\bf 欧文フォント\\
3623 %<zh>\bf 日文字体&\bf 西文字体\\
3624 \midrule
3625 \verb+\jfam+${}\in [0,256)$&\verb+\fam+\\
3626 \tt\Param{jatextfont}\,=\{<jfam>,<jfont\_cs>\}&\tt\verb+\textfont+<fam>=<font\_cs>\\
3627 \tt\Param{jascriptfont}\,=\{<jfam>,<jfont\_cs>\}&\tt\verb+\scriptfont+<fam>=<font\_cs>\\
3628 \tt\Param{jascriptscriptfont}\,=\{<jfam>,<jfont\_cs>\}&\tt\verb+\scriptscriptfont+<fam>=<font\_cs>\\
3629 \bottomrule
3630 \end{tabular}
3631 \end{center}
3632 \end{table}
3633
3634 %<en>\subsection{Callbacks}
3635 %<ja>\subsection{コールバック}
3636 %<zh>\subsection{回调}
3637
3638 %<*en>
3639 Like \LuaTeX\ itself, \LuaTeX-ja also has callbacks. These callbacks can
3640 be accessed via \verb+luatexbase.add_to_callback+ function and so on, as other callbacks.
3641 %</en>
3642 %<*ja>
3643 \LuaTeX 自体のものに加えて,\LuaTeX-jaもコールバックを持っている.
3644 これらのコールバックには,他のコールバックと同様に \verb+luatexbase.add_to_callback+
3645 関数などを用いることでアクセスすることができる.
3646 %</ja>
3647 \begin{list}{}%
3648 {\def\makelabel#1{\bfseries#1}}
3649 %<en>\item[\texttt{luatexja.load\_jfm} callback]
3650 %<ja>\item[\texttt{luatexja.load\_jfm}コールバック]
3651 %<zh>\item[\texttt{luatexja.load\_jfm}回调]
3652 %<*en>
3653 With this callback you can overwrite JFMs.
3654 This callback is called when a new JFM is loaded.
3655 %</en>
3656 %<*ja>
3657 このコールバックを用いることでJFMを上書きすることができる.
3658 このコールバックは新しいJFMが読み込まれるときに呼び出される.
3659 %</ja>
3660
3661 \begin{lstlisting}[numbers=left]
3662 function (<table> jfm_info, <string> jfm_name)
3663   return <table> new_jfm_info
3664 end
3665 \end{lstlisting}
3666
3667 %<*en>
3668 The argument \verb+jfm_info+ contains a table similar to the table in a JFM file, except
3669 this argument has \texttt{chars} field which contains character codes
3670              whose character class is not~0.
3671 %</en>
3672 %<*ja>
3673 引数 \verb+jfm_info+ はJFMファイルのテーブルと似たものが格納されるが,
3674 クラス0を除いた文字のコードを含んだ\texttt{chars}フィールドを持つ点が異なる.
3675 %</ja>
3676
3677 %<*en>
3678 An example of this callback is the \texttt{ltjarticle} class, with
3679              forcefully assigning character class~0 to \texttt{'parbdd'}
3680              in the JFM \texttt{jfm-min.lua}.
3681 %</en>
3682 %<*ja>
3683 このコールバックの使用例は\texttt{ltjarticle}クラスにあり,
3684 \texttt{jfm-min.lua}中の\texttt{'parbdd'}を強制的にクラス0に割り当てている.
3685 %</ja>
3686
3687 %<en>\item[\texttt{luatexja.define\_font} callback]
3688 %<ja>\item[\texttt{luatexja.define\_font}コールバック]
3689 %<zh>\item[\texttt{luatexja.define\_font}回调]
3690 %<*en>
3691 This callback and the next callback form a pair, and you can assign letters which don't have
3692              fixed code points in Unicode to non-zero character classes.
3693 This \texttt{luatexja.define\_font} callback is called just when new Japanese font is loaded.
3694 %</en>
3695 %<*ja>
3696 このコールバックと次のコールバックは組をなしており,Unicode中に固定された文字コード
3697 番号を持たない文字を非零の文字クラスに割り当てることができる.
3698 このコールバックは新しい和文フォントが読み込まれたときに呼び出される.
3699 %</ja>
3700
3701 \begin{lstlisting}[numbers=left]
3702 function (<table> jfont_info, <number> font_number)
3703   return <table> new_jfont_info
3704 end
3705 \end{lstlisting}
3706
3707 %<*en>
3708 You may assume that \verb+jfont_info+ has the following fields:
3709 %</en>
3710 %<*ja>
3711 \verb+jfont_info+ は以下の2フィールドを持つ:
3712 %</ja>
3713 \begin{description}
3714 \item[\tt size\_cache]
3715 %<*ja>
3716 使用されているJFMの情報が格納されているテーブルで,
3717 \textbf{このテーブルを書き換えてはならない}.
3718 中身はほぼJFMファイルに書かれている唯一のテーブルであるが,次のように若干変わっている:
3719 \begin{itemize}
3720 \item 各文字クラス$i$に属する文字達のテーブル
3721 \texttt{[$i$].chars=\{<character>, ...\}}は,トップレベルにまとめられ,
3722 \texttt{chars=\{[<character>]=$i$, ...\}}という形になっている.
3723 \item \texttt{zw},~\texttt{zh}, \texttt{kanjiskip},~\texttt{xkanjiskip} の各フィールドの値は,
3724 実際に使われるフォントサイズに合わせたsp ($1\,\mathrm{sp}=2^{-6}\,\mathrm{pt}$)単位の長さに変わっている.
3725 \item 各文字クラス$i$の情報を格納したテーブルも,\texttt{char\_type} フィールドの下にまとめられている.
3726 例えば,文字クラス1に属する文字の高さは \texttt{char\_type[1].height} で参照できる.
3727 \item \texttt{dir} フィールドはこのテーブルにはない.
3728 \end{itemize}
3729 %</ja>
3730 %<*en>
3731 A table which contains the information of a JFM, and \emph{this table must not be changed}.
3732 The contents of this table are similar to that which is written is the JFM file, but
3733 the following differ:
3734 \begin{itemize}
3735 \item There is a \texttt{chars} table, \dots
3736 \item The value in \texttt{zw},~\texttt{zh}, \texttt{kanjiskip},~\texttt{xkanjiskip} fields are
3737 now scaled by real font size, and in scaled-pont unit.
3738 \item ...
3739 \item There is no \texttt{dir} field in this table.
3740 \end{itemize}
3741 %</en>
3742 %<zh> ...
3743
3744 \item[\tt var]
3745 %<en>The value specified in \texttt{jfmvar=...} at a call of \verb+\jfont+.
3746 %<ja>\verb+\jfont+ の呼び出しの際に\texttt{jfmvar=...}で指定された値.
3747 %<zh>\verb!\jfont!调用的\texttt{jfmvar=...}值。
3748 \end{description}
3749
3750 %<*en>
3751 The returned table \verb+new_jfont_info+ also should include these two fields.
3752 The \verb+font_number+ is a font number.
3753 %</en>
3754 %<*ja>
3755 戻り値の \verb+new_jfont_info+ テーブルもこれら2つのフィールドを含まなければならないが,
3756 それ以外にユーザが勝手にフィールドを付け加えることは自由である.
3757 \verb+font_number+ はフォント番号である.
3758 %</ja>
3759
3760 %<*en>
3761 A good example of this and the next callbacks is the \Pkg{luatexja-otf}
3762              package, supporting \verb+"AJ1-xxx"+ form for Adobe-Japan1
3763              CID characters in a JFM. This callback doesn't replace any
3764              code of \LuaTeX-ja.
3765 %</en>
3766 %<*ja>
3767 これと次のコールバックの良い使用例は\Pkg{luatexja-otf}パッケージであり,
3768 JFM中でAdobe-Japan1 CIDの文字を \verb+"AJ1-xxx"+ の形で指定するために
3769 用いられている.
3770 %</ja>
3771
3772 %<en>\item[\texttt{luatexja.find\_char\_class} callback]
3773 %<ja>\item[\texttt{luatexja.find\_char\_class}コールバック]
3774 %<zh>\item[\texttt{luatexja.find\_char\_class}回调]
3775 %<*en>
3776 This callback is called just when \LuaTeX-ja is trying to determine which
3777              character class a character \verb+chr_code+ belongs.
3778 A function used in this callback should be in the following form:
3779 %</en>
3780 %<*ja>
3781 このコールバックは\LuaTeX-jaが \verb+chr_code+ の文字がどの文字クラスに
3782 属するかを決定しようとする際に呼び出される.
3783 このコールバックで呼び出される関数は次の形をしていなければならない:
3784 %</ja>
3785 \begin{lstlisting}[numbers=left]
3786 function (<number> char_class, <table> jfont_info, <number> chr_code)
3787   if char_class~=0 then return char_class
3788   else
3789     ....
3790     return (<number> new_char_class or 0)
3791   end
3792 end
3793 \end{lstlisting}
3794
3795 %<*en>
3796 The argument \verb+char_class+ is the result of \LuaTeX-ja's default
3797              routine or previous function calls in this callback, hence
3798              this argument may not be 0. Moreover, the returned
3799              \verb+new_char_class+ should be as same as \verb+char_class+ when \verb+char_class+
3800              is not~0, otherwise you will overwrite the \LuaTeX-ja's
3801              default routine.
3802 %</en>
3803 %<*ja>
3804 引数 \verb+char_class+ は\LuaTeX-jaのデフォルトルーチンか,このコールバックの
3805 直前の関数呼び出しの結果を含んでおり,したがってこの値は0ではないかもしれない.
3806 さらに,戻り値の \verb+new_char_class+ は \verb+char_class+ が非零のときには
3807 \verb+char_class+ の値と同じであるべきで,そうでないときは\LuaTeX-jaの
3808 デフォルトルーチンを書き換えることになる.
3809 %</ja>
3810
3811 %<en>\item[\texttt{luatexja.set\_width} callback]
3812 %<ja>\item[\texttt{luatexja.set\_width}コールバック]
3813 %<zh>\item[\texttt{luatexja.set\_width}回调]
3814 %<*en>
3815 This callback is called when \LuaTeX-ja is trying to encapsule a
3816              \textbf{JAchar} \textit{glyph\_node}, to adjust its
3817              dimension and position.
3818 %</en>
3819 %<*ja>
3820 このコールバックは\LuaTeX-jaが\textbf{JAchar}の寸法と位置を調節するために
3821 その\textit{glyph\_node}をカプセル化しようとする際に呼び出される.
3822 %</ja>
3823 \begin{lstlisting}[numbers=left]
3824 function (<table> shift_info, <table> jfont_info, <number> char_class)
3825   return <table> new_shift_info
3826 end
3827 \end{lstlisting}
3828
3829 %<*en>
3830 The argument \verb+shift_info+ and the returned \verb+new_shift_info+ have
3831 \texttt{down} and \texttt{left} fields, which are the amount of shifting
3832              down/left the character in a scaled-point.
3833 %</en>
3834 %<*ja>
3835 引数 \verb+shift_info+ と戻り値の \verb+new_shift_info+ は
3836 \texttt{down}と\texttt{left}のフィールドを持ち,これらの値は
3837 文字の下/左へのシフト量(スケールド・ポイント単位)である.
3838 %</ja>
3839
3840 %<*en>
3841 A good example is \Pkg{test/valign.lua}.
3842 After loading this file, the vertical position of glyphs is automatically
3843 adjusted; the ratio $(\hbox{height}:\hbox{depth})$ of glyphs is adjusted
3844 to be that of letters in the character class~0. For example, suppose that
3845 \begin{itemize}
3846 \item The setting of the JFM: $(\hbox{height})=88x$, $(\hbox{depth})=12x$
3847   (the standard values of Japanese OpenType fonts);
3848 \item The value of the real font: $(\hbox{height})=28y$, $(\hbox{depth})=5y$
3849   (the standard values of Japanese TrueType fonts).
3850 \end{itemize}
3851 Then, the position of glyphs is shifted up by
3852 \[
3853  \frac{88x}{88x+12x} (28y+5y) - 28y = \frac{26}{25}y= 1.04y.
3854 \]
3855 %</en>
3856 %<*ja>
3857 良い例が\Pkg{test/valign.lua}である.このファイルが読み込まれた状態では,
3858              JFM内で規定された文字クラス0の文字における$(\hbox{高
3859              さ}):(\hbox{深さ})$の比になるように,実際のフォントの出力上
3860              下位置が自動調整される.例えば,
3861 \begin{itemize}
3862 \item JFM側の設定:$(\hbox{高さ})=88x$, $(\hbox{深さ})=12x$%
3863 (和文OpenTypeフォントの標準値)
3864 \item 実フォント側の数値:$(\hbox{高さ})=28y$, $(\hbox{深さ})=5y$(和文TrueTypeフォントの標準値)
3865 \end{itemize}
3866 となっていたとする.すると,実際の文字の出力位置は,
3867 \[
3868  \frac{88x}{88x+12x} (28y+5y) - 28y = \frac{26}{25}y= 1.04y.
3869 \]
3870 だけ上にずらされることになる.
3871 %</ja>
3872 \end{list}
3873
3874
3875
3876 %<en>\section{Parameters}
3877 %<ja>\section{パラメータ}
3878 %<zh>\section{参数}
3879 %<en>\subsection{\texttt{\char92 ltjsetparameter} primitive}
3880 %<ja>\subsection{\texttt{\char92 ltjsetparameter}プリミティブ}
3881 %<zh>\subsection{\texttt{\char92 ltjsetparameter}基本参数}
3882
3883 %<*en>
3884 As noted before, \verb+\ltjsetparameter+ and \verb+\ltjgetparameter+ are
3885 primitives for accessing most parameters of \LuaTeX-ja. One of the main
3886 reason that \LuaTeX-ja didn't adopted the syntax similar to that of \pTeX\
3887 (\textit{e.g.},~\verb+\prebreakpenalty`)=10000+)
3888 is the position of \verb+hpack_filter+ callback in the source
3889 of \LuaTeX, see Section~\ref{sec-para}.
3890 %</en>
3891 %<*ja>
3892 先に述べたように,\verb+\ltjsetparameter+ と \verb+\ltjgetparameter+ は
3893 \LuaTeX-jaのほとんどのパラメータにアクセスするためのプリミティブである.
3894 \LuaTeX-jaが\pTeX のような文法(例えば,\verb+\prebreakpenalty`)=10000+)を
3895 採用しない理由の一つは,\LuaTeX のソースにおける \verb+hpack_filter+
3896 コールバックの位置にある.\ref{sec-para}節を参照.
3897 %</ja>
3898
3899 %<*en>
3900 \verb+\ltjsetparameter+ and \verb+\ltjglobalsetparameter+ are primitives
3901 for assigning parameters. These take one argument which is a
3902 \texttt{<key>=<value>} list. Allowed keys are described in the next
3903 subsection.
3904 The difference between
3905 \verb+\ltjsetparameter+ and \verb+\ltjglobalsetparameter+ is only the
3906 scope of assignment;
3907 \verb+\ltjsetparameter+ does a local assignment and
3908 \verb+\ltjglobalsetparameter+ does a global one.
3909 They also obey the value of \verb+\globaldefs+,
3910 like other assignment.
3911 %</en>
3912 %<*ja>
3913 \verb+\ltjsetparameter+ と \verb+\ltjglobalsetparameter+ はパラメータを
3914 指定するためのプリミティブである.これらは\texttt{<key>=<value>}のリストを
3915 引数としてとる.許されるキーは次の節に記述する.
3916 \verb+\ltjsetparameter+ と \verb+\ltjglobalsetparameter+ の違いはスコープの
3917 違いのみである.
3918 \verb+\ltjsetparameter+ はローカルな指定,\verb+\ltjglobalsetparameter+ は
3919 グローバルな指定を行う.
3920 これらは他のパラメータ指定と同様に \verb+\globaldefs+ の値に従う.
3921 %</ja>
3922
3923 %<*en>
3924 \verb+\ltjgetparameter+ is the primitive for acquiring parameters. It
3925 always takes a parameter name as first argument, and also takes the
3926 additional argument---a character code, for example---in some cases.
3927 %</en>
3928 %<*ja>
3929 \verb+\ltjgetparameter+ はパラメータの値を取得するためのプリミティブであり,
3930 常にパラメータの名前を第一引数にとる.
3931 そして,いくつかの場合には加えてさらに引数(例えば文字コード)をとる.
3932 %</ja>
3933 \begin{LTXexample}
3934 \ltjgetparameter{differentjfm},
3935 \ltjgetparameter{autospacing},
3936 \ltjgetparameter{prebreakpenalty}{`)}.
3937 \end{LTXexample}
3938 %<*en>
3939 \emph{The return value of\/ {\normalfont\tt\char92ltjgetparameter} is
3940 always a string}. This is outputted by \texttt{tex.write()}, so any
3941 character other than space~`\texttt{\char32}'~(U+0020) has the category code
3942 12~(other), while the space has 10~(space).
3943 %</en>
3944 %<*ja>
3945 \textbf{{\normalfont\tt\char92ltjgetparameter}の戻り値は常に文字列である.}
3946 これは\texttt{tex.write()}によって出力しているためで,スペース`\texttt{\char32}'~(U+0020)を除いた文字のカテゴリーコードは全て12~(other)となる.
3947 一方,スペースのカテゴリーコードは10~(space)である.
3948 %</ja>
3949
3950 %<en>\subsection{List of Parameters}
3951 %<ja>\subsection{パラメータ一覧}
3952 %<zh>\subsection{参数一览}
3953 \label{ssec-param}
3954
3955 %<*en>
3956 The following is the list of parameters which can be specified by the
3957 \verb+\ltjsetparameter+ command. [\verb+\cs+] indicates the counterpart
3958 in \pTeX, and symbols beside each parameter has the following meaning:
3959 %</en>
3960 %<*ja>
3961 以下は \verb+\ltjsetparameter+ に指定することができるパラメータの一覧である.
3962 [\verb+\cs+]は\pTeX における対応物を示す.
3963 また,それぞれのパラメータの右上にある記号には次の意味がある:
3964 %</ja>
3965 \begin{itemize}
3966 %<*zh>
3967 \item % avoiding from error ``Something's wrong--perhaps a missing \item.''.
3968 %</zh>
3969 %<*en>
3970 \item No mark: values at the end of the paragraph or the hbox are
3971       adopted in the whole paragraph/hbox.
3972 %</en>
3973 %<*ja>
3974 \item 記号なし:段落や水平ボックスの終端での値がその段落/水平ボックス全体で用いられる.
3975 %</ja>
3976 %<*en>
3977 \item `\ast' : local parameters, which can change everywhere inside a paragraph/hbox.
3978 %</en>
3979 %<*ja>
3980 \item `\ast':ローカルなパラメータであり,段落/水平ボックス内のどこででも値を変えることができる.
3981 %</ja>
3982 %<*en>
3983 \item `\dagger': assignments are always global.
3984 %</en>
3985 %<*ja>
3986 \item `\dagger':指定は常にグローバルになる.
3987 %</ja>
3988 \end{itemize}
3989
3990 \begin{list}{}{\def\makelabel{\ttfamily}\def\{{\char`\{}\def\}{\char`\}}\advance\leftmargin1\zw}
3991 \item[\Param{jcharwidowpenalty}\,=<penalty>] [\verb+\jcharwidowpenalty+]
3992 %<*en>
3993 Penalty value for suppressing orphans. This penalty is inserted just
3994              after the last \textbf{JAchar} which is not regarded as a
3995              (Japanese) punctuation mark.
3996 %</en>
3997 %<*ja>
3998 パラグラフの最後の字が孤立して改行されるのを防ぐためのペナルティの値.
3999 このペナルティは(日本語の)句読点として扱われない最後の\textbf{JAchar}の直後に
4000 挿入される.
4001 %</ja>
4002
4003 \item[\Param{kcatcode}\,=\{<chr\_code>,<natural number>\}]\
4004 %<*en>
4005 An additional attributes which each character whose character code is <chr\_code> has.
4006 At the present version, the lowermost bit of <natural number> indicates
4007              whether the character is considered as a punctuation mark
4008              (see the description of \Param{jcharwidowpenalty} above).
4009 %</en>
4010 %<*ja>
4011 文字コードが<chr\_code>の文字が持つ付加的な属性値(attribute).
4012 現在のバージョンでは,<natural number>の最下位ビットが,その文字が句読点と
4013 みなされるかどうかを表している(上の\Param{jcharwidowpenalty}の記述を参照).
4014 %</ja>
4015
4016 \item[\Param{prebreakpenalty}\,=\{<chr\_code>,<penalty>\}] [\verb+\prebreakpenalty+]\
4017 %<*ja>
4018 文字コード<chr\_code>の\textbf{JAchar}が行頭にくることを抑止するために,
4019              この文字の前に挿入/追加されるペナルティの量を指定する.
4020
4021 例えば閉じ括弧「〗」は絶対に行頭にきてはならないので,標準で読み込まれる
4022              \texttt{luatexja-kinsoku.tex}において
4023 \begin{verbatim}
4024 \ltjsetparameter{prebreakpenalty={`〙,10000}}
4025 \end{verbatim}
4026 と,最大値の10000が指定されている.他にも,小書きのカナなど,絶対禁止とい
4027              うわけではないができれば行頭にはきて欲しくない場合に,0と
4028              10000の間の値を指定するのも有用であろう.
4029 \begin{verbatim}
4030 \ltjsetparameter{prebreakpenalty={`ゕ,150}}
4031 \end{verbatim}
4032 %</ja>
4033
4034 \item[\Param{postbreakpenalty}\,=\{<chr\_code>,<penalty>\}] [\verb+\postbreakpenalty+]
4035 %<*ja>
4036 文字コード<chr\_code>の\textbf{JAchar}が行末にくることを抑止するために,
4037              この文字の後に挿入/追加されるペナルティの量を指定する.
4038
4039 \pTeX では,\verb+\prebreakpenalty+, \verb+\postbreakpenalty+において,
4040 \begin{itemize}
4041 \item 一つの文字に対して,pre, postどちらか一つしか指定することができなかっ
4042       た(後から指定した方で上書きされる).
4043 \item pre, post合わせて256文字分の情報を格納することしかできなかった.
4044 \end{itemize}
4045 という制限があったが,\LuaTeX-jaではこれらの制限は解消されている.
4046 %</ja>
4047
4048 \item[\Param{jatextfont}\,=\{<jfam>,<jfont\_cs>\}]
4049 %<en>[\verb+\textfont+ in \TeX]
4050 %<ja>[\TeX の \verb+\textfont+]
4051 %<zh>[\TeX 的\verb+\textfont+]
4052 \item[\Param{jascriptfont}\,=\{<jfam>,<jfont\_cs>\}]
4053 %<en>[\verb+\scriptfont+ in \TeX]
4054 %<ja>[\TeX の \verb+\scriptfont+]
4055 %<zh>[\TeX 中的\verb+\scriptfont+]
4056 \item[\Param{jascriptscriptfont}\,=\{<jfam>,<jfont\_cs>\}]
4057 %<en>[\verb+\scriptscriptfont+ in \TeX]
4058 %<ja>[\TeX の \verb+\scriptscriptfont+]
4059 %<zh>[\TeX 中的\verb+\scriptscriptfont+]
4060 \item[\Param{yjabaselineshift}\,=<dimen>$^\ast$]\
4061 \item[\Param{yalbaselineshift}\,=<dimen>$^\ast$] [\verb+\ybaselineshift+]
4062
4063 \item[\Param{jaxspmode}\,=\{<chr\_code>,<mode>\}]
4064
4065 %<*en>
4066 Setting whether inserting \Param{xkanjiskip} is allowed before/after a \textbf{JAchar} whose character code is <chr\_code>.
4067 The followings are allowed for <mode>:
4068 %</en>
4069 %<*ja>
4070 文字コードが<chr\_code>の\textbf{JAchar}の前/後ろに\Param{xkanjiskip}の
4071 挿入を許すかどうかの設定.
4072 以下の<mode>が許される:
4073 %</ja>
4074 \begin{description}
4075 %<en>\item[0, \texttt{inhibit}] Insertion of \Param{xkanjiskip} is inhibited before the character, nor after the character.
4076 %<ja>\item[0, \texttt{inhibit}] \Param{xkanjiskip}の挿入は文字の前/後ろのいずれでも禁止される.
4077 %<zh>\item[0, \texttt{inhibit}] 插入文字前/后的\Param{xkanjiskip}均被禁止。
4078 %<en>\item[1, \texttt{preonly}] Insertion of \Param{xkanjiskip} is allowed before the character, but not after.
4079 %<ja>\item[1, \texttt{preonly}] \Param{xkanjiskip}の挿入は文字の前では許されるが,後ろでは許されない.
4080 %<zh>\item[1, \texttt{preonly}] 文字前允许插入\Param{xkanjiskip},但其后不允许插入。
4081 %<en>\item[2, \texttt{postonly}] Insertion of \Param{xkanjiskip} is allowed after the character, but not before.
4082 %<ja>\item[2, \texttt{postonly}] \Param{xkanjiskip}の挿入は文字の後ろでは許されるが,前では許されない.
4083 %<zh>\item[2, \texttt{postonly}] 文字后允许插入\Param{xkanjiskip},但之前不允许插入。
4084 %<en>\item[3, \texttt{allow}] Insertion of \Param{xkanjiskip} is allowed both before the character and after the character. This is the default value.
4085 %<ja>\item[3, \texttt{allow}] \Param{xkanjiskip}の挿入は文字の前/後ろのいずれでも許される.これがデフォルトの値である.
4086 %<zh>\item[3, \texttt{allow}] 文字前后均可插入\Param{xkanjiskip}。此为默认值。
4087 \end{description}
4088 %<*en>
4089 This parameter is similar to the \verb+\inhibitxspcode+ primitive of \pTeX, but not compatible with \verb+\inhibitxspcode+.
4090 %</en>
4091 %<*ja>
4092 このパラメータは\pTeX の \verb+\inhibitxspcode+ プリミティブと似ているが,
4093 互換性はない.
4094 %</ja>
4095 %<*zh>
4096 此参数类似\pTeX 基本语句\verb!\inhibitxspcode!,但是和\verb!\inhibitxspcode!不兼容。
4097 %</zh>
4098 \item[\Param{alxspmode}\,=\{<chr\_code>,<mode>\}] [\verb+\xspcode+]
4099
4100 %<*en>
4101 Setting whether inserting \Param{xkanjiskip} is allowed before/after a
4102              \textbf{ALchar} whose character code is <chr\_code>.
4103              The followings are allowed for <mode>:
4104 %</en>
4105 %<*ja>
4106 文字コードが<chr\_code>の\textbf{ALchar}の前/後ろに\Param{xkanjiskip}の
4107 挿入を許すかどうかの設定.
4108 以下の<mode>が許される:
4109 %</ja>
4110 \begin{description}
4111 %<en>\item[0, \texttt{inhibit}] Insertion of \Param{xkanjiskip} is inhibited before the character, nor after the character.
4112 %<ja>\item[0, \texttt{inhibit}] \Param{xkanjiskip}の挿入は文字の前/後ろのいずれでも禁止される.
4113 %<zh>\item[0, \texttt{inhibit}] 插入文字前/后的\Param{xkanjiskip}均被禁止。
4114 %<en>\item[1, \texttt{preonly}] Insertion of \Param{xkanjiskip} is allowed before the character, but not after.
4115 %<ja>\item[1, \texttt{preonly}] \Param{xkanjiskip}の挿入は文字の前では許されるが,後ろでは許されない.
4116 %<zh>\item[1, \texttt{preonly}] 文字前允许插入\Param{xkanjiskip},但其后不允许插入。
4117 %<en>\item[2, \texttt{postonly}] Insertion of \Param{xkanjiskip} is allowed after the character, but not before.
4118 %<ja>\item[2, \texttt{postonly}] \Param{xkanjiskip}の挿入は文字の後ろでは許されるが,前では許されない.
4119 %<zh>\item[2, \texttt{postonly}] 文字后允许插入\Param{xkanjiskip},但之前不允许插入。
4120 %<en>\item[3, \texttt{allow}] Insertion of \Param{xkanjiskip} is allowed before the character and after the character. This is the default value.
4121 %<ja>\item[3, \texttt{allow}] \Param{xkanjiskip}の挿入は文字の前/後ろのいずれでも許される.これがデフォルトの値である.
4122 %<zh>\item[3, \texttt{allow}] 文字前后均可插入\Param{xkanjiskip}。此为默认值。
4123 \end{description}
4124 %<*en>
4125 Note that parameters \Param{jaxspmode} and \Param{alxspmode} use a common table, hence these two parameters are synonyms of each other.
4126 %</en>
4127 %<*ja>
4128 \Param{jaxspmode}と\Param{alxspmode}は共通のテーブルを用いているため,
4129 これら2つのパラメータは互いの異名となっていることに注意する.
4130 %</ja>
4131 %<*zh>
4132 注意参数\Param{jaxspmode}和\Param{alxspmode}公用一个表,故这两个参数互为同义语。
4133 %</zh>
4134
4135 \item[\Param{autospacing}\,=<bool>$^\ast$] [\verb+\autospacing+]
4136 \item[\Param{autoxspacing}\,=<bool>$^\ast$] [\verb+\autoxspacing+]
4137 \item[\Param{kanjiskip}\,=<skip>] [\verb+\kanjiskip+]
4138 \item[\Param{xkanjiskip}\,=<skip>] [\verb+\xkanjiskip+]
4139
4140 \item[\Param{differentjfm}\,=<mode>$^\dagger$]
4141
4142 %<*en>
4143 Specify how glues/kerns between two \textbf{JAchar}s whose JFM (or size) are different.
4144 The allowed arguments are the followings:
4145 %</en>
4146 %<*ja>
4147 JFM(もしくはサイズ)が異なる2つの\textbf{JAchar}の間にグルー/カーンをどのように
4148 入れるかを指定うる.
4149 許される値は以下の通り:
4150 %</ja>
4151 %<*zh>
4152 对于处理不同大小或者JFM的两种\textbf{JAchar}之间的胶/出格。
4153 有下列参数:
4154 %</zh>
4155 \begin{description}
4156 \item[\texttt{average}]
4157 \item[\texttt{both}]
4158 \item[\texttt{large}]
4159 \item[\texttt{small}]
4160 \end{description}
4161
4162 \item[\Param{jacharrange}\,=<ranges>$^\ast$]
4163 \item[\Param{kansujichar}\,=\{<digit>, <chr\_code>\}] [\verb+\kansujichar+]
4164 \end{list}
4165
4166
4167 %<en>\section{Other Primitives}
4168 %<ja>\section{その他のプリミティブ}
4169 %<zh>\section{其他基本语句}
4170 %<en>\subsection{Primitives for Compatibility}
4171 %<ja>\subsection{互換プリミティブ}
4172 %<zh>\subsection{基本语句兼容性}
4173
4174 %<*en>
4175 The following primitives are implemented for compatibility with \pTeX.
4176 Note that these primitives don't support JIS~X~0213, but only JIS~X~0208.
4177 %</en>
4178 %<*ja>
4179 以下のプリミティブは\pTeX との互換性のために実装されている:
4180 %</ja>
4181 %<*zh>
4182 下列基本语句的实现与\pTeX 兼容:
4183 %</zh>
4184 \begin{list}{}{\def\makelabel{\ttfamily\char92 }\advance\leftmargin1\zw}
4185 \item[kuten]
4186 \item[jis]
4187 \item[euc]
4188 \item[sjis]
4189 \item[ucs]
4190 \item[kansuji]
4191 \end{list}
4192
4193 %<en>\subsection{\texttt{\char92 inhibitglue} primitive}
4194 %<ja>\subsection{\texttt{\char92 inhibitglue}プリミティブ}
4195 %<zh>\subsection{\texttt{\char92 inhibitglue}基本语句}
4196 %<*en>
4197 The primitive \verb+\inhibitglue+ suppresses the insertion of \textbf{JAglue}.
4198 The following is an example, using a special JFM that there will be a glue between
4199 the beginning of a box and `あ', and also between `あ' and `ウ'.
4200 %</en>
4201 %<*ja>
4202 \verb+\inhibitglue+ プリミティブは\textbf{JAglue}の挿入を抑制する.
4203 以下は,ボックスの始めと`あ'の間,`あ'と`ウ'の間にグルーが入る特別なJFMを用いた例で
4204 ある.
4205 %</ja>
4206 %<*zh>
4207 基本语句\verb!\inhibitglue!会压缩\textbf{JAchar}的插入。
4208 下面的例子使用了特殊的JFM。在一个盒子和“あ”之间,以及“あ”和“ウ”之间存在胶。
4209 %</zh>
4210
4211 \begin{LTXexample}
4212 \jfont\g=psft:Ryumin-Light:jfm=test \g
4213 \fbox{\hbox{あウあ\inhibitglue ウ}}
4214 \inhibitglue\par\noindent あ1
4215 \par\inhibitglue\noindent あ2
4216 \par\noindent\inhibitglue あ3
4217 \par\hrule\noindent あoff\inhibitglue ice
4218 \end{LTXexample}
4219
4220 %<*en>
4221 With the help of this example, we remark the specification of \verb+\inhibitglue+:
4222 %</en>
4223 %<*ja>
4224 この例を援用して,\verb+\inhibitglue+ の仕様について述べる.
4225 %</ja>
4226 %<*zh>
4227 如上例子,我们注意到\verb!\inhibtglue!的用法。
4228 %</zh>
4229 \begin{itemize}
4230 %<*zh>
4231 \item
4232 %</zh>
4233 %<*en>
4234 \item The call of \verb+\inhibitglue+ in the (internal) vertical mode is
4235       simply ignored.
4236 %</en>
4237 %<*ja>
4238 \item \verb+\inhibitglue+ の垂直モード中での呼び出しは意味を持たない.
4239 4行目の入力で有効にならないのは,\verb+\inhibitglue+ の時点では垂直モードであり,
4240 \verb+\noindent+ の時点で水平モードになるからである.
4241 %</ja>
4242
4243 %<*en>
4244 \item The call of \verb+\inhibitglue+ in the (restricted) horizontal
4245       mode is only effective on the spot; does not get over boundary of
4246       paragraphs. Moreover, \verb+\inhibitglue+ cancels ligatures and
4247       kernings, as shown in the last line of above example.
4248 %</en>
4249 %<*ja>
4250 \item \verb+\inhibitglue+ の(制限された)水平モード中での呼び出しはその場でのみ
4251   有効であり,段落の境界を乗り越えない.
4252   さらに,\verb+\inhibitglue+ は上の例の最終行のように(欧文における)リガチャとカーニングを
4253   打ち消す.これは,\verb+\inhibitglue+ が内部的には「現在のリスト中にwhatsitノードを
4254   追加する」ことを行なっているからである.
4255 %</ja>
4256
4257 %<*en>
4258 \item The call of \verb+\inhibitglue+ in math mode is just ignored.
4259 %</en>
4260 %<*ja>
4261 \item \verb+\inhibitglue+ を数式モード中で呼び出した場合はただ無視される.
4262 %</ja>
4263 \end{itemize}
4264
4265 %<en>\section{Control Sequences for \LaTeXe}
4266 %<ja>\section{\LaTeXe 用のコントロールシーケンス}
4267 %<zh>\section{\LaTeXe 下使用的控制序列}
4268
4269 %<en>\subsection{Patch for NFSS2}
4270 %<ja>\subsection{NFSS2へのパッチ}
4271 %<zh>\subsection{NFSS2补丁}
4272 \label{ssub-nfsspat}
4273
4274 %<*en>
4275 As described in Subsection~\ref{ssec-ltx}, \LuaTeX-ja simply adopted
4276 \texttt{plfonts.dtx} in \pLaTeXe\ for the Japanese patch for NFSS2.
4277 For an convenience, we will describe
4278 commands which are not described in Subsection~\ref{ssub-chgfnt}.
4279 %</en>
4280 %<*ja>
4281 \ref{ssec-ltx}節で述べたように,\LuaTeX-jaはNFSS2への日本語パッチである
4282 \pLaTeXe の\texttt{plfonts.dtx}を単純に取り入れている.
4283 便宜のため,ここでは\ref{ssub-chgfnt}節で述べていなかったコマンドについて
4284 記述しておく.
4285 %</ja>
4286
4287 \begin{cslist}%
4288 \item[DeclareYokoKanjiEncoding\{<encoding>\}\{<text-settings>\}\{<math-settings>\}]
4289
4290 %<*en>
4291 In NFSS2 under \LuaTeX-ja, distinction between alphabetic font families
4292              and Japanese font families are only made by their
4293              encodings. For example, encodings OT1 and T1 are for
4294              alphabetic font families, and a Japanese font family cannot
4295              have these encodings. This command defines a new encoding
4296              scheme for Japanese font family (in horizontal direction).
4297 %</en>
4298 %<*ja>
4299 \LuaTeX-jaのNFSS2においては,欧文フォントファミリと和文フォントファミリは
4300 そのエンコーディングからのみ作られる.
4301 例えば,OT1とT1のエンコーディングは欧文フォントファミリに対するものであり,
4302 和文フォントファミリはこれらのエンコーディングを持つことはできない.
4303 このコマンドは和文フォントファミリ(横書き用)のための新しいエンコーディングを
4304 定義する.
4305 %</ja>
4306
4307 \item[DeclareKanjiEncodingDefaults\{<text-settings>\}\{<math-settings>\}]
4308 \item[DeclareKanjiSubstitution\{<encoding>\}\{<family>\}\{<series>\}\{<shape>\}]
4309 \item[DeclareErrorKanjiFont\{<encoding>\}\{<family>\}\{<series>\}\{<shape>\}\{<size>\}]
4310
4311 %<*en>
4312 The above 3~commands are just the counterparts for \verb+DeclareFontEncodingDefaults+ and~others.
4313 %</en>
4314 %<*ja>
4315 上記3つのコマンドはちょうど \verb+DeclareFontEncodingDefaults+ などに対応するものである.
4316 %</ja>
4317
4318 \item[reDeclareMathAlphabet\{<unified-cmd>\}\{<al-cmd>\}\{<ja-cmd>\}]
4319
4320 % ToDo: en
4321 %<*ja>
4322 和文・欧文の数式用フォントファミリを一度に変更する命令を作成する.
4323 具体的には,欧文数式用フォントファミリ変更の命令<al-cmd>(\verb+\mathrm+ 等)と,和文数式用フォ
4324              ントファミリ変更の命令<ja-cmd>(\verb+\mathmc+ 等)の2つを同時に行う命令として
4325              <unified-cmd>を(再)定義する.実際の使用では<unified-cmd>と
4326              <al-cmd>に同じものを指定する,すなわち,<al-cmd>で和文側も変
4327              更させるようにするのが一般的と思われる.
4328
4329 {\let\item=\origitem
4330 本命令は
4331 \begin{center}\tt
4332 <unified-cmd>\{<arg>\}\quad$\longrightarrow$\quad
4333 (<al-cmd>を1段展開したもの)\{<ja-cmd>を1段展開したもの)\{<arg>\}\}
4334 \end{center}
4335 と定義を行うので,使用には注意が必要である:
4336 \begin{itemize}
4337 \item <al-cmd>,~<ja-cmd>は既に定義されていなければならない.\verb+\reDeclareMathAlphabet+後に
4338 両命令の内容を再定義しても,<unified-cmd>の内容にそれは反映されない.
4339 \item <al-cmd>,~<ja-cmd>に\verb+\@mathrm+などと\texttt{@}をつけた命令を指定した時の動作は保証できない.
4340 \end{itemize}}
4341 %</ja>
4342
4343 \item[DeclareRelationFont\{<ja-encoding>\}\{<ja-family>\}\{<ja-series>\}\{<ja-shape>\}\\
4344   \hfill\{<al-encoding>\}\{<al-family>\}\{<al-series>\}\{<al-shape>\}]
4345 %<*en>
4346 This command sets the `accompanied' alphabetic font family (given by the latter 4~arguments)
4347 with respect to a Japanese font family given by the former 4~arguments.
4348 %</en>
4349 %<*ja>
4350 いわゆる「従属欧文」を設定するための命令である.前半の4引数で表される和文フォントファミリに対して,
4351 そのフォントに対応する「従属欧文」フォントファミリを後半の4引数により与える.
4352 %</ja>
4353 \item[SetRelationFont]
4354 %<*en>
4355 This command is almost same as \verb+\DeclareRelationFont+, except that this command does a local
4356 assignment, where \verb+\DeclareRelationFont+ does a global assignment.
4357 %</en>
4358 %<*ja>
4359 このコマンドは \verb+\DeclareRelationFont+ とローカルな指定であることを除いて
4360 ほとんど同じである(\verb+\DeclareRelationFont+ はグローバル).
4361 %</ja>
4362
4363 \item[userelfont]
4364 %<*en>
4365 Change current alphabetic font encoding/family/\dots\ to the `accompanied' alphabetic
4366              font family with respect to current Japanese font family,
4367              which was set by
4368              \verb+\DeclareRelationFont+ or \verb+\SetRelationFont+.
4369 Like \verb+\fontfamily+, \verb+\selectfont+ is required to take an effect.
4370 %</en>
4371 %<*ja>
4372 現在の欧文フォントエンコーディング/ファミリ/…… を,
4373 \verb+\DeclareRelationFont+ か \verb+\SetRelationFont+ で指定された
4374 現在の和文フォントファミリに対応する「従属欧文」フォントファミリに変更する.
4375 \verb+\fontfamily+ のように,有効にするためには \verb+\selectfont+ が必要である.
4376 %</ja>
4377
4378 \item[adjustbaseline]
4379 \ldots
4380
4381 \item[fontfamily\{<family>\}]
4382 {\let\item\origitem
4383 %<*en>
4384 As in \LaTeXe, this command changes current font family (alphabetic, Japanese,~\emph{or both})
4385 to <family>. Which family will be changed is determined as follows:
4386 %</en>
4387 %<*ja>
4388 元々の\LaTeXe におけるものと同様に,このコマンドは現在のフォントファミリ(欧文,
4389 和文,\textbf{もしくは両方})を<family>に変更する.
4390 どのファミリが変更されるかは以下のようにして決定される:
4391 %</ja>
4392 \begin{itemize}
4393 %<*zh>
4394 \item
4395 %</zh>
4396 %<*en>
4397 \item Let current encoding scheme for Japanese fonts be
4398       <ja-enc>. Current Japanese font family will be changed to
4399       <family>, if one of the following two conditions is met:
4400 %</en>
4401 %<*ja>
4402 \item 現在の和文フォントに対するエンコーディングが<ja-enc>であるとしよう.
4403   現在の和文フォントファミリは,以下の2つの条件のうちの1つが満たされているときに
4404   <family>に変更される:
4405 %</ja>
4406 \begin{itemize}
4407 %<*en>
4408 \item The family <fam> under the encoding <ja-enc> has been already defined by
4409       \verb+\DeclareKanijFamily+.
4410 %</en>
4411 %<*ja>
4412 \item エンコーディング<ja-enc>におけるファミリ<fam>が既に \verb+\DeclareKanjiFamily+ によって定義されている.
4413 %</ja>
4414 %<*en>
4415 \item A font definition named \texttt{<enc><ja-enc>.fd} (the file name is
4416       all lowercase) exists.
4417 %</en>
4418 %<*zh>
4419 \item
4420 %</zh>
4421 %<*ja>
4422 \item フォント定義ファイル\texttt{<enc><ja-enc>.fd}(ファイル名は全て小文字)が存在する.
4423 %</ja>
4424 \end{itemize}
4425 %<*en>
4426 \item Let current encoding scheme for alphabetic fonts be
4427       <al-enc>. For alphabetic font family, the criterion as above is used.
4428 %</en>
4429 %<*ja>
4430 \item 現在の欧文フォントに対するエンコーディングを<al-enc>とする.
4431   欧文フォントファミリに対しても,上記の基準が用いられる.
4432 %</ja>
4433 %<*en>
4434 \item There is a case which none of the above applies, that is, the font
4435       family named <family> doesn't seem to be defined neither under the
4436       encoding <ja-enc>, nor under <al-enc>.
4437 In this case, the default family for font substitution is used for
4438       alphabetic and Japanese fonts. Note that current encoding will not
4439       be set to <family>, unlike the original implementation in \LaTeX.
4440 %</en>
4441 %<*ja>
4442 \item 上記のいずれもが適用されない,つまり<family>が<ja-enc>と<al-enc>の
4443   どちらでも定義されないような場合がある.
4444   この場合,代替フォントに用いられるデフォルトのフォントファミリが欧文フォントと
4445   和文フォントに用いられる.\LaTeX のオリジナルの実装とは異なり,
4446   現在のエンコーディングは<family>には設定されないことに注意する.
4447 %</ja>
4448 \end{itemize}
4449 }
4450 \end{cslist}
4451
4452 %<*en>
4453 As closing this subsection, we shall introduce an example of
4454 \verb+\SetRelationFont+ and \verb+\userelfont+:
4455 %</en>
4456 %<*ja>
4457 この節の終わりに,\verb+\SetRelationFont+ と \verb+\userelfont+ の例を
4458 紹介しておこう.\verb+\userelfont+ の使用によって,「abc」の部分のフォントが
4459 Avant Garde (OT1/pag/m/n) に変わっていることがわかる.
4460 %</ja>
4461 \begin{LTXexample}
4462 \kanjifamily{gt}\selectfont あいうxyz
4463 \SetRelationFont{JY3}{gt}{m}{n}{OT1}{pag}{m}{n}
4464 \userelfont\selectfont あいうabc
4465 \end{LTXexample}
4466
4467 %<en>\section{Extensions}
4468 %<ja>\section{拡張}
4469 \subsection{\texttt{luatexja-fontspec.sty}}
4470
4471 %<*en>
4472 As described in Subsection~\ref{ssec-fontspec}, this optional package
4473 provides the counterparts for several commands defined in the
4474 \Pkg{fontspec} package.
4475 In addition to `font features' in the original \Pkg{fontspec},
4476 the following `font features' specifications are allowed for
4477 the commands of Japanese version:
4478 %</en>
4479 %<*ja>
4480 \ref{ssec-fontspec}節で述べたように,この追加パッケージは\Pkg{fontspec}
4481 パッケージで定義されているコマンドに対応する和文フォント用のコマンドを提供する.
4482 オリジナルの\Pkg{fontspec}での`font feature'に加えて,和文版のコマンドには
4483 以下の`font feature'を指定することができる:
4484 %</ja>
4485
4486
4487 \begin{list}{}{\def\makelabel{\ttfamily}\def\{{\char`\{}\def\}{\char`\}}\advance\leftmargin1\zw}
4488 \item[CID=<name>]
4489 \item[JFM=<name>]
4490 \item[JFM-var=<name>] \
4491
4492 %<*en>
4493 These 3 font features correspond to \texttt{cid}, \texttt{jfm} and
4494 \texttt{jfmvar} keys for \verb+\jfont+ primitive, respectively.
4495 \texttt{CID} is effective only when with \texttt{NoEmbed}
4496 described below.
4497 See Subsections~\ref{ssec-jfont} and \ref{ssec-psft} for details.
4498 %</en>
4499 %<*ja>
4500 これら3つのキーはそれぞれ \verb+\jfont+ プリミティブに対する
4501 \texttt{cid}, \texttt{jfm}, \texttt{jfmvar}キーとそれぞれ対応する.
4502 \texttt{CID} は下の \texttt{NoEmbed} と合わせて用いられたときのみ有効である.
4503 \verb+\jfont+ プリミティブに対する
4504 \texttt{cid}, \texttt{jfm}, \texttt{jfmvar}キーの詳細は\ref{ssec-jfont}節
4505              と\ref{ssec-psft}節を参照.
4506 %</ja>
4507
4508 \item[NoEmbed]
4509 %<*en>
4510 By specifying this font feature, one can use `name-only' Japanese font which
4511 will not be embedded in the output PDF file. See Subsection~\ref{ssec-psft}.
4512 %</en>
4513 %<*ja>
4514 これを指定することで,PDFに埋め込まれない「名前だけ」のフォントを指定することが
4515 できる.\ref{ssec-psft}節を参照.
4516 %</ja>
4517 \end{list}
4518
4519 \subsection{\texttt{luatexja-otf.sty}}
4520
4521 %<*en>
4522 This optional package supports typesetting characters in
4523 Adobe-Japan1. \texttt{luatexja-otf.sty} offers the following 2~low-level
4524 commands:
4525 %</en>
4526 %<*ja>
4527 この追加パッケージはAdobe-Japan1の文字の出力をサポートする.
4528 \texttt{luatexja-otf.sty}は以下の2つの低レベルコマンドを提供する:
4529 %</ja>
4530 \begin{list}{}{\def\makelabel{\ttfamily}\def\{{\char`\{}\def\}{\char`\}}\advance\leftmargin1\zw}
4531 \item[\char92CID\{<number>\}]
4532 %<*en>
4533 Typeset a character whose CID number is <number>.
4534 %</en>
4535 %<*ja>
4536 CID番号が<number>の文字を出力する.
4537 %</ja>
4538
4539 \item[\char92UTF\{<hex\_number>\}]
4540 %<*en>
4541 Typeset a character whose character code is <hex\_number> (in hexadecimal).
4542 This command is similar to \verb+\char"+<hex\_number>,\ %"
4543 but please remind remarks below.
4544 %</en>
4545 %<*ja>
4546 文字コードが(16進で)<hex\_number>の文字を出力する.
4547 このコマンドは \verb+\char"+<hex\_number>と似ているが,下の記述に注意すること.%"
4548 %</ja>
4549 \end{list}
4550
4551 %<en>\paragraph{Remarks}
4552 %<ja>\paragraph{注意}
4553 %<*en>
4554 Characters by \verb+\CID+ and \verb+\UTF+ commands are different from
4555 ordinary characters in the following points:
4556 %</en>
4557 %<*ja>
4558 \verb+\CID+ と \verb+\UTF+ コマンドによって出力される文字は
4559 以下の点で通常の文字と異なる:
4560 %</ja>
4561 \begin{itemize}
4562 %<*zh>
4563 \item
4564 %</zh>
4565 %<*en>
4566 \item Always treated as \textbf{JAchar}s.
4567 %</en>
4568 %<*ja>
4569 \item 常に\textbf{JAchar}として扱われる.
4570 %</ja>
4571 %<*en>
4572 \item Processing codes for supporting OpenType features (\textit{e.g.},
4573       glyph replacement and kerning) by the \Pkg{luaotfload} package
4574       is not performed to these characters.
4575 %</en>
4576 %<*ja>
4577 \item OpenType feature(例えばグリフ置換やカーニング)をサポートするための
4578   \Pkg{luaotfload}パッケージのコードはこれらの文字には働かない.
4579 %</ja>
4580 \end{itemize}
4581
4582
4583 %<en>\paragraph{Additional Syntax of JFM}
4584 %<ja>\paragraph{JFMへの記法の追加}
4585
4586 %<*en>
4587 \texttt{luatexja-otf.sty} extends the syntax of JFM; the entries of \texttt{
4588 chars} table in JFM now allows a string in the form
4589 \verb+'AJ1-xxx'+, which stands for the character
4590 whose CID number in Adobe-Japan1 is \verb+xxx+.
4591 %</en>
4592 %<*ja>
4593 \texttt{luatexja-otf.sty}はJFMの記法を拡張する.
4594 JFMの\texttt{chars}テーブルのエントリとして \verb+'AJ1-xxx'+ の形の文字列が
4595 使えるようになる.これはAdobe-Japan1におけるCID番号が \verb+xxx+ の文字を表す.
4596 %</ja>
4597
4598 \subsection{\texttt{luatexja-adjust.sty}}
4599 \label{ssec-adj}
4600 \begin{figure}[t]
4601 \def\sq{%
4602   \hbox to 1\zw{\hss\fboxsep=-.5\fboxrule\fbox{%
4603    \hskip\dimexpr-.5\zw-.2pt\vrule width.4pt height.08\zw depth.12\zw%
4604   \hskip\dimexpr.5\zw-.2pt\relax}\hss}}
4605 \def\sb{\hbox to 1\zw{\hss\fboxsep=-.5\fboxrule\fbox{%
4606   ■\hskip\dimexpr-.5\zw-.2pt\vrule width.4pt height.08\zw depth.12\zw%
4607   \hskip\dimexpr.5\zw-.2pt\relax}\hss}}
4608 \newbox\gridbox
4609 \def\outbox#1{{\Large%
4610   \ltjsetparameter{kanjiskip=0pt plus .2\zw minus .2\zw}%
4611   \setbox\gridbox=\hbox to 20\zw{\sq\sq\sq\sq\sb\sq\sq\sq\sq\sb\sq\sq\sq\sq\sb\sq\sq\sq\sq\sb}%
4612   \hbox{\textcolor{cyan!50!white}{\copy\gridbox}\hskip-20\zw%
4613   \vbox{\hsize=20\zw\noindent\leftskip0pt\rightskip0pt\parfillskip0pt#1}\vrule}%
4614 }}
4615
4616 {\centering
4617 \begin{tabular}{lc}
4618 \toprule
4619 no adjustment&\outbox{以上の原理は,「包除原理」とよく呼ばれるが\hskip-.5\zw\null}\\
4620 without priority&%
4621 \ltjdisableadjust
4622 \outbox{以上の原理は,「包除原理」とよく呼ばれるが}%
4623 \ltjenableadjust\\
4624 with priority&%
4625 \outbox{以上の原理は,「包除原理」とよく呼ばれるが}
4626 %<!ja>\ltjdisableadjust
4627 \\
4628 \bottomrule
4629 \end{tabular}\par}
4630 \smallskip
4631
4632 Note: the value of 
4633 \Param{kanjiskip} is 0\,pt${}^{+1/5\,\mathrm{em}}_{-1/5\,\mathrm{em}}$ in this figure,
4634 for making the difference obvious.
4635 %<ja>\caption{行長調整}\label{fig-adj}
4636 %<en>\caption{Line adjustment}\label{fig-adj}
4637 \end{figure}
4638
4639
4640 %<*en>
4641 ...
4642 %</en>
4643 %<*ja>
4644 \pTeX では,行長調整において優先度の概念が存在しなかったため,図
4645 \ref{fig-adj}上段における半角分の半端は,図\ref{fig-adj}中段のように,鍵
4646 括弧周辺の空白と和文間空白(\Param{kanjiskip})の両方によって負担される.し
4647 かし,「日本語組版処理の要件」\cite{jlreq}やJIS~X~4051~\cite{x4051}におい
4648 ては,このような状況では半端は鍵括弧周辺の空白のみで負担し,その他の和文
4649 文字はベタ組で組まれる(図\ref{fig-adj}下段)ことになっている.この追加
4650 パッケージは\cite{jlreq}や\cite{x4051}における規定のような,優先順位付き
4651 の行長調整を提供する.詳細な仕様については\ref{sec-adjspec}を参照.
4652
4653
4654 \texttt{luatexja-adjust.sty}は,以下の命令を提供する.これらはすべてグローバルに効力を発揮する.
4655
4656 \begin{list}{}{\def\makelabel{\ttfamily}\def\{{\char`\{}\def\}{\char`\}}\advance\leftmargin1\zw}
4657 \item[\char92ltjdisableadjust]
4658 優先順位付きの行長調整を無効化する.
4659
4660 \item[\char92ltjenableadjust]
4661 優先順位付きの行長調整を有効化する.
4662
4663 \item[優先度設定……]
4664
4665 \end{list}
4666
4667
4668
4669
4670
4671 %</ja>
4672
4673
4674
4675 %<en>\part{Implementations}
4676 %<ja>\part{実装}
4677 \label{part-imp}
4678 %<en>\section{Storing Parameters}
4679 %<ja>\section{パラメータの保持}
4680 \label{sec-para}
4681 %<en>\subsection{Used Dimensions, Attributes and whatsit nodes}
4682 %<ja>\subsection{\LuaTeX-jaで用いられる寸法レジスタ,属性レジスタ,whatsitノード}
4683
4684 %<*en>
4685 Here the following is the list of dimensions and attributes which are used in \LuaTeX-ja.
4686 %</en>
4687 %<*ja>
4688 以下は\LuaTeX-jaで用いられる寸法レジスタ(dimension),属性レジスタ(attribute)の
4689 リストである.
4690 %</ja>
4691 \begin{list}{}{%
4692 \def\makelabel{\ttfamily}\advance\leftmargin1\zw
4693 \def\dim#1{\item[\char92 #1\ \textrm{(dimension)}]}
4694 \def\attr#1{\item[\char92 #1\ \textrm{(attribute)}]}
4695 }
4696
4697 \dim{jQ}
4698 %<*en>
4699 \verb+\jQ+ is equal to
4700                         $1\,\textrm{Q}=0.25\,\textrm{mm}$, where `Q'~(also called `級') is
4701                         a unit used in Japanese phototypesetting. So one should not change the value of this dimension.
4702 %</en>
4703 %<*ja>
4704 \verb+\jQ+ は$1\,\textrm{Q}=0.25\,\textrm{mm}$
4705 と等しい.ここで,`Q'(もしくは「級」)は日本の写植で用いられる単位である.したがって,
4706 この寸法レジスタの値を変更してはならない.
4707 %</ja>
4708
4709 \dim{jH}
4710 %<*en>
4711 There is also a unit called `歯' which equals to $0.25\,\textrm{mm}$ and
4712                         used in Japanese phototypesetting. This
4713                         \verb+\jH+ is a synonym of \verb+\jQ+.
4714 %</en>
4715 %<*ja>
4716 同じく写植で用いられていた単位として「歯」があり,これも$0.25\,\textrm{mm}$と
4717 等しい.\verb+\jH+ は \verb+\jQ+ の別名である.
4718 %</ja>
4719
4720 \dim{ltj@zw}
4721 %<*en>
4722 A temporal register for the `full-width' of current Japanese font.
4723 %</en>
4724 %<*ja>
4725 現在の和文フォントの「全角幅」を保持する一時レジスタ.
4726 %</ja>
4727
4728 \dim{ltj@zh}
4729 %<*en>
4730 A temporal register for the `full-height' (usually the sum of height of imaginary body and its depth) of current Japanese font.
4731 %</en>
4732 %<*ja>
4733 現在の和文フォントの「全角高さ」(通常,高さと深さの和)を保持する一時レジスタ.
4734 %</ja>
4735
4736 \attr{jfam}
4737 %<*en>
4738 Current number of Japanese font family for math formulas.
4739 %</en>
4740 %<*ja>
4741 数式用の和文フォントファミリの現在の番号.
4742 %</ja>
4743
4744 \attr{ltj@curjfnt}
4745 %<*en>
4746 The font index of current Japanese font.
4747 %</en>
4748 %<*ja>
4749 現在の和文フォントのフォント番号.
4750 %</ja>
4751
4752 \attr{ltj@charclass}
4753 %<*en>
4754 The character class of Japanese \textit{glyph\_node}.
4755 %</en>
4756 %<*ja>
4757 和文文字の\textit{glyph\_node}の文字クラス.
4758 %</ja>
4759
4760 \attr{ltj@yablshift}
4761 %<*en>
4762 The amount of shifting the baseline of alphabetic fonts in scaled point ($2^{-16}\,\textrm{pt}$).
4763 %</en>
4764 %<*ja>
4765 スケールド・ポイント($2^{-16}\,\textrm{pt}$)を単位とした欧文フォントのベースラインの移動量.
4766 %</ja>
4767
4768 \attr{ltj@ykblshift}
4769 %<*en>
4770 The amount of shifting the baseline of Japanese fonts in scaled point ($2^{-16}\,\textrm{pt}$).
4771 %</en>
4772 %<*ja>
4773 スケールド・ポイント($2^{-16}\,\textrm{pt}$)を単位とした和文フォントのベースラインの移動量.
4774 %</ja>
4775
4776 \attr{ltj@autospc}
4777 %<*en>
4778 Whether the auto insertion of \Param{kanjiskip} is allowed at the node.
4779 %</en>
4780 %<*ja>
4781 そのノードで\Param{kanjiskip}の自動挿入が許されるかどうか.
4782 %</ja>
4783
4784 \attr{ltj@autoxspc}
4785 %<*en>
4786 Whether the auto insertion of \Param{xkanjiskip} is allowed at the node.
4787 %</en>
4788 %<*ja>
4789 そのノードで\Param{xkanjiskip}の自動挿入が許されるかどうか.
4790 %</ja>
4791
4792 \attr{ltj@icflag}
4793 %<*en>
4794 An attribute for distinguishing `kinds' of a node. One of the following value is
4795 assigned to this attribute:
4796 %</en>
4797 %<*ja>
4798 ノードの「種類」を区別するための属性.以下のうちのひとつが値として割り当てられる:
4799 %</ja>
4800 \begin{description}
4801 \item[\textit{italic} (1)]
4802 %<*en>
4803 Glues from an italic correction
4804            (\verb+\/+). This distinction of origins of glues
4805            (from explicit \verb+\kern+, or from \verb+\/+)
4806            is needed in the insertion process of \Param{xkanjiskip}.
4807 %</en>
4808 %<*ja>
4809 イタリック補正(\verb+\/+)によるグルー.このグルーの由来の区別(\verb+\kern+ か
4810 \verb+\/+ か)は\Param{xkanjiskip}の挿入過程において必要になる.
4811 %</ja>
4812
4813 \item[\textit{packed} (2)]
4814
4815 \item[\textit{kinsoku} (3)]
4816 %<*en>
4817 Penalties inserted for the word-wrapping process of Japanese characters (\emph{kinsoku}).
4818 %</en>
4819 %<*ja>
4820 和文文字のワードラップ過程において挿入されたペナルティ(\emph{kinsoku}).
4821 %</ja>
4822
4823 \item[\textit{from\_jfm} (6)]
4824 %<*en>
4825 Glues/kerns from JFM.
4826 %</en>
4827 %<*ja>
4828 JFM由来のグルー/カーン.
4829 %</ja>
4830
4831 %%\item[\textit{line\_end} (5)]
4832 %%%<*en>
4833 %%Kerns for \ldots
4834 %%%</en>
4835 %%%<*ja>
4836 %%和文文字が行末にきたとき,行末との間に挿入されるカーンである.
4837 %%% ぶら下げ組への応用
4838 %%%</ja>
4839
4840 \item[\textit{kanji\_skip} (9)]
4841 %<*en>
4842 Glues for \Param{kanjiskip}.
4843 %</en>
4844 %<*ja>
4845 \Param{kanjiskip}のグルー.
4846 %</ja>
4847
4848 \item[\textit{xkanji\_skip} (10)]
4849 %<*en>
4850 Glues for \Param{xkanjiskip}.
4851 %</en>
4852 %<*ja>
4853 \Param{xkanjiskip}のグルー.
4854 %</ja>
4855
4856 \item[\textit{processed} (11)]
4857 %<*en>
4858 Nodes which is already processed by \ldots.
4859 %</en>
4860 %<*ja>
4861 \LuaTeX-ja の内部処理によって既に処理されたノード.
4862 %</ja>
4863
4864 \item[\textit{ic\_processed} (12)]
4865 %<*en>
4866 Glues from an italic correction, but also already processed.
4867 %</en>
4868 %<*ja>
4869 イタリック補正に由来するグルーであるが,まだ処理されていないもの.
4870 %</ja>
4871
4872 \item[\textit{boxbdd} (15)]
4873 %<*en>
4874 Glues/kerns that inserted just the beginning or the ending of an hbox or a paragraph.
4875 %</en>
4876 %<*ja>
4877 ある水平ボックスか段落の最初か最後に挿入されたグルー/カーン.
4878 %</ja>
4879 \end{description}
4880
4881 \attr{ltj@kcat$i$}
4882 %<*en>
4883 Where $i$~is a natural number which is less than~7.
4884 These 7~attributes store bit~vectors indicating which character block is regarded as a block of \textbf{JAchar}s.
4885 %</en>
4886 %<*ja>
4887 $i$は7より小さい自然数.
4888 これら7つの属性レジスタは,どの文字ブロックが\textbf{JAchar}のブロックとして
4889 扱われるかを示すビットベクトルを格納する.
4890 %</ja>
4891 \end{list}
4892
4893 %<*en>
4894 Furthermore, \LuaTeX-ja uses several `user-defined' whatsit nodes for
4895 inrernal processing. All those nodes store a natural number (hence the node's
4896 \texttt{type} is 100). The following \verb+user_id+s are used:
4897 %</en>
4898 %<*ja>
4899 さらに,\LuaTeX-jaはいくつかの「ユーザ定義の」whatsit ノードを内部処理に用いる.
4900 これらの全てのノードは自然数を格納している(したがってノードの\texttt{type}は
4901 100である).次の \verb+user_id+ が使用される:
4902 %</ja>
4903 \begin{description}
4904 \item[30111]
4905 %<*en>
4906 Nodes for indicating that \verb+\inhibitglue+ is
4907            specified. The \texttt{value} field of these nodes doesn't matter.
4908 %</en>
4909 %<*ja>
4910 \verb+\inhibitglue+ が指定されたことを示すノード.これらのノードの
4911 \texttt{value}フィールドは意味を持たない.
4912 %</ja>
4913
4914 \item[30112]
4915 %<*en>
4916 Nodes for \LuaTeX-ja's stack system (see the next
4917            subsection). The \texttt{value} field of these nodes is
4918            current group.
4919 %</en>
4920 %<*ja>
4921 \LuaTeX-jaのスタックシステム(次の節を参照)のためのノード.
4922 これらのノードの\texttt{value}フィールドは現在のグループを表す.
4923 %</ja>
4924
4925 \item[30113]
4926 %<*en>
4927 Nodes for Japanese Characters which the callback process of
4928            \Pkg{luaotfload} won't be applied, and the character code is
4929            stored in the \texttt{value} field. Each node having this
4930            \verb+user_id+ is converted to a `glyph\_node' \emph{after}
4931            the callback process of luaotfload.
4932            This \verb+user_id+ is only used by the \Pkg{luatexja-otf} package.
4933 %</en>
4934 %<*ja>
4935 \Pkg{luaotfload}のコールバックによる処理が適用されない和文文字のためのノードで,
4936 \texttt{value}フィールドにその文字のコードが格納されている.
4937 この \verb+user_id+ を持つノードはそれぞれが\Pkg{luaotfload}のコールバックの処理の
4938 \textbf{後で}`glyph\_node'に変換される.この \verb+user_id+ は %
4939 \Pkg{luatexja-otf} パッケージでのみ使用される.
4940 %</ja>
4941
4942 \item[30114]
4943 Nodes for indicating beginning of a paragraph.
4944 A paragraph which is started by \verb+\item+ in list-like environments has a horizontal box
4945 for its label before the actual contents. So \dots
4946 \end{description}
4947 %<*en>
4948 These whatsits will be removed during the process of inserting \textbf{JAglue}s.
4949 %</en>
4950 %<*ja>
4951 これらのwhatsitノードは\textbf{JAglue}の挿入処理の間に取り除かれる.
4952 %</ja>
4953
4954 %<en>\subsection{Stack System of \LuaTeX-ja}
4955 %<ja>\subsection{\LuaTeX-jaのスタックシステム}
4956 \label{ssec-stack}
4957
4958 %<en>\paragraph{Background}
4959 %<ja>\paragraph{背景}
4960 %<*en>
4961 \LuaTeX-ja has its own stack system, and most parameters of \LuaTeX-ja
4962 are stored in it. To clarify the reason, imagine the parameter
4963 \Param{kanjiskip} is stored by a skip, and consider the following
4964 source:
4965 %</en>
4966 %<*ja>
4967 \LuaTeX-jaは独自のスタックシステムを持ち,\LuaTeX-jaのほとんどのパラメータは
4968 これを用いて保持されている.その理由を明らかにするために,
4969 \Param{kanjiskip}パラメータがスキップレジスタで保持されているとし,
4970 以下のコードを考えてみよう:
4971 %</ja>
4972 \begin{LTXexample}
4973 \ltjsetparameter{kanjiskip=0pt}ふがふが.%
4974 \setbox0=\hbox{\ltjsetparameter{kanjiskip=5pt}ほげほげ}
4975 \box0.ぴよぴよ\par
4976 \end{LTXexample}
4977
4978 %<*en>
4979 As described in Subsection~\ref{ssec-param}, the only effective value of
4980 \Param{kanjiskip} in an hbox is the latest value, so the value of
4981 \Param{kanjiskip} which applied in the entire hbox should be 5\,pt.
4982 However, by the implementation method of \LuaTeX, this `5\,pt' cannot be
4983 known from any callbacks.  In the \texttt{tex/packaging.w} (which is a
4984 file in the source of \LuaTeX), there are the following codes:
4985 %</en>
4986 %<*ja>
4987 \ref{ssec-param}節で述べたように,ある水平ボックスの中で効力を持つ
4988 \Param{kanjiskip}の値は最後に現れた値のみであり,したがってボックス全体に適用される
4989 \Param{kanjiskip}は5\,ptであるべきである.しかし,\LuaTeX の実装のために,
4990 この`5\,pt'はどのコールバックからも知ることはできない.
4991 \texttt{tex/packaging.w}(これは\LuaTeX のソースファイルである)の中に,
4992 以下のコードがある:
4993 %</ja>
4994 \begin{lstlisting}
4995 void package(int c)
4996 {
4997     scaled h;                   /* height of box */
4998     halfword p;                 /* first node in a box */
4999     scaled d;                   /* max depth */
5000     int grp;
5001     grp = cur_group;
5002     d = box_max_depth;
5003     unsave();
5004     save_ptr -= 4;
5005     if (cur_list.mode_field == -hmode) {
5006         cur_box = filtered_hpack(cur_list.head_field,
5007                                  cur_list.tail_field, saved_value(1),
5008                                  saved_level(1), grp, saved_level(2));
5009         subtype(cur_box) = HLIST_SUBTYPE_HBOX;
5010 \end{lstlisting}
5011 %<*en>
5012 Notice that \verb+unsave+ is executed \emph{before}
5013 \verb+filtered_hpack+ (this is where \verb+hpack_filter+ callback is
5014 executed): so `5\,pt' in the above source is orphaned at
5015 \verb+unsave+, and hence it can't be accessed from \verb+hpack_filter+
5016 callback.
5017 %</en>
5018 %<*ja>
5019 \verb+unsave+ が \verb+filtered_hpack+(これは \verb+hpack_filter+ コールバックが
5020 実行されるところである)の\textbf{前に}実行されていることに注意する.
5021 したがって,上記ソース中で`5\,pt'は \verb+unsave+ のところで捨てられ,
5022 \verb+hpack_filter+ からはアクセスすることができない.
5023 %</ja>
5024
5025 %<en>\paragraph{The method}
5026 %<ja>\paragraph{解決法}
5027 %<zh>\paragraph{解决方法}
5028
5029 %<*en>
5030 The code of stack system is based on that in a post of Dev-luatex mailing list\footnote{%
5031 \texttt{[Dev-luatex] tex.currentgrouplevel}, a post at 2008/8/19 by Jonathan Sauer.}.
5032 %</en>
5033 %<*ja>
5034 スタックシステムのコードはDev-luatexメーリングリストのある投稿\footnote{\texttt{[Dev-luatex] tex.currentgrouplevel}: Jonathan Sauerによる2008/8/19の投稿.}を
5035 ベースにしている.
5036 %</ja>
5037
5038 %<*en>
5039 These are two \TeX\ count registers for maintaining information:
5040 \verb+\ltj@@stack+ for the stack level, and \verb+\ltj@@group@level+ for
5041 the \TeX's group level when the last assignment was done.  Parameters
5042 are stored in one big table named \texttt{charprop\_stack\_table}, where
5043 \texttt{charprop\_stack\_table[$i$]} stores data of stack level~$i$. If
5044 a new stack level is created by \verb+\ltjsetparameter+, all data of the
5045 previous level is copied.
5046 %</en>
5047 %<*ja>
5048 情報を保持するために,2つの\TeX の整数レジスタを用いている:
5049 \verb+\ltj@@stack+ でスタックレベル,\verb+\ltj@@group@level+ で最後の代入が
5050 なされた時点での\TeX のグループレベルを保持している.
5051 パラメータは\texttt{charprop\_stack\_table}という名前のひとつの大きなテーブルに
5052 格納される.ここで,\texttt{charprop\_stack\_table[$i$]}はスタックレベル$i$の
5053 データを格納している.もし新しいスタックレベルが \verb+\ltjsetparameter+ によって
5054 生成されたら,前のレベルの全てのデータがコピーされる.
5055 %</ja>
5056
5057 %<*en>
5058 To resolve the problem mentioned in `Background' above, \LuaTeX-ja uses
5059 another thing: When a new stack level is about to be created, a whatsit
5060 node whose type, subtype and value are 44~(\textit{user\_defined}),
5061 30112, and current group level respectively is appended to the current
5062 list (we refer this node by \textit{stack\_flag}). This enables us to
5063 know whether assignment is done just inside a hbox. Suppose that the
5064 stack level is~$s$ and the \TeX's group level is~$t$ just after the hbox
5065 group, then:
5066 %</en>
5067 %<*ja>
5068 上の「背景」で述べた問題を解決するために,\LuaTeX-jaではもう一つの手法を導入する:
5069 新しいスタックレベルが生成されようとするとき,type, subtype, valueがそれぞれ
5070 44~(\textit{user\_defined}), 30112,そして現在のグループレベルであるwhatsitノード
5071 を現在のリストに付け加える(このノードを\textit{stack\_flag}とする).
5072 これにより,ある水平ボックスの中で代入がなされたかどうかを知ることが可能
5073 となる.スタックレベルを$s$,その水平ボックスグループの直後の\TeX のグループレベルを
5074 $t$とすると:
5075 %</ja>
5076 \begin{itemize}
5077 %<*zh>
5078 \item
5079 %</zh>
5080 %<*en>
5081 \item If there is no \textit{stack\_flag} node in the list of the hbox, then
5082       no assignment was occurred inside the hbox. Hence values of
5083       parameters at the end of the hbox are stored in the stack
5084       level~$s$.
5085 %</en>
5086 %<*ja>
5087 \item もしその水平ボックスのリストの中に\textit{stack\_flag}ノードがなければ,
5088   水平ボックスの中では代入は起こらなかったということになる.
5089   したがって,その水平ボックスの終わりにおけるパラメータの値はスタックレベル$s$に
5090   格納されている.
5091 %</ja>
5092
5093 %<*en>
5094 \item If there is a \textit{stack\_flag} node whose value is~$t+1$, then
5095       an assignment was occurred just inside the hbox group. Hence
5096       values of parameters at the end of the hbox are stored in the
5097       stack level~$s+1$.
5098 %</en>
5099 %<*ja>
5100 \item もし値が$t+1$の\textit{stack\_flag}ノードがあれば,その
5101   水平ボックスグループの中で代入が起こったことになる.
5102   したがって,水平ボックスの終わりにおけるパラメータの値はスタックレベル$s+1$に
5103   格納されている.
5104 %</ja>
5105
5106 %<*en>
5107 \item If there are \textit{stack\_flag} nodes but all of their values
5108       are more than~$t+1$, then an assignment was occurred in the box,
5109       but it is done is `more internal' group. Hence values of
5110       parameters at the end of the hbox are stored in the stack
5111       level~$s$.
5112 %</en>
5113 %<*ja>
5114 \item もし\textit{stack\_flag}ノードがあるがそれらの値が全て$t+1$より大きい
5115   場合,そのボックスの中で代入が起こったが,それは「より内部の」グループで
5116   起こったということになる.したがって,水平ボックスの終わりでのパラメータの
5117   値はスタックレベル$s$に格納されている.
5118 %</ja>
5119 \end{itemize}
5120
5121 %<*en>
5122 Note that to work this trick correctly, assignments to
5123 \verb+\ltj@@stack+ and \verb+\ltj@@group@level+ have to be local always,
5124 regardless the value of \verb+\globaldefs+.
5125 This problem is resolved by using
5126 \hbox{\verb+\directlua{tex.globaldefs=0}+} (this assignment is local).
5127 %</en>
5128 %<*ja>
5129 このトリックを正しく働かせるためには,\verb+\ltj@@stack+ と \verb+\ltj@@group@level+ への
5130 代入は \verb+\globaldefs+ の値によらず常にローカルでなければならないことに注意する.
5131 この問題は \hbox{\verb+\directlua{tex.globaldefs=0}+}(この代入は常にローカル)を
5132 用いることで解決している.
5133 %</ja>
5134
5135 %<en>\section{Linebreak after Japanese Character}
5136 %<ja>\section{和文文字直後の改行}
5137 %<zh>\section{日文字符后断行}
5138 \label{sec-lbreak}
5139 %<en>\subsection{Reference: Behavior in \pTeX}
5140 %<ja>\subsection{参考:\pTeX の動作}
5141 %<zh>\subsection{参考: \pTeX 行为}
5142 %<*en>
5143 In~\pTeX, a line break after a Japanese character doesn't emit a space,
5144 since words are not separated by spaces in Japanese writings. However,
5145 this feature isn't fully implemented in \LuaTeX-ja due to the
5146 specification of callbacks in~\LuaTeX. To clarify the difference between
5147 \pTeX~and~\LuaTeX, We briefly describe the handling of a line break in~\pTeX, in
5148 this subsection.
5149
5150 \pTeX's input processor can be described in terms of a finite state
5151 automaton, as that of~\TeX\ in~Section~2.5 of~\cite{texbytopic}. The
5152 internal states are as follows:
5153 \begin{itemize}
5154 \item State~$N$: new line
5155 \item State~$S$: skipping spaces
5156 \item State~$M$: middle of line
5157 \item State~$K$: after a Japanese character
5158 \end{itemize}
5159 The first three states---$N$, $S$~and~$M$---are as same as \TeX's input
5160 processor.  State~$K$ is similar to state~$M$, and is entered after
5161 Japanese characters.  The diagram of state transitions are indicated in
5162 Figure~\ref{fig-ptexipro}.  Note that \pTeX\ doesn't leave state~$K$
5163 after `beginning/ending of a group' characters.
5164 %</en>
5165
5166 %<*ja>
5167 欧文では文章の改行は単語間でしか行わない.そのため,\TeX では,(文字の直後の)改行は
5168 空白文字と同じ扱いとして扱われる.一方,和文ではほとんどどこでも改行が可能なため,
5169 \pTeX では和文文字の直後の改行は単純に無視されるようになっている.
5170
5171 このような動作は,\pTeX が\TeX からエンジンとして拡張されたことによって可能になったことである.
5172 \pTeX の入力処理部は,\TeX におけるそれと同じように,有限オートマトンとして記述することができ,
5173 以下に述べるような4状態を持っている.
5174
5175 \begin{itemize}
5176 \item State~$N$: 行の開始.
5177 \item State~$S$: 空白読み飛ばし.
5178 \item State~$M$: 行中.
5179 \item State~$K$: 行中(和文文字の後).
5180 \end{itemize}
5181 また,状態遷移は,図\ref{fig-ptexipro}のようになっており,図中の数字は
5182 カテゴリーコードを表している.最初の3状態は\TeX の入力処理部と同じであり,
5183 図中から状態$K$と「$j$」と書かれた矢印を取り除けば,\TeX の入力処理部と同
5184 じものになる.
5185
5186 この図から分かることは,
5187 \begin{quote}
5188 行が和文文字(とグループ境界文字)で終わっていれば,改行は無視される
5189 \end{quote}
5190 ということである.
5191 %</ja>
5192
5193 \begin{figure}[!tb]
5194 \let\sp\textvisiblespace\small
5195 \begin{minipage}{.6\textwidth}%
5196 \begin{center}
5197 \unitlength=6.5mm\sf\mathversion{bold}
5198 \begin{tikzpicture}[
5199   ->, auto, shorten >=1pt
5200 ]
5201 \node [shape=rectangle, font=\scriptsize] (init) at (2,7) {start};
5202 \node [shape=circle,draw, fill=blue!20] (newline) at (4,7) {$N$};
5203 \node [shape=circle,draw, fill=blue!20] (midline) at (4,4) {$M$};
5204 \node [shape=circle,draw, fill=blue!20] (skipspc) at (8,7) {$S$};
5205 \node [shape=circle,draw, fill=red!20]  (kanji) at (8,4) {$K$};
5206 \node [shape=rectangle,draw, fill=green!20] (scanacs) at (6,8) {scan a c.s.};
5207 \node (endk) at (8,2.5) {} ;
5208 \node (endm) at (4,2.5) {} ;
5209 \node (ends) at (8,8.5) {} ;
5210 \node (endn) at (4,8.5) {} ;
5211 \begin{scope}[font=\scriptsize]
5212 \path (newline) edge [bend right]    node [left]{G, O} (midline)
5213       (init)    edge                 node {} (newline)
5214       (midline) edge [bend right=10] node {10} (skipspc)
5215       (skipspc) edge [bend right]    node [left,right=10,above=7]{G, O} (midline)
5216       (skipspc) edge [loop right]    node {10} (skipspc)
5217       (newline) edge [loop right]    node {10} (newline)
5218       (scanacs) edge [bend left]     node [left=3,below]{$(*)$} (skipspc)
5219       (scanacs) edge [bend right]    node [right=30,above=20]{$(*)$} (midline)
5220       (midline) edge                 node {5\ [\sp]} (endm)
5221       (midline) edge [loop left]     node {G, O} (midline)
5222       (skipspc) edge                 node [right] {5} (ends)
5223       (newline) edge                 node {5 [{\tt\char92par}]} (endn);
5224 \begin{scope}[red]
5225 \path (newline) edge [bend right]    node [right=25,below=3]{J} (kanji)
5226       (midline) edge                 node [below]{J} (kanji)
5227       (kanji)   edge [bend left]     node {O} (midline)
5228       (kanji)   edge                 node {10} (skipspc)
5229       (kanji)   edge [loop right]    node {G, J} (kanji)
5230       (skipspc) edge [bend left]     node {J} (kanji)
5231       (kanji)   edge                 node {5} (endk)
5232 ;
5233 \end{scope}
5234 \end{scope}
5235 \end{tikzpicture}
5236 \end{center}
5237 \end{minipage}%
5238 \begin{minipage}{.4\textwidth}
5239 \begin{description}
5240 \item[\textsf{G}] Beginning of group (usually \verb+{+)\\
5241  and ending of group (usually \verb+}+).
5242 \item[\textsf{J}] Japanese characters.
5243 \item[\textsf{5}] \textit{end-of-line} (usually \verb+^^J+).
5244 \item[\textsf{10}] space (usually \sp).
5245 \item[\textsf{O}] other characters, whose category code is in $\{3,4,6,7,8,11,12,13\}$.
5246 \item[\textsf{[\sp]}, \textsf{[{\tt\char92par}]}]
5247 emits a space, or~\verb+\par+.
5248 \end{description}
5249 \end{minipage}
5250 \begin{itemize}
5251 \item We omitted about category codes
5252 9~(\textit{ignored}), 14~(\textit{comment})~and~15~(\textit{invalid})
5253 from the above diagram. We also ignored the input like `\verb+^^A+' or `\verb+^+\verb+^df+'.
5254 \item When a character whose category code is 0 (\textit{escape character}) is seen by \TeX,
5255 the input processor scans a control sequence (\textsf{scan a c.s.}).
5256 These paths are not shown in the above diagram.
5257
5258 After that, the state is changed to State~$S$ (skipping blanks) in most cases, but
5259 to State~$M$ (middle of line) sometimes.
5260 \end{itemize}
5261 %<en>\caption{State transitions of \pTeX's input processor.}
5262 %<ja>\caption{\pTeX の入力処理部の状態遷移.}
5263 \label{fig-ptexipro}
5264 \end{figure}
5265
5266
5267 %<en>\subsection{Behavior in \LuaTeX-ja}
5268 %<ja>\subsection{\LuaTeX-jaの動作}
5269 %<zh>\subsection{\LuaTeX-ja行为}
5270 %<*en>
5271 States in the input processor of \LuaTeX\ is the same as that of \TeX,
5272 and they can't be customized by any callbacks. Hence, we can only use
5273 \verb+process_input_buffer+ and \verb+token_filter+ callbacks for to
5274 suppress a space by a line break which is after Japanese characters.
5275
5276 However, \verb+token_filter+ callback cannot be used either, since a
5277 character in category code 5~(end-of-line) is converted into an space
5278 token \emph{in the input processor}.  So we can use only the
5279 \verb+process_input_buffer+ callback.  This means that suppressing a
5280 space must be done \emph{just before} an input line is read.
5281
5282 Considering these situations, handling of an end-of-line in \LuaTeX-ja are as follows:
5283 \begin{quote}
5284 A character U+FFFFF (its category code is set to 14~(comment) by
5285 \LuaTeX-ja) is appended to an input line, \emph{before \LuaTeX\ actually
5286 process it}, if and only if the following three conditions are satisfied:
5287 \begin{enumerate}
5288 \item The category code of \verb+\endlinechar+%
5289 \footnote{Usually, it is $\langle${return}$\rangle$
5290       (whose character code is 13).} is 5~(end-of-line).
5291 \item The category code of U+FFFFF itself is 14~(comment).
5292 \item The input line matches the following `regular expression':
5293 \[
5294   (\text{any char})^*(\textbf{JAchar})
5295   \bigl(\{\text{catcode}=1\}\cup\{\text{catcode}=2\}\bigr)^*
5296 \]
5297 \end{enumerate}
5298 \end{quote}
5299
5300 \paragraph{Remark}
5301 The following example shows the major difference from the behavior of \pTeX:
5302 \begin{LTXexample}
5303 \ltjsetparameter{autoxspacing=false}
5304 \ltjsetparameter{jacharrange={-6}}xあ
5305 y\ltjsetparameter{jacharrange={+6}}zあ
5306 u
5307 \end{LTXexample}
5308 \begin{itemize}
5309 \item There is no space between `x' and `y', since the line~2 ends with a \textbf{JAchar} `あ'
5310 (this `あ' considered as an \textbf{JAchar} at the ending of line~1).
5311 \item There is no space between `あ' (in the line~3) and `u', since the
5312       line~3 ends with an \textbf{ALchar}
5313 (the letter `あ' considered as an \textbf{ALchar} at the ending of line~2).
5314 \end{itemize}
5315 %</en>
5316
5317 %<*ja>
5318 \LuaTeX の入力処理部は\TeX のそれと全く同じであり,コールバックによりユーザが
5319 カスタマイズすることはできない.このため,改行抑制の目的でユーザが利用で
5320 きそうなコールバックとしては,\verb+process_input_buffer+や
5321 \verb+token_filter+に限られてしまう.しかし,\TeX の入力処理部をよく見る
5322 と,後者も役には経たないことが分かる:改行文字は,入力処理部によってトー
5323 クン化される時に,カテゴリーコード10の32番文字へと置き換えられてしまうた
5324 め,\verb+token_filter+で非標準なトークン読み出しを行おうとしても,空白文
5325 字由来のトークンと,改行文字由来のトークンは区別できないのだ.
5326
5327 すると,我々のとれる道は,\verb+process_input_buffer+を用いて
5328 \LuaTeX の入力処理部に引き渡される前に入力文字列を編集するというものしかない.
5329 以上を踏まえ,\LuaTeX-jaにおける「和文文字直後の改行抑制」の処理は,次のようになっている:
5330
5331 \begin{quote}
5332 各入力行に対し,\textbf{その入力行が読まれる前の内部状態で}
5333 以下の3条件が満たされている場合,\LuaTeX-jaはU+FFFFF番の文字
5334 \footnote{この文字はコメント文字として扱われるように\LuaTeX-ja内部で設定をしている.}
5335 を末尾に追加する.よって,その場合に改行は空白とは見做されないこととなる.
5336 \begin{enumerate}
5337 \item \verb+\endlinechar+の文字\footnote{普通は,改行文字(文字コード13番)である.}
5338 のカテゴリーコードが5~(end-of-line)である.
5339 \item U+FFFFFのカテゴリーコードが14~(comment)である.
5340 \item 入力行は次の「正規表現」にマッチしている:
5341 \[
5342   (\text{any char})^*(\textbf{JAchar})
5343   \bigl(\{\text{catcode}=1\}\cup\{\text{catcode}=2\}\bigr)^*
5344 \]
5345 \end{enumerate}
5346 \end{quote}
5347
5348 この仕様は,前節で述べた\pTeX の仕様にできるだけ近づけたものとなっている.最初の条件は,
5349 \texttt{verbatim}系環境などの日本語対応マクロを書かなくてすませるためのものである.
5350 しかしながら,完全に同じ挙動が実現できたわけではない.
5351 差異は,次の例が示すように,和文文字の範囲を変更した行の改行において見られる:
5352 \begin{LTXexample}
5353 \ltjsetparameter{autoxspacing=false}
5354 \ltjsetparameter{jacharrange={-6}}xあ
5355 y\ltjsetparameter{jacharrange={+6}}zあ
5356 u
5357 \end{LTXexample}
5358 もし\pTeX とまったく同じ挙動を示すならば,出力は
5359 「\hbox{\ltjsetparameter{autoxspacing=false}x yzあu}」となるべきである.しかし,実際には
5360 上のように異なる挙動となっている.
5361 \begin{itemize}
5362 \item 2行目は「あ」という和文文字で終わる(2行目を処理する前の時点では,
5363       「あ」は和文文字扱いである)ため,直後の改行文字は無視される.
5364 \item 3行目は「あ」という欧文文字で終わる(2行目を処理する前の時点では,
5365       「あ」は欧文文字扱いである)ため,直後の改行文字は空白に置き換わる.
5366 \end{itemize}
5367 このため,トラブルを避けるために,和文文字の範囲を\verb+\ltjsetparameter+で編集した場合,
5368 その行はそこで改行するようにした方がいいだろう.
5369 %</ja>
5370
5371
5372 %<en>\section{Insertion of JFM glues, \Param{kanjiskip} and \Param{xkanjiskip}}
5373 %<ja>\section{JFMグルーの挿入,\Param{kanjiskip}と\Param{xkanjiskip}}
5374 %<zh>\section{JFM的胶插入,\Param{kanjiskip}和\Param{xkanjiskip}}
5375 \label{sec-jfmglue}
5376 %<en>\subsection{Overview}
5377 %<ja>\subsection{概要}
5378 %<zh>\subsection{概要}
5379
5380 \LuaTeX-jaにおける \textbf{JAglue} の挿入方法は,\pTeX のそれとは全く異なる.
5381 \pTeX では次のような仕様であった:
5382 \begin{itemize}
5383 \item JFMグルーの挿入は,和文文字を表すトークンを元に水平リストに(文字を表す)<char\_node>を
5384 追加する過程で行われる.
5385 \item \Param{xkanjiskip}の挿入は,水平ボックスへのパッケージングや行分割前に行われる.
5386 \item \Param{kanjiskip}はノードとしては挿入されない.パッケージングや行分割の計算時に
5387 「和文文字を表す2つの<char\_node>の間には\Param{kanjiskip}がある」ものとみなされる.
5388 \end{itemize}
5389 しかし,\LuaTeX-jaでは,水平ボックスへのパッケージングや行分割前に全ての
5390 \textbf{JAglue},即ちJFMグルー・\Param{xkanjiskip}・\Param{kanjiskip}の
5391 3種類を一度に挿入することになっている.これは,\LuaTeX において欧文の合字・
5392 カーニング処理がノードベースになったことに対応する変更である.
5393
5394 \LuaTeX-jaにおける\textbf{JAglue}挿入処理では,次節で定義する
5395 「クラスタ」を単位にして行われる.大雑把にいうと,「クラスタ」は文字とそれに付随す
5396 るノード達(アクセント位置補正用のカーンや,イタリック補正)をまとめたもの
5397 であり,2つのクラスタの間には,ペナルティ,\verb+\vadjust+,whatsitなど,行組版
5398 には関係しないものがある.
5399
5400
5401 %<en>\subsection{definition of a `cluster'}
5402 %<ja>\subsection{「クラスタ」の定義}
5403 %<zh>\subsection{“cluster”定义}
5404
5405 \def\OA{$\text{\sf O}_{\text{\sf A}}$}
5406 \def\OB{$\text{\sf O}_{\text{\sf B}}$}
5407 \begin{defn}
5408 %<*en>
5409 A \emph{cluster} is a list of consecutive nodes in one of the following forms,
5410 with the \textit{id} of it:
5411 %</en>
5412 %<*ja>
5413 \textbf{クラスタ}は以下の形のうちのどれかひとつをとる連続的なノードのリストである:
5414 %</ja>
5415 \begin{enumerate}
5416 %<*en>
5417 \item Nodes whose value of\ \verb+\ltj@icflag+ is in $[3,15)$.  These
5418       nodes come from a hbox which is already packaged, by unpackaging
5419       (\verb+\unhbox+).
5420       The \textit{id} is \textit{id\_pbox}.
5421 %</en>
5422 %<*ja>
5423 \item その \verb+\ltj@icflag+ の値が$[3,15)$に入るノードのリスト.
5424   これらのノードはある既にパッケージングされた水平ボックスから \verb+\unhbox+ で
5425   アンパックされたものである.
5426   その\textit{id}は\textit{id\_pbox}である.
5427 %</ja>
5428
5429 %<*en>
5430 \item A inline math formula, including two \textit{math\_node}s at the boundary of it.
5431       The \textit{id} is \textit{id\_math}.
5432 %</en>
5433 %<*ja>
5434 \item インライン数式でその境界に2つの\textit{math\_node}を含むもの.
5435   その\textit{id}は\textit{id\_math}である.
5436 %</ja>
5437
5438 %<*en>
5439 \item A \textit{glyph\_node}~$p$ with nodes which relate with it:
5440 %</en>
5441 %<*ja>
5442 \item \textit{glpyh\_node}~$p$とそれに関係するノード:
5443 %</ja>
5444 \begin{enumerate}
5445 %<*en>
5446 \item A kern for the italic correction of~$p$.
5447 %</en>
5448 %<*ja>
5449 \item $p$のイタリック補正のためのカーン.
5450 %</ja>
5451
5452 %<*en>
5453 \item An accent attached to $p$ by \verb+\accent+.
5454 %</en>
5455 %<*ja>
5456 \item \verb+\accent+ による$p$に付随したアクセント.
5457 %</ja>
5458 \end{enumerate}
5459 \[
5460 \overbrace{%
5461  \Node{kern}{$\mathit{subtype}=2$}\longrightarrow
5462 \left\{\begin{array}{c}
5463 \Node{glyph}{accent}\\\noalign{\medskip}
5464 \Node{hbox}{accent (shifted vert.)}
5465 \end{array}\right\}\longrightarrow
5466 \Node{kern}{$\mathit{subtype}=2$}}^{\text{(a)}}
5467 \longrightarrow
5468 \Node{glyph}{$p$}\longrightarrow
5469 \overbrace{%
5470 \Node{kern}{italic corr.}}^{\text{(b)}}
5471 \]
5472
5473 %<*en>
5474 The \textit{id} is \textit{id\_jglyph} or
5475 \textit{id\_glyph}, according to whether the \textit{glyph\_node}
5476 represents a Japanese character or not.
5477 %</en>
5478 %<*ja>
5479 \textit{id}は\textit{glyph\_node}が和文文字を表すかどうかによって
5480 \textit{id\_jglyph},もしくは\textit{id\_glyph}となる.
5481 %</ja>
5482
5483 %<*en>
5484 \item An box-like node, that is, an hbox, a vbox, a rule (\verb+\vrule+) and an \textit{unset\_node}.
5485 The \textit{id} is \textit{id\_hlist} if the node is an
5486       hbox which is not shifted vertically, or \textit{id\_box\_like}
5487       otherwise.
5488 %</en>
5489 %<*ja>
5490 \item ボックス様のノード,つまり水平ボックス,垂直ボックス,罫線 (\verb+\vrule+),
5491   そして\textit{unset\_node}.
5492   その\textit{id}は垂直に移動していない水平ボックスならば\textit{id\_hlist},
5493   そうでなければ\textit{id\_box\_like}となる.
5494 %</ja>
5495
5496 %<*en>
5497 \item A glue, a kern whose subtype is not 2~(\textit{accent}), and a discretionary break.
5498 The \textit{id} is \textit{id\_glue}, \textit{id\_kern}
5499       and \textit{id\_disc}, respectively.
5500 %</en>
5501 %<*ja>
5502 \item グルー,subtypeが 2~(\textit{accent})ではないカーン,そして任意改行.
5503   その\textit{id}はそれぞれ\textit{id\_glue}, \textit{id\_kern},そして
5504   \textit{id\_disc}である.
5505 %</ja>
5506 \end{enumerate}
5507 %<*en>
5508 Let \textit{Np}, \textit{Nq} and \textit{Nr} denote a cluster.
5509 %</en>
5510 %<*ja>
5511 以下では\textit{Np}, \textit{Nq}, \textit{Nr}でクラスタを表す.
5512 %</ja>
5513 \end{defn}
5514
5515 \paragraph{\textit{id}の意味}
5516 $\mathit{Np}.\mathit{id}$の意味を述べるとともに,
5517 「先頭の文字」を表す\textit{glyph\_node}~$\mathit{Np}.\mathit{head}$と,
5518 「最後の文字」を表す\textit{glyph\_node}~$\mathit{Np}.\mathit{tail}$を次のように定義する.
5519 直感的に言うと,\textit{Np}は$\mathit{Np}.\mathit{head}$で始まり$\mathit{Np}.\mathit{tail}$で終わるような単語,
5520 と見做すことができる.これら$\mathit{Np}.\mathit{head}$, $\mathit{Np}.\mathit{tail}$は
5521 説明用に準備した概念であって,実際のLuaコード中にそのように書かれているわけではないことに注意.
5522
5523 \begin{description}
5524 \item[\textit{id\_jglyph}] 和文文字.\\
5525 $\mathit{Np}.\mathit{head}$, $\mathit{Np}.\mathit{tail}$は,その和文文字を表している
5526 \textit{glyph\_node}そのものである.
5527 \item[\textit{id\_glyph}] 和文文字を表していない\textit{glyph\_node}~$p$.\\
5528 多くの場合,$p$は欧文文字を格納しているが,`ffi'などの合字によって作られた
5529 \textit{glyph\_node}である可能性もある.
5530 前者の場合,$\mathit{Np}.\mathit{head}$,~$\mathit{Np}.\mathit{tail} = p$である.
5531 一方,後者の場合,
5532 \begin{itemize}
5533 \item $\mathit{Np}.\mathit{head}$は,
5534 合字の構成要素の先頭→(その\textit{glyph\_node}における)合字の構成要素の先頭→……
5535 と再帰的に検索していってたどり着いた\textit{glyph\_node}である.
5536 \item $\mathit{Np}.\mathit{last}$は,同様に末尾→末尾→と検索してたどり着いた\textit{glyph\_node}である.
5537 \end{itemize}
5538 \item[\textit{id\_math}] インライン数式.\\
5539 便宜的に,$\mathit{Np}.\mathit{head}$, $\mathit{Np}.\mathit{tail}$ともに
5540 「文字コード$-1$の欧文文字」とおく.
5541 \item[\textit{id\_hlist}] 縦方向にシフトされていない水平ボックス.\\
5542 この場合,$\mathit{Np}.\mathit{head}$, $\mathit{Np}.\mathit{tail}$はそれぞれ$p$の内容を表すリストの,
5543 先頭・末尾のノードである.
5544 \begin{itemize}
5545 \item 状況によっては,\TeX ソースで言うと
5546 \begin{verbatim}
5547 \hbox{\hbox{abc}...\hbox{\lower1pt\hbox{xyz}}}
5548 \end{verbatim}
5549 のように,$p$の内容が別の水平ボックスで開始・終了している可能性も十分あり得る.そのような場合,
5550 $\mathit{Np}.\mathit{head}$, $\mathit{Np}.\mathit{tail}$の算出は,\textbf{垂直方向にシフトされていない}水平ボックスの
5551 場合だけ内部を再帰的に探索する.例えば上の例では,$\mathit{Np}.\mathit{head}$は文字「a」を表すノードであり,
5552 一方$\mathit{Np}.\mathit{tail}$は垂直方向にシフトされた水平ボックス,\verb+\lower1pt\hbox{xyz}+に対応するノードである.
5553 \item また,先頭にアクセント付きの文字がきたり,末尾にイタリック補正用のカーンが
5554 来ることもあり得る.この場合は,クラスタの定義のところにもあったように,それらは無視して算出を行う.
5555 \item 最初・最後のノードが合字によって作られた\textit{glyph\_node}のときは,それぞれに対して\textit{id\_glyph}%
5556 と同様に再帰的に構成要素をたどっていく.
5557 \end{itemize}
5558 \item[\textit{id\_pbox}] 「既に処理された」ノードのリストであり,これらのノードが二度処理を受けないために
5559 まとめて1つのクラスタとして取り扱うだけである.
5560 \textit{id\_hlist}と同じ方法で$\mathit{Np}.\mathit{head}$, $\mathit{Np}.\mathit{tail}$を算出する,
5561 \item[\textit{id\_disc}] discretionary break (\verb+\discretionary{pre}{post}{nobreak}+).\\
5562 \textit{id\_hlist}と同じ方法で$\mathit{Np}.\mathit{head}$, $\mathit{Np}.\mathit{tail}$を算出するが,
5563 第3引数の \texttt{nobreak}(行分割が行われない時の内容)を使う.言い換えれば,ここで行分割が発生した時の状況は
5564 全く考慮に入れない.
5565 \item[\textit{id\_box\_like}] \textit{id\_hlist}とならないboxや,rule.\\
5566 この場合は,$\mathit{Np}.\mathit{head}$, $\mathit{Np}.\mathit{tail}$のデータは利用されないので,2つの算出は無意味である.
5567 敢えて明示するならば,$\mathit{Np}.\mathit{head}$, $\mathit{Np}.\mathit{tail}$は共にnil値である.
5568 \item[他] 以上にない\textit{id}に対しても,$\mathit{Np}.\mathit{head}$, $\mathit{Np}.\mathit{tail}$の算出は無意味.
5569 \end{description}
5570
5571 \paragraph{クラスタの別の分類}
5572 さらに,JFMグルー挿入処理の実際の説明により便利なように,\textit{id}とは別のクラスタの分類を行っておく.
5573 挿入処理では2つの隣り合ったクラスタの間に
5574 空白等の実際の挿入を行うことは前に書いたが,ここでの説明では,問題にしているクラスタ\textit{Np}は「後ろ側」のクラスタである
5575 とする.「前側」のクラスタについては,以下の説明で\textit{head}が\textit{last}に置き換わることに注意すること.
5576 \begin{description}
5577 \item[和文A] リスト中に直接出現している和文文字.
5578 \textit{id}が\textit{id\_jglyph}であるか,\\
5579 \textit{id}が\textit{id\_pbox}であって$\mathit{Np}.\mathit{head}$が\textbf{JAchar}であるとき.
5580
5581 \item[和文B] リスト中の水平ボックスの中身の先頭として出現した和文文字.和文Aとの違いは,これの前に
5582 JFMグルーの挿入が行われない(\Param{xkanjiskip},~\Param{kanjiskip}は入り得る)ことである.\\
5583 \textit{id}が\textit{id\_hlist}か\textit{id\_disc}であって$\mathit{Np}.\mathit{head}$が\textbf{JAchar}であるとき.
5584
5585 \item[欧文] リスト中に直接/水平ボックスの中身として出現している欧文文字.次の3つの場合が該当:
5586 \begin{itemize}
5587 \item \textit{id}が\textit{id\_glyph}である.
5588 \item \textit{id}が\textit{id\_math}である.
5589 \item \textit{id}が\textit{id\_pbox}か\textit{id\_hlist}か\textit{id\_disc}であって,$\mathit{Np}.\mathit{head}$が\textbf{ALchar}.
5590 \end{itemize}
5591 \item[箱] box,またはそれに類似するもの.次の2つが該当:
5592 \begin{itemize}
5593 \item \textit{id}が\textit{id\_pbox}か\textit{id\_hlist}か\textit{id\_disc}であって,$\mathit{Np}.\mathit{head}$が\textit{glyph\_node}でない.
5594 \item \textit{id}が\textit{id\_box\_like}である.
5595 \end{itemize}
5596
5597 \end{description}
5598
5599 \subsection{段落/水平ボックスの先頭や末尾}
5600 \paragraph{先頭部の処理}
5601 まず,段落/水平ボックスの一番最初にあるクラスタ\textit{Np}を探索する.
5602 水平ボックスの場合は何の問題もないが,段落の場合では以下のノード達を事前に読み飛ばしておく:
5603 \begin{center}
5604 \verb+\parindent+由来の水平ボックス ($\mathit{subtype}=3$),及び\textit{subtype}が44~(\textit{user\_defined})でない
5605 ようなwhatsit.
5606 \end{center}
5607 これは,\verb+\parindent+由来の水平ボックスがクラスタを構成しないようにするためである.
5608
5609 次に,\textit{Np}の直前に空白$g$を必要なら挿入する:
5610 \begin{enumerate}
5611 \item この処理が働くような\textit{Np}は\textsf{和文A}である.
5612 \item 問題のリストが字下げありの段落(\verb+\parindent+由来の水平ボックスあり)の場合は,
5613 この空白$g$は「文字コード\texttt{'parbdd'}の文字」と\textit{Np}の間に入るグルー/カーンである.
5614 \item そうでないとき(\verb+noindent+で開始された段落や水平ボックス)は,
5615 $g$は「文字コード\texttt{'boxbdd'}の文字」と\textit{Np}の間に入るグルー/カーンである.
5616 \end{enumerate}
5617 ただし,もし$g$がglueであった場合,この挿入によって\textit{Np}による行分割が新たに可能になるべきではない.
5618 そこで,以下の場合には,$g$の直前に\verb+\penalty10000+を挿入する:
5619 \begin{itemize}
5620 \item 問題にしているリストが段落であり,かつ
5621 \item \textit{Np}の前には予めペナルティがなく,$g$はglue.
5622 \end{itemize}
5623
5624 \paragraph{末尾の処理}
5625 末尾の処理は,問題のリストが段落のものか水平ボックスのものかによって異なる.
5626 後者の場合は容易い:最後のクラスタを\textit{Nq}とおくと,\textit{Nq}と「文字コード\texttt{'boxbdd'}の文字」の間に入るグルー/カーンを,
5627 \textit{Nq}の直後に挿入するのみである.
5628
5629 一方.前者(段落)の場合は,リストの末尾は常に\verb+\penalty10000+と,
5630 \verb+\parfillskip+由来のグルーが存在する.よって,最後のクラスタ\textit{Np}は
5631 この\verb+\parfillskip+由来のグルーとなり,実質的な中身の最後はその1つ前のクラスタ\textit{Nq}となる.
5632 \begin{enumerate}
5633 \item まず\textit{Nq}の直後に(後に述べる)\textsf{line-end~[E]}によって定まる空白を挿入する.
5634 \item 次に,段落の最後の「通常の和文文字${}+{}$句点」が独立した行となるのを防ぐために,
5635 \Param{jcharwidowpenalty}の値の分だけ適切な場所のペナルティを増やす.
5636
5637 ペナルティ量を増やす場所は,\textit{head}が\textbf{JAchar}であり,かつその文字の\Param{kcatcode}が偶数であるような
5638 最後のクラスタの直前にあるものたちである\footnote{大雑把に言えば,\Param{kcatcode}が奇数であるような\textbf{JAchar}
5639 を約物として考えていることになる.\Param{kcatcode}の最下位ビットはこの\Param{jcharwidowpenalty}用にのみ利用される.}.
5640 \end{enumerate}
5641
5642 \subsection{概観と典型例:2つの「和文A」の場合}
5643 先に述べたように,2つの隣り合ったクラスタ,\textit{Nq}と\textit{Np}の間には,
5644 ペナルティ,\verb+\vadjust+,whatsitなど,行組版には関係しないものがある.模式的に表すと,
5645 \[
5646  \Node{cluster}{\textit{Nq}}\longrightarrow
5647 \overbrace{
5648 \Node{penalty}{$p$}\longrightarrow \cdots\longrightarrow \Node{whatsit}{}}^{(a)}
5649 \longrightarrow \Node{cluster}{\textit{Np}}
5650 \]
5651 のようになっている.間の(a)に相当する部分には,何のノードもない場合ももちろんあり得る.
5652 そうして,JFMグルー挿入後には,この2クラスタ間は次のようになる:
5653 \[
5654  \Node{cluster}{\textit{Nq}}\longrightarrow\Node{kern}{左空白}\longrightarrow
5655 \overbrace{
5656 \Node{penalty}{$p+x$}\longrightarrow \cdots\longrightarrow \Node{whatsit}{}}^{(a)}
5657 \longrightarrow \Node{glue or kern}{右空白}\longrightarrow \Node{cluster}{\textit{Np}}
5658 \]
5659
5660 以後,\textbf{典型的な例として,クラスタ\textit{Nq}と\textit{Np}が共に\textsf{\textmd{和文A}}である場合を見ていこう,}
5661 この場合が全ての場合の基本となる.
5662
5663 \paragraph{「右空白」の算出}
5664 まず,「右空白」にあたる量を算出する.通常はこれが,隣り合った2つの和文文字間に入る空白量となる.
5665 \begin{description}
5666 \item[JFM由来{[M]}] JFMの文字クラス指定によって入る空白を以下によって求める.この段階で空白量が未定義(未指定)だった場合,
5667       デフォルト値\Param{kanjiskip}を採用することとなるので,次へ.
5668 \begin{enumerate}
5669 \item もし両クラスタの間で\verb+\inhibitglue+が実行されていた場合(証としてwhatsitノードが自動挿入される),
5670       代わりに\Param{kanjiskip}が挿入されることとなる.次へ.
5671 \item \textit{Nq}と\textit{Np}が同じJFM・同じ\texttt{jfmvar}キー・同じサイズの和文フォントであったならば,
5672       共通に使っているJFM内で挿入される空白(グルーかカーン)が決まっているか調べる.
5673 \item 1.でも2.でもない場合は,\textit{Nq}と\textit{Np}が違うJFM/\texttt{jfmvar}/サイズである.
5674 この場合,まず
5675 \[
5676 \vcenter{\halign{\hfil$#:={}$&(\inhibitglue#\inhibitglue)\cr
5677 gb&\textit{Nq}と「文字コードが{\tt'diffmet'}の文字」との間に入るグルー/カーン\cr
5678 ga&「文字コードが{\tt'diffmet'}の文字」と\textit{Np}との間に入るグルー/カーン\cr
5679 }}
5680 \]
5681 として,左側由来・右側由来の空白(グルー/カーン)を(それぞれのJFMから)求める.
5682 $\mathit{ga}$と$\mathit{gb}$のどちらか片方が未定義であるならば,定義されている側の値をそのまま採用する.
5683 もし$\mathit{ga}$と$\mathit{gb}$が両方決まっているならば,両者の値を平均\footnote{\Param{differentjfm}パラメタの
5684 値によって,「大きい方」「小さい方」「合計」に変えることができる.}した値を採用する.
5685 \end{enumerate}
5686
5687 例えば,
5688 \begin{verbatim}
5689 \jfont\foo=psft:Ryumin-Light:jfm=ujis
5690 \jfont\bar=psft:GothicBBB-Medium:jfm=ujis
5691 \jfont\baz=psft:GothicBBB-Medium:jfm=ujis;jfmvar=piyo
5692 \end{verbatim}
5693 という3フォントを考え,
5694 \[
5695  \overbrace{\Node{glyph}{{\tt\char92 foo}, `あ'}}^{p}
5696 \longrightarrow \overbrace{\Node{glyph}{{\tt\char92 bar}, `い'}}^{q}
5697 \longrightarrow \overbrace{\Node{glyph}{{\tt\char92 baz}, `う'}}^{r}
5698 \]
5699 という3ノードを考える(それぞれ単独でクラスタをなす).
5700 この場合,$p$と$q$の間は,実フォントが異なるにもかかわらず(2)の状況となる一方で,
5701 $q$と$r$の間は(実フォントが同じなのに)\texttt{jfmvar}キーの内容が異なるので(3)の状況となる.
5702 \item[\Param{kanjiskip}~{[K]}] 上の[M]において空白が定まらなかった場合,
5703 \Param{kanjiskip}の値を以下で定め,それを「右空白」として採用する.
5704 この段階においては,\verb+\inhibitglue+は効力を持たないため,
5705 結果として,2つの和文文字間には常に何らかのグルー/カーンが挿入されることとなる.
5706 \begin{enumerate}
5707 \item 両クラスタ(厳密には$\mathit{Nq}.\mathit{tail}$,$\mathit{Np}.\mathit{head}$)の中身の文字コードに対する
5708 \Param{autospacing}パラメタが両方ともfalseだった場合は,長さ0のglueとする.
5709 \item ユーザ側から見た\Param{kanjiskip}パラメタの自然長が${\tt \char92 maxdimen}=(2^{30}-1)\,{\rm sp}$で
5710 なければ,\Param{kanjiskip}パラメタの値を持つglueを採用する.
5711 \item 2.でない場合は,\textit{Nq}, \textit{Np}で使われているJFMに指定されている\Param{kanjiskip}の値を用いる.
5712 どちらか片方のクラスタだけが和文文字(\textsf{和文A}・\textsf{和文B})のときは,そちらのクラスタで使われている
5713 JFM由来の値だけを用いる.もし両者で使われているJFMが異なった場合は,上の[M]~3.と同様の方法を用いて調整する.
5714 \end{enumerate}
5715 \end{description}
5716 \paragraph{「左空白」の算出とそれに伴う補正}
5717 「左空白」は過去のバージョンでは定義していたが,このバージョンでは挿入は一切行われない(機能自体削除している).しかし,仕様は流動的であり,将来復活する可能性もあるため,マニュアル中の記述は今のところ極力変更しない.
5718 % 次に,「左空白」にあたる量を算出する:
5719 % \begin{description}
5720 % \item[line-end~{[E]}]
5721 % \textit{Nq}と\textit{Np}の間で行分割が起きたときに,
5722 % \textit{Nq}と行末の間に入る空白である.ぶら下げ組の組版などに用いられることを期待している.
5723 % \begin{enumerate}
5724 % \item 既に算出した「右空白」がカーンである場合は,「左空白」は挿入されない.
5725 % \item 「右空白」がglueか未定義(長さ0のglueとみなす)の場合は,「左空白」は
5726 % \textit{Nq}と「文字コード\texttt{'lineend'}の文字」との間に入るカーンとして,JFMから決定される.
5727 % \item 2.で決まった「左空白」の長さが0でなければ,その分だけ先ほど算出した「右空白」の自然長を引く.
5728 % \end{enumerate}
5729 % \end{description}
5730 \paragraph{禁則用ペナルティの挿入}
5731 まず,
5732 \[
5733  a:=(\text{\textit{Nq}{\footnotemark}の文字に対する\Param{postbreakpenalty}の値})
5734 +(\text{\textit{Np}{\footnotemark}の文字に対する\Param{prebreakpenalty}の値})
5735 \]
5736 とおく\footnotetext{厳密にはそれぞれ$\mathit{Nq}.\mathit{tail}$,$\mathit{Np}.\mathit{head}$.}.
5737 ペナルティは通常$[-10000,10000]$の整数値をとり,また$\pm 10000$は正負の無限大を意味することになっているが,この$a$の
5738 算出では単純な整数の加減算を行う.
5739
5740 $a$は禁則処理用に\textit{Nq}と\textit{Np}の間に加えられるべきペナルティ量である.
5741 \begin{description}
5742 \item[P-normal~{[PN]}]
5743 \textit{Nq}と\textit{Np}の間の(a)部分にペナルティ(\textit{penalty\_node})があれば処理は簡単である:
5744 それらの各ノードにおいて,ペナルティ値を($\pm 10000$を無限大として扱いつつ)$a$だけ増加させればよい.
5745 また,$10000 + (-10000) = 0$としている.
5746
5747 少々困るのは,(a)部分にペナルティが存在していない場合である.
5748 直感的に,補正すべき量$a$が0でないとき,その値をもつ\textit{penalty\_node}を作って
5749 「右空白」の(もし未定義なら\textit{Np}の)直前に挿入……
5750 ということになるが,実際には僅かにこれより複雑である.
5751 \begin{itemize}
5752 \item 「右空白」がカーンであるとき,
5753 それは「\textit{Nq}と\textit{Np}の間で改行は許されない」ことを意図している.そのため,
5754 この場合は$a\neq 0$であってもペナルティの挿入はしない.
5755 \item 「左空白」がカーンとしてきっちり定義されている時(このとき,「右空白」はカーンでない),
5756 この「左空白」の直後での行分割を許容しないといけないので,$a=0$であっても
5757 \textit{penalty\_node}を作って挿入する.
5758 \item 以上のどれでもないときは,$a\neq 0$ならば\textit{penalty\_node}を作って挿入する.
5759 \end{itemize}
5760 \end{description}
5761
5762 \def\gkf#1#2#3{\sf$\displaystyle\vphantom{\Bigg(}%
5763   \frac{\hbox to 1\zw{#1}\hbox to 4.5\zw{\hss #2}}{\hbox{#3}}$}
5764 \begin{table}[t]
5765 %<en>\caption{Summary of JFM glues.}
5766 %<ja>\caption{JFM グルーの概要.}
5767 %<zh>\caption{JFM胶总结。}
5768 \label{tab-jfmglue}
5769 \begin{center}
5770 \small
5771 \begin{tabular}{c|cccccc}
5772 \toprule
5773 {\bf\textit{Np}}↓&\sf 和文A&\sf 和文B&\sf 欧文&\sf 箱&\sf glue&\sf kern\\\midrule
5774 \sf 和文A&
5775 \gkf{E}{M→K}{PN}&
5776 \gkf{---}{\OA →K}{PN}&
5777 \gkf{---}{\OA →X}{PN}&
5778 \gkf{---}{\OA}{PA}&
5779 \gkf{---}{\OA}{PN}&
5780 \gkf{---}{\OA}{PS}\\
5781 \sf 和文B&
5782 \gkf{E}{\OB→K}{PA}&
5783 \gkf{---}{K}{PS}&
5784 \gkf{---}{X}{PS}\\
5785 \sf 欧文&
5786 \gkf{E}{\OB →X}{PA}&
5787 \gkf{---}{X}{PS}\cr
5788 \sf 箱&\gkf{E}{\OB}{PA}\\
5789 \sf glue&\gkf{E}{\OB}{PN}\\
5790 \sf kern&\gkf{E}{\OB}{PS}\\
5791 \bottomrule
5792 \end{tabular}
5793 \end{center}
5794 \begin{quote}
5795 %<*en>
5796 Here {\small\gkf{E}{M→K}{PN}} means that
5797 %</en>
5798 %<*ja>
5799 ここで {\small\gkf{E}{M→K}{PN}} は次の意味である:
5800 %</ja>
5801 \begin{enumerate}
5802 %<*en>
5803 \item To determine the `right-space', \LuaTeX-ja first attempts by the method `\textsf{JFM-origin~[M]}'.
5804 If this attempt fails, \LuaTeX-ja use the method `\textsf{\Param{kanjiskip}~[K]}'.
5805 %</en>
5806 %<*ja>
5807 \item 「右空白」を決めるために,\LuaTeX-ja はまず「JFM由来{[M]}」の方法を試みる.
5808   これが失敗したら,\LuaTeX-ja は「\Param{kanjiskip}~{[K]}」の方法を試みる.
5809 %</ja>
5810
5811 %<*en>
5812 \item The `left space' between \textit{Nq}~and~\textit{Np} is determined by the method `\textsf{line-end~[E]}'.
5813 %</en>
5814 %<*ja>
5815 \item \textit{Nq} と \textit{Np} の間の「左空白」は「\textsf{line-end~[E]}」の
5816   方法で決定される.
5817 %</ja>
5818
5819 %<*en>
5820 \item \LuaTeX-ja adopts the method `\textsf{P-normal~[PN]}' to adjust the penalty between two clusters for \emph{kinsoku shori}.
5821 %</en>
5822 %<*ja>
5823 \item \LuaTeX-jaは2つのクラスタの間の禁則処理用のペナルティを調節するために「\textsf{P-normal~[PN]}」の方法を採用する.
5824 %</ja>
5825 \end{enumerate}
5826 \end{quote}
5827 \end{table}
5828
5829 \subsection{その他の場合}
5830 本節の内容は表\ref{tab-jfmglue}にまとめてある.
5831
5832 \paragraph{和文Aと欧文の間}
5833 \textit{Nq}が\textsf{和文A}で,\textit{Np}が\textsf{欧文}の場合,JFMグルー挿入処理は次のようにして行われる.
5834 \begin{itemize}
5835 \item 「右空白」については,まず以下に述べる\textsf{Boundary-B~[\OB]}により空白を決定しようと試みる.
5836 それが失敗した場合は,\textsf{\Param{xkanjiskip}~[X]}によって定める.
5837 \item 「左空白」については,既に述べた\textsf{line-end~[E]}をそのまま採用する.それに伴う「右空白」の補正も同じ.
5838 \item 禁則用ペナルティも,以前述べた\textsf{P-normal~[PN]}と同じである.
5839 \end{itemize}
5840 \begin{description}
5841 \item[Boundary-B~{[\OB]}] 和文文字と「和文でないもの」との間に入る空白を以下によって求め,
5842 未定義でなければそれを「右空白」として採用する.
5843 \textsf{JFM-origin~[M]}の変種と考えて良い.
5844 これによって定まる空白の典型例は,和文の閉じ括弧と欧文文字の間に入る半角アキである.
5845 \begin{enumerate}
5846 \item もし両クラスタの間で\verb+\inhibitglue+が実行されていた場合(証としてwhatsitノードが自動挿入される),次へ.
5847 \item そうでなければ,
5848 \textit{Nq}と「文字コードが{\tt'jcharbdd'}の文字」との間に入るグルー/カーンとして定まる.
5849 \end{enumerate}
5850 \item[\Param{xkanjiskip}~{[X]}]
5851 この段階では,\textsf{\Param{kanjiskip}~[K]}のときと同じように,
5852 \Param{xkanjiskip}の値を以下で定め,それを「右空白」として採用する.
5853 この段階で\verb+\inhibitglue+は効力を持たないのも同じである.
5854 \begin{enumerate}
5855 \item 以下のいずれかの場合は,\Param{xkanjiskip}の挿入は抑止される.しかし,実際には行分割を許容するために,長さ0のglueを採用する:
5856 \begin{itemize}
5857 \item 両クラスタにおいて,それらの中身の文字コードに対する\Param{autoxspacing}パラメタが共にfalseである.
5858 \item \textit{Nq}の中身の文字コードについて,「直後への\Param{xkanjiskip}の挿入」が禁止されている
5859 (つまり,\Param{jaxspmode}~(or \Param{alxspmode})パラメタが2以上).
5860 \item \textit{Np}の中身の文字コードについて,「直前への\Param{xkanjiskip}の挿入」が禁止されている
5861 (つまり,\Param{jaxspmode}~(or \Param{alxspmode})パラメタが偶数).
5862 \end{itemize}
5863 \item ユーザ側から見た\Param{xkanjiskip}パラメタの自然長が${\tt \char92 maxdimen}=(2^{30}-1)\,{\rm sp}$で
5864 なければ,\Param{xkanjiskip}パラメタの値を持つglueを採用する.
5865 \item 2.でない場合は,\textit{Nq}, \textit{Np}(\textsf{和文A}/\textsf{和文B}なのは片方だけ)
5866 で使われているJFMに指定されている\Param{xkanjiskip}の値を用いる.
5867 \end{enumerate}
5868 \end{description}
5869
5870 \paragraph{欧文と和文Aの間}
5871 \textit{Nq}が\textsf{欧文}で,\textit{Np}が\textsf{和文A}の場合,JFMグルー挿入処理は上の場合とほぼ同じである.
5872 \textsf{和文A}のクラスタが逆になるので,\textsf{Boundary-A~[\OA]}の部分が変わるだけ.
5873 \begin{itemize}
5874 \item 「右空白」については,まず以下に述べる\textsf{Boundary-A~[\OA]}により空白を決定しようと試みる.
5875 それが失敗した場合は,\textsf{\Param{xkanjiskip}~[X]}によって定める.
5876 \item \textit{Nq}が和文でないので,「左空白」は算出されない.
5877 \item 禁則用ペナルティは,以前述べた\textsf{P-normal~[PN]}と同じである.
5878 \end{itemize}
5879 \begin{description}
5880 \item[Boundary-A~{[\OA]}] 「和文でないもの」と和文文字との間に入る空白を以下によって求め,
5881 未定義でなければそれを「右空白」として採用する.
5882 \textsf{JFM-origin~[M]}の変種と考えて良い.
5883 これによって定まる空白の典型例は,欧文文字と和文の開き括弧との間に入る半角アキである.
5884 \begin{enumerate}
5885 \item もし両クラスタの間で\verb+\inhibitglue+が実行されていた場合(証としてwhatsitノードが自動挿入される),次へ.
5886 \item そうでなければ,
5887 「文字コードが{\tt'jcharbdd'}の文字」と\textit{Np}との間に入るグルー/カーンとして定まる.
5888 \end{enumerate}
5889 \end{description}
5890
5891 \paragraph{和文Aと箱・グルー・カーンの間}
5892 \textit{Nq}が\textsf{和文A}で,\textit{Np}が\textsf{箱}・グルー・カーンのいずれかであった場合,
5893 両者の間に挿入されるJFMグルーについては同じ処理である.しかし,そこでの行分割に対する仕様が異なるので,
5894 ペナルティの挿入処理は若干異なったものとなっている.
5895
5896 \begin{itemize}
5897 \item 「右空白」については,既に述べた\textsf{Boundary-B~[\OB]}により空白を決定しようと試みる.
5898 それが失敗した場合は,「右空白」は挿入されない.
5899 \item 「左空白」については,既に述べた\textsf{line-end~[E]}の算出方法をそのまま採用する.それに伴う「右空白」の補正も同じ.
5900 \item 禁則用ペナルティの処理は,後ろのクラスタ\textit{Np}の種類によって異なる.
5901 なお,$\mathit{Np}.\mathit{head}$は無意味であるから,
5902 「$\mathit{Np}.\mathit{head}$に対する\Param{prebreakpenalty}の値」は0とみなされる.言い換えれば,
5903 \[
5904  a:=(\text{\textit{Nq}{\footnotemark}の文字に対する\Param{postbreakpenalty}の値}).
5905 \]
5906 \begin{description}
5907 \item[箱] \textit{Np}が\textsf{箱}であった場合は,両クラスタの間での行分割は
5908 (明示的に両クラスタの間に\verb+\penalty10000+があった場合を除き)いつも許容される.そのため,
5909 ペナルティ処理は,後に述べる\textsf{P-allow~[PA]}が\textsf{P-normal~[PN]}の代わりに用いられる.
5910 \item[グルー] \textit{Np}がグルーの場合,ペナルティ処理は\textsf{P-normal~[PN]}を用いる.
5911 \item[カーン] \textit{Np}がカーンであった場合は,両クラスタの間での行分割は
5912 (明示的に両クラスタの間にペナルティがあった場合を除き)許容されない.
5913 ペナルティ処理は,後に述べる\textsf{P-suppress~[PS]}を使う.
5914 \end{description}
5915 これらの\textsf{P-normal~[PN]},\textsf{P-allow~[PA]},\textsf{P-suppress~[PS]}の違いは,
5916 \textit{Nq}と\textit{Np}の間(以前の図だと(a)の部分)にペナルティが存在しない場合にのみ存在する.
5917 \end{itemize}
5918
5919 \begin{description}
5920 \item[P-allow~{[PA]}]
5921 \textit{Nq}と\textit{Np}の間の(a)部分にペナルティがあれば,\textsf{P-normal~[PN]}と同様に,
5922 それらの各ノードにおいてペナルティ値を$a$だけ増加させる.
5923
5924 (a)部分にペナルティが存在していない場合,
5925 \LuaTeX-ja は\textit{Nq}と\textit{Np}の間の行分割を可能にしようとする.
5926 そのために,以下の場合に$a$をもつ\textit{penalty\_node}を作って
5927 「右空白」の(もし未定義なら\textit{Np}の)直前に挿入する:
5928 \begin{itemize}
5929 \item 「右空白」がグルーでない(カーンか未定義)であるとき.
5930 \item 「左空白」がカーンとしてきっちり定義されている時.
5931 \end{itemize}
5932
5933 \item[P-suppress~{[PS]}]
5934 \textit{Nq}と\textit{Np}の間の(a)部分にペナルティがあれば,\textsf{P-normal~[PN]}と同様に,
5935 それらの各ノードにおいてペナルティ値を$a$だけ増加させる.
5936
5937 (a)部分にペナルティが存在していない場合,
5938 \textit{Nq}と\textit{Np}の間の行分割は元々不可能のはずだったのであるが,
5939 \LuaTeX-ja はそれをわざわざ行分割可能にはしない.
5940 そのため,「右空白」がglueであれば,その直前に\verb+\penalty10000+を挿入する.
5941 \end{description}
5942
5943 なお,「右空白」はカーン,「左空白」は未定義の
5944 \[
5945  \overbrace{\Node{glyph}{`あ'}}^{\mathit{Nq}}\longrightarrow \overbrace{\Node{glue}{1\,pt}}^{\mathit{Np}}
5946 \]
5947 のような状況を考える.
5948 このとき,$a$,即ち「あ」の\Param{postbreakpenalty}がいかなる値であっても,
5949 この2クラスタ間は最終的に
5950 \begin{equation}
5951  \overbrace{\Node{glyph}{`あ'}}^{\mathit{Nq}}\longrightarrow
5952 \Node{kern}{右空白}\longrightarrow \overbrace{\Node{glue}{1\,pt}}^{\mathit{Np}}
5953 \label{eq-gref}
5954 \end{equation}
5955 となり,$a$分のペナルティは挿入されないことに注意して欲しい.
5956 \Param{postbreakpenalty}は($a$は)殆どの場合が非負の値と考えられ,そのような場合では
5957 \eqref{eq-gref}と
5958 \[
5959  \overbrace{\Node{glyph}{`あ'}}^{\mathit{Nq}}\longrightarrow
5960 \Node{penalty}{$a$}\longrightarrow
5961 \Node{kern}{右空白}\longrightarrow \overbrace{\Node{glue}{1\,pt}}^{\mathit{Np}}
5962 \]
5963 との間に差異は生じない%
5964 \footnote{kern$\rightarrow$glueが1つの行分割可能点(行分割に伴うペナルティは0)
5965 であるため,たとえ$a=10000$であっても,\textit{Nq}と\textit{Np}の間で行分割を禁止することはできない.}.
5966
5967 \paragraph{箱・グルー・カーンと和文Aの間}
5968 \textit{Np}が\textsf{箱}・グルー・カーンのいずれかで,\textit{Np}が\textsf{和文A}であった場合は,
5969 すぐ上の(\textit{Nq}と\textit{Np}の順序が逆になっている)場合とほぼ同じであるが,「左空白」がなくなることにのみ注意.
5970 \begin{itemize}
5971 \item 「右空白」については,既に述べた\textsf{Boundary-A~[\OA]}により空白を決定しようと試みる.
5972 それが失敗した場合は,「右空白」は挿入されない.
5973 \item \textit{Nq}が和文でないので,「左空白」は算出されない.
5974 \item 禁則用ペナルティの処理は,\textit{Nq}の種類によって異なる.
5975 $\mathit{Nq}.\mathit{tail}$は無意味なので,
5976 \[
5977  a:=(\text{\textit{Np}{\footnotemark}の文字に対する\Param{prebreakpenalty}の値}).
5978 \]
5979 \begin{description}
5980 \item[箱] \textit{Nq}が\textsf{箱}の場合は,\textsf{P-allow~[PA]}を用いる.
5981 \item[グルー] \textit{Nq}がグルーの場合は,\textsf{P-normal~[PN]}を用いる.
5982 \item[カーン] \textit{Nq}がカーンの場合は,\textsf{P-suppress~[PS]}を用いる.
5983 \end{description}
5984 \end{itemize}
5985
5986 \paragraph{和文Aと和文Bの違い}
5987 先に述べたように,\textsf{和文B}は水平ボックスの中身の先頭(or 末尾)として出現している
5988 和文文字である.リスト内に直接ノードとして現れている和文文字(\textsf{和文A})との違いは,
5989 \begin{itemize}
5990 \item \textsf{和文B}に対しては,JFMの文字クラス指定から定まる空白
5991 \textsf{JFM-origin~[M]},\textsf{Boundary-A~[\OA]},\textsf{Boundary-B~[\OB]})の挿入は行われない.
5992 「左空白」の算出も行われない.例えば,
5993 \begin{itemize}
5994 \item 片方が\textsf{和文A},もう片方が\textsf{和文B}のクラスタの場合,
5995 \textsf{Boundary-A~[\OA]}または\textsf{Boundary-B~[\OB]}の挿入を試み,それがダメなら
5996 \Param{kanjiskip}~\textsf{[K]}の挿入を行う.
5997 \item \textsf{和文B}の2つのクラスタの間には,\Param{kanjiskip}~\textsf{[K]}が自動的に入る.
5998 \end{itemize}
5999 \item \textsf{和文B}と箱・グルー・カーンが隣接したとき(どちらが前かは関係ない),間にJFMグルー・ペナルティの挿入は一切しない.
6000 \item \textsf{和文B}と\textsf{和文B},また\textsf{和文B}と\textsf{欧文}とが隣接した時は,禁則用ペナルティ挿入処理は
6001 \textsf{P-suppress~[PS]}が用いられる.
6002 \item \textsf{和文B}の文字に対する\Param{prebreakpenalty},~\Param{postbreakpenalty}の値は使われず,0として計算される.
6003 \end{itemize}
6004
6005
6006 次が具体例である:
6007 \begin{LTXexample}
6008 あ.\inhibitglue A\\
6009 \hbox{あ.}A\\
6010 あ.A
6011 \end{LTXexample}
6012 \begin{itemize}
6013 \item 1行目の\verb+\inhibitglue+は\textsf{Boundary-B~[\OB]}の処理のみを抑止するので,ピリオドと「A」の間には
6014 \Param{xkanjiskip}(四分アキ)が入ることに注意.
6015 \item 2行目のピリオドと「A」の間においては,前者が\textsf{和文B}となる(水平ボックスの中身の末尾として登場しているから)ので,
6016 そもそも\textsf{Boundary-B~[\OB]}の処理は行われない.よって,\Param{xkanjiskip}が入ることとなる.
6017 \item 3行目では,ピリオドの属するクラスタは\textsf{和文A}である.これによって,
6018 ピリオドと「A」の間には\textsf{Boundary-B~[\OB]}由来の半角アキが入ることになる.
6019 \end{itemize}
6020
6021 \section{psft}
6022
6023 %<en>\section{Patch for the \Pkg{listings} package}
6024 %<ja>\section{\Pkg{listings} パッケージへの対応}
6025
6026 %<*en>
6027 It is well-known that the \Pkg{listings} package outputs weird results
6028 for Japanese input.
6029 The \Pkg{listings} package makes most of letters active and assigns
6030 output command for each letter \cite{listings}.
6031 But Japanese characters are not included in these activated letters.
6032 For \pTeX{} series, there is no method to make Japanese characters active;
6033 a patch \Pkg{jlisting.sty} \cite{jlisting} resolves the problem forcibly.
6034 %</en>
6035 %<*ja>
6036 \Pkg{listings} パッケージが,そのままでは日本語をまともに出力できないこと
6037 はよく知られている.きちんと整形して出力するために,\Pkg{listings}パッケー
6038 ジは内部で「ほとんどの文字」をアクティブにし,各文字に対してその文字の出
6039 力命令を割り当てている \cite{listings}.
6040 しかし,そこでアクティブにする文字の中に,和文文
6041 字がないためである.\pTeX 系列では,和文文字をアクティブにする手法がなく,
6042 \Pkg{jlisting.sty} というパッチ\cite{jlisting}を用いることで無理やり解決していた.
6043 %</ja>
6044
6045 %<*en>
6046 In \LuaTeX-ja, the problem is resolved by using \verb+process_input_buffer+ callback.
6047 The callback function inserts the output command before each letter above U+0080.
6048 This method can omits the process to make all Japanese characters active
6049 (most of the activated characters are not used in many cases).
6050 %</en>
6051 %<*ja>
6052 \LuaTeX-jaでは,\verb+process_input_buffer+ コールバックを利用することで,
6053 「各行に出現するU+0080以降の文字に対して,それらの出力命令を前置する」という方法をとっている.
6054 これにより,(入力には使用されていないかもしれない)和文文字をもすべてアクティブ化する手間もなく,
6055 見通しが良い実装になっている.
6056 %</ja>
6057
6058 %<*en>
6059 If \Pkg{listings.sty} and \LuaTeX-ja were loaded,
6060 then the patch \Pkg{lltjp-listings.sty} is loaded automatically at \verb+\begin{document}+.
6061 %</en>
6062 %<*ja>
6063 \LuaTeX-ja で利用される \Pkg{listings} パッケージへのパッチ \Pkg{lltjp-listings.sty} は,
6064 \Pkg{listings.sty} と\LuaTeX-jaを読み込んでおけば,
6065 \verb+\begin{document}+ の箇所において自動的に読み込まれるので,通常はあまり
6066 意識する必要はない.
6067 %</ja>
6068
6069 %<en>\paragraph{Class of characters}
6070 %<ja>\paragraph{文字種}
6071
6072 %<*en>
6073 Roughly speaking, the \Pkg{listings} package processes input as follows:
6074 %</en>
6075 %<*ja>
6076 \Pkg{listings} パッケージの内部では,大雑把に言うと
6077 %</ja>
6078 \begin{enumerate}
6079 %<*en>
6080 \item Collects \textit{letters} and \textit{digits}, which can be used for the name of identifiers.
6081 %</en>
6082 %<*ja>
6083 \item 識別子として使える文字 (``letter'',~``digit'') たちを
6084 集める.
6085 %</ja>
6086
6087 %<*en>
6088 \item When reading an \textit{other}, outputs the collected string (with modification, if needed).
6089 %</en>
6090 %<*ja>
6091 \item letterでもdigitでもない文字が現れた時に,収集した文字列を(必要なら修飾して)出力する.
6092 %</ja>
6093
6094 %<*en>
6095 \item Collects \textit{others}.
6096 %</en>
6097 %<*ja>
6098 \item 今度は逆に,letterでない文字たちをletterが現れるまで集める.
6099 %</ja>
6100
6101 %<*en>
6102 \item When reading a \textit{letter} or a \textit{digit}, outputs the collected string.
6103 %</en>
6104 %<*ja>
6105 \item letterが出現したら集めた文字列を出力する.
6106 %</ja>
6107
6108 %<*en>
6109 \item Turns back to 1.
6110 %</en>
6111 %<*ja>
6112 \item 1.に戻る.
6113 %</ja>
6114 \end{enumerate}
6115 %<*en>
6116 By the above process, line breaks inside of an identifier is blocked.
6117 A flag \verb+\lst@ifletter+ shows whether the last character can be used
6118 for the name of identifiers or not.
6119 %</en>
6120 %<*ja>
6121 という処理が行われている.これにより,識別子の途中では行分割が行われないようになっている.
6122 直前の文字が識別子として使えるか否かは \verb+\lst@ifletter+ というフラグに格納されている.
6123 %</ja>
6124
6125 %<*en>
6126 For Japanese characters, line breaks are permitted on both sides
6127 except for parentheses, dashes, etc.
6128 To process Japanese characters,
6129 \Pkg{lltjp-listings.sty} introduces a new flag \verb+\lst@kanji+, which indicates
6130 whether the last character is Japanese character or not.
6131 For illustration, we introduce the following classes of character:
6132 %</en>
6133 %<*ja>
6134 さて,日本語の処理である.殆どの和文文字の前後では行分割が可能であるが,その一方で
6135 括弧類や音引きなどでは禁則処理が必要なことから,\Pkg{lltjp-listings.sty} では,
6136 直前が和文文字であるかを示すフラグ \verb+\lst@kanji+ を新たに導入した.
6137 以降,説明のために以下のように文字を分類する:
6138 %</ja>
6139 \begin{center}
6140 \small
6141 \begin{tabular}{lccccc}
6142 \toprule
6143 &Letter&Other&Kanji&Open&Close\\\midrule
6144 \verb+\lst@ifletter+&T&F&T&F&T\\
6145 \verb+\lst@ifkanji+&F&F&T&T&F\\
6146 %<en>Meaning&identifier char&other alphabet&most of Japanese char&open paren&close paren\\
6147 %<ja>意図&識別子中の文字&その他欧文文字&殆どの和文文字&開き括弧類&閉じ括弧類\\
6148 \bottomrule
6149 \end{tabular}
6150 \end{center}
6151 %<*en>
6152 Note that \textit{digits} in the \Pkg{listings} package can be Letter or
6153 Other according to circumstances.
6154 %</en>
6155 %<*ja>
6156 なお,本来の\Pkg{listings} パッケージでの分類``digit''は,
6157 出現状況によって,上の表のLetterとOtherのどちらにもなりうる.
6158 また,KanjiとCloseは \verb+\lst@ifletter+ と \verb+\lst@ifkanji+ の値が一致しているが,
6159 これは間違いではない.
6160 %</ja>
6161
6162 %<*en>
6163 For example, let us consider the case an Open comes after a Letter.
6164 Since an Open represents Japanese open parenthesis,
6165 it is preferred to be permitted to insert line break after the Letter.
6166 Therefore, the collected string is output in this case.
6167 The following table summarizes $5\times 5=25$ cases:
6168 %</en>
6169 %<*ja>
6170 例えば,Letterの直後にOpenが来た場合を考える.
6171 文字種Openは和文開き括弧類を想定しているので,Letterの直後では行分割が可能であることが望ましい.
6172 そのため,この場合では,すでに収集されている文字列を出力することで行分割を許容するようにした.
6173 同じように,$5\times 5=25$通り全てについて書くと,次のようになる:
6174 %</ja>
6175 \begin{center}
6176 \small
6177 \begin{tabular}{llccccc}
6178 \toprule
6179 %<*en>
6180 &&\multicolumn{4}{c}{Next}\\\cmidrule(lr){3-7}
6181 &&\hbox to 4em{\hss Letter\hss}&\hbox to 4em{\hss Other\hss}
6182 &\hbox to 4em{\hss Kanji\hss}&\hbox to 4em{\hss Open\hss}&Close\\\midrule
6183 &Letter&collects&\multicolumn{3}{c}{\hrulefill \ outputs\ \hrulefill}&collects\\
6184 &Other&outputs&collects&\multicolumn{2}{c}{\hrulefill \ outputs\ \hrulefill}&collects\\
6185 Last&Kanji&\multicolumn{4}{c}{\hrulefill \ outputs\ \hrulefill}&collects\\
6186 &Open&\multicolumn{5}{c}{\hrulefill \ collects\ \hrulefill}\\
6187 &Close&\multicolumn{4}{c}{\hrulefill \ outputs\ \hrulefill}&collects\\
6188 %</en>
6189 %<*ja>
6190 &&\multicolumn{4}{c}{後ろ側の文字}\\\cmidrule(lr){3-7}
6191 &&\hbox to 4em{\hss Letter\hss}&\hbox to 4em{\hss Other\hss}
6192 &\hbox to 4em{\hss Kanji\hss}&\hbox to 4em{\hss Open\hss}&Close\\\midrule
6193 直&Letter&収集&\multicolumn{3}{c}{\hrulefill \ 出力\ \hrulefill}&収集\\
6194 前&Other&出力&収集&\multicolumn{2}{c}{\hrulefill \ 出力\ \hrulefill}&収集\\
6195 文&Kanji&\multicolumn{4}{c}{\hrulefill \ 出力\ \hrulefill}&収集\\
6196 字&Open&\multicolumn{5}{c}{\hrulefill \ 収集\ \hrulefill}\\
6197 種&Close&\multicolumn{4}{c}{\hrulefill \ 出力\ \hrulefill}&収集\\
6198 %</ja>
6199 \bottomrule
6200 \end{tabular}
6201 \end{center}
6202 %<en>In the above table,
6203 %<ja>上の表において,
6204 \begin{itemize}
6205 %<en>\item ``outputs'' means to output the collected string (i.e., line breaking is permitted there).
6206 %<ja>\item 「出力」は,それまでに集めた文字列を出力(≒ここで行分割可能)を意味する.
6207
6208 %<en>\item ``collects'' means to append the next character to the collected string (i.e., line breaking is prohibited there).
6209 %<ja>\item 「収集」は,後側の文字を,現在収集された文字列に追加(行分割不可)を意味する.
6210 \end{itemize}
6211
6212 %<en>\paragraph{Classification of characters}
6213 %<ja>\paragraph{和文文字扱いとなる文字}
6214
6215 %<*en>
6216 Characters are classified according to \Param{jacharrange} parameter (see Section \ref{ssec-setrange}):
6217 %</en>
6218 %<*ja>
6219 \Pkg{listings} パッケージにおいて和文文字と扱われる
6220 (前に述べたKanji, Open,あるいは「閉じ括弧類」分類)か否かは,
6221 通常の\textbf{JAchar}/\textbf{Alchar}の範囲の設定(\ref{ssec-setrange}節)に従って行われる:
6222 %</ja>
6223 \begin{itemize}
6224 %<en>\item \textbf{ALchars} above U+0080 are Letter.
6225 %<ja>\item (U+0080以降の)\textbf{ALchar}は,すべてLetter扱いである.
6226
6227 %<en>\item \textbf{JAchars} are classified in the order as follows:
6228 %<ja>\item (U+0080以降の)\textbf{JAchar}については,以下の順序に従って文字種を決める:
6229 \begin{enumerate}
6230 %<en>\item Characters whose \Param{prebreakpenalty} is greater than or equal to 0 are Open.
6231 %<ja>\item \Param{prebreakpenalty} が0以上の文字はOpen扱いである.
6232
6233 %<en>\item Characters whose \Param{postbreakpenalty} is greater than or equal to 0 are Close.
6234 %<ja>\item \Param{postbreakpenalty} が0以上の文字はClose扱いである.
6235
6236 %<en>\item Characters that don't satisfy the above two conditions are Kanji.
6237 %<ja>\item 上の2条件のどちらにも当てはまらなかった文字は,Kanji扱いである.
6238 \end{enumerate}
6239 \end{itemize}
6240
6241 %<*en>
6242 The width of halfwidth kana (U+FF61--U+FF9F) is same as the width of \textbf{ALchar}; the width of the other \textbf{JAchars} is double the width of \textbf{ALchar}.
6243 %</en>
6244 %<*ja>
6245 なお,半角カナ(U+FF61--U+FF9F)以外の\textbf{JAchar}は欧文文字2文字分の幅をとるものとみなされる.
6246 半角カナは欧文文字1文字分の幅となる.
6247 %</ja>
6248
6249 %<*en>
6250 The classification process is executed every time a character appears in
6251 listing environments.
6252 %</en>
6253 %<*ja>
6254 これらの文字種決定は,実際に \texttt{lstlisting} 環境などの内部で文字が出てくるたびに行われる.
6255 %</ja>
6256
6257 %<*ja>
6258 \section{和文の行長補正方法}
6259 \label{sec-adjspec}
6260 \texttt{luatexja-adjust.sty} で提供される優先順位付きの行長調整の詳細を述
6261 べる.大まかに述べると,次のようになる.
6262 \begin{itemize}
6263 \item 通常の\TeX の行分割方法に従って,段落を行分割する.この段階では,行
6264       長に半端が出た場合,その半端分は\Param{xkanjiskip},
6265       \Param{kanjiskip},JFMグルーの全てで(優先順位なく)負担される.
6266 \item その後,\texttt{post\_linebreak\_filter} callbackを使い,\textbf{段
6267       落中の各行ごとに},行末文字の位置を調整したり,優先度付きの行長調整
6268       を実現するためにグルーの伸縮度を調整する.
6269 \texttt{luatexja-adjust.sty} の作用は,このcallbackを追加するだけであり,
6270       この章の残りではcallbackでの処理について解説する.
6271 \end{itemize}
6272
6273 \paragraph{準備:合計伸縮量の計算}
6274 グルーの伸縮度(\texttt{plus} や \texttt{minus} で指定されている値)には,
6275 有限値の他に,\texttt{fi},\texttt{fil},\texttt{fill},\texttt{filll}と
6276 いう4つの無限大レベル(後ろの方ほど大きい)があり,行の調整に
6277 \texttt{fi} などの\textbf{無限大レベルの伸縮度が用いられている場合は,そ
6278 の行に対しての処理を中止}する.
6279
6280 よって,以降,問題にしている行の行長調整は伸縮度が有限長のグルーを用いて
6281 行われているとして良い.まず,段落中の行中のグルーを
6282 \begin{itemize}
6283 \item 下のどれにも該当しないグルー
6284 \item 和欧文間空白(\Param{xkanjiskip})
6285 \item JFMグルー(優先度別にまとめられる)
6286 \item 和文間空白(\Param{kanjiskip})
6287 \end{itemize}
6288 の$1+1+5+1=8$つに類別し,それぞれの種別ごとに許容されている伸縮度の合計を計算する.
6289 また,行長と自然長との差の絶対値を計算し,それを\textit{total}とおく.
6290
6291 \subsection{行末文字の位置調整}
6292 まず,行末が和文文字であった場合,それを動かすことによって,\textbf{JAglue} が負担する調整量を
6293 少なくしようとする.
6294
6295 %</ja>
6296
6297 %<*en>
6298 \section{Advanced line-adjustment for Japanese characters}
6299 \dots
6300 %</en>
6301
6302
6303
6304
6305 \begin{thebibliography}{99}
6306   \addcontentsline{toc}{section}{\refname}
6307 \bibitem{texbytopic}
6308 Victor Eijkhout,  \emph{\TeX\ by Topic, A \TeX nician's Reference}, Addison-Wesley, 1992.
6309 \bibitem{listings} C.\ Heinz, B.\ Moses. The \textsf{Listings} Package.
6310 \bibitem{jlisting} Thor Watanabe. Listings\ -\ MyTeXpert. \newblock
6311 \url{http://mytexpert.sourceforge.jp/index.php?Listings}
6312 \bibitem{min10} 乙部厳己,min10フォントについて.
6313 \url{http://argent.shinshu-u.ac.jp/~otobe/tex/files/min10.pdf}
6314 \bibitem{jlreq}  W3C Japanese Layout Task Force~(ed), Requirements for Japanese Text Layout (W3C Working Group Note), 2011, 2012. \newblock
6315 \url{http://www.w3.org/TR/jlreq/}%
6316 %<ja> \\日本語訳の書籍版:W3C日本語組版タスクフォース(編),『W3C技術ノート 日本語組版処理の要件』,東京電機大学出版局,2012.
6317 \bibitem{x4051} 日本工業規格(Japanese Industrial Standard) JIS~X~4051,
6318 日本語文書の組版方法(Formatting rules for Japanese documents), 1993, 1995, 2004.
6319 \end{thebibliography}
6320
6321 \newpage
6322 \appendix
6323
6324
6325 %<en>\section{The category code of non-kanji characters defined in JIS~X~0213}
6326 %<ja>\section{\LuaTeX-jaにおけるJIS~X~0213非漢字のcatcode}
6327
6328 %<*en>
6329 In these tables, the default catcode (\LuaTeX-ja) and kcatcode ((u)\pTeX) of non-kanji
6330 characters defined in JIS~X~0213 from row 1 to row 13 is summarized.
6331 Each character is printed as follows:
6332 %</en>
6333 %<*ja>
6334 ここでは,JIS~X~0213の非漢字部分(第1区〜第13区)のうち,
6335 どの文字が(u)\pTeX や\LuaTeX-jaで制御綴内に使用可能かを表にしてまとめる.
6336 各文字は
6337 %</ja>
6338 \begin{center}
6339 \tt\fboxsep=1pt\fbox{\hbox to \zw{\gt あ\hss}}\,\scriptsize LUP
6340 \end{center}
6341 %<*ja>
6342 のように表示しており,各文字は次の意味を持っている.
6343 この表の生成は,JIS~X~0208の範囲内の文字については\verb+\jis+命令を使って行なっている.
6344 %</ja>
6345 %<*en>
6346 The tables are generated by using \verb+\jis+ command for characters included in
6347 JIS~X~0208.
6348 Each character in the tables means:
6349 %</en>
6350 \begin{itemize}
6351 %<*en>
6352 \item The background of a character regarded as \textbf{ALchar} in \LuaTeX-ja
6353   is colored light blue.
6354 %</en>
6355 %<*ja>
6356 \item 背景が薄く青く塗られている文字は,
6357 \LuaTeX-ja の標準で\textbf{ALchar}として認識されている文字である.
6358 %</ja>
6359
6360 %<*en>
6361 \item The first letter {\tt L} means that the character is available for
6362   the name of a control sequence in \XeTeX{} and \LuaTeX-ja (its catcode is 11).
6363 %</en>
6364 %<*ja>
6365 \item 1文字目の {\tt L} は,\XeTeX や\LuaTeX-jaにおいてこの文字が制御綴内に
6366 使用可能(catcodeが11)であることを表している.
6367 %</ja>
6368
6369 %<*en>
6370 \item The second letter {\tt U} means that the character is available for
6371   the name of a control sequence in \upTeX{} (its kcatcode is 16 or 17).
6372   \upTeX{} regards these characters as Japanese character.
6373 %</en>
6374 %<*ja>
6375 \item 2文字目の{\tt U} は,\upTeX においてこの文字が制御綴内に使用可能(kcatcodeは16,~17)であることを
6376 表している.この範囲内では,\upTeX は標準で全文字を和文文字として扱うようである.
6377 %</ja>
6378
6379 %<*en>
6380 \item The third letter {\tt P} means that the character is available for
6381   the name of a control sequence in \pTeX{} (its kcatcode is 16 or 17).
6382 %</en>
6383 %<*ja>
6384 \item 3文字目の {\tt P} は,\pTeX においてこの文字が制御綴内に使用可能(kcatcodeは16,~17)であることを
6385 表している.
6386 %</ja>
6387
6388 %<*en>
6389 \item If the third letter is {\tt -} (or the character is printed in red),
6390   the character is not included in JIS~X~0208.
6391   Therefore, you can consider the character is not available in \pTeX.
6392 %</en>
6393 %<*ja>
6394 \item 3文字目が{\tt -}となっているもの(本体の文字も赤身がかっている)は,
6395 JIS~X~0208にないため\pTeX では使用不能と考えて良いものである.
6396 %</ja>
6397
6398 %<*en>
6399 \item The kana for bidakuon in row 4 and 5 are omitted.
6400 %</en>
6401 %<*ja>
6402 \item 第4区と第5区にある,鼻濁音の仮名については省略した.
6403 %</ja>
6404 \end{itemize}
6405
6406
6407 \makeatletter
6408 \def\uplist{% upTeX で \kcatcode!=18 なもの
6409   \@elt {8486}\@elt {8491}\@elt {8492}\@elt {8499}\@elt {8500}\@elt {8501}%
6410   \@elt {8502}\@elt {8504}\@elt {8508}\@elt {9008}\@elt {9009}\@elt {9010}%
6411   \@elt {9011}\@elt {9012}\@elt {9013}\@elt {9014}\@elt {9015}\@elt {9016}%
6412   \@elt {9017}\@elt {9025}\@elt {9026}\@elt {9027}\@elt {9028}\@elt {9029}%
6413   \@elt {9030}\@elt {9031}\@elt {9032}\@elt {9033}\@elt {9034}\@elt {9035}%
6414   \@elt {9036}\@elt {9037}\@elt {9038}\@elt {9039}\@elt {9040}\@elt {9041}%
6415   \@elt {9042}\@elt {9043}\@elt {9044}\@elt {9045}\@elt {9046}\@elt {9047}%
6416   \@elt {9048}\@elt {9049}\@elt {9050}\@elt {9057}\@elt {9058}\@elt {9059}%
6417   \@elt {9060}\@elt {9061}\@elt {9062}\@elt {9063}\@elt {9064}\@elt {9065}%
6418   \@elt {9066}\@elt {9067}\@elt {9068}\@elt {9069}\@elt {9070}\@elt {9071}%
6419   \@elt {9072}\@elt {9073}\@elt {9074}\@elt {9075}\@elt {9076}\@elt {9077}%
6420   \@elt {9078}\@elt {9079}\@elt {9080}\@elt {9081}\@elt {9082}\@elt {9249}%
6421   \@elt {9250}\@elt {9251}\@elt {9252}\@elt {9253}\@elt {9254}\@elt {9255}%
6422   \@elt {9256}\@elt {9257}\@elt {9258}\@elt {9259}\@elt {9260}\@elt {9261}%
6423   \@elt {9262}\@elt {9263}\@elt {9264}\@elt {9265}\@elt {9266}\@elt {9267}%
6424   \@elt {9268}\@elt {9269}\@elt {9270}\@elt {9271}\@elt {9272}\@elt {9273}%
6425   \@elt {9274}\@elt {9275}\@elt {9276}\@elt {9277}\@elt {9278}\@elt {9279}%
6426   \@elt {9280}\@elt {9281}\@elt {9282}\@elt {9283}\@elt {9284}\@elt {9285}%
6427   \@elt {9286}\@elt {9287}\@elt {9288}\@elt {9289}\@elt {9290}\@elt {9291}%
6428   \@elt {9292}\@elt {9293}\@elt {9294}\@elt {9295}\@elt {9296}\@elt {9297}%
6429   \@elt {9298}\@elt {9299}\@elt {9300}\@elt {9301}\@elt {9302}\@elt {9303}%
6430   \@elt {9304}\@elt {9305}\@elt {9306}\@elt {9307}\@elt {9308}\@elt {9309}%
6431   \@elt {9310}\@elt {9311}\@elt {9312}\@elt {9313}\@elt {9314}\@elt {9315}%
6432   \@elt {9316}\@elt {9317}\@elt {9318}\@elt {9319}\@elt {9320}\@elt {9321}%
6433   \@elt {9322}\@elt {9323}\@elt {9324}\@elt {9325}\@elt {9326}\@elt {9327}%
6434   \@elt {9328}\@elt {9329}\@elt {9330}\@elt {9331}\@elt {9505}\@elt {9506}%
6435   \@elt {9507}\@elt {9508}\@elt {9509}\@elt {9510}\@elt {9511}\@elt {9512}%
6436   \@elt {9513}\@elt {9514}\@elt {9515}\@elt {9516}\@elt {9517}\@elt {9518}%
6437   \@elt {9519}\@elt {9520}\@elt {9521}\@elt {9522}\@elt {9523}\@elt {9524}%
6438   \@elt {9525}\@elt {9526}\@elt {9527}\@elt {9528}\@elt {9529}\@elt {9530}%
6439   \@elt {9531}\@elt {9532}\@elt {9533}\@elt {9534}\@elt {9535}\@elt {9536}%
6440   \@elt {9537}\@elt {9538}\@elt {9539}\@elt {9540}\@elt {9541}\@elt {9542}%
6441   \@elt {9543}\@elt {9544}\@elt {9545}\@elt {9546}\@elt {9547}\@elt {9548}%
6442   \@elt {9549}\@elt {9550}\@elt {9551}\@elt {9552}\@elt {9553}\@elt {9554}%
6443   \@elt {9555}\@elt {9556}\@elt {9557}\@elt {9558}\@elt {9559}\@elt {9560}%
6444   \@elt {9561}\@elt {9562}\@elt {9563}\@elt {9564}\@elt {9565}\@elt {9566}%
6445   \@elt {9567}\@elt {9568}\@elt {9569}\@elt {9570}\@elt {9571}\@elt {9572}%
6446   \@elt {9573}\@elt {9574}\@elt {9575}\@elt {9576}\@elt {9577}\@elt {9578}%
6447   \@elt {9579}\@elt {9580}\@elt {9581}\@elt {9582}\@elt {9583}\@elt {9584}%
6448   \@elt {9585}\@elt {9586}\@elt {9587}\@elt {9588}\@elt {9589}\@elt {9590}%
6449   % ここから JIS X 0213
6450   \@elt {8760}\@elt {8761}\@elt {9083}\@elt {9332}\@elt {9333}\@elt {9334}%
6451   \@elt {9335}\@elt {9336}\@elt {9337}\@elt {9338}\@elt {9339}\@elt {9591}%
6452   \@elt {9592}\@elt {9593}\@elt {9594}\@elt {9595}\@elt {9596}\@elt {9597}%
6453   \@elt {9598}\@elt {9838}\@elt {9839}\@elt {9840}\@elt {9841}\@elt {9842}%
6454   \@elt {9843}\@elt {9844}\@elt {9845}\@elt {9846}\@elt {9847}\@elt {9848}%
6455   \@elt {9849}\@elt {9850}\@elt {9851}\@elt {9852}\@elt {9853}\@elt {9854}%
6456   \@elt {10098}\@elt {10099}\@elt {10100}\@elt {10101}%
6457 }
6458 \def\plist{% pTeX で \kcatcode!=18 なもの
6459   \@elt {8993}\@elt {8994}\@elt {8995}\@elt {8996}\@elt {8997}\@elt {8998}%
6460   \@elt {8999}\@elt {9000}\@elt {9001}\@elt {9002}\@elt {9003}\@elt {9004}%
6461   \@elt {9005}\@elt {9006}\@elt {9007}\@elt {9008}\@elt {9009}\@elt {9010}%
6462   \@elt {9011}\@elt {9012}\@elt {9013}\@elt {9014}\@elt {9015}\@elt {9016}%
6463   \@elt {9017}\@elt {9018}\@elt {9019}\@elt {9020}\@elt {9021}\@elt {9022}%
6464   \@elt {9023}\@elt {9024}\@elt {9025}\@elt {9026}\@elt {9027}\@elt {9028}%
6465   \@elt {9029}\@elt {9030}\@elt {9031}\@elt {9032}\@elt {9033}\@elt {9034}%
6466   \@elt {9035}\@elt {9036}\@elt {9037}\@elt {9038}\@elt {9039}\@elt {9040}%
6467   \@elt {9041}\@elt {9042}\@elt {9043}\@elt {9044}\@elt {9045}\@elt {9046}%
6468   \@elt {9047}\@elt {9048}\@elt {9049}\@elt {9050}\@elt {9051}\@elt {9052}%
6469   \@elt {9053}\@elt {9054}\@elt {9055}\@elt {9056}\@elt {9057}\@elt {9058}%
6470   \@elt {9059}\@elt {9060}\@elt {9061}\@elt {9062}\@elt {9063}\@elt {9064}%
6471   \@elt {9065}\@elt {9066}\@elt {9067}\@elt {9068}\@elt {9069}\@elt {9070}%
6472   \@elt {9071}\@elt {9072}\@elt {9073}\@elt {9074}\@elt {9075}\@elt {9076}%
6473   \@elt {9077}\@elt {9078}\@elt {9079}\@elt {9080}\@elt {9081}\@elt {9082}%
6474   \@elt {9083}\@elt {9084}\@elt {9085}\@elt {9086}\@elt {9249}\@elt {9250}%
6475   \@elt {9251}\@elt {9252}\@elt {9253}\@elt {9254}\@elt {9255}\@elt {9256}%
6476   \@elt {9257}\@elt {9258}\@elt {9259}\@elt {9260}\@elt {9261}\@elt {9262}%
6477   \@elt {9263}\@elt {9264}\@elt {9265}\@elt {9266}\@elt {9267}\@elt {9268}%
6478   \@elt {9269}\@elt {9270}\@elt {9271}\@elt {9272}\@elt {9273}\@elt {9274}%
6479   \@elt {9275}\@elt {9276}\@elt {9277}\@elt {9278}\@elt {9279}\@elt {9280}%
6480   \@elt {9281}\@elt {9282}\@elt {9283}\@elt {9284}\@elt {9285}\@elt {9286}%
6481   \@elt {9287}\@elt {9288}\@elt {9289}\@elt {9290}\@elt {9291}\@elt {9292}%
6482   \@elt {9293}\@elt {9294}\@elt {9295}\@elt {9296}\@elt {9297}\@elt {9298}%
6483   \@elt {9299}\@elt {9300}\@elt {9301}\@elt {9302}\@elt {9303}\@elt {9304}%
6484   \@elt {9305}\@elt {9306}\@elt {9307}\@elt {9308}\@elt {9309}\@elt {9310}%
6485   \@elt {9311}\@elt {9312}\@elt {9313}\@elt {9314}\@elt {9315}\@elt {9316}%
6486   \@elt {9317}\@elt {9318}\@elt {9319}\@elt {9320}\@elt {9321}\@elt {9322}%
6487   \@elt {9323}\@elt {9324}\@elt {9325}\@elt {9326}\@elt {9327}\@elt {9328}%
6488   \@elt {9329}\@elt {9330}\@elt {9331}\@elt {9332}\@elt {9333}\@elt {9334}%
6489   \@elt {9335}\@elt {9336}\@elt {9337}\@elt {9338}\@elt {9339}\@elt {9340}%
6490   \@elt {9341}\@elt {9342}\@elt {9505}\@elt {9506}\@elt {9507}\@elt {9508}%
6491   \@elt {9509}\@elt {9510}\@elt {9511}\@elt {9512}\@elt {9513}\@elt {9514}%
6492   \@elt {9515}\@elt {9516}\@elt {9517}\@elt {9518}\@elt {9519}\@elt {9520}%
6493   \@elt {9521}\@elt {9522}\@elt {9523}\@elt {9524}\@elt {9525}\@elt {9526}%
6494   \@elt {9527}\@elt {9528}\@elt {9529}\@elt {9530}\@elt {9531}\@elt {9532}%
6495   \@elt {9533}\@elt {9534}\@elt {9535}\@elt {9536}\@elt {9537}\@elt {9538}%
6496   \@elt {9539}\@elt {9540}\@elt {9541}\@elt {9542}\@elt {9543}\@elt {9544}%
6497   \@elt {9545}\@elt {9546}\@elt {9547}\@elt {9548}\@elt {9549}\@elt {9550}%
6498   \@elt {9551}\@elt {9552}\@elt {9553}\@elt {9554}\@elt {9555}\@elt {9556}%
6499   \@elt {9557}\@elt {9558}\@elt {9559}\@elt {9560}\@elt {9561}\@elt {9562}%
6500   \@elt {9563}\@elt {9564}\@elt {9565}\@elt {9566}\@elt {9567}\@elt {9568}%
6501   \@elt {9569}\@elt {9570}\@elt {9571}\@elt {9572}\@elt {9573}\@elt {9574}%
6502   \@elt {9575}\@elt {9576}\@elt {9577}\@elt {9578}\@elt {9579}\@elt {9580}%
6503   \@elt {9581}\@elt {9582}\@elt {9583}\@elt {9584}\@elt {9585}\@elt {9586}%
6504   \@elt {9587}\@elt {9588}\@elt {9589}\@elt {9590}\@elt {9591}\@elt {9592}%
6505   \@elt {9593}\@elt {9594}\@elt {9595}\@elt {9596}\@elt {9597}\@elt {9598}%
6506   \@elt {9761}\@elt {9762}\@elt {9763}\@elt {9764}\@elt {9765}\@elt {9766}%
6507   \@elt {9767}\@elt {9768}\@elt {9769}\@elt {9770}\@elt {9771}\@elt {9772}%
6508   \@elt {9773}\@elt {9774}\@elt {9775}\@elt {9776}\@elt {9777}\@elt {9778}%
6509   \@elt {9779}\@elt {9780}\@elt {9781}\@elt {9782}\@elt {9783}\@elt {9784}%
6510   \@elt {9785}\@elt {9786}\@elt {9787}\@elt {9788}\@elt {9789}\@elt {9790}%
6511   \@elt {9791}\@elt {9792}\@elt {9793}\@elt {9794}\@elt {9795}\@elt {9796}%
6512   \@elt {9797}\@elt {9798}\@elt {9799}\@elt {9800}\@elt {9801}\@elt {9802}%
6513   \@elt {9803}\@elt {9804}\@elt {9805}\@elt {9806}\@elt {9807}\@elt {9808}%
6514   \@elt {9809}\@elt {9810}\@elt {9811}\@elt {9812}\@elt {9813}\@elt {9814}%
6515   \@elt {9815}\@elt {9816}\@elt {9817}\@elt {9818}\@elt {9819}\@elt {9820}%
6516   \@elt {9821}\@elt {9822}\@elt {9823}\@elt {9824}\@elt {9825}\@elt {9826}%
6517   \@elt {9827}\@elt {9828}\@elt {9829}\@elt {9830}\@elt {9831}\@elt {9832}%
6518   \@elt {9833}\@elt {9834}\@elt {9835}\@elt {9836}\@elt {9837}\@elt {9838}%
6519   \@elt {9839}\@elt {9840}\@elt {9841}\@elt {9842}\@elt {9843}\@elt {9844}%
6520   \@elt {9845}\@elt {9846}\@elt {9847}\@elt {9848}\@elt {9849}\@elt {9850}%
6521   \@elt {9851}\@elt {9852}\@elt {9853}\@elt {9854}%
6522 }
6523
6524 \def\jlist{% JIS X 0213 だけにあるもの
6525 \@elt{"222F}{"FF07}\@elt{"2230}{"FF02}\@elt{"2231}{"FF0D}\@elt{"2232}{"FF5E}%
6526 \@elt{"2233}{"3033}\@elt{"2234}{"3034}\@elt{"2235}{"3035}\@elt{"2236}{"303B}%
6527 \@elt{"2237}{"303C}\@elt{"2238}{"30FF}\@elt{"2239}{"309F}\@elt{"2242}{"2284}%
6528 \@elt{"2243}{"2285}\@elt{"2244}{"228A}\@elt{"2245}{"228B}\@elt{"2246}{"2209}%
6529 \@elt{"2247}{"2205}\@elt{"2248}{"2305}\@elt{"2249}{"2306}\@elt{"2251}{"2295}%
6530 \@elt{"2252}{"2296}\@elt{"2253}{"2297}\@elt{"2254}{"2225}\@elt{"2255}{"2226}%
6531 \@elt{"2256}{"FF5F}\@elt{"2257}{"FF60}\@elt{"2258}{"3018}\@elt{"2259}{"3019}%
6532 \@elt{"225A}{"3016}\@elt{"225B}{"3017}\@elt{"226B}{"2262}\@elt{"226C}{"2243}%
6533 \@elt{"226D}{"2245}\@elt{"226E}{"2248}\@elt{"226F}{"2276}\@elt{"2270}{"2277}%
6534 \@elt{"2271}{"2194}\@elt{"227A}{"266E}\@elt{"227B}{"266B}\@elt{"227C}{"266C}%
6535 \@elt{"227D}{"2669}\@elt{"2321}{"25B7}\@elt{"2322}{"25B6}\@elt{"2323}{"25C1}%
6536 \@elt{"2324}{"25C0}\@elt{"2325}{"2197}\@elt{"2326}{"2198}\@elt{"2327}{"2196}%
6537 \@elt{"2328}{"2199}\@elt{"2329}{"21C4}\@elt{"232A}{"21E8}\@elt{"232B}{"21E6}%
6538 \@elt{"232C}{"21E7}\@elt{"232D}{"21E9}\@elt{"232E}{"2934}\@elt{"232F}{"2935}%
6539 \@elt{"233A}{"29BF}\@elt{"233B}{"25C9}\@elt{"233C}{"303D}\@elt{"233D}{"FE46}%
6540 \@elt{"233E}{"FE45}\@elt{"233F}{"25E6}\@elt{"2340}{"2022}\@elt{"235B}{"2213}%
6541 \@elt{"235C}{"2135}\@elt{"235D}{"210F}\@elt{"235E}{"33CB}\@elt{"235F}{"2113}%
6542 \@elt{"2360}{"2127}\@elt{"237B}{"30A0}\@elt{"237C}{"2013}\@elt{"237D}{"29FA}%
6543 \@elt{"237E}{"29FB}\@elt{"2474}{"3094}\@elt{"2475}{"3095}\@elt{"2476}{"3096}%
6544 \@elt{"2639}{"2664}\@elt{"263A}{"2660}\@elt{"263B}{"2662}%
6545 \@elt{"263C}{"2666}\@elt{"263D}{"2661}\@elt{"263E}{"2665}\@elt{"263F}{"2667}%
6546 \@elt{"2640}{"2663}\@elt{"2659}{"03C2}\@elt{"265A}{"24F5}\@elt{"265B}{"24F6}%
6547 \@elt{"265C}{"24F7}\@elt{"265D}{"24F8}\@elt{"265E}{"24F9}\@elt{"265F}{"24FA}%
6548 \@elt{"2660}{"24FB}\@elt{"2661}{"24FC}\@elt{"2662}{"24FD}\@elt{"2663}{"24FE}%
6549 \@elt{"2664}{"2616}\@elt{"2665}{"2617}\@elt{"2666}{"3020}\@elt{"2667}{"260E}%
6550 \@elt{"2668}{"2600}\@elt{"2669}{"2601}\@elt{"266A}{"2602}\@elt{"266B}{"2603}%
6551 \@elt{"266C}{"2668}\@elt{"266D}{"25B1}\@elt{"266E}{"31F0}\@elt{"266F}{"31F1}%
6552 \@elt{"2670}{"31F2}\@elt{"2671}{"31F3}\@elt{"2672}{"31F4}\@elt{"2673}{"31F5}%
6553 \@elt{"2674}{"31F6}\@elt{"2675}{"31F7}\@elt{"2676}{"31F8}\@elt{"2677}{"31F9}%
6554 \@elt{"2678}{"31F7}\@elt{"2679}{"31FA}\@elt{"267A}{"31FB}\@elt{"267B}{"31FC}%
6555 \@elt{"267C}{"31FD}\@elt{"267D}{"31FE}\@elt{"267E}{"31FF}\@elt{"2742}{"23BE}%
6556 \@elt{"2743}{"23BF}\@elt{"2744}{"23C0}\@elt{"2745}{"23C1}\@elt{"2746}{"23C2}%
6557 \@elt{"2747}{"23C3}\@elt{"2748}{"23C4}\@elt{"2749}{"23C5}\@elt{"274A}{"23C6}%
6558 \@elt{"274B}{"23C7}\@elt{"274C}{"23C8}\@elt{"274D}{"23C9}\@elt{"274E}{"23CA}%
6559 \@elt{"274F}{"23CB}\@elt{"2750}{"23CC}\@elt{"2772}{"30F7}\@elt{"2773}{"30F8}%
6560 \@elt{"2774}{"30F9}\@elt{"2775}{"30FA}\@elt{"2776}{"22DA}\@elt{"2777}{"22DB}%
6561 \@elt{"2778}{"2153}\@elt{"2779}{"2154}\@elt{"277A}{"2155}\@elt{"277B}{"2713}%
6562 \@elt{"277C}{"2318}\@elt{"277D}{"2423}\@elt{"277E}{"23CE}\@elt{"2841}{"3251}%
6563 \@elt{"2842}{"3252}\@elt{"2843}{"3253}\@elt{"2844}{"3254}\@elt{"2845}{"3255}%
6564 \@elt{"2846}{"3256}\@elt{"2847}{"3257}\@elt{"2848}{"3258}\@elt{"2849}{"3259}%
6565 \@elt{"284A}{"325A}\@elt{"284B}{"325B}\@elt{"284C}{"325C}\@elt{"284D}{"325D}%
6566 \@elt{"284E}{"325E}\@elt{"284F}{"325F}\@elt{"2850}{"32B1}\@elt{"2851}{"32B2}%
6567 \@elt{"2852}{"32B3}\@elt{"2853}{"32B4}\@elt{"2854}{"32B5}\@elt{"2855}{"32B6}%
6568 \@elt{"2856}{"32B7}\@elt{"2857}{"32B8}\@elt{"2858}{"32B9}\@elt{"2859}{"32BA}%
6569 \@elt{"285A}{"32BB}\@elt{"285B}{"32BC}\@elt{"285C}{"32BD}\@elt{"285D}{"32BE}%
6570 \@elt{"285E}{"32BF}\@elt{"2867}{"25D0}\@elt{"2868}{"25D1}\@elt{"2869}{"25D2}%
6571 \@elt{"286A}{"25D3}\@elt{"286B}{"203C}\@elt{"286C}{"2047}\@elt{"286D}{"2048}%
6572 \@elt{"286E}{"2049}\@elt{"286F}{"01CD}\@elt{"2870}{"01CE}\@elt{"2871}{"01D0}%
6573 \@elt{"2872}{"1E3E}\@elt{"2873}{"1E3F}\@elt{"2874}{"01F8}\@elt{"2875}{"01F9}%
6574 \@elt{"2876}{"01D1}\@elt{"2877}{"01D2}\@elt{"2878}{"01D4}\@elt{"2879}{"01D6}%
6575 \@elt{"287A}{"01D8}\@elt{"287B}{"01DA}\@elt{"287C}{"01DC}\@elt{"2921}{"20AC}%
6576 \@elt{"2922}{"00A0}\@elt{"2923}{"00A1}\@elt{"2924}{"00A4}\@elt{"2925}{"00A6}%
6577 \@elt{"2926}{"00A9}\@elt{"2927}{"00AA}\@elt{"2928}{"00AB}\@elt{"2929}{"00AD}%
6578 \@elt{"292A}{"00AE}\@elt{"292B}{"00AF}\@elt{"292C}{"00B2}\@elt{"292D}{"00B3}%
6579 \@elt{"292E}{"00B7}\@elt{"292F}{"00B8}\@elt{"2930}{"00B9}\@elt{"2931}{"00BA}%
6580 \@elt{"2932}{"00BB}\@elt{"2933}{"00BC}\@elt{"2934}{"00BD}\@elt{"2935}{"00BE}%
6581 \@elt{"2936}{"00BF}\@elt{"2937}{"00C0}\@elt{"2938}{"00C1}\@elt{"2939}{"00C2}%
6582 \@elt{"293A}{"00C3}\@elt{"293B}{"00C4}\@elt{"293C}{"00C5}\@elt{"293D}{"00C6}%
6583 \@elt{"293E}{"00C7}\@elt{"293F}{"00C8}\@elt{"2940}{"00C9}\@elt{"2941}{"00CA}%
6584 \@elt{"2942}{"00CB}\@elt{"2943}{"00CC}\@elt{"2944}{"00CD}\@elt{"2945}{"00CE}%
6585 \@elt{"2946}{"00CF}\@elt{"2947}{"00D0}\@elt{"2948}{"00D1}\@elt{"2949}{"00D2}%
6586 \@elt{"294A}{"00D3}\@elt{"294B}{"00D4}\@elt{"294C}{"00D5}\@elt{"294D}{"00D6}%
6587 \@elt{"294E}{"00D8}\@elt{"294F}{"00D9}\@elt{"2950}{"00DA}\@elt{"2951}{"00DB}%
6588 \@elt{"2952}{"00DC}\@elt{"2953}{"00DD}\@elt{"2954}{"00DE}\@elt{"2955}{"00DF}%
6589 \@elt{"2956}{"00E0}\@elt{"2957}{"00E1}\@elt{"2958}{"00E2}\@elt{"2959}{"00E3}%
6590 \@elt{"295A}{"00E4}\@elt{"295B}{"00E5}\@elt{"295C}{"00E6}\@elt{"295D}{"00E7}%
6591 \@elt{"295E}{"00E8}\@elt{"295F}{"00E9}\@elt{"2960}{"00EA}\@elt{"2961}{"00EB}%
6592 \@elt{"2962}{"00EC}\@elt{"2963}{"00ED}\@elt{"2964}{"00EE}\@elt{"2965}{"00EF}%
6593 \@elt{"2966}{"00F0}\@elt{"2967}{"00F1}\@elt{"2968}{"00F2}\@elt{"2969}{"00F3}%
6594 \@elt{"296A}{"00F4}\@elt{"296B}{"00F5}\@elt{"296C}{"00F6}\@elt{"296D}{"00F8}%
6595 \@elt{"296E}{"00F9}\@elt{"296F}{"00FA}\@elt{"2970}{"00FB}\@elt{"2971}{"00FC}%
6596 \@elt{"2972}{"00FD}\@elt{"2973}{"00FE}\@elt{"2974}{"00FF}\@elt{"2975}{"0100}%
6597 \@elt{"2976}{"012A}\@elt{"2977}{"016A}\@elt{"2978}{"0112}\@elt{"2979}{"014C}%
6598 \@elt{"297A}{"0101}\@elt{"297B}{"012B}\@elt{"297C}{"016B}\@elt{"297D}{"0113}%
6599 \@elt{"297E}{"014D}\@elt{"2A21}{"0104}\@elt{"2A22}{"02D8}\@elt{"2A23}{"0141}%
6600 \@elt{"2A24}{"013D}\@elt{"2A25}{"015A}\@elt{"2A26}{"0160}\@elt{"2A27}{"015E}%
6601 \@elt{"2A28}{"0164}\@elt{"2A29}{"0179}\@elt{"2A2A}{"017D}\@elt{"2A2B}{"017B}%
6602 \@elt{"2A2C}{"0105}\@elt{"2A2D}{"02DB}\@elt{"2A2E}{"0142}\@elt{"2A2F}{"013E}%
6603 \@elt{"2A30}{"015B}\@elt{"2A31}{"02C7}\@elt{"2A32}{"0161}\@elt{"2A33}{"015F}%
6604 \@elt{"2A34}{"0165}\@elt{"2A35}{"017A}\@elt{"2A36}{"02DD}\@elt{"2A37}{"017E}%
6605 \@elt{"2A38}{"017C}\@elt{"2A39}{"0154}\@elt{"2A3A}{"0102}\@elt{"2A3B}{"0139}%
6606 \@elt{"2A3C}{"0106}\@elt{"2A3D}{"010C}\@elt{"2A3E}{"0118}\@elt{"2A3F}{"011A}%
6607 \@elt{"2A40}{"010E}\@elt{"2A41}{"0143}\@elt{"2A42}{"0147}\@elt{"2A43}{"0150}%
6608 \@elt{"2A44}{"0158}\@elt{"2A45}{"016E}\@elt{"2A46}{"0170}\@elt{"2A47}{"0162}%
6609 \@elt{"2A48}{"0155}\@elt{"2A49}{"0103}\@elt{"2A4A}{"013A}\@elt{"2A4B}{"0107}%
6610 \@elt{"2A4C}{"010D}\@elt{"2A4D}{"0119}\@elt{"2A4E}{"011B}\@elt{"2A4F}{"010F}%
6611 \@elt{"2A50}{"0111}\@elt{"2A51}{"0144}\@elt{"2A52}{"0148}\@elt{"2A53}{"0151}%
6612 \@elt{"2A54}{"0159}\@elt{"2A55}{"016F}\@elt{"2A56}{"0171}\@elt{"2A57}{"0163}%
6613 \@elt{"2A58}{"02D9}\@elt{"2A59}{"0108}\@elt{"2A5A}{"011C}\@elt{"2A5B}{"0124}%
6614 \@elt{"2A5C}{"0134}\@elt{"2A5D}{"015C}\@elt{"2A5E}{"016C}\@elt{"2A5F}{"0109}%
6615 \@elt{"2A60}{"011D}\@elt{"2A61}{"0125}\@elt{"2A62}{"0135}\@elt{"2A63}{"015D}%
6616 \@elt{"2A64}{"016D}\@elt{"2A65}{"0271}\@elt{"2A66}{"028B}\@elt{"2A67}{"027E}%
6617 \@elt{"2A68}{"0283}\@elt{"2A69}{"0292}\@elt{"2A6A}{"026C}\@elt{"2A6B}{"026E}%
6618 \@elt{"2A6C}{"0279}\@elt{"2A6D}{"0288}\@elt{"2A6E}{"0256}\@elt{"2A6F}{"0273}%
6619 \@elt{"2A70}{"027D}\@elt{"2A71}{"0282}\@elt{"2A72}{"0290}\@elt{"2A73}{"027B}%
6620 \@elt{"2A74}{"026D}\@elt{"2A75}{"025F}\@elt{"2A76}{"0272}\@elt{"2A77}{"029D}%
6621 \@elt{"2A78}{"028E}\@elt{"2A79}{"0261}\@elt{"2A7A}{"014B}\@elt{"2A7B}{"0270}%
6622 \@elt{"2A7C}{"0281}\@elt{"2A7D}{"0127}\@elt{"2A7E}{"0295}\@elt{"2B21}{"0294}%
6623 \@elt{"2B22}{"0266}\@elt{"2B23}{"0298}\@elt{"2B24}{"01C2}\@elt{"2B25}{"0253}%
6624 \@elt{"2B26}{"0257}\@elt{"2B27}{"0284}\@elt{"2B28}{"0260}\@elt{"2B29}{"0193}%
6625 \@elt{"2B2A}{"0153}\@elt{"2B2B}{"0152}\@elt{"2B2C}{"0268}\@elt{"2B2D}{"0289}%
6626 \@elt{"2B2E}{"0258}\@elt{"2B2F}{"0275}\@elt{"2B30}{"0259}\@elt{"2B31}{"025C}%
6627 \@elt{"2B32}{"025E}\@elt{"2B33}{"0250}\@elt{"2B34}{"026F}\@elt{"2B35}{"028A}%
6628 \@elt{"2B36}{"0264}\@elt{"2B37}{"028C}\@elt{"2B38}{"0254}\@elt{"2B39}{"0251}%
6629 \@elt{"2B3A}{"0252}\@elt{"2B3B}{"028D}\@elt{"2B3C}{"0265}\@elt{"2B3D}{"02A2}%
6630 \@elt{"2B3E}{"02A1}\@elt{"2B3F}{"0255}\@elt{"2B40}{"0291}\@elt{"2B41}{"027A}%
6631 \@elt{"2B42}{"0267}\@elt{"2B43}{"025A}\@elt{"2B44}{"00E6}\@elt{"2B45}{"01FD}%
6632 \@elt{"2B46}{"1F70}\@elt{"2B47}{"1F71}\@elt{"2B48}{"0254}\@elt{"2B49}{"0254}%
6633 \@elt{"2B4A}{"028C}\@elt{"2B4B}{"028C}\@elt{"2B4C}{"0259}\@elt{"2B4D}{"0259}%
6634 \@elt{"2B4E}{"025A}\@elt{"2B4F}{"025A}\@elt{"2B50}{"1F72}\@elt{"2B51}{"1F73}%
6635 \@elt{"2B52}{"0361}\@elt{"2B53}{"02C8}\@elt{"2B54}{"02CC}\@elt{"2B55}{"02D0}%
6636 \@elt{"2B56}{"02D1}\@elt{"2B57}{"0306}\@elt{"2B58}{"203F}\@elt{"2B59}{"030B}%
6637 \@elt{"2B5A}{"0301}\@elt{"2B5B}{"0304}\@elt{"2B5C}{"0300}\@elt{"2B5D}{"030F}%
6638 \@elt{"2B5E}{"030C}\@elt{"2B5F}{"0302}\@elt{"2B60}{"02E5}\@elt{"2B61}{"02E6}%
6639 \@elt{"2B62}{"02E7}\@elt{"2B63}{"02E8}\@elt{"2B64}{"02E9}\@elt{"2B65}{"02E9}%
6640 \@elt{"2B66}{"02E5}\@elt{"2B67}{"0325}\@elt{"2B68}{"032C}\@elt{"2B69}{"0339}%
6641 \@elt{"2B6A}{"031C}\@elt{"2B6B}{"031F}\@elt{"2B6C}{"0320}\@elt{"2B6D}{"0308}%
6642 \@elt{"2B6E}{"033D}\@elt{"2B6F}{"0329}\@elt{"2B70}{"032F}\@elt{"2B71}{"02DE}%
6643 \@elt{"2B72}{"0324}\@elt{"2B73}{"0330}\@elt{"2B74}{"033C}\@elt{"2B75}{"0334}%
6644 \@elt{"2B76}{"031D}\@elt{"2B77}{"031E}\@elt{"2B78}{"0318}\@elt{"2B79}{"0319}%
6645 \@elt{"2B7A}{"032A}\@elt{"2B7B}{"033A}\@elt{"2B7C}{"033B}\@elt{"2B7D}{"0303}%
6646 \@elt{"2B7E}{"031A}\@elt{"2C21}{"2776}\@elt{"2C22}{"2777}\@elt{"2C23}{"2778}%
6647 \@elt{"2C24}{"2779}\@elt{"2C25}{"277A}\@elt{"2C26}{"277B}\@elt{"2C27}{"277C}%
6648 \@elt{"2C28}{"277D}\@elt{"2C29}{"277E}\@elt{"2C2A}{"277F}\@elt{"2C2B}{"24EB}%
6649 \@elt{"2C2C}{"24EC}\@elt{"2C2D}{"24ED}\@elt{"2C2E}{"24EE}\@elt{"2C2F}{"24EF}%
6650 \@elt{"2C30}{"24F0}\@elt{"2C31}{"24F1}\@elt{"2C32}{"24F2}\@elt{"2C33}{"24F3}%
6651 \@elt{"2C34}{"24F4}\@elt{"2C35}{"2170}\@elt{"2C36}{"2171}\@elt{"2C37}{"2172}%
6652 \@elt{"2C38}{"2173}\@elt{"2C39}{"2174}\@elt{"2C3A}{"2175}\@elt{"2C3B}{"2176}%
6653 \@elt{"2C3C}{"2177}\@elt{"2C3D}{"2178}\@elt{"2C3E}{"2179}\@elt{"2C3F}{"217A}%
6654 \@elt{"2C40}{"217B}\@elt{"2C41}{"24D0}\@elt{"2C42}{"24D1}\@elt{"2C43}{"24D2}%
6655 \@elt{"2C44}{"24D3}\@elt{"2C45}{"24D4}\@elt{"2C46}{"24D5}\@elt{"2C47}{"24D6}%
6656 \@elt{"2C48}{"24D7}\@elt{"2C49}{"24D8}\@elt{"2C4A}{"24D9}\@elt{"2C4B}{"24DA}%
6657 \@elt{"2C4C}{"24DB}\@elt{"2C4D}{"24DC}\@elt{"2C4E}{"24DD}\@elt{"2C4F}{"24DE}%
6658 \@elt{"2C50}{"24DF}\@elt{"2C51}{"24E0}\@elt{"2C52}{"24E1}\@elt{"2C53}{"24E2}%
6659 \@elt{"2C54}{"24E3}\@elt{"2C55}{"24E4}\@elt{"2C56}{"24E5}\@elt{"2C57}{"24E6}%
6660 \@elt{"2C58}{"24E7}\@elt{"2C59}{"24E8}\@elt{"2C5A}{"24E9}\@elt{"2C5B}{"32D0}%
6661 \@elt{"2C5C}{"32D1}\@elt{"2C5D}{"32D2}\@elt{"2C5E}{"32D3}\@elt{"2C5F}{"32D4}%
6662 \@elt{"2C60}{"32D5}\@elt{"2C61}{"32D6}\@elt{"2C62}{"32D7}\@elt{"2C63}{"32D8}%
6663 \@elt{"2C64}{"32D9}\@elt{"2C65}{"32DA}\@elt{"2C66}{"32DB}\@elt{"2C67}{"32DC}%
6664 \@elt{"2C68}{"32DD}\@elt{"2C69}{"32DE}\@elt{"2C6A}{"32DF}\@elt{"2C6B}{"32E0}%
6665 \@elt{"2C6C}{"32E1}\@elt{"2C6D}{"32E2}\@elt{"2C6E}{"32E3}\@elt{"2C6F}{"32FA}%
6666 \@elt{"2C70}{"32E9}\@elt{"2C71}{"32E5}\@elt{"2C72}{"32ED}\@elt{"2C73}{"32EC}%
6667 \@elt{"2C7D}{"2051}\@elt{"2C7E}{"2042}\@elt{"2D21}{"2460}\@elt{"2D22}{"2461}%
6668 \@elt{"2D23}{"2462}\@elt{"2D24}{"2463}\@elt{"2D25}{"2464}\@elt{"2D26}{"2465}%
6669 \@elt{"2D27}{"2466}\@elt{"2D28}{"2467}\@elt{"2D29}{"2468}\@elt{"2D2A}{"2469}%
6670 \@elt{"2D2B}{"246A}\@elt{"2D2C}{"246B}\@elt{"2D2D}{"246C}\@elt{"2D2E}{"246D}%
6671 \@elt{"2D2F}{"246E}\@elt{"2D30}{"246F}\@elt{"2D31}{"2470}\@elt{"2D32}{"2471}%
6672 \@elt{"2D33}{"2472}\@elt{"2D34}{"2473}\@elt{"2D35}{"2160}\@elt{"2D36}{"2161}%
6673 \@elt{"2D37}{"2162}\@elt{"2D38}{"2163}\@elt{"2D39}{"2164}\@elt{"2D3A}{"2165}%
6674 \@elt{"2D3B}{"2166}\@elt{"2D3C}{"2167}\@elt{"2D3D}{"2168}\@elt{"2D3E}{"2169}%
6675 \@elt{"2D3F}{"216A}\@elt{"2D40}{"3349}\@elt{"2D41}{"3314}\@elt{"2D42}{"3322}%
6676 \@elt{"2D43}{"334D}\@elt{"2D44}{"3318}\@elt{"2D45}{"3327}\@elt{"2D46}{"3303}%
6677 \@elt{"2D47}{"3336}\@elt{"2D48}{"3351}\@elt{"2D49}{"3357}\@elt{"2D4A}{"330D}%
6678 \@elt{"2D4B}{"3326}\@elt{"2D4C}{"3323}\@elt{"2D4D}{"332B}\@elt{"2D4E}{"334A}%
6679 \@elt{"2D4F}{"333B}\@elt{"2D50}{"339C}\@elt{"2D51}{"339D}\@elt{"2D52}{"339E}%
6680 \@elt{"2D53}{"338E}\@elt{"2D54}{"338F}\@elt{"2D55}{"33C4}\@elt{"2D56}{"33A1}%
6681 \@elt{"2D57}{"216B}\@elt{"2D5F}{"337B}\@elt{"2D60}{"301D}\@elt{"2D61}{"301F}%
6682 \@elt{"2D62}{"2116}\@elt{"2D63}{"33CD}\@elt{"2D64}{"2121}\@elt{"2D65}{"32A4}%
6683 \@elt{"2D66}{"32A5}\@elt{"2D67}{"32A6}\@elt{"2D68}{"32A7}\@elt{"2D69}{"32A8}%
6684 \@elt{"2D6A}{"3231}\@elt{"2D6B}{"3232}\@elt{"2D6C}{"3239}\@elt{"2D6D}{"337E}%
6685 \@elt{"2D6E}{"337D}\@elt{"2D6F}{"337C}\@elt{"2D73}{"222E}\@elt{"2D78}{"221F}%
6686 \@elt{"2D79}{"22BF}\@elt{"2D7D}{"2756}\@elt{"2D7E}{"261E}%
6687 }
6688
6689 \newcount\cntA
6690 \newcount\cntB
6691 \newcount\flag
6692 \def\chk@in@#1#2{{\global\flag=0\relax%
6693   \def\@elt##1{\ifnum#2=##1\global\flag=1 \fi}%
6694   #1}}
6695 \def\get@in@#1#2{{%
6696   \global\flag=0\relax%
6697   \def\@elt##1##2{\ifnum#2=##1\global\flag##2 \fi}%
6698   #1}}
6699
6700 \def\outi{%
6701 \get@in@{\jlist}{\cntA}\cntB=\flag
6702 \ifnum\cntB=0{}%
6703   \cntB=\jis\cntA{}%
6704   \ifnum\cntB=0 \else
6705     \ifnum\ltjgetparameter{jacharrange}{\ltjgetparameter{chartorange}{\cntB}}=0
6706     \def\@@@tmp{white}\else\def\@@@tmp{white!85!blue}\fi
6707     \fcolorbox{black}{\@@@tmp}{%
6708       \hbox to \zw{\gt  \hskip-\zw\ltjjachar\cntB  \hss}}\,\scriptsize%
6709     \ifnum\catcode\cntB=11 L\else\ \fi
6710     \chk@in@{\uplist}{\cntA}\ifnum\flag=1 U\else~\fi
6711     \chk@in@{\plist}{\cntA}\ifnum\flag=1 P\else~\fi
6712   \fi
6713 \else
6714   \ifnum\ltjgetparameter{jacharrange}{\ltjgetparameter{chartorange}{\cntB}}=0
6715   \def\@@@tmp{white}\else\def\@@@tmp{white!85!blue}\fi
6716   \fcolorbox{black}{\@@@tmp}{\color{red!50!black}%
6717      \hbox to \zw{\gt  \hskip-\zw\ltjjachar\cntB  \hss}}\,\scriptsize%
6718    \ifnum\catcode\cntB=11 L\else~\fi
6719   \chk@in@{\uplist}{\cntA}\ifnum\flag=1 U\else~\fi-%
6720 \fi\global\advance\cntA1 }
6721
6722 \def\out#1#2{%
6723 \midrule\global\cntA=\numexpr 8192+#1*256+#2*16\relax
6724 "#2{}x&\ifnum#2=2\global\advance\cntA1\else\outi\fi&\outi&\outi&\outi&\outi&\outi&\outi&\outi%"
6725 &\outi&\outi&\outi&\outi&\outi&\outi&\outi&\ifnum#2=7\global\advance\cntA1\else\outi\fi\\
6726 }
6727
6728 \def\test#1{{%
6729 %<en>\subsection*{Row #1}
6730 %<ja>\subsection*{第#1区}
6731 \tt\small\fboxsep=1pt\centering\tabcolsep=0.25\zw
6732 \begin{tabular}{ccccccccccccccccc}\toprule&"0&"1&"2&"3&"4&"5&"6&"7&"8&"9&"A&"B&"C&"D&"E&"F\\
6733 \out{#1}{2}\out{#1}{3}\out{#1}{4}\out{#1}{5}\out{#1}{6}\out{#1}{7}\bottomrule
6734 \end{tabular}\par}\medskip}
6735
6736 \test{1}\test{2}\test{3}\test{4}\test{5}\test{6}\test{7}\test{8}
6737 \test{9}\test{10}\test{11}\test{12}\test{13}
6738
6739
6740 \section{Package versions used in this document}
6741 This document was typeset using the following packages:
6742
6743 \medskip
6744
6745 {\makeatletter\tt\footnotesize
6746   \def\@pkglist#1{%
6747     \filename@parse{#1}\def\@temp{sty}
6748     \ifx\@temp\filename@ext
6749       \edef\reserved@a{%
6750         \filename@base.%
6751         \ifx\filename@ext\relax tex\else\filename@ext\fi}%
6752       \leavevmode\hskip-13em\hbox to 13em{\filename@area\reserved@a\hss}%
6753       \csname ver@\reserved@a\endcsname\par
6754     \fi
6755   }%
6756 \parindent0pt\leftskip13em
6757 \ltjpkglist
6758
6759 \makeatother}
6760 \end{document}
6761 %</!showexpl>
6762 %<*showexpl>
6763 %%
6764 %% config file for showexpl.sty
6765 %%
6766 %% Copyright The LuaTeX-ja project team, 2012
6767 %%
6768 \ProvidesFile{showexpl.cfg}
6769   [2012/05/20 v0.01 Definitions for the showexpl package (luatexja)]
6770 \lstset{}
6771 \def\SX@Info{}
6772 \endinput
6773 %</*showexpl>