OSDN Git Service

Revert 1b1d3c3 and 3b2bba1.
[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}%\ltjdisableadjust
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{\hyperlink{fld:prebp}{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{\hyperlink{fld:prebp}{prebreakpenalty}})は日本語組版用の
556       パラメータを表し,これらは \verb+\ltjsetparameter+ コマンドのキーとして
557       用いられる.
558 %</ja>
559 %<*zh>
560 \item 用无衬线字体表示的词(如:\Param{\hyperlink{fld:prebp}{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{\hyperlink{fld:xks}{xkanjiskip}}) is set to
989 %</en>
990 %<*ja>
991 \item \textbf{JAchar}と\textbf{ALchar}の間に入るグルー(\Param{\hyperlink{fld:xks}{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{\hyperlink{fld:kanjiskip}{kanjiskip}}).
2481 %</ja>
2482 %<*zh>
2483 \item 两个\textbf{JAchar}之间默认插入的胶(\Param{\hyperlink{fld:kanjiskip}{kanjiskip}})。
2484 %</zh>
2485 %<*en>
2486 \item The default glue which inserted between a \textbf{JAchar} and an
2487       \textbf{ALchar} (\Param{\hyperlink{fld:xks}{xkanjiskip}}).
2488 %</en>
2489 %<*ja>
2490 \item デフォルトで\textbf{JAchar}と\textbf{ALchar}の間に挿入されるグルー(\Param{\hyperlink{fld:xks}{xkanjiskip}}).
2491 %</ja>
2492 %<*zh>
2493 \item \textbf{JAchar}和\textbf{ALchar}之间默认插入的胶(\Param{\hyperlink{fld:xks}{xkanjiskip}})。
2494 %</zh>
2495 \end{itemize}
2496 %<*en>
2497 The value (a skip) of \Param{\hyperlink{fld:kanjiskip}{kanjiskip}} or \Param{\hyperlink{fld:xks}{xkanjiskip}} can be
2498 changed as the following.
2499 %</en>
2500 %<*ja>
2501 \Param{\hyperlink{fld:kanjiskip}{kanjiskip}}や\Param{\hyperlink{fld:xks}{xkanjiskip}}の値は以下のようにして変更可能である.
2502 %</ja>
2503 %<*zh>
2504 \Param{\hyperlink{fld:kanjiskip}{kanjiskip}}和\Param{\hyperlink{fld:xks}{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{\hyperlink{fld:kanjiskip}{kanjiskip}}'
2513 and/or `ideal width of \Param{\hyperlink{fld:xks}{xkanjiskip}}'.
2514 To use these data from JFM, set the value of \Param{\hyperlink{fld:kanjiskip}{kanjiskip}} or
2515 \Param{\hyperlink{fld:xks}{xkanjiskip}} to \verb+\maxdimen+.
2516 %</en>
2517 %<*ja>
2518 JFMは「望ましい\Param{\hyperlink{fld:kanjiskip}{kanjiskip}}の値」や「望ましい\Param{\hyperlink{fld:xks}{xkanjiskip}}の値」を
2519 持っていることがある.
2520 これらのデータを使うためには,\Param{\hyperlink{fld:kanjiskip}{kanjiskip}}や\Param{\hyperlink{fld:xks}{xkanjiskip}}の
2521 値を \verb+\maxdimen+ の値に設定すればよい.
2522 %</ja>
2523 %<*zh>
2524 当JFM包含“\Param{\hyperlink{fld:kanjiskip}{kanjiskip}}理想宽度”和/或“\Param{\hyperlink{fld:xks}{xkanjiskip}}理想宽度”数据时,
2525 上述设定产生作用。如果想用JFM中的数据,请设定\Param{\hyperlink{fld:kanjiskip}{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{\hyperlink{fld:xks}{xkanjiskip}} is inserted into every
2534 boundary between \textbf{JAchar}s and \textbf{ALchar}s. For example,
2535 \Param{\hyperlink{fld:xks}{xkanjiskip}} should not be inserted after opening parenthesis
2536 (\textit{e.g.}, compare `(あ' and `(\hskip\ltjgetparameter{xkanjiskip}あ').
2537 \LuaTeX-ja can control whether \Param{\hyperlink{fld:xks}{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{\hyperlink{fld:xks}{xkanjiskip}}がすべての\textbf{JAchar}と\textbf{ALchar}の境界に
2543 挿入されるのは望ましいことではない.例えば,\Param{\hyperlink{fld:xks}{xkanjiskip}}は開き括弧の
2544 後には挿入されるべきではない(`(あ'と`(\hskip\ltjgetparameter{xkanjiskip}あ'を
2545 比べてみよ).
2546 \LuaTeX-jaでは\Param{\hyperlink{fld:xks}{xkanjiskip}}をある文字の前/後に挿入するかどうかを,
2547 \textbf{JAchar}に対しては\Param{jaxspmode}を,\textbf{ALchar}に対しては
2548 \Param{alxspmode}をそれぞれ変えることで制御することができる.
2549 %</ja>
2550 %<*zh>
2551 并不是在所有的\textbf{JAchar}和\textbf{ALchar}周围插入\textsf{xkanjiskip}都是合适的。
2552 比如,在开标点之后插入\Param{\hyperlink{fld:xks}{xkanjiskip}}并不合适[如,比较“(あ”和“(\hskip\ltjgetparameter{xkanjiskip}あ”]。
2553 \LuaTeX-ja可以通过设定\textbf{JAchar}的\Param{jaxspmode}以及\textbf{ALchar}的\Param{alxspmode}来控制
2554 \Param{\hyperlink{fld:xks}{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{\hyperlink{fld:xks}{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{\hyperlink{fld:xks}{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{\hyperlink{fld:kanjiskip}{kanjiskip}} and
2606 \Param{\hyperlink{fld:xks}{xkanjiskip}}, set \Param{autospacing} and \Param{autoxspacing}
2607 parameters to \texttt{true}/\texttt{false}, respectively.
2608 %</en>
2609 %<*ja>
2610 もし全ての\Param{\hyperlink{fld:kanjiskip}{kanjiskip}}と\Param{\hyperlink{fld:xks}{xkanjiskip}}の挿入を有効化/無効化
2611 したければ,それぞれ\Param{autospacing}と\Param{autoxspacing}を
2612 \texttt{true}/\texttt{false}に設定すればよい.
2613 %</ja>
2614 %<*zh>
2615 如果你想要启用/屏蔽所有的\Param{\hyperlink{fld:kanjiskip}{kanjiskip}}和\Param{\hyperlink{fld:xks}{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{\hyperlink{fld:kanjiskip}{kanjiskip}}. As noted
3099              in Subsection~\ref{subs-kskip}, if the parameter
3100              \Param{\hyperlink{fld:kanjiskip}{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{\hyperlink{fld:kanjiskip}{kanjiskip}}の量を指定する.\ref{subs-kskip}節で述べたように,
3107 もし\Param{\hyperlink{fld:kanjiskip}{kanjiskip}}が \verb+\maxdimen+ の値ならば,このフィールドで指定された
3108 値が実際には用いられる(もしこのフィールドがJFMで指定されていなければ,
3109 0\,ptであるものとして扱われる).<stretch>と<shrink>のフィールドもdesign-size
3110 が単位であることに注意せよ.
3111 %</ja>
3112 %<*zh>
3113 这部分为“理想长度”\Param{\hyperlink{fld:kanjiskip}{kanjiskip}}。\ref{subs-kskip}节有详述,如果参数\Param{\hyperlink{fld:kanjiskip}{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 \texttt{kanjiskip} field, this field specifies the `ideal'
3125              amount of \Param{\hyperlink{fld:xks}{xkanjiskip}}.
3126 %</en>
3127 %<*ja>
3128 \texttt{kanjiskip}フィールドと同様に,\Param{\hyperlink{fld:xks}{xkanjiskip}}の「理想的な」量を
3129 指定する.
3130 %</ja>
3131 %<*zh>
3132 和\texttt{kanjiskip}类似,此部分设定\Param{\hyperlink{fld:xks}{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>, [$j'$]=\{<kern>, [<ratio>]\}...\}}]
3382
3383 \item[glue={\{[$j$]=\{<width>, <stretch>, <shrink>, [<priority>], [<ratio>]\}, ...\}}]
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 <ratio>も省略可能フィールドであり,$-1$から$+1$の実数値をとる.省略時の値は0である.
3394 \begin{itemize}
3395 \item $-1$はこのグルーが「前の文字」由来であることを示す.
3396 \item $+1$はこのグルーが「後の文字」由来であることを示す.
3397 \item それ以外の値は,「前の文字」由来のグルーと「後の文字」由来の
3398 グルーが混合されていることを示す.
3399 \end{itemize}
3400 なお,このフィールドの値は\Param{\hyperlink{fld:diffjfm}{differentjfm}}の値が\texttt{pleft},~\texttt{pright},~\texttt{paverage}の値のときのみ実際に用いられる.
3401
3402 例えば,\cite{x4051}では,句点と中点の間には,
3403 句点由来の二分空きと中点由来の四分空きが挿入されるが,この場合には
3404 \begin{itemize}
3405 \item <width>には$0.5+0.25=0.75$を指定する.
3406 \item <ratio>には次の値を指定する.
3407 \[
3408  -1\cdot \frac{0.5}{0.5+0.25} + 1 \cdot \frac{0.25}{0.5+0.25} = -\frac13
3409 \]
3410 \end{itemize}
3411
3412 %</ja>
3413
3414 \item[end\_stretch=<kern>]
3415 \item[end\_shrink=<kern>]
3416 %<*ja>
3417 これらのフィールドは省略可能である.
3418 優先順位付き行長調整が有効であり,かつ現在の文字クラスの文字が行
3419              末に来た時に,行長を詰める調整・伸ばす調整のた
3420              めにこの文字と行末の間に挿入可能なカーンの大きさを指定する.
3421 %</ja>
3422
3423 \end{list}
3424
3425 %<*ja>
3426 \paragraph{文字クラスの決定}
3427 文字クラスの決定は少々複雑である.ここでは例を用いて説明しよう.
3428
3429
3430 たとえば,次の内容を一部に含んだ \texttt{jfm-test.lua} を考えよう:
3431 \begin{lstlisting}
3432    [0] = {
3433       chars = { '漢', 'ヒ*' },
3434       align = 'left', left = 0.0, down = 0.0,
3435       width = 1.0, height = 0.88, depth = 0.12, italic=0.0,
3436    },
3437    [2000] = {
3438       chars = { '。', '、*', 'ヒ' },
3439       align = 'left', left = 0.0, down = 0.0,
3440       width = 0.5, height = 0.88, depth = 0.12, italic=0.0,
3441    },
3442 \end{lstlisting}
3443 句点「。」の幅は二分であるので
3444 \begin{LTXexample}
3445 \jfont\a=psft:Ryumin-Light:jfm=test;+vert
3446 \setbox0\hbox{\a 。\inhibitglue 漢}
3447 \the\wd0
3448 \end{LTXexample}
3449 では,全角二分(15.0\,pt)とならなければおかしいが,上の実行結果では20\,ptとなっている.
3450 それは以下の事情によるものである:
3451 \begin{enumerate}
3452 \item \verb+vert+ featureによって句点が縦書き用のグリフと置き換わる(\Pkg{luaotfload} による処理).
3453 \item しかしこのグリフは「文字コード」U+F0000以降とみなされている
3454 (実際にいくらになるかは,フォントによって異なる).
3455 \item よって,文字クラス0とみなされるため,結果として「。」の幅は全角だと認識されてしまう.
3456 \end{enumerate}
3457
3458 一方,「\texttt{'、*'}」のようにアスタリスクつきの指定があると,
3459 状況は異なってくる.
3460 \begin{LTXexample}
3461 \jfont\a=psft:Ryumin-Light:jfm=test;+vert
3462 \a 漢、\inhibitglue 漢
3463 \end{LTXexample}
3464 ここで,読点「、」の文字クラスは,以下のようにして決まる.
3465 \begin{enumerate}
3466 \item とりあえず句点の時と同じように,\Pkg{luaotfload} によって縦書き用読点のグリフに置き換わる.
3467 \item 置換後のグリフの「文字コード」はU+F0000以降であり,
3468 そのままでは文字クラスは0と判定される.
3469 \item ところが,JFMには「\texttt{'、*'}」指定があるので,置換前の横書き用読点のグリフ「、」(文字コードはU+3001)によって文字クラスを判定する.
3470 \item 結果として,上の出力例中の読点の文字クラスは2000となる.
3471 \end{enumerate}
3472
3473 なお,置換後のグリフで判定した文字クラスの値が0でなければ,そちらをそのまま作用する.
3474 \begin{LTXexample}
3475 \jfont\a=psft:Ryumin-Light:jfm=test;+hwid
3476 \a 漢ヒひ
3477 \end{LTXexample}
3478 上の例では,
3479 \texttt{hwid} featureにより,「ヒ」が半角の「ヒ」に置き換わるが,
3480 文字クラスは「ヒ」の属する0\textbf{ではなく},「ヒ」の属する2000となる.
3481 %</ja>
3482
3483 %<ja>\paragraph{仮想的な文字}
3484 %<!ja>\paragraph{Imaginary characters}
3485 %<*en>
3486 As described before, you can specify several `imaginary characters' in
3487 \texttt{chars} field. The most of these characters are regarded as the
3488 characters of class 0 in \pTeX.
3489 As a result, \LuaTeX-ja can control typesetting finer than \pTeX.
3490 The following is the list of `imaginary characters':
3491 %</en>
3492 %<*ja>
3493 上で説明した通り,\texttt{chars}フィールド中にはいくつかの「特殊文字」も
3494 指定可能である.これらは,大半が\pTeX のJFMグルーの挿入処理ではみな「文字
3495 クラス0の文字」として扱われていた文字であり,その結果として\pTeX より細か
3496 い組版調整ができるようになっている.以下でその一覧を述べる:
3497 %</ja>
3498 %<*zh>
3499 如上所述,你可以在\texttt{chars}中设定多个“假想字符”。这些字符中的多数字符在
3500 \pTeX 中式被视作字符集0中字符。故此,\LuaTeX-ja可以比\pTeX 做得更好。
3501 下列为“假想字符”列表:
3502 %</zh>
3503 \begin{list}{}{\def\makelabel{\ttfamily}\def\{{\char`\{}\def\}{\char`\}}\advance\leftmargin1\zw}
3504 %%\item['lineend']
3505 %%%<en>An ending of a line.
3506 %%%<ja>行の終端を表す.
3507 %%%<zh>行尾结束字符。
3508
3509 %%\item['diffmet']
3510 %%<en>Used at a boundary between two \textbf{JAchar}s whose JFM or size is different.
3511 %%<ja>JFMやサイズが異なる2つの\textbf{JAchar}の間の境界として用いられる.
3512 %%<zh>用于两个不同大小或不同JFM的两个\textbf{JAchar}间边界。
3513
3514 \item['boxbdd']
3515 %<en>The beginning/ending of a horizontal box, and the beginning of a noindented paragraph.
3516 %<ja>水平ボックスの先頭と末尾,及びインデントされていない(\verb+\noindent+ で開始された)段落の先頭を表す.
3517 %<zh>水平合字结束或结尾,以及未缩进段落开头。
3518
3519 \item['parbdd']
3520 %<en>The beginning of an (indented) paragraph.
3521 %<ja>通常の(\verb+\noindent+ で開始されていない)段落の先頭.
3522 %<zh>缩进段落开头。
3523
3524 \item['jcharbdd']
3525 %<en>A boundary between \textbf{JAchar} and anything else (such as \textbf{ALchar}, kern, glue,\,\ldots).
3526 %<ja>和文文字と「その他のもの」(欧文文字,glue,kern等)との境界.
3527 %<zh>日文字符和其他(如\textbf{ALchar},胶,出格等)边界。
3528
3529 \item[$-1$]
3530 %<en>The left/right boundary of an inline math formula.
3531 %<ja>行中数式と地の文との境界.
3532 %<zh>行中数学式的左/右边界。
3533 \end{list}
3534
3535 %<en>\paragraph{Porting JFM from \pTeX}
3536 %<ja>\paragraph{\pTeX 用和文用TFMの移植}
3537 %<zh>\paragraph{\pTeX 下使用的TFM移植}
3538
3539 % ToDo: English version.
3540
3541 %<*en>
3542 \ldots
3543 %</en>
3544
3545 %<*ja>
3546 以下に,\pTeX 用に作られた和文用TFMを\LuaTeX-ja用に移植する場合の注意点を挙げておく.
3547 \begin{itemize}
3548 \item 実際に出力される和文フォントのサイズがdesign sizeとなる.
3549 このため,例えば$1\,\textrm{zw}$がdesign sizeの0.962216倍であるJISフォン
3550       トメトリック等を移植する場合は,
3551 \begin{itemize}
3552 \item JFM中の全ての数値を$1/0.962216$倍しておく.
3553 \item \TeX ソース中で使用するところで,サイズ指定を0.962216倍にする.
3554       \LaTeX でのフォント宣言なら,例えば次のように:
3555 \begin{verbatim}
3556 \DeclareFontShape{JY3}{mc}{m}{n}{<-> s*[0.962216] psft:Ryumin-Light:jfm=jis}{}
3557 \end{verbatim}
3558 \end{itemize}
3559 \item 上に述べた特殊文字は,\texttt{'boxbdd'}を除き文字クラスを全部0とする
3560       (JFM中に単に書かなければよい).
3561 \item \texttt{'boxbdd'}については,それのみで一つの文字クラスを形成し,その
3562       文字クラスに関してはグルー/カーンの設定はしない.
3563
3564 これは,\pTeX では,
3565       水平ボックスの先頭・末尾とインデントされていない(\verb+\noindent+ で開始さ
3566       れた)段落の先頭にはJFMグルーは入らないという仕様を実現させるためである.
3567 \item \pTeX の組版を再現させようというのが目的であれば以上の注意を守れば十分である.
3568
3569 ところで,\pTeX では通常の段落の先頭にJFMグルーが残るという仕様があるので,
3570       段落先頭の開き括弧は全角二分下がりになる.全角下がりを実現させるに
3571       は,段落の最初に手動で \verb+\inhibitglue+ を追加するか,あるいは
3572       \ \verb+\everypar+ のハックを行い,それを自動化させるしかなかった.
3573
3574 一方,\LuaTeX-jaでは,\texttt{'parbdd'}によって,それがJFM側で調整できるよ
3575 うになった.例えば,\LuaTeX-ja同梱のJFMのように,\texttt{'boxbdd'}と同じ文字クラスに
3576 \texttt{'parbdd'}を入れれば全角下がりとなる.
3577
3578 \begin{LTXexample}
3579 \jfont\g=psft:Ryumin-Light:jfm=test \g
3580 \parindent1\zw\noindent{}◆◆◆◆◆
3581 \par 「◆◆←二分下がり
3582 \par 【◆◆←全角下がり
3583 \par 〔◆◆←全角二分下がり
3584 \end{LTXexample}
3585 \end{itemize}
3586
3587 但し,\verb+\everypar+ を利用している場合にはこの仕組みは正しく動かない.
3588 そのような例としては箇条書き中の \verb+\item+ で始まる段落があり,\Pkg{ltjsclasses}では
3589 人工的に「\texttt{'parbdd'}の意味を持つ」whatsitノードを作ることによって対処している%
3590 \footnote{\texttt{no\_runtime/ltjsclasses.dtx} を参照されたい.
3591 JFM側で一部の対処ができることにより,\Pkg{jsclasses}のようにif文の判定はしていない.}
3592 %</ja>
3593 %<*zh>
3594 下面,给出用于\pTeX 使用的JFM移植到\LuaTeX-ja过程中需要注意的几点。
3595 %</zh>
3596
3597
3598 %<en>\subsection{Math Font Family}
3599 %<ja>\subsection{数式フォントファミリ}
3600 %<zh>\subsection{数学字体族}
3601 \label{ssec-math}
3602
3603 %<*en>
3604 \TeX\ handles fonts in math formulas by 16~font families\footnote{Omega,
3605 Aleph, \LuaTeX~and $\varepsilon$-\kern-.125em(u)\pTeX\ can handles 256~families, but
3606 an external package is needed to support this in plain \TeX\ and
3607 \LaTeX.}, and each family has three fonts:
3608 \verb+\textfont+, \verb+\scriptfont+ and \verb+\scriptscriptfont+.
3609 %</en>
3610 %<*ja>
3611 \TeX\ は数式フォントを16のファミリ\footnote{Omega, Aleph, \LuaTeX,そして
3612   $\varepsilon$-\kern-.125em(u)\pTeX\ では256の数式ファミリを扱うことができるが,
3613   これをサポートするためにplain \TeX と\LaTeX では外部パッケージを読み込む必要が
3614   ある.}で管理し,それぞれのファミリは3つのフォントを持っている:\verb+\textfont+, \verb+\scriptfont+ そして \verb+\scriptscriptfont+ である.
3615 %</ja>
3616
3617 %<*en>
3618 \LuaTeX-ja's handling of Japanese fonts in math formulas is similar;
3619 Table~\ref{tab-math} shows counterparts to \TeX's primitives for math
3620 font families. There is no relation between the value of
3621 \verb+\fam+ and that of \verb+\jfam+; with appropriate settings,
3622 you can set both \verb+\fam+ and \verb+\jfam+ to the same value.
3623 %</en>
3624 %<*ja>
3625 \LuaTeX-jaの数式中での和文フォントの扱いも同様である.
3626 表\ref{tab-math}は数式フォントファミリに対する \TeX のプリミティブと対応する
3627 ものを示している.\verb+\fam+ と \verb+\jfam+ の値の間には関係はなく,
3628 適切な設定の下では \verb+\fam+ と \verb+\jfam+ の両方に同じ値を設定することができる.
3629 %</ja>
3630
3631 \begin{table}[!tb]
3632 %<en>\caption{Primitives for Japanese math fonts.}
3633 %<ja>\caption{和文数式フォントに対するプリミティブ.}
3634 %<zh>\caption{日语数学字体基本语句}
3635 \label{tab-math}
3636 \begin{center}
3637 \def\{{\char`\{}\def\}{\char`\}}\small
3638 \begin{tabular}{ll}
3639 \toprule
3640 %<en>\bf Japanese fonts&\bf alphabetic fonts\\
3641 %<ja>\bf 和文フォント&\bf 欧文フォント\\
3642 %<zh>\bf 日文字体&\bf 西文字体\\
3643 \midrule
3644 \verb+\jfam+${}\in [0,256)$&\verb+\fam+\\
3645 \tt\Param{jatextfont}\,=\{<jfam>,<jfont\_cs>\}&\tt\verb+\textfont+<fam>=<font\_cs>\\
3646 \tt\Param{jascriptfont}\,=\{<jfam>,<jfont\_cs>\}&\tt\verb+\scriptfont+<fam>=<font\_cs>\\
3647 \tt\Param{jascriptscriptfont}\,=\{<jfam>,<jfont\_cs>\}&\tt\verb+\scriptscriptfont+<fam>=<font\_cs>\\
3648 \bottomrule
3649 \end{tabular}
3650 \end{center}
3651 \end{table}
3652
3653 %<en>\subsection{Callbacks}
3654 %<ja>\subsection{コールバック}
3655 %<zh>\subsection{回调}
3656
3657 %<*en>
3658 Like \LuaTeX\ itself, \LuaTeX-ja also has callbacks. These callbacks can
3659 be accessed via \verb+luatexbase.add_to_callback+ function and so on, as other callbacks.
3660 %</en>
3661 %<*ja>
3662 \LuaTeX 自体のものに加えて,\LuaTeX-jaもコールバックを持っている.
3663 これらのコールバックには,他のコールバックと同様に \verb+luatexbase.add_to_callback+
3664 関数などを用いることでアクセスすることができる.
3665 %</ja>
3666 \begin{list}{}%
3667 {\def\makelabel#1{\bfseries#1}}
3668 %<en>\item[\texttt{luatexja.load\_jfm} callback]
3669 %<ja>\item[\texttt{luatexja.load\_jfm}コールバック]
3670 %<zh>\item[\texttt{luatexja.load\_jfm}回调]
3671 %<*en>
3672 With this callback you can overwrite JFMs.
3673 This callback is called when a new JFM is loaded.
3674 %</en>
3675 %<*ja>
3676 このコールバックを用いることでJFMを上書きすることができる.
3677 このコールバックは新しいJFMが読み込まれるときに呼び出される.
3678 %</ja>
3679
3680 \begin{lstlisting}[numbers=left]
3681 function (<table> jfm_info, <string> jfm_name)
3682   return <table> new_jfm_info
3683 end
3684 \end{lstlisting}
3685
3686 %<*en>
3687 The argument \verb+jfm_info+ contains a table similar to the table in a JFM file, except
3688 this argument has \texttt{chars} field which contains character codes
3689              whose character class is not~0.
3690 %</en>
3691 %<*ja>
3692 引数 \verb+jfm_info+ はJFMファイルのテーブルと似たものが格納されるが,
3693 クラス0を除いた文字のコードを含んだ\texttt{chars}フィールドを持つ点が異なる.
3694 %</ja>
3695
3696 %<*en>
3697 An example of this callback is the \texttt{ltjarticle} class, with
3698              forcefully assigning character class~0 to \texttt{'parbdd'}
3699              in the JFM \texttt{jfm-min.lua}.
3700 %</en>
3701 %<*ja>
3702 このコールバックの使用例は\texttt{ltjarticle}クラスにあり,
3703 \texttt{jfm-min.lua}中の\texttt{'parbdd'}を強制的にクラス0に割り当てている.
3704 %</ja>
3705
3706 %<en>\item[\texttt{luatexja.define\_font} callback]
3707 %<ja>\item[\texttt{luatexja.define\_font}コールバック]
3708 %<zh>\item[\texttt{luatexja.define\_font}回调]
3709 %<*en>
3710 This callback and the next callback form a pair, and you can assign letters which don't have
3711              fixed code points in Unicode to non-zero character classes.
3712 This \texttt{luatexja.define\_font} callback is called just when new Japanese font is loaded.
3713 %</en>
3714 %<*ja>
3715 このコールバックと次のコールバックは組をなしており,Unicode中に固定された文字コード
3716 番号を持たない文字を非零の文字クラスに割り当てることができる.
3717 このコールバックは新しい和文フォントが読み込まれたときに呼び出される.
3718 %</ja>
3719
3720 \begin{lstlisting}[numbers=left]
3721 function (<table> jfont_info, <number> font_number)
3722   return <table> new_jfont_info
3723 end
3724 \end{lstlisting}
3725
3726 %<*en>
3727 You may assume that \verb+jfont_info+ has the following fields:
3728 %</en>
3729 %<*ja>
3730 \verb+jfont_info+ は以下の2フィールドを持つ:
3731 %</ja>
3732 \begin{description}
3733 \item[\tt size\_cache]
3734 %<*ja>
3735 使用されているJFMの情報が格納されているテーブルで,
3736 \textbf{このテーブルを書き換えてはならない}.
3737 中身はほぼJFMファイルに書かれている唯一のテーブルであるが,次のように若干変わっている:
3738 \begin{itemize}
3739 \item 各文字クラス$i$に属する文字達のテーブル
3740 \texttt{[$i$].chars=\{<character>, ...\}}は,トップレベルにまとめられ,
3741 \texttt{chars=\{[<character>]=$i$, ...\}}という形になっている.
3742 \item \texttt{zw},~\texttt{zh}, \texttt{kanjiskip},~\texttt{xkanjiskip} の各フィールドの値は,
3743 実際に使われるフォントサイズに合わせたsp ($1\,\mathrm{sp}=2^{-6}\,\mathrm{pt}$)単位の長さに変わっている.
3744 \item 各文字クラス$i$の情報を格納したテーブルも,\texttt{char\_type} フィールドの下にまとめられている.
3745 例えば,文字クラス1に属する文字の高さは \texttt{char\_type[1].height} で参照できる.
3746 \item \texttt{dir} フィールドはこのテーブルにはない.
3747 \end{itemize}
3748 %</ja>
3749 %<*en>
3750 A table which contains the information of a JFM, and \emph{this table must not be changed}.
3751 The contents of this table are similar to that which is written is the JFM file, but
3752 the following differ:
3753 \begin{itemize}
3754 \item There is a \texttt{chars} table, \dots
3755 \item The value in \texttt{zw},~\texttt{zh}, \texttt{kanjiskip},~\texttt{xkanjiskip} fields are
3756 now scaled by real font size, and in scaled-pont unit.
3757 \item ...
3758 \item There is no \texttt{dir} field in this table.
3759 \end{itemize}
3760 %</en>
3761 %<zh> ...
3762
3763 \item[\tt var]
3764 %<en>The value specified in \texttt{jfmvar=...} at a call of \verb+\jfont+.
3765 %<ja>\verb+\jfont+ の呼び出しの際に\texttt{jfmvar=...}で指定された値.
3766 %<zh>\verb!\jfont!调用的\texttt{jfmvar=...}值。
3767 \end{description}
3768
3769 %<*en>
3770 The returned table \verb+new_jfont_info+ also should include these two fields.
3771 The \verb+font_number+ is a font number.
3772 %</en>
3773 %<*ja>
3774 戻り値の \verb+new_jfont_info+ テーブルもこれら2つのフィールドを含まなければならないが,
3775 それ以外にユーザが勝手にフィールドを付け加えることは自由である.
3776 \verb+font_number+ はフォント番号である.
3777 %</ja>
3778
3779 %<*en>
3780 A good example of this and the next callbacks is the \Pkg{luatexja-otf}
3781              package, supporting \verb+"AJ1-xxx"+ form for Adobe-Japan1
3782              CID characters in a JFM. This callback doesn't replace any
3783              code of \LuaTeX-ja.
3784 %</en>
3785 %<*ja>
3786 これと次のコールバックの良い使用例は\Pkg{luatexja-otf}パッケージであり,
3787 JFM中でAdobe-Japan1 CIDの文字を \verb+"AJ1-xxx"+ の形で指定するために
3788 用いられている.
3789 %</ja>
3790
3791 %<en>\item[\texttt{luatexja.find\_char\_class} callback]
3792 %<ja>\item[\texttt{luatexja.find\_char\_class}コールバック]
3793 %<zh>\item[\texttt{luatexja.find\_char\_class}回调]
3794 %<*en>
3795 This callback is called just when \LuaTeX-ja is trying to determine which
3796              character class a character \verb+chr_code+ belongs.
3797 A function used in this callback should be in the following form:
3798 %</en>
3799 %<*ja>
3800 このコールバックは\LuaTeX-jaが \verb+chr_code+ の文字がどの文字クラスに
3801 属するかを決定しようとする際に呼び出される.
3802 このコールバックで呼び出される関数は次の形をしていなければならない:
3803 %</ja>
3804 \begin{lstlisting}[numbers=left]
3805 function (<number> char_class, <table> jfont_info, <number> chr_code)
3806   if char_class~=0 then return char_class
3807   else
3808     ....
3809     return (<number> new_char_class or 0)
3810   end
3811 end
3812 \end{lstlisting}
3813
3814 %<*en>
3815 The argument \verb+char_class+ is the result of \LuaTeX-ja's default
3816              routine or previous function calls in this callback, hence
3817              this argument may not be 0. Moreover, the returned
3818              \verb+new_char_class+ should be as same as \verb+char_class+ when \verb+char_class+
3819              is not~0, otherwise you will overwrite the \LuaTeX-ja's
3820              default routine.
3821 %</en>
3822 %<*ja>
3823 引数 \verb+char_class+ は\LuaTeX-jaのデフォルトルーチンか,このコールバックの
3824 直前の関数呼び出しの結果を含んでおり,したがってこの値は0ではないかもしれない.
3825 さらに,戻り値の \verb+new_char_class+ は \verb+char_class+ が非零のときには
3826 \verb+char_class+ の値と同じであるべきで,そうでないときは\LuaTeX-jaの
3827 デフォルトルーチンを書き換えることになる.
3828 %</ja>
3829
3830 %<en>\item[\texttt{luatexja.set\_width} callback]
3831 %<ja>\item[\texttt{luatexja.set\_width}コールバック]
3832 %<zh>\item[\texttt{luatexja.set\_width}回调]
3833 %<*en>
3834 This callback is called when \LuaTeX-ja is trying to encapsule a
3835              \textbf{JAchar} \textit{glyph\_node}, to adjust its
3836              dimension and position.
3837 %</en>
3838 %<*ja>
3839 このコールバックは\LuaTeX-jaが\textbf{JAchar}の寸法と位置を調節するために
3840 その\textit{glyph\_node}をカプセル化しようとする際に呼び出される.
3841 %</ja>
3842 \begin{lstlisting}[numbers=left]
3843 function (<table> shift_info, <table> jfont_info, <number> char_class)
3844   return <table> new_shift_info
3845 end
3846 \end{lstlisting}
3847
3848 %<*en>
3849 The argument \verb+shift_info+ and the returned \verb+new_shift_info+ have
3850 \texttt{down} and \texttt{left} fields, which are the amount of shifting
3851              down/left the character in a scaled-point.
3852 %</en>
3853 %<*ja>
3854 引数 \verb+shift_info+ と戻り値の \verb+new_shift_info+ は
3855 \texttt{down}と\texttt{left}のフィールドを持ち,これらの値は
3856 文字の下/左へのシフト量(スケールド・ポイント単位)である.
3857 %</ja>
3858
3859 %<*en>
3860 A good example is \Pkg{test/valign.lua}.
3861 After loading this file, the vertical position of glyphs is automatically
3862 adjusted; the ratio $(\hbox{height}:\hbox{depth})$ of glyphs is adjusted
3863 to be that of letters in the character class~0. For example, suppose that
3864 \begin{itemize}
3865 \item The setting of the JFM: $(\hbox{height})=88x$, $(\hbox{depth})=12x$
3866   (the standard values of Japanese OpenType fonts);
3867 \item The value of the real font: $(\hbox{height})=28y$, $(\hbox{depth})=5y$
3868   (the standard values of Japanese TrueType fonts).
3869 \end{itemize}
3870 Then, the position of glyphs is shifted up by
3871 \[
3872  \frac{88x}{88x+12x} (28y+5y) - 28y = \frac{26}{25}y= 1.04y.
3873 \]
3874 %</en>
3875 %<*ja>
3876 良い例が\Pkg{test/valign.lua}である.このファイルが読み込まれた状態では,
3877              JFM内で規定された文字クラス0の文字における$(\hbox{高
3878              さ}):(\hbox{深さ})$の比になるように,実際のフォントの出力上
3879              下位置が自動調整される.例えば,
3880 \begin{itemize}
3881 \item JFM側の設定:$(\hbox{高さ})=88x$, $(\hbox{深さ})=12x$%
3882 (和文OpenTypeフォントの標準値)
3883 \item 実フォント側の数値:$(\hbox{高さ})=28y$, $(\hbox{深さ})=5y$(和文TrueTypeフォントの標準値)
3884 \end{itemize}
3885 となっていたとする.すると,実際の文字の出力位置は,
3886 \[
3887  \frac{88x}{88x+12x} (28y+5y) - 28y = \frac{26}{25}y= 1.04y.
3888 \]
3889 だけ上にずらされることになる.
3890 %</ja>
3891 \end{list}
3892
3893
3894
3895 %<en>\section{Parameters}
3896 %<ja>\section{パラメータ}
3897 %<zh>\section{参数}
3898 %<en>\subsection{\texttt{\char92 ltjsetparameter} primitive}
3899 %<ja>\subsection{\texttt{\char92 ltjsetparameter}プリミティブ}
3900 %<zh>\subsection{\texttt{\char92 ltjsetparameter}基本参数}
3901
3902 %<*en>
3903 As noted before, \verb+\ltjsetparameter+ and \verb+\ltjgetparameter+ are
3904 primitives for accessing most parameters of \LuaTeX-ja. One of the main
3905 reason that \LuaTeX-ja didn't adopted the syntax similar to that of \pTeX\
3906 (\textit{e.g.},~\verb+\prebreakpenalty`)=10000+)
3907 is the position of \verb+hpack_filter+ callback in the source
3908 of \LuaTeX, see Section~\ref{sec-para}.
3909 %</en>
3910 %<*ja>
3911 先に述べたように,\verb+\ltjsetparameter+ と \verb+\ltjgetparameter+ は
3912 \LuaTeX-jaのほとんどのパラメータにアクセスするためのプリミティブである.
3913 \LuaTeX-jaが\pTeX のような文法(例えば,\verb+\prebreakpenalty`)=10000+)を
3914 採用しない理由の一つは,\LuaTeX のソースにおける \verb+hpack_filter+
3915 コールバックの位置にある.\ref{sec-para}節を参照.
3916 %</ja>
3917
3918 %<*en>
3919 \verb+\ltjsetparameter+ and \verb+\ltjglobalsetparameter+ are primitives
3920 for assigning parameters. These take one argument which is a
3921 \texttt{<key>=<value>} list. Allowed keys are described in the next
3922 subsection.
3923 The difference between
3924 \verb+\ltjsetparameter+ and \verb+\ltjglobalsetparameter+ is only the
3925 scope of assignment;
3926 \verb+\ltjsetparameter+ does a local assignment and
3927 \verb+\ltjglobalsetparameter+ does a global one.
3928 They also obey the value of \verb+\globaldefs+,
3929 like other assignment.
3930 %</en>
3931 %<*ja>
3932 \verb+\ltjsetparameter+ と \verb+\ltjglobalsetparameter+ はパラメータを
3933 指定するためのプリミティブである.これらは\texttt{<key>=<value>}のリストを
3934 引数としてとる.許されるキーは次の節に記述する.
3935 \verb+\ltjsetparameter+ と \verb+\ltjglobalsetparameter+ の違いはスコープの
3936 違いのみである.
3937 \verb+\ltjsetparameter+ はローカルな指定,\verb+\ltjglobalsetparameter+ は
3938 グローバルな指定を行う.
3939 これらは他のパラメータ指定と同様に \verb+\globaldefs+ の値に従う.
3940 %</ja>
3941
3942 %<*en>
3943 \verb+\ltjgetparameter+ is the primitive for acquiring parameters. It
3944 always takes a parameter name as first argument, and also takes the
3945 additional argument---a character code, for example---in some cases.
3946 %</en>
3947 %<*ja>
3948 \verb+\ltjgetparameter+ はパラメータの値を取得するためのプリミティブであり,
3949 常にパラメータの名前を第一引数にとる.
3950 そして,いくつかの場合には加えてさらに引数(例えば文字コード)をとる.
3951 %</ja>
3952 \begin{LTXexample}
3953 \ltjgetparameter{differentjfm},
3954 \ltjgetparameter{autospacing},
3955 \ltjgetparameter{prebreakpenalty}{`)}.
3956 \end{LTXexample}
3957 %<*en>
3958 \emph{The return value of\/ {\normalfont\tt\char92ltjgetparameter} is
3959 always a string}. This is outputted by \texttt{tex.write()}, so any
3960 character other than space~`\texttt{\char32}'~(U+0020) has the category code
3961 12~(other), while the space has 10~(space).
3962 %</en>
3963 %<*ja>
3964 \textbf{{\normalfont\tt\char92ltjgetparameter}の戻り値は常に文字列である.}
3965 これは\texttt{tex.write()}によって出力しているためで,スペース`\texttt{\char32}'~(U+0020)を除いた文字のカテゴリーコードは全て12~(other)となる.
3966 一方,スペースのカテゴリーコードは10~(space)である.
3967 %</ja>
3968
3969 %<en>\subsection{List of Parameters}
3970 %<ja>\subsection{パラメータ一覧}
3971 %<zh>\subsection{参数一览}
3972 \label{ssec-param}
3973
3974 %<*en>
3975 The following is the list of parameters which can be specified by the
3976 \verb+\ltjsetparameter+ command. [\verb+\cs+] indicates the counterpart
3977 in \pTeX, and symbols beside each parameter has the following meaning:
3978 %</en>
3979 %<*ja>
3980 以下は \verb+\ltjsetparameter+ に指定することができるパラメータの一覧である.
3981 [\verb+\cs+]は\pTeX における対応物を示す.
3982 また,それぞれのパラメータの右上にある記号には次の意味がある:
3983 %</ja>
3984 \begin{itemize}
3985 %<*zh>
3986 \item % avoiding from error ``Something's wrong--perhaps a missing \item.''.
3987 %</zh>
3988 %<*en>
3989 \item No mark: values at the end of the paragraph or the hbox are
3990       adopted in the whole paragraph/hbox.
3991 %</en>
3992 %<*ja>
3993 \item 記号なし:段落や水平ボックスの終端での値がその段落/水平ボックス全体で用いられる.
3994 %</ja>
3995 %<*en>
3996 \item `\ast' : local parameters, which can change everywhere inside a paragraph/hbox.
3997 %</en>
3998 %<*ja>
3999 \item `\ast':ローカルなパラメータであり,段落/水平ボックス内のどこででも値を変えることができる.
4000 %</ja>
4001 %<*en>
4002 \item `\dagger': assignments are always global.
4003 %</en>
4004 %<*ja>
4005 \item `\dagger':指定は常にグローバルになる.
4006 %</ja>
4007 \end{itemize}
4008
4009 \begin{list}{}{\def\makelabel{\ttfamily}\def\{{\char`\{}\def\}{\char`\}}\advance\leftmargin1\zw}
4010 \item[\Param{jcharwidowpenalty}\,=<penalty>] [\verb+\jcharwidowpenalty+]
4011 %<*en>
4012 Penalty value for suppressing orphans. This penalty is inserted just
4013              after the last \textbf{JAchar} which is not regarded as a
4014              (Japanese) punctuation mark.
4015 %</en>
4016 %<*ja>
4017 パラグラフの最後の字が孤立して改行されるのを防ぐためのペナルティの値.
4018 このペナルティは(日本語の)句読点として扱われない最後の\textbf{JAchar}の直後に
4019 挿入される.
4020 %</ja>
4021
4022 \item[\Param{kcatcode}\,=\{<chr\_code>,<natural number>\}]\
4023 %<*en>
4024 An additional attributes which each character whose character code is <chr\_code> has.
4025 At the present version, the lowermost bit of <natural number> indicates
4026              whether the character is considered as a punctuation mark
4027              (see the description of \Param{jcharwidowpenalty} above).
4028 %</en>
4029 %<*ja>
4030 文字コードが<chr\_code>の文字が持つ付加的な属性値(attribute).
4031 現在のバージョンでは,<natural number>の最下位ビットが,その文字が句読点と
4032 みなされるかどうかを表している(上の\Param{jcharwidowpenalty}の記述を参照).
4033 %</ja>
4034
4035 \item[\Param{\hypertarget{fld:prebp}{prebreakpenalty}}\,=\{<chr\_code>,<penalty>\}] [\verb+\prebreakpenalty+]\
4036 %<*ja>
4037 文字コード<chr\_code>の\textbf{JAchar}が行頭にくることを抑止するために,
4038              この文字の前に挿入/追加されるペナルティの量を指定する.
4039
4040 例えば閉じ括弧「〗」は絶対に行頭にきてはならないので,
4041 \begin{verbatim}
4042 \ltjsetparameter{prebreakpenalty={`〙,10000}}
4043 \end{verbatim}
4044 と,最大値の10000が標準で指定されている.他にも,小書きのカナなど,絶対禁止とい
4045              うわけではないができれば行頭にはきて欲しくない場合に,0と
4046              10000の間の値を指定するのも有用であろう.
4047 %</ja>
4048
4049 \item[\Param{\hypertarget{fld:postbp}{postbreakpenalty}}\,=\{<chr\_code>,<penalty>\}] [\verb+\postbreakpenalty+]
4050 %<*ja>
4051 文字コード<chr\_code>の\textbf{JAchar}が行末にくることを抑止するために,
4052              この文字の後に挿入/追加されるペナルティの量を指定する.
4053
4054 \pTeX では,\verb+\prebreakpenalty+, \verb+\postbreakpenalty+において,
4055 \begin{itemize}
4056 \item 一つの文字に対して,pre, postどちらか一つしか指定することができなかっ
4057       た(後から指定した方で上書きされる).
4058 \item pre, post合わせて256文字分の情報を格納することしかできなかった.
4059 \end{itemize}
4060 という制限があったが,\LuaTeX-jaではこれらの制限は解消されている.
4061 %</ja>
4062
4063 \item[\Param{jatextfont}\,=\{<jfam>,<jfont\_cs>\}]
4064 %<en>[\verb+\textfont+ in \TeX]
4065 %<ja>[\TeX の \verb+\textfont+]
4066 %<zh>[\TeX 的\verb+\textfont+]
4067 \item[\Param{jascriptfont}\,=\{<jfam>,<jfont\_cs>\}]
4068 %<en>[\verb+\scriptfont+ in \TeX]
4069 %<ja>[\TeX の \verb+\scriptfont+]
4070 %<zh>[\TeX 中的\verb+\scriptfont+]
4071 \item[\Param{jascriptscriptfont}\,=\{<jfam>,<jfont\_cs>\}]
4072 %<en>[\verb+\scriptscriptfont+ in \TeX]
4073 %<ja>[\TeX の \verb+\scriptscriptfont+]
4074 %<zh>[\TeX 中的\verb+\scriptscriptfont+]
4075 \item[\Param{yjabaselineshift}\,=<dimen>$^\ast$]\
4076 \item[\Param{yalbaselineshift}\,=<dimen>$^\ast$] [\verb+\ybaselineshift+]
4077
4078 \item[\Param{jaxspmode}\,=\{<chr\_code>,<mode>\}]
4079
4080 %<*en>
4081 Setting whether inserting \Param{\hyperlink{fld:xks}{xkanjiskip}} is allowed before/after a \textbf{JAchar} whose character code is <chr\_code>.
4082 The followings are allowed for <mode>:
4083 %</en>
4084 %<*ja>
4085 文字コードが<chr\_code>の\textbf{JAchar}の前/後ろに\Param{\hyperlink{fld:xks}{xkanjiskip}}の
4086 挿入を許すかどうかの設定.
4087 以下の<mode>が許される:
4088 %</ja>
4089 \begin{description}
4090 %<en>\item[0, \texttt{inhibit}] Insertion of \Param{\hyperlink{fld:xks}{xkanjiskip}} is inhibited before the character, nor after the character.
4091 %<ja>\item[0, \texttt{inhibit}] \Param{\hyperlink{fld:xks}{xkanjiskip}}の挿入は文字の前/後ろのいずれでも禁止される.
4092 %<zh>\item[0, \texttt{inhibit}] 插入文字前/后的\Param{\hyperlink{fld:xks}{xkanjiskip}}均被禁止。
4093 %<en>\item[1, \texttt{preonly}] Insertion of \Param{\hyperlink{fld:xks}{xkanjiskip}} is allowed before the character, but not after.
4094 %<ja>\item[1, \texttt{preonly}] \Param{\hyperlink{fld:xks}{xkanjiskip}}の挿入は文字の前では許されるが,後ろでは許されない.
4095 %<zh>\item[1, \texttt{preonly}] 文字前允许插入\Param{\hyperlink{fld:xks}{xkanjiskip}},但其后不允许插入。
4096 %<en>\item[2, \texttt{postonly}] Insertion of \Param{\hyperlink{fld:xks}{xkanjiskip}} is allowed after the character, but not before.
4097 %<ja>\item[2, \texttt{postonly}] \Param{\hyperlink{fld:xks}{xkanjiskip}}の挿入は文字の後ろでは許されるが,前では許されない.
4098 %<zh>\item[2, \texttt{postonly}] 文字后允许插入\Param{\hyperlink{fld:xks}{xkanjiskip}},但之前不允许插入。
4099 %<en>\item[3, \texttt{allow}] Insertion of \Param{\hyperlink{fld:xks}{xkanjiskip}} is allowed both before the character and after the character. This is the default value.
4100 %<ja>\item[3, \texttt{allow}] \Param{\hyperlink{fld:xks}{xkanjiskip}}の挿入は文字の前/後ろのいずれでも許される.これがデフォルトの値である.
4101 %<zh>\item[3, \texttt{allow}] 文字前后均可插入\Param{\hyperlink{fld:xks}{xkanjiskip}}。此为默认值。
4102 \end{description}
4103 %<*en>
4104 This parameter is similar to the \verb+\inhibitxspcode+ primitive of \pTeX, but not compatible with \verb+\inhibitxspcode+.
4105 %</en>
4106 %<*ja>
4107 このパラメータは\pTeX の \verb+\inhibitxspcode+ プリミティブと似ているが,
4108 互換性はない.
4109 %</ja>
4110 %<*zh>
4111 此参数类似\pTeX 基本语句\verb!\inhibitxspcode!,但是和\verb!\inhibitxspcode!不兼容。
4112 %</zh>
4113 \item[\Param{alxspmode}\,=\{<chr\_code>,<mode>\}] [\verb+\xspcode+]
4114
4115 %<*en>
4116 Setting whether inserting \Param{\hyperlink{fld:xks}{xkanjiskip}} is allowed before/after a
4117              \textbf{ALchar} whose character code is <chr\_code>.
4118              The followings are allowed for <mode>:
4119 %</en>
4120 %<*ja>
4121 文字コードが<chr\_code>の\textbf{ALchar}の前/後ろに\Param{\hyperlink{fld:xks}{xkanjiskip}}の
4122 挿入を許すかどうかの設定.
4123 以下の<mode>が許される:
4124 %</ja>
4125 \begin{description}
4126 %<en>\item[0, \texttt{inhibit}] Insertion of \Param{\hyperlink{fld:xks}{xkanjiskip}} is inhibited before the character, nor after the character.
4127 %<ja>\item[0, \texttt{inhibit}] \Param{\hyperlink{fld:xks}{xkanjiskip}}の挿入は文字の前/後ろのいずれでも禁止される.
4128 %<zh>\item[0, \texttt{inhibit}] 插入文字前/后的\Param{\hyperlink{fld:xks}{xkanjiskip}}均被禁止。
4129 %<en>\item[1, \texttt{preonly}] Insertion of \Param{\hyperlink{fld:xks}{xkanjiskip}} is allowed before the character, but not after.
4130 %<ja>\item[1, \texttt{preonly}] \Param{\hyperlink{fld:xks}{xkanjiskip}}の挿入は文字の前では許されるが,後ろでは許されない.
4131 %<zh>\item[1, \texttt{preonly}] 文字前允许插入\Param{\hyperlink{fld:xks}{xkanjiskip}},但其后不允许插入。
4132 %<en>\item[2, \texttt{postonly}] Insertion of \Param{\hyperlink{fld:xks}{xkanjiskip}} is allowed after the character, but not before.
4133 %<ja>\item[2, \texttt{postonly}] \Param{\hyperlink{fld:xks}{xkanjiskip}}の挿入は文字の後ろでは許されるが,前では許されない.
4134 %<zh>\item[2, \texttt{postonly}] 文字后允许插入\Param{\hyperlink{fld:xks}{xkanjiskip}},但之前不允许插入。
4135 %<en>\item[3, \texttt{allow}] Insertion of \Param{\hyperlink{fld:xks}{xkanjiskip}} is allowed before the character and after the character. This is the default value.
4136 %<ja>\item[3, \texttt{allow}] \Param{\hyperlink{fld:xks}{xkanjiskip}}の挿入は文字の前/後ろのいずれでも許される.これがデフォルトの値である.
4137 %<zh>\item[3, \texttt{allow}] 文字前后均可插入\Param{\hyperlink{fld:xks}{xkanjiskip}}。此为默认值。
4138 \end{description}
4139 %<*en>
4140 Note that parameters \Param{jaxspmode} and \Param{alxspmode} use a common table, hence these two parameters are synonyms of each other.
4141 %</en>
4142 %<*ja>
4143 \Param{jaxspmode}と\Param{alxspmode}は共通のテーブルを用いているため,
4144 これら2つのパラメータは互いの異名となっていることに注意する.
4145 %</ja>
4146 %<*zh>
4147 注意参数\Param{jaxspmode}和\Param{alxspmode}公用一个表,故这两个参数互为同义语。
4148 %</zh>
4149
4150 \item[\Param{autospacing}\,=<bool>$^\ast$] [\verb+\autospacing+]
4151 \item[\Param{autoxspacing}\,=<bool>$^\ast$] [\verb+\autoxspacing+]
4152 \item[\Param{\hypertarget{fld:kanjiskip}{kanjiskip}}\,=<skip>] [\verb+\kanjiskip+]
4153 %<*ja>
4154 デフォルトで2つの\textbf{JAchar}の間に挿入されるグルーである.
4155 通常では,\pTeX と同じようにフォントサイズに比例して変わることはない.
4156 しかし,自然長が \verb+\maxdimen+ の場合は,例外的に和文フォントのJFM側で指定されている
4157 値を採用(こちらはフォントサイズに比例)することになっている.
4158 %</ja>
4159
4160 \item[\Param{\hypertarget{fld:xks}{xkanjiskip}}\,=<skip>] [\verb+\xkanjiskip+]
4161 %<*ja>
4162 デフォルトで\textbf{JAchar}と\textbf{ALchar}の間に挿入されるグルーである.
4163 \Param{\hyperlink{fld:kanjiskip}{kanjiskip}}と同じように,通常ではフォントサイズに比例して変わることはないが,
4164 自然長が \verb+\maxdimen+ の場合が例外である.
4165 %</ja>
4166
4167
4168 \item[\Param{\hypertarget{fld:diffjfm}{differentjfm}}\,=<mode>$^\dagger$]
4169
4170 %<*en>
4171 Specify how glues/kerns between two \textbf{JAchar}s whose JFM (or size) are different.
4172 The allowed arguments are the followings:
4173 %</en>
4174 %<*ja>
4175 JFM(もしくはサイズ)が異なる2つの\textbf{JAchar}の間にグルー/カーンをどのように
4176 入れるかを指定する.
4177 許される値は以下の通り:
4178 %</ja>
4179 %<*zh>
4180 对于处理不同大小或者JFM的两种\textbf{JAchar}之间的胶/出格。
4181 有下列参数:
4182 %</zh>
4183 \begin{description}
4184 \item[\texttt{average}]
4185 \item[\texttt{both}]
4186 \item[\texttt{large}]
4187 \item[\texttt{small}]
4188 \item[\texttt{pleft}]
4189 \item[\texttt{pright}]
4190 \item[\texttt{paverage}]
4191 \end{description}
4192
4193 \item[\Param{jacharrange}\,=<ranges>$^\ast$]
4194 \item[\Param{kansujichar}\,=\{<digit>, <chr\_code>\}] [\verb+\kansujichar+]
4195 \end{list}
4196
4197
4198 %<en>\section{Other Primitives}
4199 %<ja>\section{その他のプリミティブ}
4200 %<zh>\section{其他基本语句}
4201 %<en>\subsection{Primitives for Compatibility}
4202 %<ja>\subsection{互換プリミティブ}
4203 %<zh>\subsection{基本语句兼容性}
4204
4205 %<*en>
4206 The following primitives are implemented for compatibility with \pTeX.
4207 Note that these primitives don't support JIS~X~0213, but only JIS~X~0208.
4208 %</en>
4209 %<*ja>
4210 以下のプリミティブは\pTeX との互換性のために実装されている:
4211 %</ja>
4212 %<*zh>
4213 下列基本语句的实现与\pTeX 兼容:
4214 %</zh>
4215 \begin{list}{}{\def\makelabel{\ttfamily\char92 }\advance\leftmargin1\zw}
4216 \item[kuten]
4217 \item[jis]
4218 \item[euc]
4219 \item[sjis]
4220 \item[ucs]
4221 \item[kansuji]
4222 \end{list}
4223
4224 %<en>\subsection{\texttt{\char92 inhibitglue} primitive}
4225 %<ja>\subsection{\texttt{\char92 inhibitglue}プリミティブ}
4226 %<zh>\subsection{\texttt{\char92 inhibitglue}基本语句}
4227 %<*en>
4228 The primitive \verb+\inhibitglue+ suppresses the insertion of \textbf{JAglue}.
4229 The following is an example, using a special JFM that there will be a glue between
4230 the beginning of a box and `あ', and also between `あ' and `ウ'.
4231 %</en>
4232 %<*ja>
4233 \verb+\inhibitglue+ プリミティブは\textbf{JAglue}の挿入を抑制する.
4234 以下は,ボックスの始めと`あ'の間,`あ'と`ウ'の間にグルーが入る特別なJFMを用いた例で
4235 ある.
4236 %</ja>
4237 %<*zh>
4238 基本语句\verb!\inhibitglue!会压缩\textbf{JAchar}的插入。
4239 下面的例子使用了特殊的JFM。在一个盒子和“あ”之间,以及“あ”和“ウ”之间存在胶。
4240 %</zh>
4241
4242 \begin{LTXexample}
4243 \jfont\g=psft:Ryumin-Light:jfm=test \g
4244 \fbox{\hbox{あウあ\inhibitglue ウ}}
4245 \inhibitglue\par\noindent あ1
4246 \par\inhibitglue\noindent あ2
4247 \par\noindent\inhibitglue あ3
4248 \par\hrule\noindent あoff\inhibitglue ice
4249 \end{LTXexample}
4250
4251 %<*en>
4252 With the help of this example, we remark the specification of \verb+\inhibitglue+:
4253 %</en>
4254 %<*ja>
4255 この例を援用して,\verb+\inhibitglue+ の仕様について述べる.
4256 %</ja>
4257 %<*zh>
4258 如上例子,我们注意到\verb!\inhibtglue!的用法。
4259 %</zh>
4260 \begin{itemize}
4261 %<*zh>
4262 \item
4263 %</zh>
4264 %<*en>
4265 \item The call of \verb+\inhibitglue+ in the (internal) vertical mode is
4266       simply ignored.
4267 %</en>
4268 %<*ja>
4269 \item \verb+\inhibitglue+ の垂直モード中での呼び出しは意味を持たない.
4270 4行目の入力で有効にならないのは,\verb+\inhibitglue+ の時点では垂直モードであり,
4271 \verb+\noindent+ の時点で水平モードになるからである.
4272 %</ja>
4273
4274 %<*en>
4275 \item The call of \verb+\inhibitglue+ in the (restricted) horizontal
4276       mode is only effective on the spot; does not get over boundary of
4277       paragraphs. Moreover, \verb+\inhibitglue+ cancels ligatures and
4278       kernings, as shown in the last line of above example.
4279 %</en>
4280 %<*ja>
4281 \item \verb+\inhibitglue+ の(制限された)水平モード中での呼び出しはその場でのみ
4282   有効であり,段落の境界を乗り越えない.
4283   さらに,\verb+\inhibitglue+ は上の例の最終行のように(欧文における)リガチャとカーニングを
4284   打ち消す.これは,\verb+\inhibitglue+ が内部的には「現在のリスト中にwhatsitノードを
4285   追加する」ことを行なっているからである.
4286 %</ja>
4287
4288 %<*en>
4289 \item The call of \verb+\inhibitglue+ in math mode is just ignored.
4290 %</en>
4291 %<*ja>
4292 \item \verb+\inhibitglue+ を数式モード中で呼び出した場合はただ無視される.
4293 %</ja>
4294 \end{itemize}
4295
4296 %<en>\section{Control Sequences for \LaTeXe}
4297 %<ja>\section{\LaTeXe 用のコントロールシーケンス}
4298 %<zh>\section{\LaTeXe 下使用的控制序列}
4299
4300 %<en>\subsection{Patch for NFSS2}
4301 %<ja>\subsection{NFSS2へのパッチ}
4302 %<zh>\subsection{NFSS2补丁}
4303 \label{ssub-nfsspat}
4304
4305 %<*en>
4306 As described in Subsection~\ref{ssec-ltx}, \LuaTeX-ja simply adopted
4307 \texttt{plfonts.dtx} in \pLaTeXe\ for the Japanese patch for NFSS2.
4308 For an convenience, we will describe
4309 commands which are not described in Subsection~\ref{ssub-chgfnt}.
4310 %</en>
4311 %<*ja>
4312 \ref{ssec-ltx}節で述べたように,\LuaTeX-jaはNFSS2への日本語パッチである
4313 \pLaTeXe の\texttt{plfonts.dtx}を単純に取り入れている.
4314 便宜のため,ここでは\ref{ssub-chgfnt}節で述べていなかったコマンドについて
4315 記述しておく.
4316 %</ja>
4317
4318 \begin{cslist}%
4319 \item[DeclareYokoKanjiEncoding\{<encoding>\}\{<text-settings>\}\{<math-settings>\}]
4320
4321 %<*en>
4322 In NFSS2 under \LuaTeX-ja, distinction between alphabetic font families
4323              and Japanese font families are only made by their
4324              encodings. For example, encodings OT1 and T1 are for
4325              alphabetic font families, and a Japanese font family cannot
4326              have these encodings. This command defines a new encoding
4327              scheme for Japanese font family (in horizontal direction).
4328 %</en>
4329 %<*ja>
4330 \LuaTeX-jaのNFSS2においては,欧文フォントファミリと和文フォントファミリは
4331 そのエンコーディングからのみ作られる.
4332 例えば,OT1とT1のエンコーディングは欧文フォントファミリに対するものであり,
4333 和文フォントファミリはこれらのエンコーディングを持つことはできない.
4334 このコマンドは和文フォントファミリ(横書き用)のための新しいエンコーディングを
4335 定義する.
4336 %</ja>
4337
4338 \item[DeclareKanjiEncodingDefaults\{<text-settings>\}\{<math-settings>\}]
4339 \item[DeclareKanjiSubstitution\{<encoding>\}\{<family>\}\{<series>\}\{<shape>\}]
4340 \item[DeclareErrorKanjiFont\{<encoding>\}\{<family>\}\{<series>\}\{<shape>\}\{<size>\}]
4341
4342 %<*en>
4343 The above 3~commands are just the counterparts for \verb+DeclareFontEncodingDefaults+ and~others.
4344 %</en>
4345 %<*ja>
4346 上記3つのコマンドはちょうど \verb+DeclareFontEncodingDefaults+ などに対応するものである.
4347 %</ja>
4348
4349 \item[reDeclareMathAlphabet\{<unified-cmd>\}\{<al-cmd>\}\{<ja-cmd>\}]
4350
4351 % ToDo: en
4352 %<*ja>
4353 和文・欧文の数式用フォントファミリを一度に変更する命令を作成する.
4354 具体的には,欧文数式用フォントファミリ変更の命令<al-cmd>(\verb+\mathrm+ 等)と,和文数式用フォ
4355              ントファミリ変更の命令<ja-cmd>(\verb+\mathmc+ 等)の2つを同時に行う命令として
4356              <unified-cmd>を(再)定義する.実際の使用では<unified-cmd>と
4357              <al-cmd>に同じものを指定する,すなわち,<al-cmd>で和文側も変
4358              更させるようにするのが一般的と思われる.
4359
4360 {\let\item=\origitem
4361 本命令は
4362 \begin{center}\tt
4363 <unified-cmd>\{<arg>\}\quad$\longrightarrow$\quad
4364 (<al-cmd>を1段展開したもの)\{<ja-cmd>を1段展開したもの)\{<arg>\}\}
4365 \end{center}
4366 と定義を行うので,使用には注意が必要である:
4367 \begin{itemize}
4368 \item <al-cmd>,~<ja-cmd>は既に定義されていなければならない.\verb+\reDeclareMathAlphabet+後に
4369 両命令の内容を再定義しても,<unified-cmd>の内容にそれは反映されない.
4370 \item <al-cmd>,~<ja-cmd>に\verb+\@mathrm+などと\texttt{@}をつけた命令を指定した時の動作は保証できない.
4371 \end{itemize}}
4372 %</ja>
4373
4374 \item[DeclareRelationFont\{<ja-encoding>\}\{<ja-family>\}\{<ja-series>\}\{<ja-shape>\}\\
4375   \hfill\{<al-encoding>\}\{<al-family>\}\{<al-series>\}\{<al-shape>\}]
4376 %<*en>
4377 This command sets the `accompanied' alphabetic font family (given by the latter 4~arguments)
4378 with respect to a Japanese font family given by the former 4~arguments.
4379 %</en>
4380 %<*ja>
4381 いわゆる「従属欧文」を設定するための命令である.前半の4引数で表される和文フォントファミリに対して,
4382 そのフォントに対応する「従属欧文」フォントファミリを後半の4引数により与える.
4383 %</ja>
4384 \item[SetRelationFont]
4385 %<*en>
4386 This command is almost same as \verb+\DeclareRelationFont+, except that this command does a local
4387 assignment, where \verb+\DeclareRelationFont+ does a global assignment.
4388 %</en>
4389 %<*ja>
4390 このコマンドは \verb+\DeclareRelationFont+ とローカルな指定であることを除いて
4391 ほとんど同じである(\verb+\DeclareRelationFont+ はグローバル).
4392 %</ja>
4393
4394 \item[userelfont]
4395 %<*en>
4396 Change current alphabetic font encoding/family/\dots\ to the `accompanied' alphabetic
4397              font family with respect to current Japanese font family,
4398              which was set by
4399              \verb+\DeclareRelationFont+ or \verb+\SetRelationFont+.
4400 Like \verb+\fontfamily+, \verb+\selectfont+ is required to take an effect.
4401 %</en>
4402 %<*ja>
4403 現在の欧文フォントエンコーディング/ファミリ/…… を,
4404 \verb+\DeclareRelationFont+ か \verb+\SetRelationFont+ で指定された
4405 現在の和文フォントファミリに対応する「従属欧文」フォントファミリに変更する.
4406 \verb+\fontfamily+ のように,有効にするためには \verb+\selectfont+ が必要である.
4407 %</ja>
4408
4409 \item[adjustbaseline]
4410 \ldots
4411
4412 \item[fontfamily\{<family>\}]
4413 {\let\item\origitem
4414 %<*en>
4415 As in \LaTeXe, this command changes current font family (alphabetic, Japanese,~\emph{or both})
4416 to <family>. Which family will be changed is determined as follows:
4417 %</en>
4418 %<*ja>
4419 元々の\LaTeXe におけるものと同様に,このコマンドは現在のフォントファミリ(欧文,
4420 和文,\textbf{もしくは両方})を<family>に変更する.
4421 どのファミリが変更されるかは以下のようにして決定される:
4422 %</ja>
4423 \begin{itemize}
4424 %<*zh>
4425 \item
4426 %</zh>
4427 %<*en>
4428 \item Let current encoding scheme for Japanese fonts be
4429       <ja-enc>. Current Japanese font family will be changed to
4430       <family>, if one of the following two conditions is met:
4431 %</en>
4432 %<*ja>
4433 \item 現在の和文フォントに対するエンコーディングが<ja-enc>であるとしよう.
4434   現在の和文フォントファミリは,以下の2つの条件のうちの1つが満たされているときに
4435   <family>に変更される:
4436 %</ja>
4437 \begin{itemize}
4438 %<*en>
4439 \item The family <fam> under the encoding <ja-enc> has been already defined by
4440       \verb+\DeclareKanijFamily+.
4441 %</en>
4442 %<*ja>
4443 \item エンコーディング<ja-enc>におけるファミリ<fam>が既に \verb+\DeclareKanjiFamily+ によって定義されている.
4444 %</ja>
4445 %<*en>
4446 \item A font definition named \texttt{<enc><ja-enc>.fd} (the file name is
4447       all lowercase) exists.
4448 %</en>
4449 %<*zh>
4450 \item
4451 %</zh>
4452 %<*ja>
4453 \item フォント定義ファイル\texttt{<enc><ja-enc>.fd}(ファイル名は全て小文字)が存在する.
4454 %</ja>
4455 \end{itemize}
4456 %<*en>
4457 \item Let current encoding scheme for alphabetic fonts be
4458       <al-enc>. For alphabetic font family, the criterion as above is used.
4459 %</en>
4460 %<*ja>
4461 \item 現在の欧文フォントに対するエンコーディングを<al-enc>とする.
4462   欧文フォントファミリに対しても,上記の基準が用いられる.
4463 %</ja>
4464 %<*en>
4465 \item There is a case which none of the above applies, that is, the font
4466       family named <family> doesn't seem to be defined neither under the
4467       encoding <ja-enc>, nor under <al-enc>.
4468 In this case, the default family for font substitution is used for
4469       alphabetic and Japanese fonts. Note that current encoding will not
4470       be set to <family>, unlike the original implementation in \LaTeX.
4471 %</en>
4472 %<*ja>
4473 \item 上記のいずれもが適用されない,つまり<family>が<ja-enc>と<al-enc>の
4474   どちらでも定義されないような場合がある.
4475   この場合,代替フォントに用いられるデフォルトのフォントファミリが欧文フォントと
4476   和文フォントに用いられる.\LaTeX のオリジナルの実装とは異なり,
4477   現在のエンコーディングは<family>には設定されないことに注意する.
4478 %</ja>
4479 \end{itemize}
4480 }
4481 \end{cslist}
4482
4483 %<*en>
4484 As closing this subsection, we shall introduce an example of
4485 \verb+\SetRelationFont+ and \verb+\userelfont+:
4486 %</en>
4487 %<*ja>
4488 この節の終わりに,\verb+\SetRelationFont+ と \verb+\userelfont+ の例を
4489 紹介しておこう.\verb+\userelfont+ の使用によって,「abc」の部分のフォントが
4490 Avant Garde (OT1/pag/m/n) に変わっていることがわかる.
4491 %</ja>
4492 \begin{LTXexample}
4493 \kanjifamily{gt}\selectfont あいうxyz
4494 \SetRelationFont{JY3}{gt}{m}{n}{OT1}{pag}{m}{n}
4495 \userelfont\selectfont あいうabc
4496 \end{LTXexample}
4497
4498 %<en>\section{Extensions}
4499 %<ja>\section{拡張}
4500 \subsection{\texttt{luatexja-fontspec.sty}}
4501
4502 %<*en>
4503 As described in Subsection~\ref{ssec-fontspec}, this optional package
4504 provides the counterparts for several commands defined in the
4505 \Pkg{fontspec} package.
4506 In addition to `font features' in the original \Pkg{fontspec},
4507 the following `font features' specifications are allowed for
4508 the commands of Japanese version:
4509 %</en>
4510 %<*ja>
4511 \ref{ssec-fontspec}節で述べたように,この追加パッケージは\Pkg{fontspec}
4512 パッケージで定義されているコマンドに対応する和文フォント用のコマンドを提供する.
4513 オリジナルの\Pkg{fontspec}での`font feature'に加えて,和文版のコマンドには
4514 以下の`font feature'を指定することができる:
4515 %</ja>
4516
4517
4518 \begin{list}{}{\def\makelabel{\ttfamily}\def\{{\char`\{}\def\}{\char`\}}\advance\leftmargin1\zw}
4519 \item[CID=<name>]
4520 \item[JFM=<name>]
4521 \item[JFM-var=<name>] \
4522
4523 %<*en>
4524 These 3 font features correspond to \texttt{cid}, \texttt{jfm} and
4525 \texttt{jfmvar} keys for \verb+\jfont+ primitive, respectively.
4526 \texttt{CID} is effective only when with \texttt{NoEmbed}
4527 described below.
4528 See Subsections~\ref{ssec-jfont} and \ref{ssec-psft} for details.
4529 %</en>
4530 %<*ja>
4531 これら3つのキーはそれぞれ \verb+\jfont+ プリミティブに対する
4532 \texttt{cid}, \texttt{jfm}, \texttt{jfmvar}キーとそれぞれ対応する.
4533 \texttt{CID} は下の \texttt{NoEmbed} と合わせて用いられたときのみ有効である.
4534 \verb+\jfont+ プリミティブに対する
4535 \texttt{cid}, \texttt{jfm}, \texttt{jfmvar}キーの詳細は\ref{ssec-jfont}節
4536              と\ref{ssec-psft}節を参照.
4537 %</ja>
4538
4539 \item[NoEmbed]
4540 %<*en>
4541 By specifying this font feature, one can use `name-only' Japanese font which
4542 will not be embedded in the output PDF file. See Subsection~\ref{ssec-psft}.
4543 %</en>
4544 %<*ja>
4545 これを指定することで,PDFに埋め込まれない「名前だけ」のフォントを指定することが
4546 できる.\ref{ssec-psft}節を参照.
4547 %</ja>
4548 \end{list}
4549
4550 \subsection{\texttt{luatexja-otf.sty}}
4551
4552 %<*en>
4553 This optional package supports typesetting characters in
4554 Adobe-Japan1. \texttt{luatexja-otf.sty} offers the following 2~low-level
4555 commands:
4556 %</en>
4557 %<*ja>
4558 この追加パッケージはAdobe-Japan1の文字の出力をサポートする.
4559 \texttt{luatexja-otf.sty}は以下の2つの低レベルコマンドを提供する:
4560 %</ja>
4561 \begin{list}{}{\def\makelabel{\ttfamily}\def\{{\char`\{}\def\}{\char`\}}\advance\leftmargin1\zw}
4562 \item[\char92CID\{<number>\}]
4563 %<*en>
4564 Typeset a character whose CID number is <number>.
4565 %</en>
4566 %<*ja>
4567 CID番号が<number>の文字を出力する.
4568 %</ja>
4569
4570 \item[\char92UTF\{<hex\_number>\}]
4571 %<*en>
4572 Typeset a character whose character code is <hex\_number> (in hexadecimal).
4573 This command is similar to \verb+\char"+<hex\_number>,\ %"
4574 but please remind remarks below.
4575 %</en>
4576 %<*ja>
4577 文字コードが(16進で)<hex\_number>の文字を出力する.
4578 このコマンドは \verb+\char"+<hex\_number>と似ているが,下の記述に注意すること.%"
4579 %</ja>
4580 \end{list}
4581
4582 %<en>\paragraph{Remarks}
4583 %<ja>\paragraph{注意}
4584 %<*en>
4585 Characters by \verb+\CID+ and \verb+\UTF+ commands are different from
4586 ordinary characters in the following points:
4587 %</en>
4588 %<*ja>
4589 \verb+\CID+ と \verb+\UTF+ コマンドによって出力される文字は
4590 以下の点で通常の文字と異なる:
4591 %</ja>
4592 \begin{itemize}
4593 %<*zh>
4594 \item
4595 %</zh>
4596 %<*en>
4597 \item Always treated as \textbf{JAchar}s.
4598 %</en>
4599 %<*ja>
4600 \item 常に\textbf{JAchar}として扱われる.
4601 %</ja>
4602 %<*en>
4603 \item Processing codes for supporting OpenType features (\textit{e.g.},
4604       glyph replacement and kerning) by the \Pkg{luaotfload} package
4605       is not performed to these characters.
4606 %</en>
4607 %<*ja>
4608 \item OpenType feature(例えばグリフ置換やカーニング)をサポートするための
4609   \Pkg{luaotfload}パッケージのコードはこれらの文字には働かない.
4610 %</ja>
4611 \end{itemize}
4612
4613
4614 %<en>\paragraph{Additional Syntax of JFM}
4615 %<ja>\paragraph{JFMへの記法の追加}
4616
4617 %<*en>
4618 \texttt{luatexja-otf.sty} extends the syntax of JFM; the entries of \texttt{
4619 chars} table in JFM now allows a string in the form
4620 \verb+'AJ1-xxx'+, which stands for the character
4621 whose CID number in Adobe-Japan1 is \verb+xxx+.
4622 %</en>
4623 %<*ja>
4624 \texttt{luatexja-otf.sty}はJFMの記法を拡張する.
4625 JFMの\texttt{chars}テーブルのエントリとして \verb+'AJ1-xxx'+ の形の文字列が
4626 使えるようになる.これはAdobe-Japan1におけるCID番号が \verb+xxx+ の文字を表す.
4627 %</ja>
4628
4629 \subsection{\texttt{luatexja-adjust.sty}}
4630 \label{ssec-adj}
4631 \begin{figure}[t]
4632 \def\sq{%
4633   \hbox to 1\zw{\hss\fboxsep=-.5\fboxrule\fbox{%
4634    \hskip\dimexpr-.5\zw-.2pt\vrule width.4pt height.08\zw depth.12\zw%
4635   \hskip\dimexpr.5\zw-.2pt\relax}\hss}}
4636 \def\sb{\hbox to 1\zw{\hss\fboxsep=-.5\fboxrule\fbox{%
4637   ■\hskip\dimexpr-.5\zw-.2pt\vrule width.4pt height.08\zw depth.12\zw%
4638   \hskip\dimexpr.5\zw-.2pt\relax}\hss}}
4639 \newbox\gridbox
4640 \def\outbox#1{{\Large%
4641   \ltjsetparameter{kanjiskip=0pt plus .2\zw minus .2\zw}%
4642   \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}%
4643   \hbox{\textcolor{cyan!50!white}{\copy\gridbox}\hskip-20\zw%
4644   \vbox{\hsize=20\zw\noindent\leftskip0pt\rightskip0pt\parfillskip0pt#1}\vrule}%
4645 }}
4646
4647 {\centering
4648 \begin{tabular}{lc}
4649 \toprule
4650 no adjustment&\outbox{以上の原理は,「包除原理」とよく呼ばれるが\hskip-.5\zw\null}\\
4651 without priority&%
4652 \ltjdisableadjust
4653 \outbox{以上の原理は,「包除原理」とよく呼ばれるが}%
4654 \ltjenableadjust\\
4655 with priority&%
4656 \outbox{以上の原理は,「包除原理」とよく呼ばれるが}
4657 %<!ja>\ltjdisableadjust
4658 \\
4659 \bottomrule
4660 \end{tabular}\par}
4661 \smallskip
4662
4663 Note: the value of 
4664 \Param{\hyperlink{fld:kanjiskip}{kanjiskip}} is 0\,pt${}^{+1/5\,\mathrm{em}}_{-1/5\,\mathrm{em}}$ in this figure,
4665 for making the difference obvious.
4666 %<ja>\caption{行長調整}\label{fig-adj}
4667 %<en>\caption{Line adjustment}\label{fig-adj}
4668 \end{figure}
4669
4670
4671 %<*en>
4672 ...
4673 %</en>
4674 %<*ja>
4675 \pTeX では,行長調整において優先度の概念が存在しなかったため,図
4676 \ref{fig-adj}上段における半角分の半端は,図\ref{fig-adj}中段のように,鍵
4677 括弧周辺の空白と和文間空白(\Param{\hyperlink{fld:kanjiskip}{kanjiskip}})の両方によって負担される.し
4678 かし,「日本語組版処理の要件」\cite{jlreq}やJIS~X~4051~\cite{x4051}におい
4679 ては,このような状況では半端は鍵括弧周辺の空白のみで負担し,その他の和文
4680 文字はベタ組で組まれる(図\ref{fig-adj}下段)ことになっている.この追加
4681 パッケージは\cite{jlreq}や\cite{x4051}における規定のような,優先順位付き
4682 の行長調整を提供する.詳細な仕様については\ref{sec-adjspec}を参照.
4683
4684
4685 \texttt{luatexja-adjust.sty}は,以下の命令を提供する.これらはすべてグローバルに効力を発揮する.
4686
4687 \begin{list}{}{\def\makelabel{\ttfamily}\def\{{\char`\{}\def\}{\char`\}}\advance\leftmargin1\zw}
4688 \item[\char92ltjdisableadjust]
4689 優先順位付きの行長調整を無効化する.
4690
4691 \item[\char92ltjenableadjust]
4692 優先順位付きの行長調整を有効化する.
4693
4694 \item[優先度設定……]
4695
4696 \end{list}
4697
4698
4699
4700
4701
4702 %</ja>
4703
4704
4705
4706 %<en>\part{Implementations}
4707 %<ja>\part{実装}
4708 \label{part-imp}
4709 %<en>\section{Storing Parameters}
4710 %<ja>\section{パラメータの保持}
4711 \label{sec-para}
4712 %<en>\subsection{Used Dimensions, Attributes and whatsit nodes}
4713 %<ja>\subsection{\LuaTeX-jaで用いられる寸法レジスタ,属性レジスタ,whatsitノード}
4714
4715 %<*en>
4716 Here the following is the list of dimensions and attributes which are used in \LuaTeX-ja.
4717 %</en>
4718 %<*ja>
4719 以下は\LuaTeX-jaで用いられる寸法レジスタ(dimension),属性レジスタ(attribute)の
4720 リストである.
4721 %</ja>
4722 \begin{list}{}{%
4723 \def\makelabel{\ttfamily}\advance\leftmargin1\zw
4724 \def\dim#1{\item[\char92 #1\ \textrm{(dimension)}]}
4725 \def\attr#1{\item[\char92 #1\ \textrm{(attribute)}]}
4726 }
4727
4728 \dim{jQ}
4729 %<*en>
4730 \verb+\jQ+ is equal to
4731                         $1\,\textrm{Q}=0.25\,\textrm{mm}$, where `Q'~(also called `級') is
4732                         a unit used in Japanese phototypesetting. So one should not change the value of this dimension.
4733 %</en>
4734 %<*ja>
4735 \verb+\jQ+ は$1\,\textrm{Q}=0.25\,\textrm{mm}$
4736 と等しい.ここで,`Q'(もしくは「級」)は日本の写植で用いられる単位である.したがって,
4737 この寸法レジスタの値を変更してはならない.
4738 %</ja>
4739
4740 \dim{jH}
4741 %<*en>
4742 There is also a unit called `歯' which equals to $0.25\,\textrm{mm}$ and
4743                         used in Japanese phototypesetting. This
4744                         \verb+\jH+ is a synonym of \verb+\jQ+.
4745 %</en>
4746 %<*ja>
4747 同じく写植で用いられていた単位として「歯」があり,これも$0.25\,\textrm{mm}$と
4748 等しい.\verb+\jH+ は \verb+\jQ+ の別名である.
4749 %</ja>
4750
4751 \dim{ltj@zw}
4752 %<*en>
4753 A temporal register for the `full-width' of current Japanese font.
4754 %</en>
4755 %<*ja>
4756 現在の和文フォントの「全角幅」を保持する一時レジスタ.
4757 %</ja>
4758
4759 \dim{ltj@zh}
4760 %<*en>
4761 A temporal register for the `full-height' (usually the sum of height of imaginary body and its depth) of current Japanese font.
4762 %</en>
4763 %<*ja>
4764 現在の和文フォントの「全角高さ」(通常,高さと深さの和)を保持する一時レジスタ.
4765 %</ja>
4766
4767 \attr{jfam}
4768 %<*en>
4769 Current number of Japanese font family for math formulas.
4770 %</en>
4771 %<*ja>
4772 数式用の和文フォントファミリの現在の番号.
4773 %</ja>
4774
4775 \attr{ltj@curjfnt}
4776 %<*en>
4777 The font index of current Japanese font.
4778 %</en>
4779 %<*ja>
4780 現在の和文フォントのフォント番号.
4781 %</ja>
4782
4783 \attr{ltj@charclass}
4784 %<*en>
4785 The character class of Japanese \textit{glyph\_node}.
4786 %</en>
4787 %<*ja>
4788 和文文字の\textit{glyph\_node}の文字クラス.
4789 %</ja>
4790
4791 \attr{ltj@yablshift}
4792 %<*en>
4793 The amount of shifting the baseline of alphabetic fonts in scaled point ($2^{-16}\,\textrm{pt}$).
4794 %</en>
4795 %<*ja>
4796 スケールド・ポイント($2^{-16}\,\textrm{pt}$)を単位とした欧文フォントのベースラインの移動量.
4797 %</ja>
4798
4799 \attr{ltj@ykblshift}
4800 %<*en>
4801 The amount of shifting the baseline of Japanese fonts in scaled point ($2^{-16}\,\textrm{pt}$).
4802 %</en>
4803 %<*ja>
4804 スケールド・ポイント($2^{-16}\,\textrm{pt}$)を単位とした和文フォントのベースラインの移動量.
4805 %</ja>
4806
4807 \attr{ltj@autospc}
4808 %<*en>
4809 Whether the auto insertion of \Param{\hyperlink{fld:kanjiskip}{kanjiskip}} is allowed at the node.
4810 %</en>
4811 %<*ja>
4812 そのノードで\Param{\hyperlink{fld:kanjiskip}{kanjiskip}}の自動挿入が許されるかどうか.
4813 %</ja>
4814
4815 \attr{ltj@autoxspc}
4816 %<*en>
4817 Whether the auto insertion of \Param{\hyperlink{fld:xks}{xkanjiskip}} is allowed at the node.
4818 %</en>
4819 %<*ja>
4820 そのノードで\Param{\hyperlink{fld:xks}{xkanjiskip}}の自動挿入が許されるかどうか.
4821 %</ja>
4822
4823 \attr{ltj@icflag}
4824 %<*en>
4825 An attribute for distinguishing `kinds' of a node. One of the following value is
4826 assigned to this attribute:
4827 %</en>
4828 %<*ja>
4829 ノードの「種類」を区別するための属性.以下のうちのひとつが値として割り当てられる:
4830 %</ja>
4831 \begin{description}
4832 \item[\textit{italic} (1)]
4833 %<*en>
4834 Glues from an italic correction
4835            (\verb+\/+). This distinction of origins of glues
4836            (from explicit \verb+\kern+, or from \verb+\/+)
4837            is needed in the insertion process of \Param{\hyperlink{fld:xks}{xkanjiskip}}.
4838 %</en>
4839 %<*ja>
4840 イタリック補正(\verb+\/+)によるグルー.このグルーの由来の区別(\verb+\kern+ か
4841 \verb+\/+ か)は\Param{\hyperlink{fld:xks}{xkanjiskip}}の挿入過程において必要になる.
4842 %</ja>
4843
4844 \item[\textit{packed} (2)]
4845
4846 \item[\textit{kinsoku} (3)]
4847 %<*en>
4848 Penalties inserted for the word-wrapping process of Japanese characters (\emph{kinsoku}).
4849 %</en>
4850 %<*ja>
4851 和文文字のワードラップ過程において挿入されたペナルティ(\emph{kinsoku}).
4852 %</ja>
4853
4854 \item[\textit{from\_jfm} (6)]
4855 %<*en>
4856 Glues/kerns from JFM.
4857 %</en>
4858 %<*ja>
4859 JFM由来のグルー/カーン.
4860 %</ja>
4861
4862 %%\item[\textit{line\_end} (5)]
4863 %%%<*en>
4864 %%Kerns for \ldots
4865 %%%</en>
4866 %%%<*ja>
4867 %%和文文字が行末にきたとき,行末との間に挿入されるカーンである.
4868 %%% ぶら下げ組への応用
4869 %%%</ja>
4870
4871 \item[\textit{kanji\_skip} (9)]
4872 %<*en>
4873 Glues for \Param{\hyperlink{fld:kanjiskip}{kanjiskip}}.
4874 %</en>
4875 %<*ja>
4876 \Param{\hyperlink{fld:kanjiskip}{kanjiskip}}のグルー.
4877 %</ja>
4878
4879 \item[\textit{xkanji\_skip} (10)]
4880 %<*en>
4881 Glues for \Param{\hyperlink{fld:xks}{xkanjiskip}}.
4882 %</en>
4883 %<*ja>
4884 \Param{\hyperlink{fld:xks}{xkanjiskip}}のグルー.
4885 %</ja>
4886
4887 \item[\textit{processed} (11)]
4888 %<*en>
4889 Nodes which is already processed by \ldots.
4890 %</en>
4891 %<*ja>
4892 \LuaTeX-ja の内部処理によって既に処理されたノード.
4893 %</ja>
4894
4895 \item[\textit{ic\_processed} (12)]
4896 %<*en>
4897 Glues from an italic correction, but also already processed.
4898 %</en>
4899 %<*ja>
4900 イタリック補正に由来するグルーであるが,まだ処理されていないもの.
4901 %</ja>
4902
4903 \item[\textit{boxbdd} (15)]
4904 %<*en>
4905 Glues/kerns that inserted just the beginning or the ending of an hbox or a paragraph.
4906 %</en>
4907 %<*ja>
4908 ある水平ボックスか段落の最初か最後に挿入されたグルー/カーン.
4909 %</ja>
4910 \end{description}
4911
4912 \attr{ltj@kcat$i$}
4913 %<*en>
4914 Where $i$~is a natural number which is less than~7.
4915 These 7~attributes store bit~vectors indicating which character block is regarded as a block of \textbf{JAchar}s.
4916 %</en>
4917 %<*ja>
4918 $i$は7より小さい自然数.
4919 これら7つの属性レジスタは,どの文字ブロックが\textbf{JAchar}のブロックとして
4920 扱われるかを示すビットベクトルを格納する.
4921 %</ja>
4922 \end{list}
4923
4924 %<*en>
4925 Furthermore, \LuaTeX-ja uses several `user-defined' whatsit nodes for
4926 inrernal processing. All those nodes store a natural number (hence the node's
4927 \texttt{type} is 100). The following \verb+user_id+s are used:
4928 %</en>
4929 %<*ja>
4930 さらに,\LuaTeX-jaはいくつかの「ユーザ定義の」whatsit ノードを内部処理に用いる.
4931 これらの全てのノードは自然数を格納している(したがってノードの\texttt{type}は
4932 100である).次の \verb+user_id+ が使用される:
4933 %</ja>
4934 \begin{description}
4935 \item[30111]
4936 %<*en>
4937 Nodes for indicating that \verb+\inhibitglue+ is
4938            specified. The \texttt{value} field of these nodes doesn't matter.
4939 %</en>
4940 %<*ja>
4941 \verb+\inhibitglue+ が指定されたことを示すノード.これらのノードの
4942 \texttt{value}フィールドは意味を持たない.
4943 %</ja>
4944
4945 \item[30112]
4946 %<*en>
4947 Nodes for \LuaTeX-ja's stack system (see the next
4948            subsection). The \texttt{value} field of these nodes is
4949            current group.
4950 %</en>
4951 %<*ja>
4952 \LuaTeX-jaのスタックシステム(次の節を参照)のためのノード.
4953 これらのノードの\texttt{value}フィールドは現在のグループを表す.
4954 %</ja>
4955
4956 \item[30113]
4957 %<*en>
4958 Nodes for Japanese Characters which the callback process of
4959            \Pkg{luaotfload} won't be applied, and the character code is
4960            stored in the \texttt{value} field. Each node having this
4961            \verb+user_id+ is converted to a `glyph\_node' \emph{after}
4962            the callback process of luaotfload.
4963            This \verb+user_id+ is only used by the \Pkg{luatexja-otf} package.
4964 %</en>
4965 %<*ja>
4966 \Pkg{luaotfload}のコールバックによる処理が適用されない和文文字のためのノードで,
4967 \texttt{value}フィールドにその文字のコードが格納されている.
4968 この \verb+user_id+ を持つノードはそれぞれが\Pkg{luaotfload}のコールバックの処理の
4969 \textbf{後で}`glyph\_node'に変換される.この \verb+user_id+ は %
4970 \Pkg{luatexja-otf} パッケージでのみ使用される.
4971 %</ja>
4972
4973 \item[30114]
4974 Nodes for indicating beginning of a paragraph.
4975 A paragraph which is started by \verb+\item+ in list-like environments has a horizontal box
4976 for its label before the actual contents. So \dots
4977 \end{description}
4978 %<*en>
4979 These whatsits will be removed during the process of inserting \textbf{JAglue}s.
4980 %</en>
4981 %<*ja>
4982 これらのwhatsitノードは\textbf{JAglue}の挿入処理の間に取り除かれる.
4983 %</ja>
4984
4985 %<en>\subsection{Stack System of \LuaTeX-ja}
4986 %<ja>\subsection{\LuaTeX-jaのスタックシステム}
4987 \label{ssec-stack}
4988
4989 %<en>\paragraph{Background}
4990 %<ja>\paragraph{背景}
4991 %<*en>
4992 \LuaTeX-ja has its own stack system, and most parameters of \LuaTeX-ja
4993 are stored in it. To clarify the reason, imagine the parameter
4994 \Param{\hyperlink{fld:kanjiskip}{kanjiskip}} is stored by a skip, and consider the following
4995 source:
4996 %</en>
4997 %<*ja>
4998 \LuaTeX-jaは独自のスタックシステムを持ち,\LuaTeX-jaのほとんどのパラメータは
4999 これを用いて保持されている.その理由を明らかにするために,
5000 \Param{\hyperlink{fld:kanjiskip}{kanjiskip}}パラメータがスキップレジスタで保持されているとし,
5001 以下のコードを考えてみよう:
5002 %</ja>
5003 \begin{LTXexample}
5004 \ltjsetparameter{kanjiskip=0pt}ふがふが.%
5005 \setbox0=\hbox{\ltjsetparameter{kanjiskip=5pt}ほげほげ}
5006 \box0.ぴよぴよ\par
5007 \end{LTXexample}
5008
5009 %<*en>
5010 As described in Subsection~\ref{ssec-param}, the only effective value of
5011 \Param{\hyperlink{fld:kanjiskip}{kanjiskip}} in an hbox is the latest value, so the value of
5012 \Param{\hyperlink{fld:kanjiskip}{kanjiskip}} which applied in the entire hbox should be 5\,pt.
5013 However, by the implementation method of \LuaTeX, this `5\,pt' cannot be
5014 known from any callbacks.  In the \texttt{tex/packaging.w} (which is a
5015 file in the source of \LuaTeX), there are the following codes:
5016 %</en>
5017 %<*ja>
5018 \ref{ssec-param}節で述べたように,ある水平ボックスの中で効力を持つ
5019 \Param{\hyperlink{fld:kanjiskip}{kanjiskip}}の値は最後に現れた値のみであり,したがってボックス全体に適用される
5020 \Param{\hyperlink{fld:kanjiskip}{kanjiskip}}は5\,ptであるべきである.しかし,\LuaTeX の実装のために,
5021 この`5\,pt'はどのコールバックからも知ることはできない.
5022 \texttt{tex/packaging.w}(これは\LuaTeX のソースファイルである)の中に,
5023 以下のコードがある:
5024 %</ja>
5025 \begin{lstlisting}
5026 void package(int c)
5027 {
5028     scaled h;                   /* height of box */
5029     halfword p;                 /* first node in a box */
5030     scaled d;                   /* max depth */
5031     int grp;
5032     grp = cur_group;
5033     d = box_max_depth;
5034     unsave();
5035     save_ptr -= 4;
5036     if (cur_list.mode_field == -hmode) {
5037         cur_box = filtered_hpack(cur_list.head_field,
5038                                  cur_list.tail_field, saved_value(1),
5039                                  saved_level(1), grp, saved_level(2));
5040         subtype(cur_box) = HLIST_SUBTYPE_HBOX;
5041 \end{lstlisting}
5042 %<*en>
5043 Notice that \verb+unsave+ is executed \emph{before}
5044 \verb+filtered_hpack+ (this is where \verb+hpack_filter+ callback is
5045 executed): so `5\,pt' in the above source is orphaned at
5046 \verb+unsave+, and hence it can't be accessed from \verb+hpack_filter+
5047 callback.
5048 %</en>
5049 %<*ja>
5050 \verb+unsave+ が \verb+filtered_hpack+(これは \verb+hpack_filter+ コールバックが
5051 実行されるところである)の\textbf{前に}実行されていることに注意する.
5052 したがって,上記ソース中で`5\,pt'は \verb+unsave+ のところで捨てられ,
5053 \verb+hpack_filter+ からはアクセスすることができない.
5054 %</ja>
5055
5056 %<en>\paragraph{The method}
5057 %<ja>\paragraph{解決法}
5058 %<zh>\paragraph{解决方法}
5059
5060 %<*en>
5061 The code of stack system is based on that in a post of Dev-luatex mailing list\footnote{%
5062 \texttt{[Dev-luatex] tex.currentgrouplevel}, a post at 2008/8/19 by Jonathan Sauer.}.
5063 %</en>
5064 %<*ja>
5065 スタックシステムのコードはDev-luatexメーリングリストのある投稿\footnote{\texttt{[Dev-luatex] tex.currentgrouplevel}: Jonathan Sauerによる2008/8/19の投稿.}を
5066 ベースにしている.
5067 %</ja>
5068
5069 %<*en>
5070 These are two \TeX\ count registers for maintaining information:
5071 \verb+\ltj@@stack+ for the stack level, and \verb+\ltj@@group@level+ for
5072 the \TeX's group level when the last assignment was done.  Parameters
5073 are stored in one big table named \texttt{charprop\_stack\_table}, where
5074 \texttt{charprop\_stack\_table[$i$]} stores data of stack level~$i$. If
5075 a new stack level is created by \verb+\ltjsetparameter+, all data of the
5076 previous level is copied.
5077 %</en>
5078 %<*ja>
5079 情報を保持するために,2つの\TeX の整数レジスタを用いている:
5080 \verb+\ltj@@stack+ でスタックレベル,\verb+\ltj@@group@level+ で最後の代入が
5081 なされた時点での\TeX のグループレベルを保持している.
5082 パラメータは\texttt{charprop\_stack\_table}という名前のひとつの大きなテーブルに
5083 格納される.ここで,\texttt{charprop\_stack\_table[$i$]}はスタックレベル$i$の
5084 データを格納している.もし新しいスタックレベルが \verb+\ltjsetparameter+ によって
5085 生成されたら,前のレベルの全てのデータがコピーされる.
5086 %</ja>
5087
5088 %<*en>
5089 To resolve the problem mentioned in `Background' above, \LuaTeX-ja uses
5090 another thing: When a new stack level is about to be created, a whatsit
5091 node whose type, subtype and value are 44~(\textit{user\_defined}),
5092 30112, and current group level respectively is appended to the current
5093 list (we refer this node by \textit{stack\_flag}). This enables us to
5094 know whether assignment is done just inside a hbox. Suppose that the
5095 stack level is~$s$ and the \TeX's group level is~$t$ just after the hbox
5096 group, then:
5097 %</en>
5098 %<*ja>
5099 上の「背景」で述べた問題を解決するために,\LuaTeX-jaではもう一つの手法を導入する:
5100 新しいスタックレベルが生成されようとするとき,type, subtype, valueがそれぞれ
5101 44~(\textit{user\_defined}), 30112,そして現在のグループレベルであるwhatsitノード
5102 を現在のリストに付け加える(このノードを\textit{stack\_flag}とする).
5103 これにより,ある水平ボックスの中で代入がなされたかどうかを知ることが可能
5104 となる.スタックレベルを$s$,その水平ボックスグループの直後の\TeX のグループレベルを
5105 $t$とすると:
5106 %</ja>
5107 \begin{itemize}
5108 %<*zh>
5109 \item
5110 %</zh>
5111 %<*en>
5112 \item If there is no \textit{stack\_flag} node in the list of the hbox, then
5113       no assignment was occurred inside the hbox. Hence values of
5114       parameters at the end of the hbox are stored in the stack
5115       level~$s$.
5116 %</en>
5117 %<*ja>
5118 \item もしその水平ボックスのリストの中に\textit{stack\_flag}ノードがなければ,
5119   水平ボックスの中では代入は起こらなかったということになる.
5120   したがって,その水平ボックスの終わりにおけるパラメータの値はスタックレベル$s$に
5121   格納されている.
5122 %</ja>
5123
5124 %<*en>
5125 \item If there is a \textit{stack\_flag} node whose value is~$t+1$, then
5126       an assignment was occurred just inside the hbox group. Hence
5127       values of parameters at the end of the hbox are stored in the
5128       stack level~$s+1$.
5129 %</en>
5130 %<*ja>
5131 \item もし値が$t+1$の\textit{stack\_flag}ノードがあれば,その
5132   水平ボックスグループの中で代入が起こったことになる.
5133   したがって,水平ボックスの終わりにおけるパラメータの値はスタックレベル$s+1$に
5134   格納されている.
5135 %</ja>
5136
5137 %<*en>
5138 \item If there are \textit{stack\_flag} nodes but all of their values
5139       are more than~$t+1$, then an assignment was occurred in the box,
5140       but it is done is `more internal' group. Hence values of
5141       parameters at the end of the hbox are stored in the stack
5142       level~$s$.
5143 %</en>
5144 %<*ja>
5145 \item もし\textit{stack\_flag}ノードがあるがそれらの値が全て$t+1$より大きい
5146   場合,そのボックスの中で代入が起こったが,それは「より内部の」グループで
5147   起こったということになる.したがって,水平ボックスの終わりでのパラメータの
5148   値はスタックレベル$s$に格納されている.
5149 %</ja>
5150 \end{itemize}
5151
5152 %<*en>
5153 Note that to work this trick correctly, assignments to
5154 \verb+\ltj@@stack+ and \verb+\ltj@@group@level+ have to be local always,
5155 regardless the value of \verb+\globaldefs+.
5156 This problem is resolved by using
5157 \hbox{\verb+\directlua{tex.globaldefs=0}+} (this assignment is local).
5158 %</en>
5159 %<*ja>
5160 このトリックを正しく働かせるためには,\verb+\ltj@@stack+ と \verb+\ltj@@group@level+ への
5161 代入は \verb+\globaldefs+ の値によらず常にローカルでなければならないことに注意する.
5162 この問題は \hbox{\verb+\directlua{tex.globaldefs=0}+}(この代入は常にローカル)を
5163 用いることで解決している.
5164 %</ja>
5165
5166 %<en>\section{Linebreak after Japanese Character}
5167 %<ja>\section{和文文字直後の改行}
5168 %<zh>\section{日文字符后断行}
5169 \label{sec-lbreak}
5170 %<en>\subsection{Reference: Behavior in \pTeX}
5171 %<ja>\subsection{参考:\pTeX の動作}
5172 %<zh>\subsection{参考: \pTeX 行为}
5173 %<*en>
5174 In~\pTeX, a line break after a Japanese character doesn't emit a space,
5175 since words are not separated by spaces in Japanese writings. However,
5176 this feature isn't fully implemented in \LuaTeX-ja due to the
5177 specification of callbacks in~\LuaTeX. To clarify the difference between
5178 \pTeX~and~\LuaTeX, We briefly describe the handling of a line break in~\pTeX, in
5179 this subsection.
5180
5181 \pTeX's input processor can be described in terms of a finite state
5182 automaton, as that of~\TeX\ in~Section~2.5 of~\cite{texbytopic}. The
5183 internal states are as follows:
5184 \begin{itemize}
5185 \item State~$N$: new line
5186 \item State~$S$: skipping spaces
5187 \item State~$M$: middle of line
5188 \item State~$K$: after a Japanese character
5189 \end{itemize}
5190 The first three states---$N$, $S$~and~$M$---are as same as \TeX's input
5191 processor.  State~$K$ is similar to state~$M$, and is entered after
5192 Japanese characters.  The diagram of state transitions are indicated in
5193 Figure~\ref{fig-ptexipro}.  Note that \pTeX\ doesn't leave state~$K$
5194 after `beginning/ending of a group' characters.
5195 %</en>
5196
5197 %<*ja>
5198 欧文では文章の改行は単語間でしか行わない.そのため,\TeX では,(文字の直後の)改行は
5199 空白文字と同じ扱いとして扱われる.一方,和文ではほとんどどこでも改行が可能なため,
5200 \pTeX では和文文字の直後の改行は単純に無視されるようになっている.
5201
5202 このような動作は,\pTeX が\TeX からエンジンとして拡張されたことによって可能になったことである.
5203 \pTeX の入力処理部は,\TeX におけるそれと同じように,有限オートマトンとして記述することができ,
5204 以下に述べるような4状態を持っている.
5205
5206 \begin{itemize}
5207 \item State~$N$: 行の開始.
5208 \item State~$S$: 空白読み飛ばし.
5209 \item State~$M$: 行中.
5210 \item State~$K$: 行中(和文文字の後).
5211 \end{itemize}
5212 また,状態遷移は,図\ref{fig-ptexipro}のようになっており,図中の数字は
5213 カテゴリーコードを表している.最初の3状態は\TeX の入力処理部と同じであり,
5214 図中から状態$K$と「$j$」と書かれた矢印を取り除けば,\TeX の入力処理部と同
5215 じものになる.
5216
5217 この図から分かることは,
5218 \begin{quote}
5219 行が和文文字(とグループ境界文字)で終わっていれば,改行は無視される
5220 \end{quote}
5221 ということである.
5222 %</ja>
5223
5224 \begin{figure}[!tb]
5225 \let\sp\textvisiblespace\small
5226 \begin{minipage}{.6\textwidth}%
5227 \begin{center}
5228 \unitlength=6.5mm\sf\mathversion{bold}
5229 \begin{tikzpicture}[
5230   ->, auto, shorten >=1pt
5231 ]
5232 \node [shape=rectangle, font=\scriptsize] (init) at (2,7) {start};
5233 \node [shape=circle,draw, fill=blue!20] (newline) at (4,7) {$N$};
5234 \node [shape=circle,draw, fill=blue!20] (midline) at (4,4) {$M$};
5235 \node [shape=circle,draw, fill=blue!20] (skipspc) at (8,7) {$S$};
5236 \node [shape=circle,draw, fill=red!20]  (kanji) at (8,4) {$K$};
5237 \node [shape=rectangle,draw, fill=green!20] (scanacs) at (6,8) {scan a c.s.};
5238 \node (endk) at (8,2.5) {} ;
5239 \node (endm) at (4,2.5) {} ;
5240 \node (ends) at (8,8.5) {} ;
5241 \node (endn) at (4,8.5) {} ;
5242 \begin{scope}[font=\scriptsize]
5243 \path (newline) edge [bend right]    node [left]{G, O} (midline)
5244       (init)    edge                 node {} (newline)
5245       (midline) edge [bend right=10] node {10} (skipspc)
5246       (skipspc) edge [bend right]    node [left,right=10,above=7]{G, O} (midline)
5247       (skipspc) edge [loop right]    node {10} (skipspc)
5248       (newline) edge [loop right]    node {10} (newline)
5249       (scanacs) edge [bend left]     node [left=3,below]{$(*)$} (skipspc)
5250       (scanacs) edge [bend right]    node [right=30,above=20]{$(*)$} (midline)
5251       (midline) edge                 node {5\ [\sp]} (endm)
5252       (midline) edge [loop left]     node {G, O} (midline)
5253       (skipspc) edge                 node [right] {5} (ends)
5254       (newline) edge                 node {5 [{\tt\char92par}]} (endn);
5255 \begin{scope}[red]
5256 \path (newline) edge [bend right]    node [right=25,below=3]{J} (kanji)
5257       (midline) edge                 node [below]{J} (kanji)
5258       (kanji)   edge [bend left]     node {O} (midline)
5259       (kanji)   edge                 node {10} (skipspc)
5260       (kanji)   edge [loop right]    node {G, J} (kanji)
5261       (skipspc) edge [bend left]     node {J} (kanji)
5262       (kanji)   edge                 node {5} (endk)
5263 ;
5264 \end{scope}
5265 \end{scope}
5266 \end{tikzpicture}
5267 \end{center}
5268 \end{minipage}%
5269 \begin{minipage}{.4\textwidth}
5270 \begin{description}
5271 \item[\textsf{G}] Beginning of group (usually \verb+{+)\\
5272  and ending of group (usually \verb+}+).
5273 \item[\textsf{J}] Japanese characters.
5274 \item[\textsf{5}] \textit{end-of-line} (usually \verb+^^J+).
5275 \item[\textsf{10}] space (usually \sp).
5276 \item[\textsf{O}] other characters, whose category code is in $\{3,4,6,7,8,11,12,13\}$.
5277 \item[\textsf{[\sp]}, \textsf{[{\tt\char92par}]}]
5278 emits a space, or~\verb+\par+.
5279 \end{description}
5280 \end{minipage}
5281 \begin{itemize}
5282 \item We omitted about category codes
5283 9~(\textit{ignored}), 14~(\textit{comment})~and~15~(\textit{invalid})
5284 from the above diagram. We also ignored the input like `\verb+^^A+' or `\verb+^+\verb+^df+'.
5285 \item When a character whose category code is 0 (\textit{escape character}) is seen by \TeX,
5286 the input processor scans a control sequence (\textsf{scan a c.s.}).
5287 These paths are not shown in the above diagram.
5288
5289 After that, the state is changed to State~$S$ (skipping blanks) in most cases, but
5290 to State~$M$ (middle of line) sometimes.
5291 \end{itemize}
5292 %<en>\caption{State transitions of \pTeX's input processor.}
5293 %<ja>\caption{\pTeX の入力処理部の状態遷移.}
5294 \label{fig-ptexipro}
5295 \end{figure}
5296
5297
5298 %<en>\subsection{Behavior in \LuaTeX-ja}
5299 %<ja>\subsection{\LuaTeX-jaの動作}
5300 %<zh>\subsection{\LuaTeX-ja行为}
5301 %<*en>
5302 States in the input processor of \LuaTeX\ is the same as that of \TeX,
5303 and they can't be customized by any callbacks. Hence, we can only use
5304 \verb+process_input_buffer+ and \verb+token_filter+ callbacks for to
5305 suppress a space by a line break which is after Japanese characters.
5306
5307 However, \verb+token_filter+ callback cannot be used either, since a
5308 character in category code 5~(end-of-line) is converted into an space
5309 token \emph{in the input processor}.  So we can use only the
5310 \verb+process_input_buffer+ callback.  This means that suppressing a
5311 space must be done \emph{just before} an input line is read.
5312
5313 Considering these situations, handling of an end-of-line in \LuaTeX-ja are as follows:
5314 \begin{quote}
5315 A character U+FFFFF (its category code is set to 14~(comment) by
5316 \LuaTeX-ja) is appended to an input line, \emph{before \LuaTeX\ actually
5317 process it}, if and only if the following three conditions are satisfied:
5318 \begin{enumerate}
5319 \item The category code of \verb+\endlinechar+%
5320 \footnote{Usually, it is $\langle${return}$\rangle$
5321       (whose character code is 13).} is 5~(end-of-line).
5322 \item The category code of U+FFFFF itself is 14~(comment).
5323 \item The input line matches the following `regular expression':
5324 \[
5325   (\text{any char})^*(\textbf{JAchar})
5326   \bigl(\{\text{catcode}=1\}\cup\{\text{catcode}=2\}\bigr)^*
5327 \]
5328 \end{enumerate}
5329 \end{quote}
5330
5331 \paragraph{Remark}
5332 The following example shows the major difference from the behavior of \pTeX:
5333 \begin{LTXexample}
5334 \ltjsetparameter{autoxspacing=false}
5335 \ltjsetparameter{jacharrange={-6}}xあ
5336 y\ltjsetparameter{jacharrange={+6}}zあ
5337 u
5338 \end{LTXexample}
5339 \begin{itemize}
5340 \item There is no space between `x' and `y', since the line~2 ends with a \textbf{JAchar} `あ'
5341 (this `あ' considered as an \textbf{JAchar} at the ending of line~1).
5342 \item There is no space between `あ' (in the line~3) and `u', since the
5343       line~3 ends with an \textbf{ALchar}
5344 (the letter `あ' considered as an \textbf{ALchar} at the ending of line~2).
5345 \end{itemize}
5346 %</en>
5347
5348 %<*ja>
5349 \LuaTeX の入力処理部は\TeX のそれと全く同じであり,コールバックによりユーザが
5350 カスタマイズすることはできない.このため,改行抑制の目的でユーザが利用で
5351 きそうなコールバックとしては,\verb+process_input_buffer+や
5352 \verb+token_filter+に限られてしまう.しかし,\TeX の入力処理部をよく見る
5353 と,後者も役には経たないことが分かる:改行文字は,入力処理部によってトー
5354 クン化される時に,カテゴリーコード10の32番文字へと置き換えられてしまうた
5355 め,\verb+token_filter+で非標準なトークン読み出しを行おうとしても,空白文
5356 字由来のトークンと,改行文字由来のトークンは区別できないのだ.
5357
5358 すると,我々のとれる道は,\verb+process_input_buffer+を用いて
5359 \LuaTeX の入力処理部に引き渡される前に入力文字列を編集するというものしかない.
5360 以上を踏まえ,\LuaTeX-jaにおける「和文文字直後の改行抑制」の処理は,次のようになっている:
5361
5362 \begin{quote}
5363 各入力行に対し,\textbf{その入力行が読まれる前の内部状態で}
5364 以下の3条件が満たされている場合,\LuaTeX-jaはU+FFFFF番の文字
5365 \footnote{この文字はコメント文字として扱われるように\LuaTeX-ja内部で設定をしている.}
5366 を末尾に追加する.よって,その場合に改行は空白とは見做されないこととなる.
5367 \begin{enumerate}
5368 \item \verb+\endlinechar+の文字\footnote{普通は,改行文字(文字コード13番)である.}
5369 のカテゴリーコードが5~(end-of-line)である.
5370 \item U+FFFFFのカテゴリーコードが14~(comment)である.
5371 \item 入力行は次の「正規表現」にマッチしている:
5372 \[
5373   (\text{any char})^*(\textbf{JAchar})
5374   \bigl(\{\text{catcode}=1\}\cup\{\text{catcode}=2\}\bigr)^*
5375 \]
5376 \end{enumerate}
5377 \end{quote}
5378
5379 この仕様は,前節で述べた\pTeX の仕様にできるだけ近づけたものとなっている.最初の条件は,
5380 \texttt{verbatim}系環境などの日本語対応マクロを書かなくてすませるためのものである.
5381 しかしながら,完全に同じ挙動が実現できたわけではない.
5382 差異は,次の例が示すように,和文文字の範囲を変更した行の改行において見られる:
5383 \begin{LTXexample}
5384 \ltjsetparameter{autoxspacing=false}
5385 \ltjsetparameter{jacharrange={-6}}xあ
5386 y\ltjsetparameter{jacharrange={+6}}zあ
5387 u
5388 \end{LTXexample}
5389 もし\pTeX とまったく同じ挙動を示すならば,出力は
5390 「\hbox{\ltjsetparameter{autoxspacing=false}x yzあu}」となるべきである.しかし,実際には
5391 上のように異なる挙動となっている.
5392 \begin{itemize}
5393 \item 2行目は「あ」という和文文字で終わる(2行目を処理する前の時点では,
5394       「あ」は和文文字扱いである)ため,直後の改行文字は無視される.
5395 \item 3行目は「あ」という欧文文字で終わる(2行目を処理する前の時点では,
5396       「あ」は欧文文字扱いである)ため,直後の改行文字は空白に置き換わる.
5397 \end{itemize}
5398 このため,トラブルを避けるために,和文文字の範囲を\verb+\ltjsetparameter+で編集した場合,
5399 その行はそこで改行するようにした方がいいだろう.
5400 %</ja>
5401
5402
5403 %<en>\section{Insertion of JFM glues, \Param{kanjiskip} and \Param{xkanjiskip}}
5404 %<ja>\section{JFMグルーの挿入,\Param{kanjiskip}と\Param{xkanjiskip}}
5405 %<zh>\section{JFM的胶插入,\Param{kanjiskip}和\Param{xkanjiskip}}
5406 \label{sec-jfmglue}
5407 %<en>\subsection{Overview}
5408 %<ja>\subsection{概要}
5409 %<zh>\subsection{概要}
5410
5411 \LuaTeX-jaにおける \textbf{JAglue} の挿入方法は,\pTeX のそれとは全く異なる.
5412 \pTeX では次のような仕様であった:
5413 \begin{itemize}
5414 \item JFMグルーの挿入は,和文文字を表すトークンを元に水平リストに(文字を表す)<char\_node>を
5415 追加する過程で行われる.
5416 \item \Param{\hyperlink{fld:xks}{xkanjiskip}}の挿入は,水平ボックスへのパッケージングや行分割前に行われる.
5417 \item \Param{\hyperlink{fld:kanjiskip}{kanjiskip}}はノードとしては挿入されない.パッケージングや行分割の計算時に
5418 「和文文字を表す2つの<char\_node>の間には\Param{\hyperlink{fld:kanjiskip}{kanjiskip}}がある」ものとみなされる.
5419 \end{itemize}
5420 しかし,\LuaTeX-jaでは,水平ボックスへのパッケージングや行分割前に全ての
5421 \textbf{JAglue},即ちJFMグルー・\Param{\hyperlink{fld:xks}{xkanjiskip}}・\Param{\hyperlink{fld:kanjiskip}{kanjiskip}}の
5422 3種類を一度に挿入することになっている.これは,\LuaTeX において欧文の合字・
5423 カーニング処理がノードベースになったことに対応する変更である.
5424
5425 \LuaTeX-jaにおける\textbf{JAglue}挿入処理では,次節で定義する
5426 「クラスタ」を単位にして行われる.大雑把にいうと,「クラスタ」は文字とそれに付随す
5427 るノード達(アクセント位置補正用のカーンや,イタリック補正)をまとめたもの
5428 であり,2つのクラスタの間には,ペナルティ,\verb+\vadjust+,whatsitなど,行組版
5429 には関係しないものがある.
5430
5431
5432 %<en>\subsection{definition of a `cluster'}
5433 %<ja>\subsection{「クラスタ」の定義}
5434 %<zh>\subsection{“cluster”定义}
5435
5436 \def\OA{$\text{\sf O}_{\text{\sf A}}$}
5437 \def\OB{$\text{\sf O}_{\text{\sf B}}$}
5438 \begin{defn}
5439 %<*en>
5440 A \emph{cluster} is a list of consecutive nodes in one of the following forms,
5441 with the \textit{id} of it:
5442 %</en>
5443 %<*ja>
5444 \textbf{クラスタ}は以下の形のうちのどれかひとつをとる連続的なノードのリストである:
5445 %</ja>
5446 \begin{enumerate}
5447 %<*en>
5448 \item Nodes whose value of\ \verb+\ltj@icflag+ is in $[3,15)$.  These
5449       nodes come from a hbox which is already packaged, by unpackaging
5450       (\verb+\unhbox+).
5451       The \textit{id} is \textit{id\_pbox}.
5452 %</en>
5453 %<*ja>
5454 \item その \verb+\ltj@icflag+ の値が$[3,15)$に入るノードのリスト.
5455   これらのノードはある既にパッケージングされた水平ボックスから \verb+\unhbox+ で
5456   アンパックされたものである.
5457   その\textit{id}は\textit{id\_pbox}である.
5458 %</ja>
5459
5460 %<*en>
5461 \item A inline math formula, including two \textit{math\_node}s at the boundary of it.
5462       The \textit{id} is \textit{id\_math}.
5463 %</en>
5464 %<*ja>
5465 \item インライン数式でその境界に2つの\textit{math\_node}を含むもの.
5466   その\textit{id}は\textit{id\_math}である.
5467 %</ja>
5468
5469 %<*en>
5470 \item A \textit{glyph\_node}~$p$ with nodes which relate with it:
5471 %</en>
5472 %<*ja>
5473 \item \textit{glpyh\_node}~$p$とそれに関係するノード:
5474 %</ja>
5475 \begin{enumerate}
5476 %<*en>
5477 \item A kern for the italic correction of~$p$.
5478 %</en>
5479 %<*ja>
5480 \item $p$のイタリック補正のためのカーン.
5481 %</ja>
5482
5483 %<*en>
5484 \item An accent attached to $p$ by \verb+\accent+.
5485 %</en>
5486 %<*ja>
5487 \item \verb+\accent+ による$p$に付随したアクセント.
5488 %</ja>
5489 \end{enumerate}
5490 \[
5491 \overbrace{%
5492  \Node{kern}{$\mathit{subtype}=2$}\longrightarrow
5493 \left\{\begin{array}{c}
5494 \Node{glyph}{accent}\\\noalign{\medskip}
5495 \Node{hbox}{accent (shifted vert.)}
5496 \end{array}\right\}\longrightarrow
5497 \Node{kern}{$\mathit{subtype}=2$}}^{\text{(a)}}
5498 \longrightarrow
5499 \Node{glyph}{$p$}\longrightarrow
5500 \overbrace{%
5501 \Node{kern}{italic corr.}}^{\text{(b)}}
5502 \]
5503
5504 %<*en>
5505 The \textit{id} is \textit{id\_jglyph} or
5506 \textit{id\_glyph}, according to whether the \textit{glyph\_node}
5507 represents a Japanese character or not.
5508 %</en>
5509 %<*ja>
5510 \textit{id}は\textit{glyph\_node}が和文文字を表すかどうかによって
5511 \textit{id\_jglyph},もしくは\textit{id\_glyph}となる.
5512 %</ja>
5513
5514 %<*en>
5515 \item An box-like node, that is, an hbox, a vbox, a rule (\verb+\vrule+) and an \textit{unset\_node}.
5516 The \textit{id} is \textit{id\_hlist} if the node is an
5517       hbox which is not shifted vertically, or \textit{id\_box\_like}
5518       otherwise.
5519 %</en>
5520 %<*ja>
5521 \item ボックス様のノード,つまり水平ボックス,垂直ボックス,罫線 (\verb+\vrule+),
5522   そして\textit{unset\_node}.
5523   その\textit{id}は垂直に移動していない水平ボックスならば\textit{id\_hlist},
5524   そうでなければ\textit{id\_box\_like}となる.
5525 %</ja>
5526
5527 %<*en>
5528 \item A glue, a kern whose subtype is not 2~(\textit{accent}), and a discretionary break.
5529 The \textit{id} is \textit{id\_glue}, \textit{id\_kern}
5530       and \textit{id\_disc}, respectively.
5531 %</en>
5532 %<*ja>
5533 \item グルー,subtypeが 2~(\textit{accent})ではないカーン,そして任意改行.
5534   その\textit{id}はそれぞれ\textit{id\_glue}, \textit{id\_kern},そして
5535   \textit{id\_disc}である.
5536 %</ja>
5537 \end{enumerate}
5538 %<*en>
5539 Let \textit{Np}, \textit{Nq} and \textit{Nr} denote a cluster.
5540 %</en>
5541 %<*ja>
5542 以下では\textit{Np}, \textit{Nq}, \textit{Nr}でクラスタを表す.
5543 %</ja>
5544 \end{defn}
5545
5546 \paragraph{\textit{id}の意味}
5547 $\mathit{Np}.\mathit{id}$の意味を述べるとともに,
5548 「先頭の文字」を表す\textit{glyph\_node}~$\mathit{Np}.\mathit{head}$と,
5549 「最後の文字」を表す\textit{glyph\_node}~$\mathit{Np}.\mathit{tail}$を次のように定義する.
5550 直感的に言うと,\textit{Np}は$\mathit{Np}.\mathit{head}$で始まり$\mathit{Np}.\mathit{tail}$で終わるような単語,
5551 と見做すことができる.これら$\mathit{Np}.\mathit{head}$, $\mathit{Np}.\mathit{tail}$は
5552 説明用に準備した概念であって,実際のLuaコード中にそのように書かれているわけではないことに注意.
5553
5554 \begin{description}
5555 \item[\textit{id\_jglyph}] 和文文字.\\
5556 $\mathit{Np}.\mathit{head}$, $\mathit{Np}.\mathit{tail}$は,その和文文字を表している
5557 \textit{glyph\_node}そのものである.
5558 \item[\textit{id\_glyph}] 和文文字を表していない\textit{glyph\_node}~$p$.\\
5559 多くの場合,$p$は欧文文字を格納しているが,`ffi'などの合字によって作られた
5560 \textit{glyph\_node}である可能性もある.
5561 前者の場合,$\mathit{Np}.\mathit{head}$,~$\mathit{Np}.\mathit{tail} = p$である.
5562 一方,後者の場合,
5563 \begin{itemize}
5564 \item $\mathit{Np}.\mathit{head}$は,
5565 合字の構成要素の先頭→(その\textit{glyph\_node}における)合字の構成要素の先頭→……
5566 と再帰的に検索していってたどり着いた\textit{glyph\_node}である.
5567 \item $\mathit{Np}.\mathit{last}$は,同様に末尾→末尾→と検索してたどり着いた\textit{glyph\_node}である.
5568 \end{itemize}
5569 \item[\textit{id\_math}] インライン数式.\\
5570 便宜的に,$\mathit{Np}.\mathit{head}$, $\mathit{Np}.\mathit{tail}$ともに
5571 「文字コード$-1$の欧文文字」とおく.
5572 \item[\textit{id\_hlist}] 縦方向にシフトされていない水平ボックス.\\
5573 この場合,$\mathit{Np}.\mathit{head}$, $\mathit{Np}.\mathit{tail}$はそれぞれ$p$の内容を表すリストの,
5574 先頭・末尾のノードである.
5575 \begin{itemize}
5576 \item 状況によっては,\TeX ソースで言うと
5577 \begin{verbatim}
5578 \hbox{\hbox{abc}...\hbox{\lower1pt\hbox{xyz}}}
5579 \end{verbatim}
5580 のように,$p$の内容が別の水平ボックスで開始・終了している可能性も十分あり得る.そのような場合,
5581 $\mathit{Np}.\mathit{head}$, $\mathit{Np}.\mathit{tail}$の算出は,\textbf{垂直方向にシフトされていない}水平ボックスの
5582 場合だけ内部を再帰的に探索する.例えば上の例では,$\mathit{Np}.\mathit{head}$は文字「a」を表すノードであり,
5583 一方$\mathit{Np}.\mathit{tail}$は垂直方向にシフトされた水平ボックス,\verb+\lower1pt\hbox{xyz}+に対応するノードである.
5584 \item また,先頭にアクセント付きの文字がきたり,末尾にイタリック補正用のカーンが
5585 来ることもあり得る.この場合は,クラスタの定義のところにもあったように,それらは無視して算出を行う.
5586 \item 最初・最後のノードが合字によって作られた\textit{glyph\_node}のときは,それぞれに対して\textit{id\_glyph}%
5587 と同様に再帰的に構成要素をたどっていく.
5588 \end{itemize}
5589 \item[\textit{id\_pbox}] 「既に処理された」ノードのリストであり,これらのノードが二度処理を受けないために
5590 まとめて1つのクラスタとして取り扱うだけである.
5591 \textit{id\_hlist}と同じ方法で$\mathit{Np}.\mathit{head}$, $\mathit{Np}.\mathit{tail}$を算出する,
5592 \item[\textit{id\_disc}] discretionary break (\verb+\discretionary{pre}{post}{nobreak}+).\\
5593 \textit{id\_hlist}と同じ方法で$\mathit{Np}.\mathit{head}$, $\mathit{Np}.\mathit{tail}$を算出するが,
5594 第3引数の \texttt{nobreak}(行分割が行われない時の内容)を使う.言い換えれば,ここで行分割が発生した時の状況は
5595 全く考慮に入れない.
5596 \item[\textit{id\_box\_like}] \textit{id\_hlist}とならないboxや,rule.\\
5597 この場合は,$\mathit{Np}.\mathit{head}$, $\mathit{Np}.\mathit{tail}$のデータは利用されないので,2つの算出は無意味である.
5598 敢えて明示するならば,$\mathit{Np}.\mathit{head}$, $\mathit{Np}.\mathit{tail}$は共にnil値である.
5599 \item[他] 以上にない\textit{id}に対しても,$\mathit{Np}.\mathit{head}$, $\mathit{Np}.\mathit{tail}$の算出は無意味.
5600 \end{description}
5601
5602 \paragraph{クラスタの別の分類}
5603 さらに,JFMグルー挿入処理の実際の説明により便利なように,\textit{id}とは別のクラスタの分類を行っておく.
5604 挿入処理では2つの隣り合ったクラスタの間に
5605 空白等の実際の挿入を行うことは前に書いたが,ここでの説明では,問題にしているクラスタ\textit{Np}は「後ろ側」のクラスタである
5606 とする.「前側」のクラスタについては,以下の説明で\textit{head}が\textit{last}に置き換わることに注意すること.
5607 \begin{description}
5608 \item[和文A] リスト中に直接出現している和文文字.
5609 \textit{id}が\textit{id\_jglyph}であるか,\\
5610 \textit{id}が\textit{id\_pbox}であって$\mathit{Np}.\mathit{head}$が\textbf{JAchar}であるとき.
5611
5612 \item[和文B] リスト中の水平ボックスの中身の先頭として出現した和文文字.和文Aとの違いは,これの前に
5613 JFMグルーの挿入が行われない(\Param{\hyperlink{fld:xks}{xkanjiskip}},~\Param{\hyperlink{fld:kanjiskip}{kanjiskip}}は入り得る)ことである.\\
5614 \textit{id}が\textit{id\_hlist}か\textit{id\_disc}であって$\mathit{Np}.\mathit{head}$が\textbf{JAchar}であるとき.
5615
5616 \item[欧文] リスト中に直接/水平ボックスの中身として出現している欧文文字.次の3つの場合が該当:
5617 \begin{itemize}
5618 \item \textit{id}が\textit{id\_glyph}である.
5619 \item \textit{id}が\textit{id\_math}である.
5620 \item \textit{id}が\textit{id\_pbox}か\textit{id\_hlist}か\textit{id\_disc}であって,$\mathit{Np}.\mathit{head}$が\textbf{ALchar}.
5621 \end{itemize}
5622 \item[箱] box,またはそれに類似するもの.次の2つが該当:
5623 \begin{itemize}
5624 \item \textit{id}が\textit{id\_pbox}か\textit{id\_hlist}か\textit{id\_disc}であって,$\mathit{Np}.\mathit{head}$が\textit{glyph\_node}でない.
5625 \item \textit{id}が\textit{id\_box\_like}である.
5626 \end{itemize}
5627
5628 \end{description}
5629
5630 \subsection{段落/水平ボックスの先頭や末尾}
5631 \paragraph{先頭部の処理}
5632 まず,段落/水平ボックスの一番最初にあるクラスタ\textit{Np}を探索する.
5633 水平ボックスの場合は何の問題もないが,段落の場合では以下のノード達を事前に読み飛ばしておく:
5634 \begin{center}
5635 \verb+\parindent+由来の水平ボックス ($\mathit{subtype}=3$),及び\textit{subtype}が44~(\textit{user\_defined})でない
5636 ようなwhatsit.
5637 \end{center}
5638 これは,\verb+\parindent+由来の水平ボックスがクラスタを構成しないようにするためである.
5639
5640 次に,\textit{Np}の直前に空白$g$を必要なら挿入する:
5641 \begin{enumerate}
5642 \item この処理が働くような\textit{Np}は\textsf{和文A}である.
5643 \item 問題のリストが字下げありの段落(\verb+\parindent+由来の水平ボックスあり)の場合は,
5644 この空白$g$は「文字コード\texttt{'parbdd'}の文字」と\textit{Np}の間に入るグルー/カーンである.
5645 \item そうでないとき(\verb+noindent+で開始された段落や水平ボックス)は,
5646 $g$は「文字コード\texttt{'boxbdd'}の文字」と\textit{Np}の間に入るグルー/カーンである.
5647 \end{enumerate}
5648 ただし,もし$g$がglueであった場合,この挿入によって\textit{Np}による行分割が新たに可能になるべきではない.
5649 そこで,以下の場合には,$g$の直前に\verb+\penalty10000+を挿入する:
5650 \begin{itemize}
5651 \item 問題にしているリストが段落であり,かつ
5652 \item \textit{Np}の前には予めペナルティがなく,$g$はglue.
5653 \end{itemize}
5654
5655 \paragraph{末尾の処理}
5656 末尾の処理は,問題のリストが段落のものか水平ボックスのものかによって異なる.
5657 後者の場合は容易い:最後のクラスタを\textit{Nq}とおくと,\textit{Nq}と「文字コード\texttt{'boxbdd'}の文字」の間に入るグルー/カーンを,
5658 \textit{Nq}の直後に挿入するのみである.
5659
5660 一方.前者(段落)の場合は,リストの末尾は常に\verb+\penalty10000+と,
5661 \verb+\parfillskip+由来のグルーが存在する.よって,最後のクラスタ\textit{Np}は
5662 この\verb+\parfillskip+由来のグルーとなり,実質的な中身の最後はその1つ前のクラスタ\textit{Nq}となる.
5663 \begin{enumerate}
5664 \item まず\textit{Nq}の直後に(後に述べる)\textsf{line-end~[E]}によって定まる空白を挿入する.
5665 \item 次に,段落の最後の「通常の和文文字${}+{}$句点」が独立した行となるのを防ぐために,
5666 \Param{jcharwidowpenalty}の値の分だけ適切な場所のペナルティを増やす.
5667
5668 ペナルティ量を増やす場所は,\textit{head}が\textbf{JAchar}であり,かつその文字の\Param{kcatcode}が偶数であるような
5669 最後のクラスタの直前にあるものたちである\footnote{大雑把に言えば,\Param{kcatcode}が奇数であるような\textbf{JAchar}
5670 を約物として考えていることになる.\Param{kcatcode}の最下位ビットはこの\Param{jcharwidowpenalty}用にのみ利用される.}.
5671 \end{enumerate}
5672
5673 \subsection{概観と典型例:2つの「和文A」の場合}
5674 先に述べたように,2つの隣り合ったクラスタ,\textit{Nq}と\textit{Np}の間には,
5675 ペナルティ,\verb+\vadjust+,whatsitなど,行組版には関係しないものがある.模式的に表すと,
5676 \[
5677  \Node{cluster}{\textit{Nq}}\longrightarrow
5678 \overbrace{
5679 \Node{penalty}{$p$}\longrightarrow \cdots\longrightarrow \Node{whatsit}{}}^{(a)}
5680 \longrightarrow \Node{cluster}{\textit{Np}}
5681 \]
5682 のようになっている.間の(a)に相当する部分には,何のノードもない場合ももちろんあり得る.
5683 そうして,JFMグルー挿入後には,この2クラスタ間は次のようになる:
5684 \[
5685  \Node{cluster}{\textit{Nq}}\longrightarrow\Node{kern}{左空白}\longrightarrow
5686 \overbrace{
5687 \Node{penalty}{$p+x$}\longrightarrow \cdots\longrightarrow \Node{whatsit}{}}^{(a)}
5688 \longrightarrow \Node{glue or kern}{右空白}\longrightarrow \Node{cluster}{\textit{Np}}
5689 \]
5690
5691 以後,\textbf{典型的な例として,クラスタ\textit{Nq}と\textit{Np}が共に\textsf{\textmd{和文A}}である場合を見ていこう,}
5692 この場合が全ての場合の基本となる.
5693
5694 \paragraph{「右空白」の算出}
5695 まず,「右空白」にあたる量を算出する.通常はこれが,隣り合った2つの和文文字間に入る空白量となる.
5696 \begin{description}
5697 \item[JFM由来{[M]}] JFMの文字クラス指定によって入る空白を以下によって求める.この段階で空白量が未定義(未指定)だった場合,
5698       デフォルト値\Param{\hyperlink{fld:kanjiskip}{kanjiskip}}を採用することとなるので,次へ.
5699 \begin{enumerate}
5700 \item もし両クラスタの間で\verb+\inhibitglue+が実行されていた場合(証としてwhatsitノードが自動挿入される),
5701       代わりに\Param{\hyperlink{fld:kanjiskip}{kanjiskip}}が挿入されることとなる.次へ.
5702 \item \textit{Nq}と\textit{Np}が同じJFM・同じ\texttt{jfmvar}キー・同じサイズの和文フォントであったならば,
5703       共通に使っているJFM内で挿入される空白(グルーかカーン)が決まっているか調べ,決まっていればそれを採用.
5704 \item 1.でも2.でもない場合は,\textit{Nq}と\textit{Np}が違うJFM/\texttt{jfmvar}/サイズである.
5705 この場合,まず
5706 \[
5707 \vcenter{\halign{\hfil$#:={}$&\inhibitglue#\inhibitglue\cr
5708 gb&(\textit{Nq}と「使用フォントが\textit{Nq}のそれと同じで,\hfil\cr
5709 \omit&\quad 文字コードが\textit{Np}のそれの文字」との間に入るグルー/カーン)\hfil\cr
5710 ga&(\inhibitglue 「使用フォントが\textit{Np}のそれと同じで,\hfil\cr
5711 \omit&\quad 文字コードが\textit{Nq}のそれの文字」と\textit{Np}との間に入るグルー/カーン)\hfil\cr
5712 }}
5713 \]
5714 として,前側の文字のJFMを使った時の空白(グルー/カーン)と,後側の文字のJFMを使った時のそれを求める.
5715
5716 $\mathit{gb}$,~$\mathit{ga}$それぞれに対する<ratio>の値を$d_b$,~$d_a$とする.
5717 \begin{itemize}
5718 \item 
5719 $\mathit{ga}$と$\mathit{gb}$の両方が未定義であるならば,JFM由来のグルーは挿入されず,\Param{\hyperlink{fld:kanjiskip}{kanjiskip}}を採用することとなる.どちらか片方のみが未定義であるならば,次のステップでその未定義の方は長さ0のkernで,<ratio>の値は0であるかのように扱われる.
5720 \item 
5721 \Param{\hyperlink{fld:diffjfm}{diffrentjfm}}の値が\texttt{pleft}, \texttt{pright}, \texttt{paverage}のとき,
5722 <ratio>の指定に従って比例配分を行う.
5723 JFM由来のグルー/カーンは以下の値となる:
5724 \[
5725  f\left(\frac{1-d_b}2\textit{gb} + \frac{1+d_b}2\textit{ga},
5726 \frac{1-d_a}2\textit{gb} + \frac{1+d_a}2\textit{ga}\right)
5727 \]
5728 ここで.$f(x,y)$は
5729 \[
5730  f(x,y)=\begin{cases}
5731 x&\text{if\ }\Param{\hyperlink{fld:diffjfm}{diffrentjfm}}=\texttt{pleft};\\
5732 y&\text{if\ }\Param{\hyperlink{fld:diffjfm}{diffrentjfm}}=\texttt{pright};\\
5733 (x+y)/2&\text{if\ }\Param{\hyperlink{fld:diffjfm}{diffrentjfm}}=\texttt{paverage};
5734 \end{cases}.
5735 \]
5736 \item 
5737 \Param{differentmet}がそれ以外の値の時は,<ratio>の値は無視され,JFM由来のグルー/カーンは以下の値となる:
5738 \[
5739  f(\textit{gb},\textit{ga})
5740 \]
5741 ここで.$f(x,y)$は
5742 \[
5743  f(x,y)=\begin{cases}
5744 \min(x,y)&\text{if\ }\Param{\hyperlink{fld:diffjfm}{diffrentjfm}}=\texttt{small};\\
5745 \max(x,y)&\text{if\ }\Param{\hyperlink{fld:diffjfm}{diffrentjfm}}=\texttt{large};\\
5746 (x+y)/2&\text{if\ }\Param{\hyperlink{fld:diffjfm}{diffrentjfm}}=\texttt{average};\\
5747 x+y&\text{if\ }\Param{\hyperlink{fld:diffjfm}{diffrentjfm}}=\texttt{both};
5748 \end{cases}.
5749 \]
5750 \end{itemize}
5751 \end{enumerate}
5752
5753 例えば,
5754 \begin{verbatim}
5755 \jfont\foo=psft:Ryumin-Light:jfm=ujis
5756 \jfont\bar=psft:GothicBBB-Medium:jfm=ujis
5757 \jfont\baz=psft:GothicBBB-Medium:jfm=ujis;jfmvar=piyo
5758 \end{verbatim}
5759 という3フォントを考え,
5760 \[
5761  \overbrace{\Node{glyph}{{\tt\char92 foo}, `あ'}}^{p}
5762 \longrightarrow \overbrace{\Node{glyph}{{\tt\char92 bar}, `い'}}^{q}
5763 \longrightarrow \overbrace{\Node{glyph}{{\tt\char92 baz}, `う'}}^{r}
5764 \]
5765 という3ノードを考える(それぞれ単独でクラスタをなす).
5766 この場合,$p$と$q$の間は,実フォントが異なるにもかかわらず(2)の状況となる一方で,
5767 $q$と$r$の間は(実フォントが同じなのに)\texttt{jfmvar}キーの内容が異なるので(3)の状況となる.
5768 \item[\Param{kanjiskip}~{[K]}] 上の[M]において空白が定まらなかった場合,
5769 以下で定めた量「右空白」として採用する.
5770 この段階においては,\verb+\inhibitglue+は効力を持たないため,
5771 結果として,2つの和文文字間には常に何らかのグルー/カーンが挿入されることとなる.
5772 \begin{enumerate}
5773 \item 両クラスタ(厳密には$\mathit{Nq}.\mathit{tail}$,$\mathit{Np}.\mathit{head}$)の中身の文字コードに対する
5774 \Param{autospacing}パラメタが両方ともfalseだった場合は,長さ0のglueとする.
5775 \item ユーザ側から見た\Param{\hyperlink{fld:kanjiskip}{kanjiskip}}パラメタの自然長が${\tt \char92 maxdimen}=(2^{30}-1)\,{\rm sp}$で
5776 なければ,\Param{\hyperlink{fld:kanjiskip}{kanjiskip}}パラメタの値を持つglueを採用する.
5777 \item 2.でない場合は,\textit{Nq}, \textit{Np}で使われているJFMに指定されている\Param{\hyperlink{fld:kanjiskip}{kanjiskip}}の値を用いる.
5778 どちらか片方のクラスタだけが和文文字(\textsf{和文A}・\textsf{和文B})のときは,そちらのクラスタで使われている
5779 JFM由来の値だけを用いる.もし両者で使われているJFMが異なった場合は,上の[M]~3.と同様の方法を用いて調整する.
5780 \end{enumerate}
5781 \end{description}
5782 \paragraph{「左空白」の算出とそれに伴う補正}
5783 「左空白」は過去のバージョンでは定義していたが,このバージョンでは挿入は一切行われない(機能自体削除している).しかし,仕様は流動的であり,将来復活する可能性もあるため,マニュアル中の記述は今のところ極力変更しない.
5784 % 次に,「左空白」にあたる量を算出する:
5785 % \begin{description}
5786 % \item[line-end~{[E]}]
5787 % \textit{Nq}と\textit{Np}の間で行分割が起きたときに,
5788 % \textit{Nq}と行末の間に入る空白である.ぶら下げ組の組版などに用いられることを期待している.
5789 % \begin{enumerate}
5790 % \item 既に算出した「右空白」がカーンである場合は,「左空白」は挿入されない.
5791 % \item 「右空白」がglueか未定義(長さ0のglueとみなす)の場合は,「左空白」は
5792 % \textit{Nq}と「文字コード\texttt{'lineend'}の文字」との間に入るカーンとして,JFMから決定される.
5793 % \item 2.で決まった「左空白」の長さが0でなければ,その分だけ先ほど算出した「右空白」の自然長を引く.
5794 % \end{enumerate}
5795 % \end{description}
5796 \paragraph{禁則用ペナルティの挿入}
5797 まず,
5798 \[
5799  a:=(\text{\textit{Nq}{\footnotemark}の文字に対する\Param{\hyperlink{fld:postbp}{postbreakpenalty}}の値})
5800 +(\text{\textit{Np}{\footnotemark}の文字に対する\Param{\hyperlink{fld:prebp}{prebreakpenalty}}の値})
5801 \]
5802 とおく\footnotetext{厳密にはそれぞれ$\mathit{Nq}.\mathit{tail}$,$\mathit{Np}.\mathit{head}$.}.
5803 ペナルティは通常$[-10000,10000]$の整数値をとり,また$\pm 10000$は正負の無限大を意味することになっているが,この$a$の
5804 算出では単純な整数の加減算を行う.
5805
5806 $a$は禁則処理用に\textit{Nq}と\textit{Np}の間に加えられるべきペナルティ量である.
5807 \begin{description}
5808 \item[P-normal~{[PN]}]
5809 \textit{Nq}と\textit{Np}の間の(a)部分にペナルティ(\textit{penalty\_node})があれば処理は簡単である:
5810 それらの各ノードにおいて,ペナルティ値を($\pm 10000$を無限大として扱いつつ)$a$だけ増加させればよい.
5811 また,$10000 + (-10000) = 0$としている.
5812
5813 少々困るのは,(a)部分にペナルティが存在していない場合である.
5814 直感的に,補正すべき量$a$が0でないとき,その値をもつ\textit{penalty\_node}を作って
5815 「右空白」の(もし未定義なら\textit{Np}の)直前に挿入……
5816 ということになるが,実際には僅かにこれより複雑である.
5817 \begin{itemize}
5818 \item 「右空白」がカーンであるとき,
5819 それは「\textit{Nq}と\textit{Np}の間で改行は許されない」ことを意図している.そのため,
5820 この場合は$a\neq 0$であってもペナルティの挿入はしない.
5821 \item 「左空白」がカーンとしてきっちり定義されている時(このとき,「右空白」はカーンでない),
5822 この「左空白」の直後での行分割を許容しないといけないので,$a=0$であっても
5823 \textit{penalty\_node}を作って挿入する.
5824 \item 以上のどれでもないときは,$a\neq 0$ならば\textit{penalty\_node}を作って挿入する.
5825 \end{itemize}
5826 \end{description}
5827
5828 \def\gkf#1#2#3{\sf$\displaystyle\vphantom{\Bigg(}%
5829   \frac{\hbox to 1\zw{#1}\hbox to 4.5\zw{\hss #2}}{\hbox{#3}}$}
5830 \begin{table}[t]
5831 %<en>\caption{Summary of JFM glues.}
5832 %<ja>\caption{JFM グルーの概要.}
5833 %<zh>\caption{JFM胶总结。}
5834 \label{tab-jfmglue}
5835 \begin{center}
5836 \small
5837 \begin{tabular}{c|cccccc}
5838 \toprule
5839 {\bf\textit{Np}}↓&\sf 和文A&\sf 和文B&\sf 欧文&\sf 箱&\sf glue&\sf kern\\\midrule
5840 \sf 和文A&
5841 \gkf{E}{M→K}{PN}&
5842 \gkf{---}{\OA →K}{PN}&
5843 \gkf{---}{\OA →X}{PN}&
5844 \gkf{---}{\OA}{PA}&
5845 \gkf{---}{\OA}{PN}&
5846 \gkf{---}{\OA}{PS}\\
5847 \sf 和文B&
5848 \gkf{E}{\OB→K}{PA}&
5849 \gkf{---}{K}{PS}&
5850 \gkf{---}{X}{PS}\\
5851 \sf 欧文&
5852 \gkf{E}{\OB →X}{PA}&
5853 \gkf{---}{X}{PS}\cr
5854 \sf 箱&\gkf{E}{\OB}{PA}\\
5855 \sf glue&\gkf{E}{\OB}{PN}\\
5856 \sf kern&\gkf{E}{\OB}{PS}\\
5857 \bottomrule
5858 \end{tabular}
5859 \end{center}
5860 \begin{quote}
5861 %<*en>
5862 Here {\small\gkf{E}{M→K}{PN}} means that
5863 %</en>
5864 %<*ja>
5865 ここで {\small\gkf{E}{M→K}{PN}} は次の意味である:
5866 %</ja>
5867 \begin{enumerate}
5868 %<*en>
5869 \item To determine the `right-space', \LuaTeX-ja first attempts by the method `\textsf{JFM-origin~[M]}'.
5870 If this attempt fails, \LuaTeX-ja use the method `\textsf{\Param{kanjiskip}~[K]}'.
5871 %</en>
5872 %<*ja>
5873 \item 「右空白」を決めるために,\LuaTeX-ja はまず「JFM由来{[M]}」の方法を試みる.
5874   これが失敗したら,\LuaTeX-ja は「\Param{kanjiskip}~{[K]}」の方法を試みる.
5875 %</ja>
5876
5877 %<*en>
5878 \item The `left space' between \textit{Nq}~and~\textit{Np} is determined by the method `\textsf{line-end~[E]}'.
5879 %</en>
5880 %<*ja>
5881 \item \textit{Nq} と \textit{Np} の間の「左空白」は「\textsf{line-end~[E]}」の
5882   方法で決定される.
5883 %</ja>
5884
5885 %<*en>
5886 \item \LuaTeX-ja adopts the method `\textsf{P-normal~[PN]}' to adjust the penalty between two clusters for \emph{kinsoku shori}.
5887 %</en>
5888 %<*ja>
5889 \item \LuaTeX-jaは2つのクラスタの間の禁則処理用のペナルティを調節するために「\textsf{P-normal~[PN]}」の方法を採用する.
5890 %</ja>
5891 \end{enumerate}
5892 \end{quote}
5893 \end{table}
5894
5895 \subsection{その他の場合}
5896 本節の内容は表\ref{tab-jfmglue}にまとめてある.
5897
5898 \paragraph{和文Aと欧文の間}
5899 \textit{Nq}が\textsf{和文A}で,\textit{Np}が\textsf{欧文}の場合,JFMグルー挿入処理は次のようにして行われる.
5900 \begin{itemize}
5901 \item 「右空白」については,まず以下に述べる\textsf{Boundary-B~[\OB]}により空白を決定しようと試みる.
5902 それが失敗した場合は,\textsf{\Param{\hyperlink{fld:xks}{xkanjiskip}}~[X]}によって定める.
5903 \item 「左空白」については,既に述べた\textsf{line-end~[E]}をそのまま採用する.それに伴う「右空白」の補正も同じ.
5904 \item 禁則用ペナルティも,以前述べた\textsf{P-normal~[PN]}と同じである.
5905 \end{itemize}
5906 \begin{description}
5907 \item[Boundary-B~{[\OB]}] 和文文字と「和文でないもの」との間に入る空白を以下によって求め,
5908 未定義でなければそれを「右空白」として採用する.
5909 \textsf{JFM-origin~[M]}の変種と考えて良い.
5910 これによって定まる空白の典型例は,和文の閉じ括弧と欧文文字の間に入る半角アキである.
5911 \begin{enumerate}
5912 \item もし両クラスタの間で\verb+\inhibitglue+が実行されていた場合(証としてwhatsitノードが自動挿入される),次へ.
5913 \item そうでなければ,
5914 \textit{Nq}と「文字コードが{\tt'jcharbdd'}の文字」との間に入るグルー/カーンとして定まる.
5915 \end{enumerate}
5916 \item[\Param{\hyperlink{fld:xks}{xkanjiskip}}~{[X]}]
5917 この段階では,\textsf{\Param{kanjiskip}~[K]}のときと同じように,
5918 以下で定めた量を「右空白」として採用する.
5919 この段階で\verb+\inhibitglue+は効力を持たないのも同じである.
5920 \begin{enumerate}
5921 \item 以下のいずれかの場合は,\Param{\hyperlink{fld:xks}{xkanjiskip}}の挿入は抑止される.しかし,実際には行分割を許容するために,長さ0のglueを採用する:
5922 \begin{itemize}
5923 \item 両クラスタにおいて,それらの中身の文字コードに対する\Param{autoxspacing}パラメタが共にfalseである.
5924 \item \textit{Nq}の中身の文字コードについて,「直後への\Param{\hyperlink{fld:xks}{xkanjiskip}}の挿入」が禁止されている
5925 (つまり,\Param{jaxspmode}~(or \Param{alxspmode})パラメタが2以上).
5926 \item \textit{Np}の中身の文字コードについて,「直前への\Param{\hyperlink{fld:xks}{xkanjiskip}}の挿入」が禁止されている
5927 (つまり,\Param{jaxspmode}~(or \Param{alxspmode})パラメタが偶数).
5928 \end{itemize}
5929 \item ユーザ側から見た\Param{\hyperlink{fld:xks}{xkanjiskip}}パラメタの自然長が${\tt \char92 maxdimen}=(2^{30}-1)\,{\rm sp}$で
5930 なければ,\Param{\hyperlink{fld:xks}{xkanjiskip}}パラメタの値を持つglueを採用する.
5931 \item 2.でない場合は,\textit{Nq}, \textit{Np}(\textsf{和文A}/\textsf{和文B}なのは片方だけ)
5932 で使われているJFMに指定されている\Param{\hyperlink{fld:xks}{xkanjiskip}}の値を用いる.
5933 \end{enumerate}
5934 \end{description}
5935
5936 \paragraph{欧文と和文Aの間}
5937 \textit{Nq}が\textsf{欧文}で,\textit{Np}が\textsf{和文A}の場合,JFMグルー挿入処理は上の場合とほぼ同じである.
5938 \textsf{和文A}のクラスタが逆になるので,\textsf{Boundary-A~[\OA]}の部分が変わるだけ.
5939 \begin{itemize}
5940 \item 「右空白」については,まず以下に述べる\textsf{Boundary-A~[\OA]}により空白を決定しようと試みる.
5941 それが失敗した場合は,\textsf{\Param{\hyperlink{fld:xks}{xkanjiskip}}~[X]}によって定める.
5942 \item \textit{Nq}が和文でないので,「左空白」は算出されない.
5943 \item 禁則用ペナルティは,以前述べた\textsf{P-normal~[PN]}と同じである.
5944 \end{itemize}
5945 \begin{description}
5946 \item[Boundary-A~{[\OA]}] 「和文でないもの」と和文文字との間に入る空白を以下によって求め,
5947 未定義でなければそれを「右空白」として採用する.
5948 \textsf{JFM-origin~[M]}の変種と考えて良い.
5949 これによって定まる空白の典型例は,欧文文字と和文の開き括弧との間に入る半角アキである.
5950 \begin{enumerate}
5951 \item もし両クラスタの間で\verb+\inhibitglue+が実行されていた場合(証としてwhatsitノードが自動挿入される),次へ.
5952 \item そうでなければ,
5953 「文字コードが{\tt'jcharbdd'}の文字」と\textit{Np}との間に入るグルー/カーンとして定まる.
5954 \end{enumerate}
5955 \end{description}
5956
5957 \paragraph{和文Aと箱・グルー・カーンの間}
5958 \textit{Nq}が\textsf{和文A}で,\textit{Np}が\textsf{箱}・グルー・カーンのいずれかであった場合,
5959 両者の間に挿入されるJFMグルーについては同じ処理である.しかし,そこでの行分割に対する仕様が異なるので,
5960 ペナルティの挿入処理は若干異なったものとなっている.
5961
5962 \begin{itemize}
5963 \item 「右空白」については,既に述べた\textsf{Boundary-B~[\OB]}により空白を決定しようと試みる.
5964 それが失敗した場合は,「右空白」は挿入されない.
5965 \item 「左空白」については,既に述べた\textsf{line-end~[E]}の算出方法をそのまま採用する.それに伴う「右空白」の補正も同じ.
5966 \item 禁則用ペナルティの処理は,後ろのクラスタ\textit{Np}の種類によって異なる.
5967 なお,$\mathit{Np}.\mathit{head}$は無意味であるから,
5968 「$\mathit{Np}.\mathit{head}$に対する\Param{\hyperlink{fld:prebp}{prebreakpenalty}}の値」は0とみなされる.言い換えれば,
5969 \[
5970  a:=(\text{\textit{Nq}{\footnotemark}の文字に対する\Param{\hyperlink{fld:postbp}{postbreakpenalty}}の値}).
5971 \]
5972 \begin{description}
5973 \item[箱] \textit{Np}が\textsf{箱}であった場合は,両クラスタの間での行分割は
5974 (明示的に両クラスタの間に\verb+\penalty10000+があった場合を除き)いつも許容される.そのため,
5975 ペナルティ処理は,後に述べる\textsf{P-allow~[PA]}が\textsf{P-normal~[PN]}の代わりに用いられる.
5976 \item[グルー] \textit{Np}がグルーの場合,ペナルティ処理は\textsf{P-normal~[PN]}を用いる.
5977 \item[カーン] \textit{Np}がカーンであった場合は,両クラスタの間での行分割は
5978 (明示的に両クラスタの間にペナルティがあった場合を除き)許容されない.
5979 ペナルティ処理は,後に述べる\textsf{P-suppress~[PS]}を使う.
5980 \end{description}
5981 これらの\textsf{P-normal~[PN]},\textsf{P-allow~[PA]},\textsf{P-suppress~[PS]}の違いは,
5982 \textit{Nq}と\textit{Np}の間(以前の図だと(a)の部分)にペナルティが存在しない場合にのみ存在する.
5983 \end{itemize}
5984
5985 \begin{description}
5986 \item[P-allow~{[PA]}]
5987 \textit{Nq}と\textit{Np}の間の(a)部分にペナルティがあれば,\textsf{P-normal~[PN]}と同様に,
5988 それらの各ノードにおいてペナルティ値を$a$だけ増加させる.
5989
5990 (a)部分にペナルティが存在していない場合,
5991 \LuaTeX-ja は\textit{Nq}と\textit{Np}の間の行分割を可能にしようとする.
5992 そのために,以下の場合に$a$をもつ\textit{penalty\_node}を作って
5993 「右空白」の(もし未定義なら\textit{Np}の)直前に挿入する:
5994 \begin{itemize}
5995 \item 「右空白」がグルーでない(カーンか未定義)であるとき.
5996 \item 「左空白」がカーンとしてきっちり定義されている時.
5997 \end{itemize}
5998
5999 \item[P-suppress~{[PS]}]
6000 \textit{Nq}と\textit{Np}の間の(a)部分にペナルティがあれば,\textsf{P-normal~[PN]}と同様に,
6001 それらの各ノードにおいてペナルティ値を$a$だけ増加させる.
6002
6003 (a)部分にペナルティが存在していない場合,
6004 \textit{Nq}と\textit{Np}の間の行分割は元々不可能のはずだったのであるが,
6005 \LuaTeX-ja はそれをわざわざ行分割可能にはしない.
6006 そのため,「右空白」がglueであれば,その直前に\verb+\penalty10000+を挿入する.
6007 \end{description}
6008
6009 なお,「右空白」はカーン,「左空白」は未定義の
6010 \[
6011  \overbrace{\Node{glyph}{`あ'}}^{\mathit{Nq}}\longrightarrow \overbrace{\Node{glue}{1\,pt}}^{\mathit{Np}}
6012 \]
6013 のような状況を考える.
6014 このとき,$a$,即ち「あ」の\Param{\hyperlink{fld:postbp}{postbreakpenalty}}がいかなる値であっても,
6015 この2クラスタ間は最終的に
6016 \begin{equation}
6017  \overbrace{\Node{glyph}{`あ'}}^{\mathit{Nq}}\longrightarrow
6018 \Node{kern}{右空白}\longrightarrow \overbrace{\Node{glue}{1\,pt}}^{\mathit{Np}}
6019 \label{eq-gref}
6020 \end{equation}
6021 となり,$a$分のペナルティは挿入されないことに注意して欲しい.
6022 \Param{\hyperlink{fld:postbp}{postbreakpenalty}}は($a$は)殆どの場合が非負の値と考えられ,そのような場合では
6023 \eqref{eq-gref}と
6024 \[
6025  \overbrace{\Node{glyph}{`あ'}}^{\mathit{Nq}}\longrightarrow
6026 \Node{penalty}{$a$}\longrightarrow
6027 \Node{kern}{右空白}\longrightarrow \overbrace{\Node{glue}{1\,pt}}^{\mathit{Np}}
6028 \]
6029 との間に差異は生じない%
6030 \footnote{kern$\rightarrow$glueが1つの行分割可能点(行分割に伴うペナルティは0)
6031 であるため,たとえ$a=10000$であっても,\textit{Nq}と\textit{Np}の間で行分割を禁止することはできない.}.
6032
6033 \paragraph{箱・グルー・カーンと和文Aの間}
6034 \textit{Np}が\textsf{箱}・グルー・カーンのいずれかで,\textit{Np}が\textsf{和文A}であった場合は,
6035 すぐ上の(\textit{Nq}と\textit{Np}の順序が逆になっている)場合とほぼ同じであるが,「左空白」がなくなることにのみ注意.
6036 \begin{itemize}
6037 \item 「右空白」については,既に述べた\textsf{Boundary-A~[\OA]}により空白を決定しようと試みる.
6038 それが失敗した場合は,「右空白」は挿入されない.
6039 \item \textit{Nq}が和文でないので,「左空白」は算出されない.
6040 \item 禁則用ペナルティの処理は,\textit{Nq}の種類によって異なる.
6041 $\mathit{Nq}.\mathit{tail}$は無意味なので,
6042 \[
6043  a:=(\text{\textit{Np}{\footnotemark}の文字に対する\Param{\hyperlink{fld:prebp}{prebreakpenalty}}の値}).
6044 \]
6045 \begin{description}
6046 \item[箱] \textit{Nq}が\textsf{箱}の場合は,\textsf{P-allow~[PA]}を用いる.
6047 \item[グルー] \textit{Nq}がグルーの場合は,\textsf{P-normal~[PN]}を用いる.
6048 \item[カーン] \textit{Nq}がカーンの場合は,\textsf{P-suppress~[PS]}を用いる.
6049 \end{description}
6050 \end{itemize}
6051
6052 \paragraph{和文Aと和文Bの違い}
6053 先に述べたように,\textsf{和文B}は水平ボックスの中身の先頭(or 末尾)として出現している
6054 和文文字である.リスト内に直接ノードとして現れている和文文字(\textsf{和文A})との違いは,
6055 \begin{itemize}
6056 \item \textsf{和文B}に対しては,JFMの文字クラス指定から定まる空白
6057 \textsf{JFM-origin~[M]},\textsf{Boundary-A~[\OA]},\textsf{Boundary-B~[\OB]})の挿入は行われない.
6058 「左空白」の算出も行われない.例えば,
6059 \begin{itemize}
6060 \item 片方が\textsf{和文A},もう片方が\textsf{和文B}のクラスタの場合,
6061 \textsf{Boundary-A~[\OA]}または\textsf{Boundary-B~[\OB]}の挿入を試み,それがダメなら
6062 \Param{kanjiskip}~\textsf{[K]}の挿入を行う.
6063 \item \textsf{和文B}の2つのクラスタの間には,\Param{kanjiskip}~\textsf{[K]}が自動的に入る.
6064 \end{itemize}
6065 \item \textsf{和文B}と箱・グルー・カーンが隣接したとき(どちらが前かは関係ない),間にJFMグルー・ペナルティの挿入は一切しない.
6066 \item \textsf{和文B}と\textsf{和文B},また\textsf{和文B}と\textsf{欧文}とが隣接した時は,禁則用ペナルティ挿入処理は
6067 \textsf{P-suppress~[PS]}が用いられる.
6068 \item \textsf{和文B}の文字に対する\Param{\hyperlink{fld:prebp}{prebreakpenalty}},~\Param{\hyperlink{fld:postbp}{postbreakpenalty}}の値は使われず,0として計算される.
6069 \end{itemize}
6070
6071
6072 次が具体例である:
6073 \begin{LTXexample}
6074 あ.\inhibitglue A\\
6075 \hbox{あ.}A\\
6076 あ.A
6077 \end{LTXexample}
6078 \begin{itemize}
6079 \item 1行目の\verb+\inhibitglue+は\textsf{Boundary-B~[\OB]}の処理のみを抑止するので,ピリオドと「A」の間には
6080 \Param{\hyperlink{fld:xks}{xkanjiskip}}(四分アキ)が入ることに注意.
6081 \item 2行目のピリオドと「A」の間においては,前者が\textsf{和文B}となる(水平ボックスの中身の末尾として登場しているから)ので,
6082 そもそも\textsf{Boundary-B~[\OB]}の処理は行われない.よって,\Param{\hyperlink{fld:xks}{xkanjiskip}}が入ることとなる.
6083 \item 3行目では,ピリオドの属するクラスタは\textsf{和文A}である.これによって,
6084 ピリオドと「A」の間には\textsf{Boundary-B~[\OB]}由来の半角アキが入ることになる.
6085 \end{itemize}
6086
6087 \section{psft}
6088 ...
6089
6090 %<en>\section{Patch for the \Pkg{listings} package}
6091 %<zh>\section{Patch for the \Pkg{listings} package}
6092 %<ja>\section{\Pkg{listings} パッケージへの対応}
6093
6094 %<*en>
6095 It is well-known that the \Pkg{listings} package outputs weird results
6096 for Japanese input.
6097 The \Pkg{listings} package makes most of letters active and assigns
6098 output command for each letter \cite{listings}.
6099 But Japanese characters are not included in these activated letters.
6100 For \pTeX{} series, there is no method to make Japanese characters active;
6101 a patch \Pkg{jlisting.sty} \cite{jlisting} resolves the problem forcibly.
6102 %</en>
6103 %<*ja>
6104 \Pkg{listings} パッケージが,そのままでは日本語をまともに出力できないこと
6105 はよく知られている.きちんと整形して出力するために,\Pkg{listings}パッケー
6106 ジは内部で「ほとんどの文字」をアクティブにし,各文字に対してその文字の出
6107 力命令を割り当てている \cite{listings}.
6108 しかし,そこでアクティブにする文字の中に,和文文
6109 字がないためである.\pTeX 系列では,和文文字をアクティブにする手法がなく,
6110 \Pkg{jlisting.sty} というパッチ\cite{jlisting}を用いることで無理やり解決していた.
6111 %</ja>
6112
6113 %<*en>
6114 In \LuaTeX-ja, the problem is resolved by using \verb+process_input_buffer+ callback.
6115 The callback function inserts the output command before each letter above U+0080.
6116 This method can omits the process to make all Japanese characters active
6117 (most of the activated characters are not used in many cases).
6118 %</en>
6119 %<*ja>
6120 \LuaTeX-jaでは,\verb+process_input_buffer+ コールバックを利用することで,
6121 「各行に出現するU+0080以降の文字に対して,それらの出力命令を前置する」という方法をとっている.
6122 これにより,(入力には使用されていないかもしれない)和文文字をもすべてアクティブ化する手間もなく,
6123 見通しが良い実装になっている.
6124 %</ja>
6125
6126 %<*en>
6127 If \Pkg{listings.sty} and \LuaTeX-ja were loaded,
6128 then the patch \Pkg{lltjp-listings.sty} is loaded automatically at \verb+\begin{document}+.
6129 %</en>
6130 %<*ja>
6131 \LuaTeX-ja で利用される \Pkg{listings} パッケージへのパッチ \Pkg{lltjp-listings.sty} は,
6132 \Pkg{listings.sty} と\LuaTeX-jaを読み込んでおけば,
6133 \verb+\begin{document}+ の箇所において自動的に読み込まれるので,通常はあまり
6134 意識する必要はない.
6135 %</ja>
6136
6137 %<en>\paragraph{Class of characters}
6138 %<ja>\paragraph{文字種}
6139
6140 %<*en>
6141 Roughly speaking, the \Pkg{listings} package processes input as follows:
6142 %</en>
6143 %<*ja>
6144 \Pkg{listings} パッケージの内部では,大雑把に言うと
6145 %</ja>
6146 \begin{enumerate}
6147 %<zh>\item ...
6148 %<*en>
6149 \item Collects \textit{letters} and \textit{digits}, which can be used for the name of identifiers.
6150 %</en>
6151 %<*ja>
6152 \item 識別子として使える文字 (``letter'',~``digit'') たちを
6153 集める.
6154 %</ja>
6155 %<*en>
6156 \item When reading an \textit{other}, outputs the collected character string (with modification, if needed).
6157 %</en>
6158 %<*ja>
6159 \item letterでもdigitでもない文字が現れた時に,収集した文字列を(必要なら修飾して)出力する.
6160 %</ja>
6161 %<*en>
6162 \item Collects \textit{others}.
6163 %</en>
6164 %<*ja>
6165 \item 今度は逆に,letterでない文字たちをletterが現れるまで集める.
6166 %</ja>
6167 %<*en>
6168 \item When reading a \textit{letter} or a \textit{digit}, outputs the collected character string.
6169 %</en>
6170 %<*ja>
6171 \item letterが出現したら集めた文字列を出力する.
6172 %</ja>
6173 %<*en>
6174 \item Turns back to 1.
6175 %</en>
6176 %<*ja>
6177 \item 1.に戻る.
6178 %</ja>
6179 \end{enumerate}
6180 %<*en>
6181 By the above process, line breaks inside of an identifier are blocked.
6182 A flag \verb+\lst@ifletter+ indicates whether the previous character can be used
6183 for the name of identifiers or not.
6184 %</en>
6185 %<*ja>
6186 という処理が行われている.これにより,識別子の途中では行分割が行われないようになっている.
6187 直前の文字が識別子として使えるか否かは \verb+\lst@ifletter+ というフラグに格納されている.
6188 %</ja>
6189
6190 %<*en>
6191 For Japanese characters, line breaks are permitted on both sides
6192 except for parentheses, dashes, etc.
6193 To process Japanese characters,
6194 The pacth \Pkg{lltjp-listings.sty} introduces a new flag \verb+\lst@ifkanji+, which indicates
6195 whether the previous character is Japanese character or not.
6196 For illustration, we introduce the following classes of character:
6197 %</en>
6198 %<*ja>
6199 さて,日本語の処理である.殆どの和文文字の前後では行分割が可能であるが,その一方で
6200 括弧類や音引きなどでは禁則処理が必要なことから,\Pkg{lltjp-listings.sty} では,
6201 直前が和文文字であるかを示すフラグ \verb+\lst@ifkanji+ を新たに導入した.
6202 以降,説明のために以下のように文字を分類する:
6203 %</ja>
6204 \begin{center}
6205 \small
6206 \begin{tabular}{lccccc}
6207 \toprule
6208 &Letter&Other&Kanji&Open&Close\\\midrule
6209 \verb+\lst@ifletter+&T&F&T&F&T\\
6210 \verb+\lst@ifkanji+&F&F&T&T&F\\
6211 %<en>Meaning&identifier char&other alphabet&most of Japanese char&open paren&close paren\\
6212 %<ja>意図&識別子中の文字&その他欧文文字&殆どの和文文字&開き括弧類&閉じ括弧類\\
6213 \bottomrule
6214 \end{tabular}
6215 \end{center}
6216 %<*en>
6217 Note that \textit{digits} in the \Pkg{listings} package can be Letter or
6218 Other according to circumstances.
6219 %</en>
6220 %<*ja>
6221 なお,本来の\Pkg{listings} パッケージでの分類``digit''は,
6222 出現状況によって,上の表のLetterとOtherのどちらにもなりうる.
6223 また,KanjiとCloseは \verb+\lst@ifletter+ と \verb+\lst@ifkanji+ の値が一致しているが,
6224 これは間違いではない.
6225 %</ja>
6226
6227 %<*en>
6228 For example, let us consider the case an Open comes after a Letter.
6229 Since an Open represents Japanese open parenthesis,
6230 it is preferred to be permitted to insert line break after the Letter.
6231 Therefore, the collected character string is output in this case.
6232 %</en>
6233 %<*ja>
6234 例えば,Letterの直後にOpenが来た場合を考える.
6235 文字種Openは和文開き括弧類を想定しているので,Letterの直後では行分割が可能であることが望ましい.
6236 そのため,この場合では,すでに収集されている文字列を出力することで行分割を許容するようにした.
6237 %</ja>
6238
6239 %<*en>
6240 The following table summarizes $5\times 5=25$ cases:
6241 %</en>
6242 %<*ja>
6243 同じように,$5\times 5=25$通り全てについて書くと,次のようになる:
6244 %</ja>
6245 \begin{center}
6246 \small
6247 \begin{tabular}{llccccc}
6248 \toprule
6249 %<*en>
6250 &&\multicolumn{4}{c}{Next}\\\cmidrule(lr){3-7}
6251 &&\hbox to 4em{\hss Letter\hss}&\hbox to 4em{\hss Other\hss}
6252 &\hbox to 4em{\hss Kanji\hss}&\hbox to 4em{\hss Open\hss}&Close\\\midrule
6253 &Letter&collects&\multicolumn{3}{c}{\hrulefill \ outputs\ \hrulefill}&collects\\
6254 &Other&outputs&collects&\multicolumn{2}{c}{\hrulefill \ outputs\ \hrulefill}&collects\\
6255 Prev&Kanji&\multicolumn{4}{c}{\hrulefill \ outputs\ \hrulefill}&collects\\
6256 &Open&\multicolumn{5}{c}{\hrulefill \ collects\ \hrulefill}\\
6257 &Close&\multicolumn{4}{c}{\hrulefill \ outputs\ \hrulefill}&collects\\
6258 %</en>
6259 %<*ja>
6260 &&\multicolumn{4}{c}{後ろ側の文字}\\\cmidrule(lr){3-7}
6261 &&\hbox to 4em{\hss Letter\hss}&\hbox to 4em{\hss Other\hss}
6262 &\hbox to 4em{\hss Kanji\hss}&\hbox to 4em{\hss Open\hss}&Close\\\midrule
6263 直&Letter&収集&\multicolumn{3}{c}{\hrulefill \ 出力\ \hrulefill}&収集\\
6264 前&Other&出力&収集&\multicolumn{2}{c}{\hrulefill \ 出力\ \hrulefill}&収集\\
6265 文&Kanji&\multicolumn{4}{c}{\hrulefill \ 出力\ \hrulefill}&収集\\
6266 字&Open&\multicolumn{5}{c}{\hrulefill \ 収集\ \hrulefill}\\
6267 種&Close&\multicolumn{4}{c}{\hrulefill \ 出力\ \hrulefill}&収集\\
6268 %</ja>
6269 \bottomrule
6270 \end{tabular}
6271 \end{center}
6272 %<en>In the above table,
6273 %<ja>上の表において,
6274 \begin{itemize}
6275 %<zh>\item ...
6276 %<en>\item ``outputs'' means to output the collected character string (i.e., line breaking is permitted there).
6277 %<ja>\item 「出力」は,それまでに集めた文字列を出力(≒ここで行分割可能)を意味する.
6278
6279 %<en>\item ``collects'' means to append the next character to the collected character string (i.e., line breaking is prohibited there).
6280 %<ja>\item 「収集」は,後側の文字を,現在収集された文字列に追加(行分割不可)を意味する.
6281 \end{itemize}
6282
6283 %<en>\paragraph{Classification of characters}
6284 %<ja>\paragraph{和文文字扱いとなる文字}
6285
6286 %<*en>
6287 Characters are classified according to \Param{jacharrange} parameter (see Section \ref{ssec-setrange}):
6288 %</en>
6289 %<*ja>
6290 \Pkg{listings} パッケージにおいて和文文字と扱われる
6291 (前に述べたKanji, Open,あるいは「閉じ括弧類」分類)か否かは,
6292 通常の\textbf{JAchar}/\textbf{Alchar}の範囲の設定(\Param{jacharrange} パラメータ,\ref{ssec-setrange}節を参照)に従って行われる:
6293 %</ja>
6294 \begin{itemize}
6295 %<zh>\item ...
6296
6297 %<en>\item \textbf{ALchars} above U+0080 are Letter.
6298 %<ja>\item (U+0080以降の)\textbf{ALchar}は,すべてLetter扱いである.
6299
6300 %<en>\item \textbf{JAchars} are classified in the order as follows:
6301 %<ja>\item (U+0080以降の)\textbf{JAchar}については,以下の順序に従って文字種を決める:
6302 \begin{enumerate}
6303 %<zh>\item ...
6304 %<en>\item Characters whose \Param{\hyperlink{fld:prebp}{prebreakpenalty}} is greater than or equal to 0 are Open.
6305 %<ja>\item \Param{\hyperlink{fld:prebp}{prebreakpenalty}}が0以上の文字はOpen扱いである.
6306
6307 %<en>\item Characters whose \Param{\hyperlink{fld:postbp}{postbreakpenalty}} is greater than or equal to 0 are Close.
6308 %<ja>\item \Param{\hyperlink{fld:postbp}{postbreakpenalty}}が0以上の文字はClose扱いである.
6309
6310 %<en>\item Characters that don't satisfy the above two conditions are Kanji.
6311 %<ja>\item 上の2条件のどちらにも当てはまらなかった文字は,Kanji扱いである.
6312 \end{enumerate}
6313 \end{itemize}
6314
6315 %<*en>
6316 The width of halfwidth kana (U+FF61--U+FF9F) is same as the width of \textbf{ALchar};
6317 the width of the other \textbf{JAchars} is double the width of \textbf{ALchar}.
6318 %</en>
6319 %<*ja>
6320 なお,半角カナ(U+FF61--U+FF9F)以外の\textbf{JAchar}は欧文文字2文字分の幅をとるものとみなされる.
6321 半角カナは欧文文字1文字分の幅となる.
6322 %</ja>
6323
6324 %<*en>
6325 The classification process is executed every time a character appears in
6326 listing environments.
6327 %</en>
6328 %<*ja>
6329 これらの文字種決定は,実際に \texttt{lstlisting} 環境などの内部で文字が出てくるたびに行われる.
6330 %</ja>
6331
6332 %<*ja>
6333 \section{和文の行長補正方法}
6334 \label{sec-adjspec}
6335 \texttt{luatexja-adjust.sty} で提供される優先順位付きの行長調整の詳細を述
6336 べる.大まかに述べると,次のようになる.
6337 \begin{itemize}
6338 \item 通常の\TeX の行分割方法に従って,段落を行分割する.この段階では,行
6339       長に半端が出た場合,その半端分は\Param{\hyperlink{fld:xks}{xkanjiskip}},
6340       \Param{\hyperlink{fld:kanjiskip}{kanjiskip}},JFMグルーの全てで(優先順位なく)負担される.
6341 \item その後,\texttt{post\_linebreak\_filter} callbackを使い,\textbf{段
6342       落中の各行ごとに},行末文字の位置を調整したり,優先度付きの行長調整
6343       を実現するためにグルーの伸縮度を調整する.
6344 \texttt{luatexja-adjust.sty} の作用は,このcallbackを追加するだけであり,
6345       この章の残りではcallbackでの処理について解説する.
6346 \end{itemize}
6347
6348 \paragraph{準備:合計伸縮量の計算}
6349 グルーの伸縮度(\texttt{plus} や \texttt{minus} で指定されている値)には,
6350 有限値の他に,\texttt{fi},\texttt{fil},\texttt{fill},\texttt{filll}と
6351 いう4つの無限大レベル(後ろの方ほど大きい)があり,行の調整に
6352 \texttt{fi} などの\textbf{無限大レベルの伸縮度が用いられている場合は,そ
6353 の行に対しての処理を中止}する.
6354
6355 よって,以降,問題にしている行の行長調整は伸縮度が有限長のグルーを用いて
6356 行われているとして良い.まず,段落中の行中のグルーを
6357 \begin{itemize}
6358 \item 下のどれにも該当しないグルー
6359 \item JFMグルー(優先度別にまとめられる)
6360 \item 和欧文間空白(\Param{\hyperlink{fld:xks}{xkanjiskip}})
6361 \item 和文間空白(\Param{\hyperlink{fld:kanjiskip}{kanjiskip}})
6362 \end{itemize}
6363 の$1+1+5+1=8$つに類別し,それぞれの種別ごとに許容されている伸縮度の合計を計算する.
6364 また,行長と自然長との差の絶対値を計算し,それを\textit{total}とおく.
6365
6366 \subsection{行末文字の位置調整}
6367 まず,行末が文字クラス$n$の\textbf{Jachar}であった場合,
6368 それを動かすことによって,\textbf{JAglue} が負担する調整量を少なくしようとする.
6369 この行末文字の左右の移動可能量は,JFM中にある文字クラス$n$の定義の
6370 \texttt{end\_stretch},~\texttt{end\_shrink}フィールドに全角単位の値として記述されている.
6371
6372 例えば,行末文字が句点「。」であり,そこで用いられているJFM中に
6373 \begin{verbatim}
6374   [2] = {
6375     chars = { '。', ... }, width = 0.5, ...,
6376     end_stretch = 0.5, end_shrink = 0.5,
6377   }, 
6378 \end{verbatim}
6379 という指定があった場合,この行末の句点は
6380 \begin{itemize}
6381 \item 通常の\TeX の行分割処理で「半角以上の詰め」が行われていた場合,
6382 この分の行中の\textbf{JAglue}の負担を軽減するため,
6383 行末の句点を半角だけ右に移動する(ぶら下げ組を行う).
6384 \item 通常の\TeX の行分割処理で「半角以上の空き」が行われていた場合,
6385 逆に行末句点を半角左に移動させる(見た目的に全角取りとなる).
6386 \item 以上のどちらでもない場合,行末句点の位置調整は行わない.
6387 \end{itemize}
6388 となる.
6389
6390 行末文字を移動した場合,その分だけ\textit{total}の値を引いておく.
6391
6392 \subsection{グルーの調整}
6393 \textit{total}の分だけが,行中のグルーの伸縮度に応じて負担されることになる.
6394 ……
6395
6396 %</ja>
6397
6398 %<*en>
6399 \section{Advanced line-adjustment for Japanese characters}
6400 \dots
6401 %</en>
6402
6403
6404
6405
6406 \begin{thebibliography}{99}
6407   \addcontentsline{toc}{section}{\refname}
6408 \bibitem{texbytopic}
6409 Victor Eijkhout,  \emph{\TeX\ by Topic, A \TeX nician's Reference}, Addison-Wesley, 1992.
6410 \bibitem{listings} C.\ Heinz, B.\ Moses. The \textsf{Listings} Package.
6411 \bibitem{jlisting} Thor Watanabe. Listings\ -\ MyTeXpert. \newblock
6412 \url{http://mytexpert.sourceforge.jp/index.php?Listings}
6413 \bibitem{min10} 乙部厳己,min10フォントについて.
6414 \url{http://argent.shinshu-u.ac.jp/~otobe/tex/files/min10.pdf}
6415 \bibitem{jlreq}  W3C Japanese Layout Task Force~(ed), Requirements for Japanese Text Layout (W3C Working Group Note), 2011, 2012. \newblock
6416 \url{http://www.w3.org/TR/jlreq/}%
6417 %<ja> \\日本語訳の書籍版:W3C日本語組版タスクフォース(編),『W3C技術ノート 日本語組版処理の要件』,東京電機大学出版局,2012.
6418 \bibitem{x4051} 日本工業規格(Japanese Industrial Standard) JIS~X~4051,
6419 日本語文書の組版方法(Formatting rules for Japanese documents), 1993, 1995, 2004.
6420 \end{thebibliography}
6421
6422 \newpage
6423 \appendix
6424 \batchmode
6425 %<*!zh>
6426 %<en>\section{The category code of non-kanji characters defined in JIS~X~0213}
6427 %<ja>\section{\LuaTeX-jaにおけるJIS~X~0213非漢字のcatcode}
6428
6429 %<*en>
6430 In these tables, the default catcode (\LuaTeX-ja) and kcatcode ((u)\pTeX) of non-kanji
6431 characters defined in JIS~X~0213 from row 1 to row 13 is summarized.
6432 Each character is printed as follows:
6433 %</en>
6434 %<*ja>
6435 ここでは,JIS~X~0213の非漢字部分(第1区〜第13区)のうち,
6436 どの文字が(u)\pTeX や\LuaTeX-jaで制御綴内に使用可能かを表にしてまとめる.
6437 各文字は
6438 %</ja>
6439 \begin{center}
6440 \tt\fboxsep=1pt\fbox{\hbox to \zw{\gt あ\hss}}\,\scriptsize LUP
6441 \end{center}
6442 %<*ja>
6443 のように表示しており,各文字は次の意味を持っている.
6444 この表の生成は,JIS~X~0208の範囲内の文字については\verb+\jis+命令を使って行なっている.
6445 %</ja>
6446 %<*en>
6447 The tables are generated by using \verb+\jis+ command for characters included in
6448 JIS~X~0208.
6449 Each character in the tables means:
6450 %</en>
6451 \begin{itemize}
6452 %<*en>
6453 \item The background of a character regarded as \textbf{ALchar} in \LuaTeX-ja
6454   is colored light blue.
6455 %</en>
6456 %<*ja>
6457 \item 背景が薄く青く塗られている文字は,
6458 \LuaTeX-ja の標準で\textbf{ALchar}として認識されている文字である.
6459 %</ja>
6460
6461 %<*en>
6462 \item The first letter {\tt L} means that the character is available for
6463   the name of a control sequence in \XeTeX{} and \LuaTeX-ja (its catcode is 11).
6464 %</en>
6465 %<*ja>
6466 \item 1文字目の {\tt L} は,\XeTeX や\LuaTeX-jaにおいてこの文字が制御綴内に
6467 使用可能(catcodeが11)であることを表している.
6468 %</ja>
6469
6470 %<*en>
6471 \item The second letter {\tt U} means that the character is available for
6472   the name of a control sequence in \upTeX{} (its kcatcode is 16 or 17).
6473   \upTeX{} regards these characters as Japanese character.
6474 %</en>
6475 %<*ja>
6476 \item 2文字目の{\tt U} は,\upTeX においてこの文字が制御綴内に使用可能(kcatcodeは16,~17)であることを
6477 表している.この範囲内では,\upTeX は標準で全文字を和文文字として扱うようである.
6478 %</ja>
6479
6480 %<*en>
6481 \item The third letter {\tt P} means that the character is available for
6482   the name of a control sequence in \pTeX{} (its kcatcode is 16 or 17).
6483 %</en>
6484 %<*ja>
6485 \item 3文字目の {\tt P} は,\pTeX においてこの文字が制御綴内に使用可能(kcatcodeは16,~17)であることを
6486 表している.
6487 %</ja>
6488
6489 %<*en>
6490 \item If the third letter is {\tt -} (or the character is printed in red),
6491   the character is not included in JIS~X~0208.
6492   Therefore, you can consider the character is not available in \pTeX.
6493 %</en>
6494 %<*ja>
6495 \item 3文字目が{\tt -}となっているもの(本体の文字も赤身がかっている)は,
6496 JIS~X~0208にないため\pTeX では使用不能と考えて良いものである.
6497 %</ja>
6498
6499 %<*en>
6500 \item The kana for bidakuon in row 4 and 5 are omitted.
6501 %</en>
6502 %<*ja>
6503 \item 第4区と第5区にある,鼻濁音の仮名については省略した.
6504 %</ja>
6505 \end{itemize}
6506
6507
6508 \makeatletter
6509 \def\uplist{% upTeX で \kcatcode!=18 なもの
6510   \@elt {8486}\@elt {8491}\@elt {8492}\@elt {8499}\@elt {8500}\@elt {8501}%
6511   \@elt {8502}\@elt {8504}\@elt {8508}\@elt {9008}\@elt {9009}\@elt {9010}%
6512   \@elt {9011}\@elt {9012}\@elt {9013}\@elt {9014}\@elt {9015}\@elt {9016}%
6513   \@elt {9017}\@elt {9025}\@elt {9026}\@elt {9027}\@elt {9028}\@elt {9029}%
6514   \@elt {9030}\@elt {9031}\@elt {9032}\@elt {9033}\@elt {9034}\@elt {9035}%
6515   \@elt {9036}\@elt {9037}\@elt {9038}\@elt {9039}\@elt {9040}\@elt {9041}%
6516   \@elt {9042}\@elt {9043}\@elt {9044}\@elt {9045}\@elt {9046}\@elt {9047}%
6517   \@elt {9048}\@elt {9049}\@elt {9050}\@elt {9057}\@elt {9058}\@elt {9059}%
6518   \@elt {9060}\@elt {9061}\@elt {9062}\@elt {9063}\@elt {9064}\@elt {9065}%
6519   \@elt {9066}\@elt {9067}\@elt {9068}\@elt {9069}\@elt {9070}\@elt {9071}%
6520   \@elt {9072}\@elt {9073}\@elt {9074}\@elt {9075}\@elt {9076}\@elt {9077}%
6521   \@elt {9078}\@elt {9079}\@elt {9080}\@elt {9081}\@elt {9082}\@elt {9249}%
6522   \@elt {9250}\@elt {9251}\@elt {9252}\@elt {9253}\@elt {9254}\@elt {9255}%
6523   \@elt {9256}\@elt {9257}\@elt {9258}\@elt {9259}\@elt {9260}\@elt {9261}%
6524   \@elt {9262}\@elt {9263}\@elt {9264}\@elt {9265}\@elt {9266}\@elt {9267}%
6525   \@elt {9268}\@elt {9269}\@elt {9270}\@elt {9271}\@elt {9272}\@elt {9273}%
6526   \@elt {9274}\@elt {9275}\@elt {9276}\@elt {9277}\@elt {9278}\@elt {9279}%
6527   \@elt {9280}\@elt {9281}\@elt {9282}\@elt {9283}\@elt {9284}\@elt {9285}%
6528   \@elt {9286}\@elt {9287}\@elt {9288}\@elt {9289}\@elt {9290}\@elt {9291}%
6529   \@elt {9292}\@elt {9293}\@elt {9294}\@elt {9295}\@elt {9296}\@elt {9297}%
6530   \@elt {9298}\@elt {9299}\@elt {9300}\@elt {9301}\@elt {9302}\@elt {9303}%
6531   \@elt {9304}\@elt {9305}\@elt {9306}\@elt {9307}\@elt {9308}\@elt {9309}%
6532   \@elt {9310}\@elt {9311}\@elt {9312}\@elt {9313}\@elt {9314}\@elt {9315}%
6533   \@elt {9316}\@elt {9317}\@elt {9318}\@elt {9319}\@elt {9320}\@elt {9321}%
6534   \@elt {9322}\@elt {9323}\@elt {9324}\@elt {9325}\@elt {9326}\@elt {9327}%
6535   \@elt {9328}\@elt {9329}\@elt {9330}\@elt {9331}\@elt {9505}\@elt {9506}%
6536   \@elt {9507}\@elt {9508}\@elt {9509}\@elt {9510}\@elt {9511}\@elt {9512}%
6537   \@elt {9513}\@elt {9514}\@elt {9515}\@elt {9516}\@elt {9517}\@elt {9518}%
6538   \@elt {9519}\@elt {9520}\@elt {9521}\@elt {9522}\@elt {9523}\@elt {9524}%
6539   \@elt {9525}\@elt {9526}\@elt {9527}\@elt {9528}\@elt {9529}\@elt {9530}%
6540   \@elt {9531}\@elt {9532}\@elt {9533}\@elt {9534}\@elt {9535}\@elt {9536}%
6541   \@elt {9537}\@elt {9538}\@elt {9539}\@elt {9540}\@elt {9541}\@elt {9542}%
6542   \@elt {9543}\@elt {9544}\@elt {9545}\@elt {9546}\@elt {9547}\@elt {9548}%
6543   \@elt {9549}\@elt {9550}\@elt {9551}\@elt {9552}\@elt {9553}\@elt {9554}%
6544   \@elt {9555}\@elt {9556}\@elt {9557}\@elt {9558}\@elt {9559}\@elt {9560}%
6545   \@elt {9561}\@elt {9562}\@elt {9563}\@elt {9564}\@elt {9565}\@elt {9566}%
6546   \@elt {9567}\@elt {9568}\@elt {9569}\@elt {9570}\@elt {9571}\@elt {9572}%
6547   \@elt {9573}\@elt {9574}\@elt {9575}\@elt {9576}\@elt {9577}\@elt {9578}%
6548   \@elt {9579}\@elt {9580}\@elt {9581}\@elt {9582}\@elt {9583}\@elt {9584}%
6549   \@elt {9585}\@elt {9586}\@elt {9587}\@elt {9588}\@elt {9589}\@elt {9590}%
6550   % ここから JIS X 0213
6551   \@elt {8760}\@elt {8761}\@elt {9083}\@elt {9332}\@elt {9333}\@elt {9334}%
6552   \@elt {9335}\@elt {9336}\@elt {9337}\@elt {9338}\@elt {9339}\@elt {9591}%
6553   \@elt {9592}\@elt {9593}\@elt {9594}\@elt {9595}\@elt {9596}\@elt {9597}%
6554   \@elt {9598}\@elt {9838}\@elt {9839}\@elt {9840}\@elt {9841}\@elt {9842}%
6555   \@elt {9843}\@elt {9844}\@elt {9845}\@elt {9846}\@elt {9847}\@elt {9848}%
6556   \@elt {9849}\@elt {9850}\@elt {9851}\@elt {9852}\@elt {9853}\@elt {9854}%
6557   \@elt {10098}\@elt {10099}\@elt {10100}\@elt {10101}%
6558 }
6559 \def\plist{% pTeX で \kcatcode!=18 なもの
6560   \@elt {8993}\@elt {8994}\@elt {8995}\@elt {8996}\@elt {8997}\@elt {8998}%
6561   \@elt {8999}\@elt {9000}\@elt {9001}\@elt {9002}\@elt {9003}\@elt {9004}%
6562   \@elt {9005}\@elt {9006}\@elt {9007}\@elt {9008}\@elt {9009}\@elt {9010}%
6563   \@elt {9011}\@elt {9012}\@elt {9013}\@elt {9014}\@elt {9015}\@elt {9016}%
6564   \@elt {9017}\@elt {9018}\@elt {9019}\@elt {9020}\@elt {9021}\@elt {9022}%
6565   \@elt {9023}\@elt {9024}\@elt {9025}\@elt {9026}\@elt {9027}\@elt {9028}%
6566   \@elt {9029}\@elt {9030}\@elt {9031}\@elt {9032}\@elt {9033}\@elt {9034}%
6567   \@elt {9035}\@elt {9036}\@elt {9037}\@elt {9038}\@elt {9039}\@elt {9040}%
6568   \@elt {9041}\@elt {9042}\@elt {9043}\@elt {9044}\@elt {9045}\@elt {9046}%
6569   \@elt {9047}\@elt {9048}\@elt {9049}\@elt {9050}\@elt {9051}\@elt {9052}%
6570   \@elt {9053}\@elt {9054}\@elt {9055}\@elt {9056}\@elt {9057}\@elt {9058}%
6571   \@elt {9059}\@elt {9060}\@elt {9061}\@elt {9062}\@elt {9063}\@elt {9064}%
6572   \@elt {9065}\@elt {9066}\@elt {9067}\@elt {9068}\@elt {9069}\@elt {9070}%
6573   \@elt {9071}\@elt {9072}\@elt {9073}\@elt {9074}\@elt {9075}\@elt {9076}%
6574   \@elt {9077}\@elt {9078}\@elt {9079}\@elt {9080}\@elt {9081}\@elt {9082}%
6575   \@elt {9083}\@elt {9084}\@elt {9085}\@elt {9086}\@elt {9249}\@elt {9250}%
6576   \@elt {9251}\@elt {9252}\@elt {9253}\@elt {9254}\@elt {9255}\@elt {9256}%
6577   \@elt {9257}\@elt {9258}\@elt {9259}\@elt {9260}\@elt {9261}\@elt {9262}%
6578   \@elt {9263}\@elt {9264}\@elt {9265}\@elt {9266}\@elt {9267}\@elt {9268}%
6579   \@elt {9269}\@elt {9270}\@elt {9271}\@elt {9272}\@elt {9273}\@elt {9274}%
6580   \@elt {9275}\@elt {9276}\@elt {9277}\@elt {9278}\@elt {9279}\@elt {9280}%
6581   \@elt {9281}\@elt {9282}\@elt {9283}\@elt {9284}\@elt {9285}\@elt {9286}%
6582   \@elt {9287}\@elt {9288}\@elt {9289}\@elt {9290}\@elt {9291}\@elt {9292}%
6583   \@elt {9293}\@elt {9294}\@elt {9295}\@elt {9296}\@elt {9297}\@elt {9298}%
6584   \@elt {9299}\@elt {9300}\@elt {9301}\@elt {9302}\@elt {9303}\@elt {9304}%
6585   \@elt {9305}\@elt {9306}\@elt {9307}\@elt {9308}\@elt {9309}\@elt {9310}%
6586   \@elt {9311}\@elt {9312}\@elt {9313}\@elt {9314}\@elt {9315}\@elt {9316}%
6587   \@elt {9317}\@elt {9318}\@elt {9319}\@elt {9320}\@elt {9321}\@elt {9322}%
6588   \@elt {9323}\@elt {9324}\@elt {9325}\@elt {9326}\@elt {9327}\@elt {9328}%
6589   \@elt {9329}\@elt {9330}\@elt {9331}\@elt {9332}\@elt {9333}\@elt {9334}%
6590   \@elt {9335}\@elt {9336}\@elt {9337}\@elt {9338}\@elt {9339}\@elt {9340}%
6591   \@elt {9341}\@elt {9342}\@elt {9505}\@elt {9506}\@elt {9507}\@elt {9508}%
6592   \@elt {9509}\@elt {9510}\@elt {9511}\@elt {9512}\@elt {9513}\@elt {9514}%
6593   \@elt {9515}\@elt {9516}\@elt {9517}\@elt {9518}\@elt {9519}\@elt {9520}%
6594   \@elt {9521}\@elt {9522}\@elt {9523}\@elt {9524}\@elt {9525}\@elt {9526}%
6595   \@elt {9527}\@elt {9528}\@elt {9529}\@elt {9530}\@elt {9531}\@elt {9532}%
6596   \@elt {9533}\@elt {9534}\@elt {9535}\@elt {9536}\@elt {9537}\@elt {9538}%
6597   \@elt {9539}\@elt {9540}\@elt {9541}\@elt {9542}\@elt {9543}\@elt {9544}%
6598   \@elt {9545}\@elt {9546}\@elt {9547}\@elt {9548}\@elt {9549}\@elt {9550}%
6599   \@elt {9551}\@elt {9552}\@elt {9553}\@elt {9554}\@elt {9555}\@elt {9556}%
6600   \@elt {9557}\@elt {9558}\@elt {9559}\@elt {9560}\@elt {9561}\@elt {9562}%
6601   \@elt {9563}\@elt {9564}\@elt {9565}\@elt {9566}\@elt {9567}\@elt {9568}%
6602   \@elt {9569}\@elt {9570}\@elt {9571}\@elt {9572}\@elt {9573}\@elt {9574}%
6603   \@elt {9575}\@elt {9576}\@elt {9577}\@elt {9578}\@elt {9579}\@elt {9580}%
6604   \@elt {9581}\@elt {9582}\@elt {9583}\@elt {9584}\@elt {9585}\@elt {9586}%
6605   \@elt {9587}\@elt {9588}\@elt {9589}\@elt {9590}\@elt {9591}\@elt {9592}%
6606   \@elt {9593}\@elt {9594}\@elt {9595}\@elt {9596}\@elt {9597}\@elt {9598}%
6607   \@elt {9761}\@elt {9762}\@elt {9763}\@elt {9764}\@elt {9765}\@elt {9766}%
6608   \@elt {9767}\@elt {9768}\@elt {9769}\@elt {9770}\@elt {9771}\@elt {9772}%
6609   \@elt {9773}\@elt {9774}\@elt {9775}\@elt {9776}\@elt {9777}\@elt {9778}%
6610   \@elt {9779}\@elt {9780}\@elt {9781}\@elt {9782}\@elt {9783}\@elt {9784}%
6611   \@elt {9785}\@elt {9786}\@elt {9787}\@elt {9788}\@elt {9789}\@elt {9790}%
6612   \@elt {9791}\@elt {9792}\@elt {9793}\@elt {9794}\@elt {9795}\@elt {9796}%
6613   \@elt {9797}\@elt {9798}\@elt {9799}\@elt {9800}\@elt {9801}\@elt {9802}%
6614   \@elt {9803}\@elt {9804}\@elt {9805}\@elt {9806}\@elt {9807}\@elt {9808}%
6615   \@elt {9809}\@elt {9810}\@elt {9811}\@elt {9812}\@elt {9813}\@elt {9814}%
6616   \@elt {9815}\@elt {9816}\@elt {9817}\@elt {9818}\@elt {9819}\@elt {9820}%
6617   \@elt {9821}\@elt {9822}\@elt {9823}\@elt {9824}\@elt {9825}\@elt {9826}%
6618   \@elt {9827}\@elt {9828}\@elt {9829}\@elt {9830}\@elt {9831}\@elt {9832}%
6619   \@elt {9833}\@elt {9834}\@elt {9835}\@elt {9836}\@elt {9837}\@elt {9838}%
6620   \@elt {9839}\@elt {9840}\@elt {9841}\@elt {9842}\@elt {9843}\@elt {9844}%
6621   \@elt {9845}\@elt {9846}\@elt {9847}\@elt {9848}\@elt {9849}\@elt {9850}%
6622   \@elt {9851}\@elt {9852}\@elt {9853}\@elt {9854}%
6623 }
6624
6625 \def\jlist{% JIS X 0213 だけにあるもの
6626 \@elt{"222F}{"FF07}\@elt{"2230}{"FF02}\@elt{"2231}{"FF0D}\@elt{"2232}{"FF5E}%
6627 \@elt{"2233}{"3033}\@elt{"2234}{"3034}\@elt{"2235}{"3035}\@elt{"2236}{"303B}%
6628 \@elt{"2237}{"303C}\@elt{"2238}{"30FF}\@elt{"2239}{"309F}\@elt{"2242}{"2284}%
6629 \@elt{"2243}{"2285}\@elt{"2244}{"228A}\@elt{"2245}{"228B}\@elt{"2246}{"2209}%
6630 \@elt{"2247}{"2205}\@elt{"2248}{"2305}\@elt{"2249}{"2306}\@elt{"2251}{"2295}%
6631 \@elt{"2252}{"2296}\@elt{"2253}{"2297}\@elt{"2254}{"2225}\@elt{"2255}{"2226}%
6632 \@elt{"2256}{"FF5F}\@elt{"2257}{"FF60}\@elt{"2258}{"3018}\@elt{"2259}{"3019}%
6633 \@elt{"225A}{"3016}\@elt{"225B}{"3017}\@elt{"226B}{"2262}\@elt{"226C}{"2243}%
6634 \@elt{"226D}{"2245}\@elt{"226E}{"2248}\@elt{"226F}{"2276}\@elt{"2270}{"2277}%
6635 \@elt{"2271}{"2194}\@elt{"227A}{"266E}\@elt{"227B}{"266B}\@elt{"227C}{"266C}%
6636 \@elt{"227D}{"2669}\@elt{"2321}{"25B7}\@elt{"2322}{"25B6}\@elt{"2323}{"25C1}%
6637 \@elt{"2324}{"25C0}\@elt{"2325}{"2197}\@elt{"2326}{"2198}\@elt{"2327}{"2196}%
6638 \@elt{"2328}{"2199}\@elt{"2329}{"21C4}\@elt{"232A}{"21E8}\@elt{"232B}{"21E6}%
6639 \@elt{"232C}{"21E7}\@elt{"232D}{"21E9}\@elt{"232E}{"2934}\@elt{"232F}{"2935}%
6640 \@elt{"233A}{"29BF}\@elt{"233B}{"25C9}\@elt{"233C}{"303D}\@elt{"233D}{"FE46}%
6641 \@elt{"233E}{"FE45}\@elt{"233F}{"25E6}\@elt{"2340}{"2022}\@elt{"235B}{"2213}%
6642 \@elt{"235C}{"2135}\@elt{"235D}{"210F}\@elt{"235E}{"33CB}\@elt{"235F}{"2113}%
6643 \@elt{"2360}{"2127}\@elt{"237B}{"30A0}\@elt{"237C}{"2013}\@elt{"237D}{"29FA}%
6644 \@elt{"237E}{"29FB}\@elt{"2474}{"3094}\@elt{"2475}{"3095}\@elt{"2476}{"3096}%
6645 \@elt{"2639}{"2664}\@elt{"263A}{"2660}\@elt{"263B}{"2662}%
6646 \@elt{"263C}{"2666}\@elt{"263D}{"2661}\@elt{"263E}{"2665}\@elt{"263F}{"2667}%
6647 \@elt{"2640}{"2663}\@elt{"2659}{"03C2}\@elt{"265A}{"24F5}\@elt{"265B}{"24F6}%
6648 \@elt{"265C}{"24F7}\@elt{"265D}{"24F8}\@elt{"265E}{"24F9}\@elt{"265F}{"24FA}%
6649 \@elt{"2660}{"24FB}\@elt{"2661}{"24FC}\@elt{"2662}{"24FD}\@elt{"2663}{"24FE}%
6650 \@elt{"2664}{"2616}\@elt{"2665}{"2617}\@elt{"2666}{"3020}\@elt{"2667}{"260E}%
6651 \@elt{"2668}{"2600}\@elt{"2669}{"2601}\@elt{"266A}{"2602}\@elt{"266B}{"2603}%
6652 \@elt{"266C}{"2668}\@elt{"266D}{"25B1}\@elt{"266E}{"31F0}\@elt{"266F}{"31F1}%
6653 \@elt{"2670}{"31F2}\@elt{"2671}{"31F3}\@elt{"2672}{"31F4}\@elt{"2673}{"31F5}%
6654 \@elt{"2674}{"31F6}\@elt{"2675}{"31F7}\@elt{"2676}{"31F8}\@elt{"2677}{"31F9}%
6655 \@elt{"2678}{"31F7}\@elt{"2679}{"31FA}\@elt{"267A}{"31FB}\@elt{"267B}{"31FC}%
6656 \@elt{"267C}{"31FD}\@elt{"267D}{"31FE}\@elt{"267E}{"31FF}\@elt{"2742}{"23BE}%
6657 \@elt{"2743}{"23BF}\@elt{"2744}{"23C0}\@elt{"2745}{"23C1}\@elt{"2746}{"23C2}%
6658 \@elt{"2747}{"23C3}\@elt{"2748}{"23C4}\@elt{"2749}{"23C5}\@elt{"274A}{"23C6}%
6659 \@elt{"274B}{"23C7}\@elt{"274C}{"23C8}\@elt{"274D}{"23C9}\@elt{"274E}{"23CA}%
6660 \@elt{"274F}{"23CB}\@elt{"2750}{"23CC}\@elt{"2772}{"30F7}\@elt{"2773}{"30F8}%
6661 \@elt{"2774}{"30F9}\@elt{"2775}{"30FA}\@elt{"2776}{"22DA}\@elt{"2777}{"22DB}%
6662 \@elt{"2778}{"2153}\@elt{"2779}{"2154}\@elt{"277A}{"2155}\@elt{"277B}{"2713}%
6663 \@elt{"277C}{"2318}\@elt{"277D}{"2423}\@elt{"277E}{"23CE}\@elt{"2841}{"3251}%
6664 \@elt{"2842}{"3252}\@elt{"2843}{"3253}\@elt{"2844}{"3254}\@elt{"2845}{"3255}%
6665 \@elt{"2846}{"3256}\@elt{"2847}{"3257}\@elt{"2848}{"3258}\@elt{"2849}{"3259}%
6666 \@elt{"284A}{"325A}\@elt{"284B}{"325B}\@elt{"284C}{"325C}\@elt{"284D}{"325D}%
6667 \@elt{"284E}{"325E}\@elt{"284F}{"325F}\@elt{"2850}{"32B1}\@elt{"2851}{"32B2}%
6668 \@elt{"2852}{"32B3}\@elt{"2853}{"32B4}\@elt{"2854}{"32B5}\@elt{"2855}{"32B6}%
6669 \@elt{"2856}{"32B7}\@elt{"2857}{"32B8}\@elt{"2858}{"32B9}\@elt{"2859}{"32BA}%
6670 \@elt{"285A}{"32BB}\@elt{"285B}{"32BC}\@elt{"285C}{"32BD}\@elt{"285D}{"32BE}%
6671 \@elt{"285E}{"32BF}\@elt{"2867}{"25D0}\@elt{"2868}{"25D1}\@elt{"2869}{"25D2}%
6672 \@elt{"286A}{"25D3}\@elt{"286B}{"203C}\@elt{"286C}{"2047}\@elt{"286D}{"2048}%
6673 \@elt{"286E}{"2049}\@elt{"286F}{"01CD}\@elt{"2870}{"01CE}\@elt{"2871}{"01D0}%
6674 \@elt{"2872}{"1E3E}\@elt{"2873}{"1E3F}\@elt{"2874}{"01F8}\@elt{"2875}{"01F9}%
6675 \@elt{"2876}{"01D1}\@elt{"2877}{"01D2}\@elt{"2878}{"01D4}\@elt{"2879}{"01D6}%
6676 \@elt{"287A}{"01D8}\@elt{"287B}{"01DA}\@elt{"287C}{"01DC}\@elt{"2921}{"20AC}%
6677 \@elt{"2922}{"00A0}\@elt{"2923}{"00A1}\@elt{"2924}{"00A4}\@elt{"2925}{"00A6}%
6678 \@elt{"2926}{"00A9}\@elt{"2927}{"00AA}\@elt{"2928}{"00AB}\@elt{"2929}{"00AD}%
6679 \@elt{"292A}{"00AE}\@elt{"292B}{"00AF}\@elt{"292C}{"00B2}\@elt{"292D}{"00B3}%
6680 \@elt{"292E}{"00B7}\@elt{"292F}{"00B8}\@elt{"2930}{"00B9}\@elt{"2931}{"00BA}%
6681 \@elt{"2932}{"00BB}\@elt{"2933}{"00BC}\@elt{"2934}{"00BD}\@elt{"2935}{"00BE}%
6682 \@elt{"2936}{"00BF}\@elt{"2937}{"00C0}\@elt{"2938}{"00C1}\@elt{"2939}{"00C2}%
6683 \@elt{"293A}{"00C3}\@elt{"293B}{"00C4}\@elt{"293C}{"00C5}\@elt{"293D}{"00C6}%
6684 \@elt{"293E}{"00C7}\@elt{"293F}{"00C8}\@elt{"2940}{"00C9}\@elt{"2941}{"00CA}%
6685 \@elt{"2942}{"00CB}\@elt{"2943}{"00CC}\@elt{"2944}{"00CD}\@elt{"2945}{"00CE}%
6686 \@elt{"2946}{"00CF}\@elt{"2947}{"00D0}\@elt{"2948}{"00D1}\@elt{"2949}{"00D2}%
6687 \@elt{"294A}{"00D3}\@elt{"294B}{"00D4}\@elt{"294C}{"00D5}\@elt{"294D}{"00D6}%
6688 \@elt{"294E}{"00D8}\@elt{"294F}{"00D9}\@elt{"2950}{"00DA}\@elt{"2951}{"00DB}%
6689 \@elt{"2952}{"00DC}\@elt{"2953}{"00DD}\@elt{"2954}{"00DE}\@elt{"2955}{"00DF}%
6690 \@elt{"2956}{"00E0}\@elt{"2957}{"00E1}\@elt{"2958}{"00E2}\@elt{"2959}{"00E3}%
6691 \@elt{"295A}{"00E4}\@elt{"295B}{"00E5}\@elt{"295C}{"00E6}\@elt{"295D}{"00E7}%
6692 \@elt{"295E}{"00E8}\@elt{"295F}{"00E9}\@elt{"2960}{"00EA}\@elt{"2961}{"00EB}%
6693 \@elt{"2962}{"00EC}\@elt{"2963}{"00ED}\@elt{"2964}{"00EE}\@elt{"2965}{"00EF}%
6694 \@elt{"2966}{"00F0}\@elt{"2967}{"00F1}\@elt{"2968}{"00F2}\@elt{"2969}{"00F3}%
6695 \@elt{"296A}{"00F4}\@elt{"296B}{"00F5}\@elt{"296C}{"00F6}\@elt{"296D}{"00F8}%
6696 \@elt{"296E}{"00F9}\@elt{"296F}{"00FA}\@elt{"2970}{"00FB}\@elt{"2971}{"00FC}%
6697 \@elt{"2972}{"00FD}\@elt{"2973}{"00FE}\@elt{"2974}{"00FF}\@elt{"2975}{"0100}%
6698 \@elt{"2976}{"012A}\@elt{"2977}{"016A}\@elt{"2978}{"0112}\@elt{"2979}{"014C}%
6699 \@elt{"297A}{"0101}\@elt{"297B}{"012B}\@elt{"297C}{"016B}\@elt{"297D}{"0113}%
6700 \@elt{"297E}{"014D}\@elt{"2A21}{"0104}\@elt{"2A22}{"02D8}\@elt{"2A23}{"0141}%
6701 \@elt{"2A24}{"013D}\@elt{"2A25}{"015A}\@elt{"2A26}{"0160}\@elt{"2A27}{"015E}%
6702 \@elt{"2A28}{"0164}\@elt{"2A29}{"0179}\@elt{"2A2A}{"017D}\@elt{"2A2B}{"017B}%
6703 \@elt{"2A2C}{"0105}\@elt{"2A2D}{"02DB}\@elt{"2A2E}{"0142}\@elt{"2A2F}{"013E}%
6704 \@elt{"2A30}{"015B}\@elt{"2A31}{"02C7}\@elt{"2A32}{"0161}\@elt{"2A33}{"015F}%
6705 \@elt{"2A34}{"0165}\@elt{"2A35}{"017A}\@elt{"2A36}{"02DD}\@elt{"2A37}{"017E}%
6706 \@elt{"2A38}{"017C}\@elt{"2A39}{"0154}\@elt{"2A3A}{"0102}\@elt{"2A3B}{"0139}%
6707 \@elt{"2A3C}{"0106}\@elt{"2A3D}{"010C}\@elt{"2A3E}{"0118}\@elt{"2A3F}{"011A}%
6708 \@elt{"2A40}{"010E}\@elt{"2A41}{"0143}\@elt{"2A42}{"0147}\@elt{"2A43}{"0150}%
6709 \@elt{"2A44}{"0158}\@elt{"2A45}{"016E}\@elt{"2A46}{"0170}\@elt{"2A47}{"0162}%
6710 \@elt{"2A48}{"0155}\@elt{"2A49}{"0103}\@elt{"2A4A}{"013A}\@elt{"2A4B}{"0107}%
6711 \@elt{"2A4C}{"010D}\@elt{"2A4D}{"0119}\@elt{"2A4E}{"011B}\@elt{"2A4F}{"010F}%
6712 \@elt{"2A50}{"0111}\@elt{"2A51}{"0144}\@elt{"2A52}{"0148}\@elt{"2A53}{"0151}%
6713 \@elt{"2A54}{"0159}\@elt{"2A55}{"016F}\@elt{"2A56}{"0171}\@elt{"2A57}{"0163}%
6714 \@elt{"2A58}{"02D9}\@elt{"2A59}{"0108}\@elt{"2A5A}{"011C}\@elt{"2A5B}{"0124}%
6715 \@elt{"2A5C}{"0134}\@elt{"2A5D}{"015C}\@elt{"2A5E}{"016C}\@elt{"2A5F}{"0109}%
6716 \@elt{"2A60}{"011D}\@elt{"2A61}{"0125}\@elt{"2A62}{"0135}\@elt{"2A63}{"015D}%
6717 \@elt{"2A64}{"016D}\@elt{"2A65}{"0271}\@elt{"2A66}{"028B}\@elt{"2A67}{"027E}%
6718 \@elt{"2A68}{"0283}\@elt{"2A69}{"0292}\@elt{"2A6A}{"026C}\@elt{"2A6B}{"026E}%
6719 \@elt{"2A6C}{"0279}\@elt{"2A6D}{"0288}\@elt{"2A6E}{"0256}\@elt{"2A6F}{"0273}%
6720 \@elt{"2A70}{"027D}\@elt{"2A71}{"0282}\@elt{"2A72}{"0290}\@elt{"2A73}{"027B}%
6721 \@elt{"2A74}{"026D}\@elt{"2A75}{"025F}\@elt{"2A76}{"0272}\@elt{"2A77}{"029D}%
6722 \@elt{"2A78}{"028E}\@elt{"2A79}{"0261}\@elt{"2A7A}{"014B}\@elt{"2A7B}{"0270}%
6723 \@elt{"2A7C}{"0281}\@elt{"2A7D}{"0127}\@elt{"2A7E}{"0295}\@elt{"2B21}{"0294}%
6724 \@elt{"2B22}{"0266}\@elt{"2B23}{"0298}\@elt{"2B24}{"01C2}\@elt{"2B25}{"0253}%
6725 \@elt{"2B26}{"0257}\@elt{"2B27}{"0284}\@elt{"2B28}{"0260}\@elt{"2B29}{"0193}%
6726 \@elt{"2B2A}{"0153}\@elt{"2B2B}{"0152}\@elt{"2B2C}{"0268}\@elt{"2B2D}{"0289}%
6727 \@elt{"2B2E}{"0258}\@elt{"2B2F}{"0275}\@elt{"2B30}{"0259}\@elt{"2B31}{"025C}%
6728 \@elt{"2B32}{"025E}\@elt{"2B33}{"0250}\@elt{"2B34}{"026F}\@elt{"2B35}{"028A}%
6729 \@elt{"2B36}{"0264}\@elt{"2B37}{"028C}\@elt{"2B38}{"0254}\@elt{"2B39}{"0251}%
6730 \@elt{"2B3A}{"0252}\@elt{"2B3B}{"028D}\@elt{"2B3C}{"0265}\@elt{"2B3D}{"02A2}%
6731 \@elt{"2B3E}{"02A1}\@elt{"2B3F}{"0255}\@elt{"2B40}{"0291}\@elt{"2B41}{"027A}%
6732 \@elt{"2B42}{"0267}\@elt{"2B43}{"025A}\@elt{"2B44}{"00E6}\@elt{"2B45}{"01FD}%
6733 \@elt{"2B46}{"1F70}\@elt{"2B47}{"1F71}\@elt{"2B48}{"0254}\@elt{"2B49}{"0254}%
6734 \@elt{"2B4A}{"028C}\@elt{"2B4B}{"028C}\@elt{"2B4C}{"0259}\@elt{"2B4D}{"0259}%
6735 \@elt{"2B4E}{"025A}\@elt{"2B4F}{"025A}\@elt{"2B50}{"1F72}\@elt{"2B51}{"1F73}%
6736 \@elt{"2B52}{"0361}\@elt{"2B53}{"02C8}\@elt{"2B54}{"02CC}\@elt{"2B55}{"02D0}%
6737 \@elt{"2B56}{"02D1}\@elt{"2B57}{"0306}\@elt{"2B58}{"203F}\@elt{"2B59}{"030B}%
6738 \@elt{"2B5A}{"0301}\@elt{"2B5B}{"0304}\@elt{"2B5C}{"0300}\@elt{"2B5D}{"030F}%
6739 \@elt{"2B5E}{"030C}\@elt{"2B5F}{"0302}\@elt{"2B60}{"02E5}\@elt{"2B61}{"02E6}%
6740 \@elt{"2B62}{"02E7}\@elt{"2B63}{"02E8}\@elt{"2B64}{"02E9}\@elt{"2B65}{"02E9}%
6741 \@elt{"2B66}{"02E5}\@elt{"2B67}{"0325}\@elt{"2B68}{"032C}\@elt{"2B69}{"0339}%
6742 \@elt{"2B6A}{"031C}\@elt{"2B6B}{"031F}\@elt{"2B6C}{"0320}\@elt{"2B6D}{"0308}%
6743 \@elt{"2B6E}{"033D}\@elt{"2B6F}{"0329}\@elt{"2B70}{"032F}\@elt{"2B71}{"02DE}%
6744 \@elt{"2B72}{"0324}\@elt{"2B73}{"0330}\@elt{"2B74}{"033C}\@elt{"2B75}{"0334}%
6745 \@elt{"2B76}{"031D}\@elt{"2B77}{"031E}\@elt{"2B78}{"0318}\@elt{"2B79}{"0319}%
6746 \@elt{"2B7A}{"032A}\@elt{"2B7B}{"033A}\@elt{"2B7C}{"033B}\@elt{"2B7D}{"0303}%
6747 \@elt{"2B7E}{"031A}\@elt{"2C21}{"2776}\@elt{"2C22}{"2777}\@elt{"2C23}{"2778}%
6748 \@elt{"2C24}{"2779}\@elt{"2C25}{"277A}\@elt{"2C26}{"277B}\@elt{"2C27}{"277C}%
6749 \@elt{"2C28}{"277D}\@elt{"2C29}{"277E}\@elt{"2C2A}{"277F}\@elt{"2C2B}{"24EB}%
6750 \@elt{"2C2C}{"24EC}\@elt{"2C2D}{"24ED}\@elt{"2C2E}{"24EE}\@elt{"2C2F}{"24EF}%
6751 \@elt{"2C30}{"24F0}\@elt{"2C31}{"24F1}\@elt{"2C32}{"24F2}\@elt{"2C33}{"24F3}%
6752 \@elt{"2C34}{"24F4}\@elt{"2C35}{"2170}\@elt{"2C36}{"2171}\@elt{"2C37}{"2172}%
6753 \@elt{"2C38}{"2173}\@elt{"2C39}{"2174}\@elt{"2C3A}{"2175}\@elt{"2C3B}{"2176}%
6754 \@elt{"2C3C}{"2177}\@elt{"2C3D}{"2178}\@elt{"2C3E}{"2179}\@elt{"2C3F}{"217A}%
6755 \@elt{"2C40}{"217B}\@elt{"2C41}{"24D0}\@elt{"2C42}{"24D1}\@elt{"2C43}{"24D2}%
6756 \@elt{"2C44}{"24D3}\@elt{"2C45}{"24D4}\@elt{"2C46}{"24D5}\@elt{"2C47}{"24D6}%
6757 \@elt{"2C48}{"24D7}\@elt{"2C49}{"24D8}\@elt{"2C4A}{"24D9}\@elt{"2C4B}{"24DA}%
6758 \@elt{"2C4C}{"24DB}\@elt{"2C4D}{"24DC}\@elt{"2C4E}{"24DD}\@elt{"2C4F}{"24DE}%
6759 \@elt{"2C50}{"24DF}\@elt{"2C51}{"24E0}\@elt{"2C52}{"24E1}\@elt{"2C53}{"24E2}%
6760 \@elt{"2C54}{"24E3}\@elt{"2C55}{"24E4}\@elt{"2C56}{"24E5}\@elt{"2C57}{"24E6}%
6761 \@elt{"2C58}{"24E7}\@elt{"2C59}{"24E8}\@elt{"2C5A}{"24E9}\@elt{"2C5B}{"32D0}%
6762 \@elt{"2C5C}{"32D1}\@elt{"2C5D}{"32D2}\@elt{"2C5E}{"32D3}\@elt{"2C5F}{"32D4}%
6763 \@elt{"2C60}{"32D5}\@elt{"2C61}{"32D6}\@elt{"2C62}{"32D7}\@elt{"2C63}{"32D8}%
6764 \@elt{"2C64}{"32D9}\@elt{"2C65}{"32DA}\@elt{"2C66}{"32DB}\@elt{"2C67}{"32DC}%
6765 \@elt{"2C68}{"32DD}\@elt{"2C69}{"32DE}\@elt{"2C6A}{"32DF}\@elt{"2C6B}{"32E0}%
6766 \@elt{"2C6C}{"32E1}\@elt{"2C6D}{"32E2}\@elt{"2C6E}{"32E3}\@elt{"2C6F}{"32FA}%
6767 \@elt{"2C70}{"32E9}\@elt{"2C71}{"32E5}\@elt{"2C72}{"32ED}\@elt{"2C73}{"32EC}%
6768 \@elt{"2C7D}{"2051}\@elt{"2C7E}{"2042}\@elt{"2D21}{"2460}\@elt{"2D22}{"2461}%
6769 \@elt{"2D23}{"2462}\@elt{"2D24}{"2463}\@elt{"2D25}{"2464}\@elt{"2D26}{"2465}%
6770 \@elt{"2D27}{"2466}\@elt{"2D28}{"2467}\@elt{"2D29}{"2468}\@elt{"2D2A}{"2469}%
6771 \@elt{"2D2B}{"246A}\@elt{"2D2C}{"246B}\@elt{"2D2D}{"246C}\@elt{"2D2E}{"246D}%
6772 \@elt{"2D2F}{"246E}\@elt{"2D30}{"246F}\@elt{"2D31}{"2470}\@elt{"2D32}{"2471}%
6773 \@elt{"2D33}{"2472}\@elt{"2D34}{"2473}\@elt{"2D35}{"2160}\@elt{"2D36}{"2161}%
6774 \@elt{"2D37}{"2162}\@elt{"2D38}{"2163}\@elt{"2D39}{"2164}\@elt{"2D3A}{"2165}%
6775 \@elt{"2D3B}{"2166}\@elt{"2D3C}{"2167}\@elt{"2D3D}{"2168}\@elt{"2D3E}{"2169}%
6776 \@elt{"2D3F}{"216A}\@elt{"2D40}{"3349}\@elt{"2D41}{"3314}\@elt{"2D42}{"3322}%
6777 \@elt{"2D43}{"334D}\@elt{"2D44}{"3318}\@elt{"2D45}{"3327}\@elt{"2D46}{"3303}%
6778 \@elt{"2D47}{"3336}\@elt{"2D48}{"3351}\@elt{"2D49}{"3357}\@elt{"2D4A}{"330D}%
6779 \@elt{"2D4B}{"3326}\@elt{"2D4C}{"3323}\@elt{"2D4D}{"332B}\@elt{"2D4E}{"334A}%
6780 \@elt{"2D4F}{"333B}\@elt{"2D50}{"339C}\@elt{"2D51}{"339D}\@elt{"2D52}{"339E}%
6781 \@elt{"2D53}{"338E}\@elt{"2D54}{"338F}\@elt{"2D55}{"33C4}\@elt{"2D56}{"33A1}%
6782 \@elt{"2D57}{"216B}\@elt{"2D5F}{"337B}\@elt{"2D60}{"301D}\@elt{"2D61}{"301F}%
6783 \@elt{"2D62}{"2116}\@elt{"2D63}{"33CD}\@elt{"2D64}{"2121}\@elt{"2D65}{"32A4}%
6784 \@elt{"2D66}{"32A5}\@elt{"2D67}{"32A6}\@elt{"2D68}{"32A7}\@elt{"2D69}{"32A8}%
6785 \@elt{"2D6A}{"3231}\@elt{"2D6B}{"3232}\@elt{"2D6C}{"3239}\@elt{"2D6D}{"337E}%
6786 \@elt{"2D6E}{"337D}\@elt{"2D6F}{"337C}\@elt{"2D73}{"222E}\@elt{"2D78}{"221F}%
6787 \@elt{"2D79}{"22BF}\@elt{"2D7D}{"2756}\@elt{"2D7E}{"261E}%
6788 }
6789
6790 \newcount\cntA
6791 \newcount\cntB
6792 \newcount\flag
6793 \def\chk@in@#1#2{{\global\flag=0\relax%
6794   \def\@elt##1{\ifnum#2=##1\global\flag=1 \fi}%
6795   #1}}
6796 \def\get@in@#1#2{{%
6797   \global\flag=0\relax%
6798   \def\@elt##1##2{\ifnum#2=##1\global\flag##2 \fi}%
6799   #1}}
6800
6801 \def\outi{%
6802 \get@in@{\jlist}{\cntA}\cntB=\flag
6803 \ifnum\cntB=0{}%
6804   \cntB=\jis\cntA{}%
6805   \ifnum\cntB=0 \else
6806     \ifnum\ltjgetparameter{jacharrange}{\ltjgetparameter{chartorange}{\cntB}}=0
6807     \def\@@@tmp{white}\else\def\@@@tmp{white!85!blue}\fi
6808     \fcolorbox{black}{\@@@tmp}{%
6809       \hbox to \zw{\gt  \hskip-\zw\ltjjachar\cntB  \hss}}\,\scriptsize%
6810     \ifnum\catcode\cntB=11 L\else\ \fi
6811     \chk@in@{\uplist}{\cntA}\ifnum\flag=1 U\else~\fi
6812     \chk@in@{\plist}{\cntA}\ifnum\flag=1 P\else~\fi
6813   \fi
6814 \else
6815   \ifnum\ltjgetparameter{jacharrange}{\ltjgetparameter{chartorange}{\cntB}}=0
6816   \def\@@@tmp{white}\else\def\@@@tmp{white!85!blue}\fi
6817   \fcolorbox{black}{\@@@tmp}{\color{red!50!black}%
6818      \hbox to \zw{\gt  \hskip-\zw\ltjjachar\cntB  \hss}}\,\scriptsize%
6819    \ifnum\catcode\cntB=11 L\else~\fi
6820   \chk@in@{\uplist}{\cntA}\ifnum\flag=1 U\else~\fi-%
6821 \fi\global\advance\cntA1 }
6822
6823 \def\out#1#2{%
6824 \midrule\global\cntA=\numexpr 8192+#1*256+#2*16\relax
6825 "#2{}x&\ifnum#2=2\global\advance\cntA1\else\outi\fi&\outi&\outi&\outi&\outi&\outi&\outi&\outi%"
6826 &\outi&\outi&\outi&\outi&\outi&\outi&\outi&\ifnum#2=7\global\advance\cntA1\else\outi\fi\\
6827 }
6828
6829 \def\test#1{{%
6830 %<en>\subsection*{Row #1}
6831 %<ja>\subsection*{第#1区}
6832 \tt\small\fboxsep=1pt\centering\tabcolsep=0.25\zw
6833 \begin{tabular}{ccccccccccccccccc}\toprule&"0&"1&"2&"3&"4&"5&"6&"7&"8&"9&"A&"B&"C&"D&"E&"F\\
6834 \out{#1}{2}\out{#1}{3}\out{#1}{4}\out{#1}{5}\out{#1}{6}\out{#1}{7}\bottomrule
6835 \end{tabular}\par}\medskip}
6836
6837 \test{1}\test{2}\test{3}\test{4}\test{5}\test{6}\test{7}\test{8}
6838 \test{9}\test{10}\test{11}\test{12}\test{13}
6839
6840 \errorstopmode
6841
6842 %</!zh>
6843 \section{Package versions used in this document}
6844 This document was typeset using the following packages:
6845
6846 \medskip
6847
6848 {\makeatletter\tt\footnotesize
6849   \def\@pkglist#1{%
6850     \filename@parse{#1}\def\@temp{sty}
6851     \ifx\@temp\filename@ext
6852       \edef\reserved@a{%
6853         \filename@base.%
6854         \ifx\filename@ext\relax tex\else\filename@ext\fi}%
6855       \leavevmode\hskip-13em\hbox to 13em{\filename@area\reserved@a\hss}%
6856       \csname ver@\reserved@a\endcsname\par
6857     \fi
6858   }%
6859 \parindent0pt\leftskip13em
6860 \ltjpkglist
6861
6862 \makeatother}
6863 \end{document}
6864 %</!showexpl>
6865 %<*showexpl>
6866 %%
6867 %% config file for showexpl.sty
6868 %%
6869 %% Copyright The LuaTeX-ja project team, 2012
6870 %%
6871 \ProvidesFile{showexpl.cfg}
6872   [2012/05/20 v0.01 Definitions for the showexpl package (luatexja)]
6873 \lstset{}
6874 \def\SX@Info{}
6875 \endinput
6876 %</*showexpl>