2 %#! lualatex -shell-escape
4 %<en>\documentclass[a4paper,titlepage]{article}
5 %<ja>\documentclass[a4paper,titlepage]{ltjsarticle}
6 %<zh>\documentclass[a4paper,titlepage]{ltjsarticle}
12 %%%%%%%% record loaded packages
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%
19 \let\@pkglist=\relax\xdef#1{#1\@pkglist{#2}}%
21 \def\@append@newentry@pkglist#1{%
23 \ifx\@tempa\@tempb\@real@append@listfalse\fi}
24 \def\@addtofilelist#1{\@append@newentry\ltjpkglist{#1}}
28 \usepackage[margin=25mm,footskip=6mm]{geometry}
29 \usepackage{luatexja-adjust}\ltjdisableadjust
30 \parskip=\smallskipamount
33 \usepackage[textwidth=45\zw, lines=45, footskip=6mm]{geometry}
34 \usepackage{luatexja-adjust}
35 \advance\leftmargini-1\zw\advance\leftmarginii-1\zw
38 \usepackage[textwidth=45\zw, lines=45, footskip=6mm]{geometry}
39 \usepackage{luatexja-adjust}\ltjdisableadjust
40 \advance\leftmargini-1\zw\advance\leftmarginii-1\zw
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}
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}
81 \usepackage{amsmath,tikz,pict2e,multienum,float}
82 \usepackage{booktabs,multicol}
85 \usepackage{listings,showexpl}
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}
91 % Suppress output from showexpl to stdout.
97 \title{The \LuaTeX-ja package}
98 \author{The \LuaTeX-ja project team}
101 \title{\LuaTeX-jaパッケージ}
102 \author{\LuaTeX-jaプロジェクトチーム}
106 \author{\LuaTeX-ja项目团队}
111 allbordercolors=1 1 1,
114 pdfauthor={The LuaTeX-ja project team},
115 pdftitle={The LuaTeX-ja package}
118 pdfauthor={LuaTeX-jaプロジェクトチーム},
119 pdftitle={LuaTeX-jaパッケージ}
122 pdfauthor={LuaTeX-ja项目团队},
123 pdftitle={LuaTeX-ja宏包}
127 %%%%%%%% definition env.
129 \theoremstyle{definition}
130 %<en>\newtheorem{defn}{Definition}
131 %<ja>\newtheorem{defn}{定義}
132 %<zh>\newtheorem{defn}{定义}
135 \usepackage{luatexja-otf}
136 \usepackage[jis2004]{luatexja-preset}
137 %<!en>\usepackage{amssymb}
139 \usepackage{unicode-math}
140 \setmainfont[Ligatures=TeX]{TeX Gyre Termes}
141 \setsansfont[Ligatures=TeX]{TeX Gyre Heros}
142 \setmathfont{xits-math.otf}
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}
157 %%%%%%%% other macros
158 \newenvironment{cslist}{%
159 \leftskip2em\parindent=0pt\def\makelabel##1{{\tt\char92##1}}
160 \def\{{\char`\{}\def\}{\char`\}}
162 \def\item[##1]{\par\smallskip\par\hskip-\leftskip\makelabel{##1}\par}
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
172 \global \@minipagefalse
173 \hb@xt@\hsize{\hfil\box\@tempboxa\hfil}%
175 \vskip\belowcaptionskip}
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}}}}\,}}
184 \protected\def\Param#1{\textsf{#1}} % parameter name
185 \protected\def\Pkg#1{\underline{\smash{\texttt{#1}}}} % packages/classes
190 \def<#1>{{\normalfont\rm\itshape$\langle$#1$\rangle$}}
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.
202 \textbf{\large 本ドキュメントはまだまだ未完成です.}
205 \textbf{\large 本文档尚未完成。}
209 %<en>\part{User's manual}
210 %<ja>\part{ユーザーズマニュアル}
213 %<en>\section{Introduction}
219 The \LuaTeX-ja package is a macro package for typesetting high-quality
220 Japanese documents when using \LuaTeX.
223 \LuaTeX-jaパッケージは,次世代標準\TeX である\LuaTeX の上で,\pTeX と同等
224 /それ以上の品質の日本語組版を実現させようとするマクロパッケージである.
227 \LuaTeX-ja宏包是应用于下一代标准\TeX 引擎亦即\LuaTeX 引擎上的高质量日语文档排版宏包。
230 %<en>\subsection{Backgrounds}
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).
245 従来,「\TeX を用いて日本語組版を行う」といったとき,エンジンとしては
246 ASCII \pTeX やそれの拡張物が用いられることが一般的であった.\pTeX は\TeX
247 のエンジン拡張であり,(少々仕様上不便な点はあるものの)商業印刷の分野に
248 も用いられるほどの高品質な日本語組版を可能としている.だが,それは弱点に
249 もなってしまった:\pTeX という(組版的に)満足なものがあったため,海外で
250 行われている数々の\TeX の拡張――例えば\eTeX や\pdfTeX ――や,TrueType,
251 OpenType, Unicodeといった計算機で日本語を扱う際の状況の変化に追従すること
255 一般情况下,\TeX 下的日语文档输出,是ASCII \pTeX(\TeX 的一个扩展)及其衍生
256 软件来完成的。\pTeX 作为\TeX 的一个扩展引擎,在生成高质量的日语文档时,规避
257 了繁杂的宏编写。但是在和同时期的引擎相比之下,\pTeX 的处境未免有些尴尬:\pTeX
258 已经远远落后于\eTeX 和pdf\TeX,此外也没有跟上计算机上对日文处理的演进(比如,
259 UTF-8编码,TrueType字体,OpenType字体)。
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.
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は未だにあるのが現状であ
278 最近开发的\pTeX 扩展,即\upTeX(Unicode下的\pTeX 实现)和\epTeX(\pTeX 和
279 \eTeX 的融合版本),虽然在部分情况上弥补了上述的差距,但是差距依然存在。
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.
290 しかし,\LuaTeX の登場で,状況は大きく変わることになった.Luaコードで
291 `callback'を書くことにより,\LuaTeX の内部処理に割り込みをかけることが可
292 能となった.これは,エンジン拡張という真似をしなくても,Luaコードとそれに
293 関する\TeX マクロを書けば,エンジン拡張とほぼ同程度のことができるようになっ
294 たということを意味する.\LuaTeX-jaは,このアプローチによってLuaコード・
295 \TeX マクロによって日本語組版を\LuaTeX の上で実現させようという目的で開発
299 不过,\LuaTeX 的出现改变了整个状况。用户可以通过使用Lua语言的“callback”来
300 调整\LuaTeX 的内部处理机制。所以,没有必要去通过修改引擎的源代码来支持日文
301 排版,相反,我们需要做的仅仅是编写其当处理callback的Lua脚本。
304 %<en>\subsection{Major Changes from \pTeX}
305 %<ja>\subsection{\pTeX からの主な変更点}
306 %<zh>\subsection{与\pTeX 的差异所在}
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}.
315 \LuaTeX-jaは,\pTeX に多大な影響を受けている.初期の開発目標は,\pTeX の機
316 能をLuaコードにより実装することであった.しかし,開発が進むにつれ,\pTeX
317 の完全な移植は不可能であり,また\pTeX における実装がいささか不可解になっ
318 ているような状況も発見された.そのため,\textbf{\LuaTeX-jaは,もはや
319 \pTeX の完全な移植は目標とはしない.\pTeX における不自然な仕様・挙動があ
323 \LuaTeX-ja宏包在设计上,受\pTeX 影响很大。最初开发的主要议题是实现\pTeX 的特性。
324 不过,{\bf\LuaTeX-ja不是简简单单的移植\pTeX,很多不自然的特征和现象都被移出了。}
328 The followings are major changes from \pTeX:
331 以下は \pTeX からの主な変更点である.
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
344 \item 和文フォントは(小塚明朝,IPA明朝などの)実際のフォント,和文フォン
345 トメトリック(JFMと呼ぶ\footnote{混乱を防ぐため,p\TeX の意味での
346 JFM (\texttt{min10.tfm}) などは本ドキュメントでは\textbf{和文用
347 TFM}とよぶことにする.}),そして`variation'と呼ばれる文字列の組で
351 \item 一个日文字体是由三部分构成的元组:实际的字体(如小塚明
352 朝,IPA明朝),日文字体测度(\textbf{JFM})和变体字串。
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
363 \item 日本語の文書中では改行はほとんどどこでも許されるので,\pTeX では和文文字
364 直後の改行は無視される(スペースが入らない)ようになっていた.しかし,
365 \LuaTeX-ja では \LuaTeX の仕様のためにこの機能は完全には実装されていない.
368 \item \pTeX 中,日文字符之后的断行并不允许(也不产生空格),其他在源码中的断行
369 是可以随处允许的。不过,因为\LuaTeX 的特殊关系,\LuaTeX-ja并没有这个功能。
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
379 \item 2つの和文文字の間や,和文文字と欧文文字の間に入るグルー/カーン
380 (両者をあわせて\textbf{JAglue}と呼ぶ)の挿入処理が0から書き直されている.
383 \item 插在日文字符和其他字符言之间的胶/出格(我们将此称为\textbf{JAglue})是重新实现的。
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'.
393 \item \LuaTeX の内部での文字の扱いが「ノードベース」になっているように(例えば,
394 \verb+of{}fice+ で合字は抑制されない),\textbf{JAglue}の挿入処理も
398 \item 在\LuaTeX 中,内部的字符处理是“基于node的”(例如:\verb!of{}fice!不会避免合字),
399 \textbf{JAglue}的插入处理,现在也是“基于node的”。
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.
408 \item さらに,2つの文字の間にある行末では効果を持たないノード(例えば \verb+\special+ ノード)や,
409 イタリック補正に伴い挿入されるカーンは挿入処理中では無視される.
412 \item 此外,两个字符之间的node在断行时不起作用的(例如,\verb!\special!node),还有
413 意大利体校正带来的出格在插入处理中也是被忽略的。
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:
422 \item \textbf{注意:上の2つの変更により,従来\textbf{JAglue}の挿入処理を分断するのに
423 使われていたいくつかの方法は用いることができない.具体的には,次の方法はもはや無効である:}
426 \item \textbf{警告:鉴于以上两点,在\pTeX 中分割\textbf{JAglue}处理的多种方法不再生效。}
433 If you want to do so, please put an empty hbox between it instead:
436 もし同じことをやりたければ,空の水平ボックスを間に挟めばよい:
447 \item In the process, two Japanese fonts which only differ in their `real'
448 fonts are identified.
451 \item 処理中では,2つの和文フォントは,「実際の」フォントのみが異なる場合に同一視
455 \item 处理过程中,两个在“真实”字体上具区别的日文字体可以被识别出来。
460 \item \LuaTeX-jaでは,\pTeX と同様に漢字・仮名を制御綴内に用いることができ,
461 \verb+\西暦+ などが正しく動作するようにしている.
462 但し,制御綴中に使える和文文字が\pTeX・\upTeX と全く同じではないことに注意すること.
466 \item At the present, vertical typesetting (\emph{tategaki}), is not
467 supported in \LuaTeX-ja.
470 \item 現時点では,縦書きは\LuaTeX-jaではサポートされていない.
473 \item 当下,\LuaTeX-ja并不支持直行排版。
479 For detailed information, see Part~\ref{part-imp}.
482 詳細については第\ref{part-imp}部を参照.
485 详细的描述,请参见第\ref{part-imp}编。
488 %<en>\subsection{Notations}
489 %<ja>\subsection{用語と記法}
490 %<zh>\subsection{一些约定}
494 In this document, the following terms and notations are used:
497 本ドキュメントでは,以下の用語と記法を用いる:
505 \item Characters are divided into two types:
515 \item \textbf{JAchar}: standing for Japanese characters such as
516 Hiragana, Katakana, Kanji and other punctuation marks for
520 \item \textbf{JAchar}: ひらがな,カタカナ,漢字,和文用の約物といった和文文字の
524 \item \textbf{JAchar}:表示日文字符,如平假名,片假名,汉字,日文标点。
528 \item \textbf{ALchar}: standing for all other characters like alphabets.
531 \item \textbf{ALchar}: アルファベットを始めとする,その他全ての文字を指す.
534 \item \textbf{ALchar}:代表其他字母字符。
539 We say `alphabetic fonts' for fonts used in \textbf{ALchar}, and `Japanese fonts' for fonts used in \textbf{JAchar}.
542 そして,\textbf{ALchar}の出力に用いられるフォントを「欧文フォント」と呼び,
543 \textbf{JAchar}の出力に用いられるフォントを「和文フォント」と呼ぶ.
546 我们将用于\textbf{ALchar}的字体称为“字母字体”,用于\textbf{JAchar}的字体称为“日文字体”。
550 \item A word in a sans-serif font (like \Param{prebreakpenalty})
551 means an internal parameter for Japanese typesetting, and it
552 is used as a key in \verb+\ltjsetparameter+ command.
555 \item サンセリフ体で書かれた語(例:\Param{prebreakpenalty})は日本語組版用の
556 パラメータを表し,これらは \verb+\ltjsetparameter+ コマンドのキーとして
560 \item 用无衬线字体表示的词(如:\Param{prebreakpenalty})表示
561 日文排版中的内部便利iang,并用做\verb!\ltjsetparameter!命令一个键。
565 \item A word in typewriter font with underline (like \Pkg{fontspec})
566 means a package or a class of \LaTeX.
569 \item 下線付きタイプライタ体の語(例:\Pkg{fontspec})は\LaTeX の
573 \item 用下划线表示的词(如:\Pkg{fontspec})表示\LaTeX 的宏包或者文档类。
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
582 \item 「プリミティブ」という語を,\LuaTeX のプリミティブだけではなく \LuaTeX-ja
583 のコアモジュールで定義されたコントロールシーケンスに対しても用いる.
586 \item “primitive”,该词在本文档中不仅表示\LuaTeX 的基本控制命令,也包括\LuaTeX-ja的相关的基本控制命令
590 \item In this document, natural numbers start from~0.
593 \item 本ドキュメントでは,自然数は0から始まる.
600 %<en>\subsection{About the project}
601 %<ja>\subsection{プロジェクトについて}
602 %<zh>\subsection{关于本项目}
605 \paragraph{Project Wiki} Project Wiki is under construction.
608 \paragraph{プロジェクトWiki} プロジェクトWikiは構築中である.
611 \paragraph{项目wiki} 本项目wiki正在编写中。
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)
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}(中国語)
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}(汉语)
636 This project is hosted by SourceForge.JP.
639 本プロジェクトはSourceForge.JPのサービスを用いて運営されている.
642 本项目由SourceForge.JP托管。
645 %<en>\paragraph{Members}\
646 %<ja>\paragraph{開発メンバー}\
647 %<zh>\paragraph{开发者}\
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}
658 \begin{multienumerate}
659 \def\labelenumi{$\bullet$}
660 \mitemxxx{北川 弘典}{前田 一貴}{八登 崇之}
661 \mitemxxx{黒木 裕介}{阿部 紀行}{山本 宗宏}
662 \mitemxxx{本田 知亮}{齋藤 修三郎}{馬 起園}
666 \begin{multienumerate}
667 \def\labelenumi{$\bullet$}
668 \mitemxxx{北川 弘典}{前田 一贵}{八登 崇之}
669 \mitemxxx{黒木 裕介}{阿部 纪行}{山本 宗宏}
670 \mitemxxx{本田 知亮}{斋藤 修三郎}{马 起园}
674 % \paragraph{Acknowledgments} -- 挿入するならここ
677 %<en>\section{Getting Started}
680 %<en>\subsection{Installation}
681 %<ja>\subsection{インストール}
685 To install the \LuaTeX-ja\ package, you will need:
688 \LuaTeX-jaパッケージのインストールには,次のものが必要である.
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.
699 \item \LuaTeX(バージョン 0.65.0-beta 以降)とその支援パッケージ.
700 \TeX~Live~2011やW32\TeX の最新版ならば問題ない.
703 \item \LuaTeX(版本号为大于0.65)和相关支持宏包。\\
704 如果用户使用的是\TeX Live2011以及最新版本的W32\TeX,可不考虑此项。
707 \item The source archive of \LuaTeX-ja, of course\texttt{:)}
710 \item \LuaTeX-jaのソースアーカイブ(もちろん\texttt{:)}).
713 \item \LuaTeX-ja的源码(当然喽\texttt{:)})。
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.
721 \item \Pkg{xunicode}パッケージ(\textbf{2011/09/09,~v0.981}).\\
722 \Pkg{fontspec}パッケージが導入されていればこのパッケージも導入されているはずであるが,
723 このv0.981以外のバージョンでは\LuaTeX-ja上で正しく動作しない危険性がある.
726 \Pkg{xunicode}宏包,当前版本必须为\textit{v0.981(2011/09/09)}。\\
727 如果你使用\Pkg{fontspec}宏包,\Pkg{xunicode}就必须存在。但是请注意该包的
733 The installation methods are as follows:
743 \item Download the source archive, by one of the following method.
744 At the present, \LuaTeX-ja has no \emph{stable} release.
747 \item Copy the Git repository:
749 $ git clone git://git.sourceforge.jp/gitroot/luatex-ja/luatexja.git
751 \item Download the \texttt{tar.gz} archive of HEAD in the \texttt{master} branch from
753 \url{http://git.sourceforge.jp/view?p=luatex-ja/luatexja.git;a=snapshot;h=HEAD;sf=tgz}.
755 \item Now \LuaTeX-ja is available from the following archive and distributions:
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})
762 These are based on the \texttt{master} branch.
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.
769 \item ソースアーカイブを以下のいずれかの方法で取得する.現在公開されているのはあくまでも
773 \item Gitリポジトリの内容をコピーする:
775 $ git clone git://git.sourceforge.jp/gitroot/luatex-ja/luatexja.git
777 \item \texttt{master}ブランチのスナップショット(\texttt{tar.gz}形式)をダウンロードする.
779 \url{http://git.sourceforge.jp/view?p=luatex-ja/luatexja.git;a=snapshot;h=HEAD;sf=tgz}.
781 \item 今や,\LuaTeX-jaは以下のアーカイブ,およびディストリビューションにも収録されている:
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})
788 これらは\texttt{master}ブランチの内容を元にしている.
791 \texttt{master}ブランチ(従って,CTAN内のアーカイブも)はたまにしか更新されないことに注意.
792 主な開発は\texttt{master}の外で行われ,比較的まとまってきたらそれを\texttt{master}に
796 \item 按照如下方法下载源码归档。现在,\LuaTeX-ja没有稳定版本。
801 $ git clone git://git.sourceforge.jp/gitroot/luatex-ja/luatexja.git
803 \item 下载\texttt{master} HEAD版本的\texttt{tar.gz}归档:
805 \url{http://git.sourceforge.jp/view?p=luatex-ja/luatexja.git;a=snapshot;h=HEAD;sf=tgz}.
807 \item 现在\LuaTeX-ja可以在下列仓库和发行版中获取::
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})
814 这些版本都基于\texttt{master}分支。
817 注意\texttt{master}分支和CTAN仓库中的版本,升级并不频繁。
818 前段开发并未在\texttt{master}分支。
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.
826 \item 「Gitリポジトリをコピー」以外の方法でアーカイブを取得したならば,それを展開する.
827 \texttt{src/}をはじめとしたいくつかのディレクトリができるが,
828 動作には\texttt{src/}以下の内容だけで十分.
831 \item 解压归档。你会看到\texttt{src/}和其他相关文件夹。
832 但是只有\texttt{src/}文件夹下的相关文件是\LuaTeX-ja运行所必须的。
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.
842 \item \texttt{src/}の中身を自分の\texttt{TEXMF}ツリーにコピーする.
843 場所の例としては,例えば\texttt{TEXMF/tex/luatex/luatexja/}がある.
844 シンボリックリンクが利用できる環境で,かつリポジトリを直接取得したのであれば,
845 (更新を容易にするために)コピーではなくリンクを貼ることを勧める.
848 \item 复制\texttt{src/}文件夹下内容至\texttt{TEXMF}数下。
849 \texttt{TEXMF/tex/luatex/luatexja/}为例。
850 如果你复制了整个Git仓库,为\texttt{src/}制作软链接来替代复制也是可以的。
854 \item If \texttt{mktexlsr} is needed to update the file name database, make it so.
857 \item 必要があれば,\texttt{mktexlsr}を実行する.
860 \item 如有必要,执行\texttt{mktexlsr}。
864 %<en>\subsection{Cautions}
865 %<ja>\subsection{注意点}
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.
875 \item 原稿のソースファイルの文字コードはUTF-8固定である.
876 従来日本語の文字コードとして用いられてきたEUC-JPやShift-JISは使用できない.
879 \item 源文档编码必须是UTF-8。其他的编码,如EUC-JP和Shift-JIS都不被支持。
883 %<en>\subsection{Using in plain \TeX}
884 %<ja>\subsection{plain \TeX で使う}
885 %<zh>\subsection{plain \TeX 下使用}
889 To use \LuaTeX-ja in plain \TeX, simply put the following at the beginning of the document:
892 \LuaTeX-jaを plain \TeX で使うためには,単に次の行をソースファイルの冒頭に追加すればよい:
895 在plain \TeX 下使用\LuaTeX-ja相当简易,在文档开头放置一行:
901 This does minimal settings (like \texttt{ptex.tex}) for typesetting Japanese documents:
904 これで(\texttt{ptex.tex}のように)日本語組版のための最低限の設定がなされる:
907 这里做出了做小的日文文档排版设定(如\texttt{ptex.tex}):
912 \item The following 6~Japanese fonts are preloaded:
914 \begin{tabular}{ccccc}
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+\\
924 \item 以下の6つの和文フォントが定義される:
926 \begin{tabular}{ccccc}
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+\\
936 \item 提前加载了六种日文字体,如下:
938 \begin{tabular}{ccccc}
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+\\
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
956 \item `Ryumin-Light'と`GothicBBB-Medium'はPDFファイルに埋め込まずに
957 名前参照のみで用いることが広く受け入れられており,この場合PDFリーダーが
958 適切な外部フォントで代用する(例えば,Adobe ReaderではRyumin-Lightは
959 小塚明朝で代替される).そこで,これらを引き続きデフォルトのフォントと
963 \item 广为接受的“Ryumin-Light”和“GothicBBB-Medium”字体不嵌入PDF文件,
964 而PDF阅读器则会使用外部日文字体替代(例如,在Adobe Reader中使用
965 Kozuka Mincho字体替代Ryumin-Light)。我们使用默认设定。
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.
975 \item 欧文フォントの文字は和文フォントの文字よりも,同じ文字サイズでも
976 一般に小さくデザインされている.そこで,標準ではこれらの和文フォントの実際のサイズは指定された値よりも
977 小さくなるように設定されており,具体的には指定の0.962216倍にスケールされる.
978 この0.962216という数値も,\pTeX におけるスケーリングを踏襲した値である.
981 \item 一般情况下,相同大小日文字体比西文字体要大一下。所以实际的日文字体尺寸需哟小于西文字
987 \item The amount of glue that are inserted between a \textbf{JAchar} and
988 an \textbf{ALchar} (the parameter \Param{xkanjiskip}) is set to
991 \item \textbf{JAchar}と\textbf{ALchar}の間に入るグルー(\Param{xkanjiskip})の
995 \item 在\textbf{JAchar}和\textbf{ALchar}之间插入的胶(\textsf{xkanjiskip}参数)大小为:
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}}.
1003 %<en>\subsection{Using in \LaTeX}
1004 %<ja>\subsection{\LaTeX で使う}
1005 %<zh>\subsection{\LaTeX 下使用}
1011 Using in \LaTeXe\ is basically same. To set up the minimal environment
1012 for Japanese, you only have to load \texttt{luatexja.sty}:
1015 \LaTeXe を用いる場合も基本的には同じである.日本語組版のための最低限の環境を
1016 設定するためには,\texttt{luatexja.sty}を読み込むだけでよい:
1019 在\LaTeXe 下使用基本相同。设定日文的最小环境,你只需加载\texttt{luatexja.sty}:
1022 \usepackage{luatexja}
1025 It also does minimal settings (counterparts in \pLaTeX\ are \texttt{
1026 plfonts.dtx} and \texttt{pldefs.ltx}):
1029 これで\pLaTeX の\texttt{plfonts.dtx}と\texttt{pldefs.ltx}に相当する最低限の設定が
1033 这些做了最小的设定(作用相当于\pLaTeX 中的\texttt{plfonts.dtx}和\texttt{pldefs.ltx}):
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.
1042 \item \texttt{JY3}は和文フォント用のフォントエンコーディングである(横書き用).\\
1043 将来的に,\LuaTeX-jaで縦書きがサポートされる際には,\texttt{JT3}を縦書き用として
1047 \item \texttt{JY3}是日文字体编码(在水平方向)。\\
1048 在将来\LuaTeX-ja要支持直行排版的时候,\texttt{JT3}会用于直行字体。
1052 \item Two font families \texttt{mc} and \texttt{gt} are defined:
1053 \begin{center}\small
1054 \begin{tabular}{ccccc}
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\\
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.
1067 \item 2つのフォントファミリ\texttt{mc}と\texttt{gt}が定義されている:
1068 \begin{center}\small
1069 \begin{tabular}{ccccc}
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\\
1077 どちらのファミリにおいても,そのboldシリーズはゴシック体のmediumシリーズで
1078 あることに注意.これは初期のDTPにおいて和文フォントが2つ(それがちょうど\
1079 Ryumin-Light, GothicBBB-Mediumだった)しか利用できなかった時の名残であり,\pLaTeX{}
1083 \item 定义了两个字体族:\texttt{mc}!和\texttt{gt}:\\
1084 \begin{center}\small
1085 \begin{tabular}{ccccc}
1087 \textbf{字体}&\textbf{字体族}&\verb!\mdseries!&\verb!\bfseries!&缩放率\\
1089 \textit{mincho}&\verb!mc!&Ryumin-Light&GothicBBB-Medium&0.962216\\
1090 \textit{gothic}&\verb!gt!&GothicBBB-Medium&GothicBBB-Medium&0.962216\\
1094 注意的是两个字体族的粗体系列同为中等系列的\textbf{哥特}族。这\pLaTeX 中的规定。在近些年
1095 中的DTP实务中有仅使用2个字体的趋向(是为Ryumin-Light和GothicBBB-Medium)。
1099 \item Japanese characters in math mode are typeset by the font family \texttt{mc}.
1102 \item 数式モード中の和文文字は\texttt{mc}ファミリで出力される.
1105 \item 在数学模式下,日文字符使用\verb!mc!字体族来排印。
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}.
1118 しかしながら,上記の設定は日本語の文書にとって十分とは言えない.
1119 日本語文書を組版するためには,\texttt{article.cls}, \texttt{book.cls}といった
1120 欧文用のクラスファイルではなく,和文用のクラスファイルを用いた方がよい.
1121 現時点では,\Pkg{jclasses}(\pLaTeX の標準クラス)と\Pkg{jsclasses}
1122 (奥村晴彦氏によるクラスファイル)に対応するものとして,\Pkg{ltjclasses},
1123 \Pkg{ltjsclasses}がそれぞれ用意されている.
1126 不过,上述设定并不能满足排版基于日文的文档。为了排印基于日文的文
1127 档,你最好不要使用\texttt{article.cls},\texttt{book.cls}等文档类文件。
1128 现在,我们有相当于\Pkg{jclasses}(\pLaTeX 标准文档类)和\Pkg{jsclasses}
1129 (奥村晴彦)的文档类,即\Pkg{ltjclasses}和\Pkg{ltjsclasses}。
1132 %<en>\section{Changing Fonts}
1133 %<ja>\section{フォントの変更}
1136 \subsection{plain \TeX~and~\LaTeXe}
1139 \paragraph{plain \TeX}
1141 To change Japanese fonts in plain \TeX, you must use the primitive
1142 \verb+\jfont+. So please see Subsection~\ref{ssec-jfont}.
1145 plain \TeX で和文フォントを変更するためには,\verb+\jfont+ プリミティブを直接用いる.
1146 \ref{ssec-jfont}節を参照.
1149 在plain \TeX 下改变日文字体,你必须使用基本语句\verb!\jfont!。请参见\ref{ssec-jfont}。
1152 \paragraph{\LaTeXe\ (NFSS2)}
1154 For \LaTeXe, \LuaTeX-ja adopted most of the font selection system of \pLaTeXe\ (in \texttt{plfonts.dtx}).
1157 \LaTeXe については,\LuaTeX-jaではフォント選択システムを\pLaTeXe\ (\texttt{plfonts.dtx})
1161 对于\LaTeXe,\LuaTeX-ja采用了\pLaTeXe 中(即\texttt{plfonts.dtx})大部分字体选择系统。
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+.
1171 \item 2つのコントロールシーケンス \verb+\mcdefault+ と \verb+\gtdefault+ がそれぞ
1172 れ明朝体とゴシック体のデフォルトのフォントファミリを指定するために用いられる.
1173 初期値:\verb+\mcdefault+ は\texttt{mc},\verb+\gtdefault+ は\texttt{gt}.
1176 \item \verb!\mcdefault!和\verb!\gtdefault!控制语句用来分别控制默认的\textit{mincho}和\textit{gothic}字体族。
1177 默认值:\texttt{mc}用于\verb!\mcdefault!,\texttt{gt}用于\verb!\gtdefault!。
1180 \item Commands \verb+\fontfamily+, \verb+\fontseries+,
1181 \verb+\fontshape+ and \verb+\selectfont+ can be used to change
1182 attributes of Japanese fonts.
1185 \item \verb+\fontfamily+, \verb+\fontseries+, \verb+\fontshape+, そして
1186 \verb+\selectfont+ が和文フォントの属性を変更するために使用できる.
1189 \item 命令\verb!\fontfamily!,\verb!\fontseries!,\verb!\fontshape!个\verb!\selectfont!用来改变日文字体属性。
1193 \begin{center}\small
1194 \begin{tabular}{cccccc}
1196 &\textbf{encoding}&\textbf{family}&\textbf{series}&\textbf{shape}&\textbf{selection}\\\midrule
1198 &\verb+\romanencoding+&\verb+\romanfamily+&\verb+\romanseries+&\verb+\romanshape+
1201 &\verb+\kanjiencoding+&\verb+\kanjifamily+&\verb+\kanjiseries+&\verb+\kanjishape+
1203 both&---&--&\verb+\fontseries+&\verb+\fontshape+&---\\
1204 auto select&\verb+\fontencoding+&\verb+\fontfamily+&---&---&\verb+\usefont+\\
1210 \begin{center}\small
1211 \begin{tabular}{cccccc}
1213 &\textbf{エンコーディング}&\textbf{ファミリ}&\textbf{シリーズ}&\textbf{シェープ}&\textbf{選択}\\\midrule
1215 &\verb+\romanencoding+&\verb+\romanfamily+&\verb+\romanseries+&\verb+\romanshape+
1218 &\verb+\kanjiencoding+&\verb+\kanjifamily+&\verb+\kanjiseries+&\verb+\kanjishape+
1220 両方&---&--&\verb+\fontseries+&\verb+\fontshape+&---\\
1221 自動選択&\verb+\fontencoding+&\verb+\fontfamily+&---&---&\verb+\usefont+\\
1227 \begin{center}\small
1228 \begin{tabular}{cccccc}
1230 &\textbf{编码}&\textbf{族}&\textbf{系列}&\textbf{形状}&\textbf{选择}\\\midrule
1232 &\verb+\romanencoding+&\verb+\romanfamily+&\verb+\romanseries+&\verb+\romanshape+
1235 &\verb+\kanjiencoding+&\verb+\kanjifamily+&\verb+\kanjiseries+&\verb+\kanjishape+
1237 两者&---&--&\verb+\fontseries+&\verb+\fontshape+&---\\
1238 自动选择&\verb+\fontencoding+&\verb+\fontfamily+&---&---&\verb+\usefont+\\
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}.
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}節を参照すること.
1263 \verb!\fontencoding{<encoding>}!依赖于参数以改变西文字体或者日文字体。
1264 例如,\verb!\fontencoding{JY3}!改变当前日文字体至\texttt{JY3},
1265 \verb!\fontencoding{T1}!改变西文字体至\texttt{T1}。
1266 \verb!\fontfamily!也会改变日文字体或西文字体的族,抑或二者。
1267 细节详见\ref{ssub-nfsspat}。
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.
1277 \item 和文フォントファミリの定義には \verb+\DeclareFontFamily+ の
1278 代わりに \verb+\DeclareKanjiFamily+ を用いる.しかし,現在の
1279 実装では \verb+\DeclareFontFamily+ を用いても問題は生じない.
1282 \item 对于定义日文字体族,使用\verb!\DeclareKanjiFamily!代替\verb!\DeclareFontFamily!。
1283 不过,在现在的实现中,使用\verb!\DeclareFontFamily!不会引起任何问题。
1288 \paragraph{Remark: Japanese Characters in Math Mode}
1289 Since \pTeX\ supports Japanese characters in math mode, there are
1290 sources like the following:
1293 \paragraph{注意:数式モード中の和文文字}
1294 \pTeX では,特に何もしないでも数式中に和文文字を記述することができた.そのため,
1298 \paragraph{注记:数学模式下的日文字符}
1299 \pTeX 支持在数学模式下的日文字符,如以下源码:
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}\,\}$.
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,
1313 \LuaTeX-jaプロジェクトでは,数式モード中での和文文字はそれらが識別子として用いられる
1318 我们(\LuaTeX-ja项目成员)认为在数学模式下使用日文字符,只有在这些字符充当标识符时才是正确的。在这点下:
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.
1326 \item 上記数式のうち1, 2行目は正しくない.なぜならば`高温'が意味のあるラベルと
1327 して,`よって'が接続詞として用いられているからである.
1330 \item 第1行和第2行是不正确的,因为“高温”的作用为文本标签,“よって”用作为连词。
1333 \item However, the line~3 is correct, since `素' is used as an identifier.
1336 \item しかしながら,3行目は`素'が識別子として用いられているので正しい.
1339 \item 不过,第3行是正确的,因为“素”是作为标识符的。
1343 Hence, in our opinion, the above input should be corrected as:
1346 したがって,\LuaTeX-jaプロジェクトの意見としては,上記の入力は次のように直されるべき
1350 那么,根据我们的观点,上述输入应当校正为:
1354 ($f_{\text{high temperature}}$).
1356 \mathrel{\text{よって}}\quad y>0 \]
1357 $5\in 素:=\{\,p\in\mathbb N:\text{$p$ is a prime}\,\}$.
1359 %BUG?: \{\}がなければ「素」がでない.上の段落の「よって」もでてない.
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}.
1366 また\LuaTeX-jaプロジェクトでは,和文文字が識別子として用いられることはほとんどない
1367 と考えており,したがってこの節では数式モード中の和文フォントを変更する方法については
1368 記述しない.この方法については\ref{ssec-math}節を参照のこと.
1371 我们也认为使用日文字符作为标识符的情况极为少见,所以我们不在此章节描述如何在数学模式下改变日文字体。
1372 关于此方法,请参见\ref{ssec-math}。
1375 \subsection{fontspec}
1376 \label{ssec-fontspec}
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}
1384 \Pkg{fontspec}パッケージと同様の機能を和文フォントに対しても用いるためには,
1385 \Pkg{luatexja-fontspec}パッケージをプリアンブルで読み込む必要がある.このパッケージ
1386 は必要ならば自動で\Pkg{luatexja}パッケージと\Pkg{fontspec}パッケージを読み込む.
1389 为与\Pkg{fontspec}宏包共存,需要在导言区中使用\Pkg{luatexja-fontspec}宏包。
1390 这个附加宏包会自动加载\Pkg{luatexja}和\Pkg{fontspec}。
1394 In \Pkg{luatexja-fontspec} package, the following 7~commands are defined as
1395 counterparts of original commands in the \Pkg{fontspec} package:
1398 \Pkg{luatexja-fontspec}パッケージでは,以下の7つのコマンドを\Pkg{fontspec}
1399 パッケージの元のコマンドに対応するものとして定義している:
1402 在\Pkg{luatexja-fontspec}中,定义了如下七条命令,这些命令和\Pkg{fontspec}的相关命令对比如下:
1405 \begin{center}\small
1406 \begin{tabular}{ccccc}
1409 &\verb+\jfontspec+&\verb+\setmainjfont+&\verb+\setsansjfont+&\verb+\newjfontfamily+\\
1411 &\verb+\fontspec+&\verb+\setmainfont+&\verb+\setsansfont+&\verb+\newfontfamily+\\
1414 &\verb+\newjfontface+&\verb+\defaultjfontfeatures+&\verb+\addjfontfeatures+\\
1416 &\verb+\newfontface+&\verb+\defaultfontfeatures+&\verb+\addfontfeatures+\\
1422 \begin{center}\small
1423 \begin{tabular}{cccc}
1426 &\verb+\jfontspec+&\verb+\setmainjfont+&\verb+\setsansjfont+\\
1428 &\verb+\fontspec+&\verb+\setmainfont+&\verb+\setsansfont+\\
1431 &\verb+\newjfontfamily+&\verb+\newjfontface+&\verb+\defaultjfontfeatures+\\
1433 &\verb+\newfontfamily+&\verb+\newfontface+&\verb+\defaultfontfeatures+\\
1436 &\verb+\addjfontfeatures+\\
1438 &\verb+\addfontfeatures+\\
1444 \begin{center}\small
1445 \begin{tabular}{ccccc}
1447 日文字体&\verb+\jfontspec+&\verb+\setmainjfont+&\verb+\setsansjfont+&\verb+\newjfontfamily+\\
1448 西文字体&\verb+\fontspec+&\verb+\setmainfont+&\verb+\setsansfont+&\verb+\newfontfamily+\\
1450 日文字体&\verb+\newjfontface+&\verb+\defaultjfontfeatures+&\verb+\addjfontfeatures+&\\
1451 西文字体&\verb+\newfontface+&\verb+\defaultfontfeatures+&\verb+\addfontfeatures+&\\
1458 \fontspec[Numbers=OldStyle]{LMSans10-Regular}
1459 \jfontspec{IPAexMincho}
1462 \addjfontfeatures{CJKShape=JIS1990}
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
1474 和文フォントについては全ての和文文字のグリフがほぼ等幅であるのが普通であるため,
1475 \verb+\setmonojfont+ コマンドは存在しないことに注意.また,これらの和文用の7つのコマ
1476 ンドではKerning featureはデフォルトではoffとなっている.これはこの
1477 featureが\textbf{JAglue}と衝突するためである(\ref{para-kern}節を参照).
1480 请注意并没有\verb!\setmonofont!命令,因为流行的日文字体几乎全部是等宽的。
1481 另注意,出格特性在这7个命令中默认关闭,因为此特性会与\textbf{JAglue}冲突(参见\ref{para-kern})。
1484 %<en>\subsection{Preset}
1485 %<ja>\subsection{プリセット設定}
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.
1495 よく使われている和文フォント設定を一行で指定できるようにしたのが
1496 \Pkg{luatexja-preset}パッケージである.このパッケージは,
1497 \Pkg{otf}パッケージの一部機能と八登崇之氏による\Pkg{PXchfon}パッケージの一部機能とを
1498 合わせたような格好をしており,内部で\Pkg{luatexja-fontspec}を読み込んでいる.
1501 %<en>\paragraph{General options}
1502 %<ja>\paragraph{一般的なオプション}
1503 \begin{list}{}{\def\makelabel{\ttfamily}\def\{{\char`\{}\def\}{\char`\}}\advance\leftmargin1\zw}
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+).
1515 明朝体2ウェイト・ゴシック体3ウェイトと,
1516 丸ゴシック体 (\verb+\mgfamily+) を使用可能とする.
1517 ゴシック体は細字・太字・極太の3ウェイトがあるが,極太ゴシック体はファミリの切り替え (\verb+\gtebfamily+) %
1518 で実現している.\Pkg{fontspec}では通常 (\verb+\mdseries+) と太字 (\verb+\bfseries+) しか扱えないために
1523 Use horizontal kana alternates, and define a control sequence \verb+\rubyfamily+ to use kana
1524 characters designed for ruby.
1527 横組専用仮名を用いる.また,\verb+\rubyfamily+ でルビ用仮名が使用可能となる.
1531 Use bold gothic as bold mincho.
1538 Use fonts with 90JIS glyphs if possible.
1541 出来る限り90JISの字形を採用しているフォントを使う.
1545 Use fonts with JIS2004 glyphs if possible.
1548 出来る限りJIS2004の字形を採用しているフォントを使う.
1552 Use the JFM \texttt{jfm-jis.lua}, instead of \texttt{jfm-ujis.lua}, which is the default JFM of
1556 用いるJFMを(JISフォントメトリック類似の)\texttt{jfm-jis.lua}にする.このオプションがない時は
1557 \LuaTeX-ja標準の\texttt{jfm-ujis.lua}が用いられる.
1561 %<en>\paragraph{Kozuka fonts}
1562 %<ja>\paragraph{小塚フォント}
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}.
1570 まず,小塚フォントを用いる設定を述べる.
1571 単ウェイト時のゴシック体は小塚ゴシックRでは細いように感じるので,
1573 さらに,丸ゴシック体はないので便宜上小塚ゴシックHで代用している.
1575 \begin{center}\small
1576 \begin{tabular}{llll}
1578 &\tt kozuka4&\tt kozuka6&\tt kozuka6n\\
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\\
1585 without \texttt{deluxe}
1586 &Kozuka Gothic Pro M&Kozuka Gothic ProVI M&Kozuka Gothic Pr6N M\\
1588 &Kozuka Gothic Pro R&Kozuka Gothic ProVI R&Kozuka Gothic Pr6N R\\
1591 &Kozuka Gothic Pro B&Kozuka Gothic ProVI B&Kozuka Gothic Pr6N B\\
1593 &Kozuka Gothic Pro H&Kozuka Gothic ProVI H&Kozuka Gothic Pr6N H\\
1595 &Kozuka Gothic Pro H&Kozuka Gothic ProVI H&Kozuka Gothic Pr6N H\\
1598 \gt 明朝体細字&小塚明朝Pro~R&小塚明朝ProVI~R&小塚明朝Pr6N~R\\
1599 \gt 明朝体太字&小塚明朝Pro~B&小塚明朝ProVI~B&小塚明朝Pr6N~B\\
1603 &小塚ゴシックPro~M&小塚ゴシックProVI~M&小塚ゴシックPr6N~M\\
1605 &小塚ゴシックPro~R&小塚ゴシックProVI~R&小塚ゴシックPr6N~R\\
1608 &小塚ゴシックPro~B&小塚ゴシックProVI~B&小塚ゴシックPr6N~B\\
1610 &小塚ゴシックPro~H&小塚ゴシックProVI~H&小塚ゴシックPr6N~H\\
1611 \inhibitglue(丸ゴシック体)\inhibitglue
1612 &小塚ゴシックPro~H&小塚ゴシックProVI~H&小塚ゴシックPr6N~H\\
1618 %<en>\paragraph{Hiragino and Morisawa}
1619 %<ja>\paragraph{ヒラギノ・モリサワ}
1621 Settings for Hiragino fonts:
1626 % これらは持っているわけではないので,フォント名が
1627 % 異なっているかもしれません.確認お願いします.
1628 \begin{center}\small
1629 \begin{tabular}{lll}
1631 &\tt hiragino&\tt hiraginon\\
1635 Hiragino Mincho Pro W3&Hiragino Mincho Pr6N W3\\
1637 Hiragino Mincho Pro W6&Hiragino Mincho Pr6N W6\\
1639 Hiragino Kaku Gothic Pro W3&Hiragino Kaku Gothic ProN W3\\
1641 Hiragino Kaku Gothic Pro W6&Hiragino Kaku Gothic ProN W6\\
1643 Hiragino Kaku Gothic Std W8&Hiragino Kaku Gothic StdN W8\\
1645 Hiragino Maru Gothic Pro W4&Hiragino Maru Gothic ProN W4\\
1649 ヒラギノ明朝体Pro~W3&ヒラギノ明朝体Pr6N~W3\\
1651 ヒラギノ明朝体Pro~W6&ヒラギノ明朝体Pr6N~W6\\
1653 ヒラギノ角ゴPro~W3&ヒラギノ角ゴProN~W3\\
1655 ヒラギノ角ゴPro~W6&ヒラギノ角ゴProN~W6\\
1657 ヒラギノ角ゴStd~W8&ヒラギノ角ゴStdN~W8\\
1659 ヒラギノ丸ゴPro~W4&ヒラギノ丸ゴProN~W4\\
1665 Settings for Morisawa fonts:
1668 次はモリサワフォントを用いる設定である:
1670 \begin{center}\small
1671 \begin{tabular}{lll}
1673 &\tt morisawa4&\tt morisawa6n\\
1677 Ryumin Pro L-KL&Ryumin Pr6N L-KL\\
1679 Futo Min A101 Pro Bold&Futo Min A101 Pr6N Bold\\
1681 Chu Gothic BBB Pro Med&Chu Gothic BBB Pr6N Med\\
1683 Futo Go B101 Pro Bold&Futo Go B101 Pr6N Bold\\
1685 Midashi Go Pro MB31&Midashi Go Pr6N MB31\\
1687 Jun Pro 101&Jun Pr6N 101\\
1691 リュウミンPro~L-KL&リュウミンPr6N~L-KL\\
1693 太ミンA101~Pro~Bold&太ミンA101~Pr6N~Bold\\
1695 中ゴシックBBB~Pro~Med&中ゴシックBBB~Pr6N~Med\\
1697 太ゴB101~Pro~Bold&太ゴB101~Pr6N~Bold\\
1699 見出ゴPro~MB31&見出ゴPr6N~MB31\\
1701 じゅんPro 101&じゅんPr6N 101\\
1707 %<en>\paragraph{Settings for single weight}
1708 %<ja>\paragraph{単ウェイト用設定}
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).
1716 次に,単ウェイト用の設定を述べる.この4設定では「細字」「太字」の区別はない.
1717 また,丸ゴシック体はゴシック体と同じフォントを用いる.
1719 \begin{center}\small
1720 \begin{tabular}{lllll}
1722 &\tt noembed&\tt ipa&\tt ipaex&\tt ms\\
1725 \bf mincho&Ryumin-Light (non-embedded)
1726 &IPAMincho&IPAexMincho&MS Mincho\\
1727 \bf gothic&GothicBBB-Medium (non-embedded)
1728 &IPAGothic&IPAexGothic&MS Gothic\\
1731 \gt 明朝体&Ryumin-Light(非埋込)
1732 &IPA明朝&IPAex明朝&MS明朝\\
1733 \gt ゴシック体&GothicBBB-Medium(非埋込)
1734 &IPAゴシック&IPAexゴシック&MSゴシック\\
1740 %<en>\paragraph{Using HG fonts}
1741 %<ja>\paragraph{HGフォントの利用}
1743 We can use HG~fonts bundled with Microsoft Office for realizing multiple weights in Japanese fonts.
1746 すぐ前に書いた単ウェイト用設定を,Microsoft Office等に付属するHGフォントを使って
1749 \begin{center}\small
1750 \begin{tabular}{llll}
1752 &\tt ipa-dx&\tt ipaex-dx&\tt ms-dx\\
1756 &IPAMincho&IPAexMincho&MS Mincho\\\midrule
1758 \multicolumn{3}{c}{HG Mincho E}\\\midrule
1760 ~~without \texttt{deluxe}
1761 &IPAGothic&IPAexGothic&MS Gothic\\
1762 ~~with {\tt jis2004}
1763 &IPAGothic&IPAexGothic&MS Gothic\\
1766 \multicolumn{3}{c}{HG Gothic M}\\\midrule
1768 \multicolumn{3}{c}{HG Gothic E}\\\midrule
1770 \multicolumn{3}{c}{HG Soei Kaku Gothic UB}\\\midrule
1772 \multicolumn{3}{c}{HG Maru Gothic PRO}\\
1776 &IPA明朝&IPAex明朝&MS明朝\\\midrule
1778 \multicolumn{3}{c}{HG明朝E}\\\midrule
1781 &IPAゴシック&IPAexゴシック&MSゴシック\\
1783 &IPAゴシック&IPAexゴシック&MSゴシック\\
1786 \multicolumn{3}{c}{HGゴシックM}\\\midrule
1788 \multicolumn{3}{c}{HGゴシックE}\\\midrule
1790 \multicolumn{3}{c}{HG創英角ゴシックUB}\\\midrule
1792 \multicolumn{3}{c}{HG丸ゴシック体PRO}\\
1798 Note that HG~Mincho~E, HG~Gothic~E, HG Soei Kaku Gothic UB and HG Maru Gothic PRO
1799 are internally specified by:
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}).
1807 なお,HG明朝E・HGゴシックE・HG創英角ゴシックUB・HG丸ゴシック体PROの4つについては,内部で
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})
1815 として指定を行っているので注意すること.
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.
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}パッケージ
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}宏包。
1842 \fontencoding{JY3}\selectfont
1846 森\UTF{9DD7}外と内田百\UTF{9592}とが\UTF{9AD9}島屋に行く。
1848 \CID{7652}飾区の\CID{13706}野家,
1856 \Pkg{otf}パッケージでは,それぞれ次のようなオプションが存在した:
1858 \item[\texttt{deluxe}] 明朝体・ゴシック体各2ウェイトと,丸ゴシック体を扱えるようになる.
1859 \item[\texttt{expert}] 仮名が横組・縦組専用のものに切り替わり,ルビ用仮名も扱えるようになる.
1860 \item[\texttt{bold}] ゴシック体を標準で太いウェイトのものに設定する.
1862 しかしこれらのオプションは\Pkg{luatexja-otf}パッケージには存在しない.
1863 \Pkg{otf}パッケージが文書中で使用する和文用TFMを自前の物に置き換えていたのに対し,
1864 \Pkg{luatexja-otf}パッケージでは,そのようなことは行わないからである.
1867 \Pkg{luatexja-preset} パッケージにプリセットを使う時に一緒に指定するか,
1868 あるいは対応する内容を\ref{ssub-chgfnt}節 (NFSS2) や
1869 \ref{ssec-fontspec}節 (\Pkg{fontspec}) の方法で手動で指定する必要がある.
1872 %<en>\section{Changing Parameters}
1873 %<ja>\section{パラメータの変更}
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+.
1884 \LuaTeX-jaには多くのパラメータが存在する.そして\LuaTeX の仕様のために,
1885 その多くは\TeX のレジスタにではなく,\LuaTeX-ja独自の方法で保持されている.
1886 そのため,これらのパラメータを設定・取得するためには \verb+\ltjsetparameter+ と \verb+\ltjgetparameter+ を
1890 \LuaTeX-ja包含大量的参数,以控制排版细节。
1891 设定这些参数需要使用命令:\verb!\ltjsetparameter!和\verb!\ltjgetparameter!命令。
1894 %<en>\subsection{Editing the range of \textbf{JAchar}s}
1895 %<ja>\subsection{\textbf{JAchar}の範囲の設定}
1896 %<zh>\subsection{\textbf{JAchar}范围设定}
1897 \label{ssec-setrange}
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.
1907 \textbf{JAchar}の範囲を設定するためには,まず各文字に0より大きく217より小さいindexを
1908 割り当てる必要がある.これには \verb+\ltjdefcharrange+ プリミティブを用いる.
1909 例えば,次のように書くことで追加漢字面(SIP)にある全ての文字と`漢'が
1910 「100番の文字範囲」に属するように設定される.
1913 在设定\textbf{JAchar}之前,需要分配一个小于217的自然数。
1914 这个可以由\verb!\ltjdefcharrange!基本语句来完成。例如,
1915 下面就分配了整个表意文字补充平面和汉字“漢”为100。
1918 \ltjdefcharrange{100}{"20000-"2FFFF,`漢}
1921 This assignment of numbers to ranges are always global, so you should
1922 not do this in the middle of a document.
1925 この文字範囲の割り当ては常にグローバルであり,したがって文書の途中で
1929 范围数的分配是全局的,故你不可在文档中使用。
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.
1940 もし指定されたある文字がある非零番号の範囲に属していたならば,これは新しい設定で
1941 上書きされる.例えば,SIPは全て\LuaTeX-jaのデフォルトでは4番の文字範囲に
1942 属しているが,上記の指定を行えばSIPは100番に属すようになり,4番からは除かれる.
1945 如果某些字符被改变为新的非零数范围,将会被新设定重写。
1946 例如,整个SIP在\LuaTeX-ja默认设定中属于范围4,如果你使用如上设定,
1947 SIP将会被设定为范围100,且从范围4种移除。
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):
1957 文字範囲に番号を割り当てた後は,\textsf{jacharrange}パラメータが\textbf{JAchar}と
1958 して扱われる文字の範囲を設定するために用いられる.例えば,以下は\LuaTeX-jaの
1962 分配了范围数之后,\textsf{jacharrange}参数将用于设定字符范围为\textbf{JAchar},
1963 如下(为\LuaTeX-ja默认设定):
1966 \ltjsetparameter{jacharrange={-1, +2, +3, -4, -5, +6, +7, +8}}
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}'.
1975 \textsf{jacharrange}パラメータには整数のリストを与える.
1976 リスト中の負の整数$-n$は「文字範囲$n$に属する文字は\textbf{ALchar}として
1977 扱われる」ことを意味し,正の整数$+n$は\textbf{JAchar}として扱うことを意味する.
1980 \textsf{jacharrange}参数的变量未整数数组。
1981 负数$-n$在数组中表示“字符范围$n$中的字符被视作\textbf{ALchar}”,
1982 正数$+n$则表示“字符范围$n$被视作\textbf{JAchar}”。
1986 \paragraph{Default Setting}
1987 \LuaTeX-ja predefines eight character ranges for convenience. They are
1988 determined from the following data:
1992 \LuaTeX-jaでは8つの文字範囲を設定している.これらは以下のデータに基づいて決定して
1997 \LuaTeX-ja默认设定了8个字符范围。如下设定:
2001 \item Blocks in Unicode~6.0.
2004 \item Unicode~6.0のブロック.
2010 \item The \texttt{Adobe-Japan1-UCS2} mapping between a CID Adobe-Japan1-6 and Unicode.
2013 \item \texttt{Adobe-Japan1-UCS2}によるAdobe-Japan1-6のCIDとUnicodeの間の
2017 \item 在CID Adobe-Japan1-6和Unicode之间的映射\texttt{Adobe-Japan1-UCS2}。
2020 \item The \Pkg{PXbase} bundle for \upTeX\ by Takayuki Yato.
2023 \item 八登崇之氏による\upTeX 用の\Pkg{PXbase}バンドル.
2026 \item 八登崇之的\Pkg{PXbase}宏包(\upTeX 下使用)。
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.
2037 以下ではこれら8つの文字範囲について記述する.番号のあとのアルファベット`J'と`A'
2038 はデフォルトで\textbf{JAchar}か\textbf{ALchar}かを表している.これらの設定は
2039 \texttt{PXbase}バンドルで定義されている\texttt{prefercjk}と類似のものである.
2042 现在我们描述8个字符范围。在数字后的“J”和“A”表明代表\textbf{JAchar}或者未跟随默认设定。
2043 这些设定类似于\texttt{PXbase}中的\texttt{prefercjk}设定。
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:
2052 \item[範囲8${}^{\text{J}}$] ISO~8859-1の上位領域(ラテン1補助)と
2053 JIS~X~0208の共通部分にある記号.この文字範囲は
2057 \item[范围8${}^\text{J}$] ISO 8859-1(Latin-1补充)的上半部和JIS X 0208(日文基本字符集)的重叠部分,包含下列字符:
2059 \begin{multicols}{2}
2061 \def\ch#1#2{\item \char"#1\ (\texttt{U+00#1}, #2)}%"
2063 \ch{A7}{Section Sign}
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}
2077 \ch{B4}{アキュート・アクセント}
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}:
2100 \item[範囲1${}^{\text{A}}$] ラテン文字.一部はAdobe-Japan1-6にも含まれている.
2101 この範囲は以下のUnicodeのブロックから構成されている.
2102 \textbf{ただし,範囲8は除く.}
2105 \item[范围1${}^\text{A}$] 包含于Adobe-Japan1-6中的拉丁字符,此范围包含下列
2106 Unicode区域,但\textbf{不包括上述提到过的范围8}:
2108 \begin{multicols}{2}
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
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}: ラテン文字拡張追加
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}: 拉丁字母扩充附加
2141 \item[Range~2${}^{\text{J}}$] Greek and Cyrillic letters. JIS~X~0208 (hence most of Japanese
2142 fonts) has some of these characters.
2145 \item[範囲2${}^{\text{J}}$] ギリシャ文字とキリル文字.JIS~X~0208(したがってほとんどの
2149 \item[范围2${}^\text{J}$] 希腊文和西里尔字母,使用JIS X 0208的大部分日文字体包含这些字符:
2151 \begin{multicols}{2}
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
2159 \item \texttt{U+0370}--\texttt{U+03FF}: ギリシア文字及びコプト文字
2160 \item \texttt{U+0400}--\texttt{U+04FF}: キリル文字
2161 \item \texttt{U+1F00}--\texttt{U+1FFF}: キリル文字補助
2164 \item \texttt{U+0370}--\texttt{U+03FF}: 希腊字母
2165 \item \texttt{U+0400}--\texttt{U+04FF}: 西里尔字母
2166 \item \texttt{U+1F00}--\texttt{U+1FFF}: 希腊文扩充
2172 \item[Range~3${}^{\text{J}}$] Punctuations and Miscellaneous symbols. The block list is
2173 indicated in Table~\ref{table-rng3}.
2176 \item[範囲3${}^{\text{J}}$] 句読点と記号類.ブロックのリストは表\ref{table-rng3}%
2180 \item[范围3${}^\text{J}$] 标点以及杂项符号,参见表\ref{table-rng3}。
2184 \caption{Unicode blocks in predefined character range~3.}
2187 \caption{文字範囲3に指定されているUnicodeブロック.}
2190 \caption{字符范围3定义的Unicode范围}
2193 \catcode`\"=13\def"#1#2#3#4{\texttt{U+#1#2#3#4}}%"
2194 \begin{center}\small
2195 \begin{tabular}{llll}
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&
2219 "2070--"209F&上付き・下付き\\
2221 "20D0--"20FF&記号用ダイアクリティカルマーク(合成可能)\\
2223 "2150--"218F&数字に準じるもの\\
2225 "2200--"22FF&数学記号(演算子)\\
2226 "2300--"23FF&その他の技術用記号&
2227 "2400--"243F&制御機能用記号\\
2229 "2580--"259F&ブロック要素\\
2231 "2600--"26FF&その他の記号\\
2233 "2900--"297F&補助矢印B\\
2234 "2980--"29FF&その他の数学記号B&
2235 "2B00--"2BFF&その他の記号及び矢印\\
2236 "E000--"F8FF&私用領域(外字領域)&
2239 "2000--"206F&一般标点符号&
2240 "2070--"209F&上标及下标\\
2242 "20D0--"20FF& 符号用组合附加符号\\
2246 "2200--"22FF&数学运算符号\\
2247 "2300--"23FF&杂项技术符号&
2254 "2900--"297F&补充性箭头-B\\
2255 "2980--"29FF&混合数学符号-B&
2256 "2B00--"2BFF&杂项符号和箭头符号\\
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:
2269 \item[範囲4${}^{\text{A}}$] 通常和文フォントには含まれていない文字.
2270 この範囲は他の範囲にないほとんど全てのUnicodeブロック
2271 で構成されている.したがって,ブロックのリストを示す
2275 \item[范围4${}^\text{A}$] 通常情况下不包含于日文字体的部分。本范围包含有其他
2276 范围尚未涵盖部分。故,我们直接给出定义:
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
2285 \item[Range~5${}^{\text{A}}$] Surrogates and Supplementary Private Use Areas.
2288 \item[範囲5${}^{\text{A}}$] 代用符号と補助私用領域.
2291 \item[范围5${}^\text{A}$] 代替以及补充私有使用区域。
2294 \item[Range~6${}^{\text{J}}$] Characters used in Japanese. The block list is indicated in Table~\ref{table-rng6}.
2297 \item[範囲6${}^{\text{J}}$] 日本語で用いられる文字.ブロックのリストは
2298 表\ref{table-rng6}に示す.
2301 \item[范围6${}^\text{J}$] 日文字符。
2305 \caption{Unicode blocks in predefined character range~6.}
2308 \caption{文字範囲6に指定されているUnicodeブロック.}
2311 \caption{字符范围6定义的Unicode范围}
2314 \catcode`\"=13\def"#1#2#3#4{\texttt{U+#1#2#3#4}}%"
2315 \begin{center}\small
2316 \begin{tabular}{llll}
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)
2337 "2E80--"2EFF&CJK部首補助\\
2338 "3000--"303F&CJKの記号及び句読点&
2341 "3190--"319F&漢文用記号(返り点)\\
2343 "3200--"32FF&囲みCJK文字・月\\
2344 "3300--"33FF&CJK互換用文字&
2345 "3400--"4DBF&CJK統合漢字拡張A\\
2346 "4E00--"9FFF&CJK統合漢字&
2347 "F900--"FAFF&CJK互換漢字\\
2349 "FE30--"FE4F&CJK互換形\\
2351 "{20}000--"{2F}FFF&(追加漢字面)
2354 "2460--"24FF&圈状字母数字&
2355 "2E80--"2EFF&CJK部首补充\\
2356 "3000--"303F&CJK标点符号&
2359 "3190--"319F&汉文标注号\\
2360 "31F0--"31FF&片假名音标补充&
2361 "3200--"32FF&圈状CJK字母及月份\\
2363 "3400--"4DBF&CJK统一表意文字扩充A\\
2364 "4E00--"9FFF&CJK统一表意文字&
2365 "F900--"FAFF&CJK兼容表意文字\\
2367 "FE30--"FE4F&CJK兼容形式\\
2369 "{20}000--"{2F}FFF&(补充字符)
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}.
2379 \item[範囲7${}^{\text{J}}$] CJK言語で用いられる文字のうち,Adobe-Japan1-6に
2381 ブロックのリストは表\ref{table-rng7}に示す.
2384 \item[范围7${}^\text{J}$] 不包含于Adobe-Japan1-6的CJK字符,参见表\ref{table-rng7}。
2388 \caption{Unicode blocks in predefined character range~7.}
2391 \caption{文字範囲7に指定されているUnicodeブロック.}
2394 \caption{字符范围7定义的Unicode范围}
2397 \catcode`\"=13\def"#1#2#3#4{\texttt{U+#1#2#3#4}}%"
2398 \begin{center}\small
2399 \begin{tabular}{llll}
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
2415 "1100--"11FF&ハングル字母&
2417 "2FF0--"2FFF&漢字構成記述文字&
2418 "3100--"312F&注音字母 (注音符号)\\
2419 "3130--"318F&ハングル互換字母&
2420 "31A0--"31BF&注音字母拡張\\
2421 "31C0--"31EF&CJKの筆画&
2424 "A830--"A83F&共通インド数字に準じるもの\\
2425 "AC00--"D7AF&ハングル音節文字&
2426 "D7B0--"D7FF&ハングル字母拡張B
2431 "2FF0--"2FFF&汉字结构描述字符&
2433 "3130--"318F&谚文兼容字母&
2434 "31A0--"31BF&注音字母扩充\\
2438 "A830--"A83F&一般印度数字\\
2440 "D7B0--"D7FF&谚文字母扩充-B
2448 %<en>\subsection{\Param{kanjiskip} and \Param{xkanjiskip}}
2449 %<ja>\subsection{\Param{kanjiskip}と\Param{xkanjiskip}}
2450 %<zh>\subsection{\Param{kanjiskip}和\Param{xkanjiskip}}
2454 \textbf{JAglue} is divided into the following three categories:
2457 \textbf{JAglue}は以下の3つのカテゴリに分類される:
2460 \textbf{JAglue}分为以下三个范畴:
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
2469 \item JFMで指定されたグルー/カーン.もし \verb+\inhibitglue+ が和文文字の周りで
2470 発行されていれば,このグルーは挿入されない.
2473 \item JFM设定的胶或出格值。如果在一个日文字符附近使用\verb!\inhibitglue!,则胶便不会插入。
2476 \item The default glue which inserted between two \textbf{JAchar}s (\Param{%
2480 \item デフォルトで2つの\textbf{JAchar}の間に挿入されるグルー(\Param{kanjiskip}).
2483 \item 两个\textbf{JAchar}之间默认插入的胶(\Param{kanjiskip})。
2486 \item The default glue which inserted between a \textbf{JAchar} and an
2487 \textbf{ALchar} (\Param{xkanjiskip}).
2490 \item デフォルトで\textbf{JAchar}と\textbf{ALchar}の間に挿入されるグルー(\Param{xkanjiskip}).
2493 \item \textbf{JAchar}和\textbf{ALchar}之间默认插入的胶(\Param{xkanjiskip})。
2497 The value (a skip) of \Param{kanjiskip} or \Param{xkanjiskip} can be
2498 changed as the following.
2501 \Param{kanjiskip}や\Param{xkanjiskip}の値は以下のようにして変更可能である.
2504 \Param{kanjiskip}和\Param{xkanjiskip}的设定如下所示:
2507 \ltjsetparameter{kanjiskip={0pt plus 0.4pt minus 0.4pt},
2508 xkanjiskip={0.25\zw plus 1pt minus 1pt}}
2512 It may occur that JFM contains the data of `ideal width of \Param{kanjiskip}'
2513 and/or `ideal width of \Param{xkanjiskip}'.
2514 To use these data from JFM, set the value of \Param{kanjiskip} or
2515 \Param{xkanjiskip} to \verb+\maxdimen+.
2518 JFMは「望ましい\Param{kanjiskip}の値」や「望ましい\Param{xkanjiskip}の値」を
2520 これらのデータを使うためには,\Param{kanjiskip}や\Param{xkanjiskip}の
2521 値を \verb+\maxdimen+ の値に設定すればよい.
2524 当JFM包含“\Param{kanjiskip}理想宽度”和/或“\Param{xkanjiskip}理想宽度”数据时,
2525 上述设定产生作用。如果想用JFM中的数据,请设定\Param{kanjiskip}或\textsf{xkanjiskip}为\verb!\maxdimen!。
2528 %<en>\subsection{Insertion Setting of \Param{xkanjiskip}}
2529 %<ja>\subsection{\Param{xkanjiskip} の挿入設定}
2530 %<zh>\subsection{\Param{xkanjiskip}插入设定}
2533 It is not desirable that \Param{xkanjiskip} is inserted into every
2534 boundary between \textbf{JAchar}s and \textbf{ALchar}s. For example,
2535 \Param{xkanjiskip} should not be inserted after opening parenthesis
2536 (\textit{e.g.}, compare `(あ' and `(\hskip\ltjgetparameter{xkanjiskip}あ').
2537 \LuaTeX-ja can control whether \Param{xkanjiskip} can be inserted
2538 before/after a character, by changing \Param{jaxspmode} for \textbf{JAchar}s and
2539 \Param{alxspmode} parameters \textbf{ALchar}s respectively.
2542 \Param{xkanjiskip}がすべての\textbf{JAchar}と\textbf{ALchar}の境界に
2543 挿入されるのは望ましいことではない.例えば,\Param{xkanjiskip}は開き括弧の
2544 後には挿入されるべきではない(`(あ'と`(\hskip\ltjgetparameter{xkanjiskip}あ'を
2546 \LuaTeX-jaでは\Param{xkanjiskip}をある文字の前/後に挿入するかどうかを,
2547 \textbf{JAchar}に対しては\Param{jaxspmode}を,\textbf{ALchar}に対しては
2548 \Param{alxspmode}をそれぞれ変えることで制御することができる.
2551 并不是在所有的\textbf{JAchar}和\textbf{ALchar}周围插入\textsf{xkanjiskip}都是合适的。
2552 比如,在开标点之后插入\Param{xkanjiskip}并不合适[如,比较“(あ”和“(\hskip\ltjgetparameter{xkanjiskip}あ”]。
2553 \LuaTeX-ja可以通过设定\textbf{JAchar}的\Param{jaxspmode}以及\textbf{ALchar}的\Param{alxspmode}来控制
2554 \Param{xkanjiskip}在字符前后的插入。
2557 \ltjsetparameter{jaxspmode={`あ,preonly}, alxspmode={`\!,postonly}}
2562 The second argument \texttt{preonly} means `the insertion of
2563 \Param{xkanjiskip} is allowed before this character, but not after'.
2564 the other possible values are \texttt{postonly}, \texttt{allow} and \texttt{
2568 2つ目の引数の \texttt{preonly}は「\Param{xkanjiskip}の挿入はこの文字の
2569 前でのみ許され,後では許さない」ことを意味する.他に指定可能な値は
2570 \texttt{postonly}, \texttt{allow}, \texttt{inhibit}である.
2573 第二个参数\textsf{preonly}表示的含义为“允许在该字符前插入\textsf{xkanjiskip},但不允许在该字符之后插入”。
2574 其他参数还有\textsf{postonly},\textsf{allow}和\textsf{inhibit}。
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
2584 仕様では,\Param{jaxspmode}, \Param{alxspmode}はテーブルを共有しており,
2585 上のコードの1行目を次のように変えても同じことになる:
2588 当前版本的\Param{jaxspmode}和\Param{alxspmode}使用相同的的表保存参数。
2592 \ltjsetparameter{alxspmode={`あ,preonly}, jaxspmode={`\!,postonly}}
2595 One can use also numbers to specify these two parameters (see Subsection~\ref{ssec-param}).
2598 また,これら2パラメータには数値で値を指定することもできる(\ref{ssec-param}節を参照).
2601 你也可以使用数字来定义两个参数(参见\ref{ssec-param})。
2605 If you want to enable/disable all insertions of \Param{kanjiskip} and
2606 \Param{xkanjiskip}, set \Param{autospacing} and \Param{autoxspacing}
2607 parameters to \texttt{true}/\texttt{false}, respectively.
2610 もし全ての\Param{kanjiskip}と\Param{xkanjiskip}の挿入を有効化/無効化
2611 したければ,それぞれ\Param{autospacing}と\Param{autoxspacing}を
2612 \texttt{true}/\texttt{false}に設定すればよい.
2615 如果你想要启用/屏蔽所有的\Param{kanjiskip}和\Param{xkanjiskip}插入,设定
2616 \Param{autospacing}和\Param{autoxspcing}为\texttt{ture}/\texttt{false}即可。
2619 %<en>\subsection{Shifting Baseline}
2620 %<ja>\subsection{ベースラインの移動}
2621 %<zh>\subsection{基线浮动}
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}
2635 和文フォントと欧文フォントを合わせるためには,時々どちらかのベースラインの移動が
2636 必要になる.\pTeX ではこれは \verb+\ybaselineshift+ を非零の長さに設定することで
2637 なされていた(欧文フォントのベースラインが下がる).しかし,日本語が主ではない
2638 文書に対しては,欧文フォントではなく和文フォントのベースラインを移動した方がよい.
2639 このため,\LuaTeX-jaでは欧文フォントのベースラインのシフト量
2640 (\Param{yalbaselineshift}パラメータ)と和文フォントのベースラインのシフト量
2641 (\Param{yjabaselineshift}パラメータ)を独立に設定できるようになっている.
2644 为了确保日文字体和西文字体能够对其,有时需要浮动其中一者的基线。
2645 在\pTeX 中,此项设定由设定\verb!\yabaselineshift!为非零长度(西文字体基线应向下浮动)。
2646 不过,如果文档的中主要语言不是日文,那么最好上浮日文字体的基线,西文字体不变。
2647 如上所述,\LuaTeX-ja可以独立设定西文字体的基线(\Param{yabaselineshift}参数)和日文字体的基线(\Param{yjabaselineshift}参数)。
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あいう
2656 Here the horizontal line in above is the baseline of a line.
2659 上の例において引かれている水平線がベースラインである.
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):
2671 この機能には面白い使い方がある:2つのパラメータを適切に設定することで,サイズの
2672 異なる文字を中心線に揃えることができるのだ.
2673 以下は一つの例である(値はあまり調整されていないことに注意):
2676 这里还有一个有趣的副作用:不同大小的字符可以通过适当调整这两个参数而在一行中垂直居中。
2677 下面是一个例子(注意,参数值并没有刻意调整):
2682 \ltjsetparameter{yjabaselineshift=-1pt,
2683 yalbaselineshift=-1pt}
2689 %<en>\part{Reference}
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}基本语句}
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:
2709 フォントを和文フォントとして読み込むためには,\verb+\jfont+ プリミティブを
2710 \verb+\font+ プリミティブの代わりに用いる.
2711 \verb+\jfont+ プリミティブの文法は \verb+\font+ と同じである.
2712 \LuaTeX-jaは\Pkg{luaotfload}パッケージを自動的に読み込むので,
2713 TrueType/OpenTypeフォントにfeatureを指定したものを和文フォントとして用いる
2717 为了加载日文字体,需要使用\verb!\jfont!基本语句替代\verb!\font!,前者支持后者所有相同句法。
2718 \LuaTeX-ja自动加载\Pkg{luaotfload}宏包,故TrueType/OpenType字体的特性可以使用于日文字体:
2721 \jfont\tradgt={file:ipaexg.ttf:script=latn;%
2722 +trad;-kern;jfm=ujis} at 14pt
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>.
2734 なお,\verb+\jfont+ で定義されたコントロールシーケンス(上の例だと \verb+\tradgt+)
2735 は\textit{font\_def}トークンではないので,\verb+\fontname\tradgt+ のような
2736 入力はエラーとなることに注意する.以下では \verb+\jfont+ で定義された
2737 コントロールシーケンスを<jfont\_cs>で表す.
2740 注意定义的控制序列(上例中的\verb!\tradgt!)使用的\verb!\jfont!并不是一个\textit{font\_def}标记,
2741 故类似\verb!\fontname\tradgt!输入会引起错误。
2742 我们将定义\verb!\jfont!采用<jfont\_cs>。
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:
2754 「はじめに」の節で述べたように,JFMは文字と和文組版で自動的に挿入される
2755 グルー/カーンの寸法情報を持っている.JFMの構造は次の小節で述べる.
2756 \verb+\jfont+ プリミティブの呼び出しの際には,どのJFMを用いるのかを以下のキーで
2760 在引言中已提及此项,所谓JFM是字符亮度和日文排版中自动插入的胶/出格。
2761 JFM的结构将在下节进行描述。在使用\verb!\jfont!基本语句时,必须设定JFM如下两个键:
2764 \begin{list}{}{\def\makelabel{\ttfamily}\def\{{\char`\{}\def\}{\char`\}}\advance\leftmargin1\zw}
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}.
2770 The following JFMs are shipped with \LuaTeX-ja:
2773 JFMの名前を指定する.もし以前に指定されたJFMが読み込まれていなければ,
2774 \texttt{jfm-<name>.lua}を読み込む.
2776 以下のJFMが\LuaTeX-jaには同梱されている:
2779 设定JFM名称。设定的JFM如未加载,\LuaTeX-ja会搜寻并加载一个命名为\texttt{jfm-}<\textit{name}>\texttt{.lua}的文件。
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.
2790 \item[\tt jfm-ujis.lua] \LuaTeX-jaの標準JFMである.このJFMは\upTeX で
2791 用いられるUTF/OTFパッケージ用の和文用TFMである \verb+upnmlminr-h.tfm+ を
2792 元にしている.\Pkg{luatexja-otf}パッケージを使うときはこのJFMを指定するべきである.
2795 \item[\tt jfm-ujis.lua] \LuaTeX-ja标准JFM。次JFM基于\upTeX 使用的UTF/OTF宏包的\verb!upnmlminr-h.tfm!。
2796 如果你使用\Pkg{luatexja-otf}宏包,你将会用到此JFM。
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
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}では横長の長方形状である.
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}下则为长方形。
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}.
2825 \item[\tt jfm-min.lua] \pTeX に同梱されているデフォルトの和文用TFM
2826 である \verb+min10.tfm+ に相当するJFMである.このJFMと他の2つのJFMの間には
2827 表\ref{tab-difjfm}に示すような特筆すべき違いがある.
2830 \item[\tt jfm-min.lua] 相当于\pTeX 中默认的\verb!min10.tfm!。
2831 这个JFM与其他2个JFM的区别如表\ref{tab-difjfm}所示。
2835 \item[jfmvar=<string>] Sometimes there is a need that \ldots.
2839 %<en>\caption{Differences between JFMs shipped with \LuaTeX-ja}
2840 %<ja>\caption{\LuaTeX-ja に同梱されている JFM の違い}
2841 %<zh>\caption{\LuaTeX-ja下不同JFM表现}
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
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}
2860 &\tt jfm-ujis.lua&\tt jfm-jis.lua&\tt jfm-min.lua\\
2862 %<en>Example~1\cite{min10}
2865 &\r{ujis}&\r{jis}&\r{min}\\
2869 &\s{ujis}&\s{jis}&\s{min}\\
2870 Bounding Box&\t{ujis}&\t{jis}&\t{min}\\
2874 \ltjsetparameter{jacharrange={-3}}
2877 %<en>\paragraph{Note: kern feature}
2878 %<ja>\paragraph{注意:kern feature}
2879 %<zh>\paragraph{注意:kern feature}
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.
2890 いくつかのフォントはグリフ間のスペースについての情報を持っている.しかし,
2891 この情報は\LuaTeX-ja とはあまり相性がよくない.具体的には,この情報に基づいて挿入
2892 されるカーニングスペースは\textbf{JAglue}の挿入過程の\textbf{前に}挿入され,
2893 JFMに基づくグルー/カーンも挿入される場合には2文字間の意図しないスペースの原因と
2897 一些字体具有内部字形间距信息。但是,这些信息在\LuaTeX-ja下并不良好兼容。
2898 仔细些说,出格间距是在\textbf{JAglue}插入\textbf{之前}而先行插入的,
2899 这就造成了字体数据中和JFM中的胶/出格在两个字符间插入出错。
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=...}\,.
2908 \item \texttt{script=...}といったfeatureを使いたい場合には,\verb+\jfont+
2909 プリミティブに\texttt{-kern}を指定するべきである.
2912 \item 当你想使用其他字体特性如\texttt{script=...}的时候,可以在\verb!jfont!基本语句中设置\texttt{-kern}
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.
2919 \item もしプロポーショナル幅の和文フォントをそのフォントの情報に基づいて使いたい
2920 ならば,\texttt{jfm-prop.lua}をJFMとして指定し,……
2923 \item 如果你想使用比例宽度的日文字体,并且使用此字体信息,使用\texttt{jfm-prop.lua}为其JFM,……
2929 %<en>\subsection{Prefix \texttt{psft}}
2930 %<ja>\subsection{\texttt{psft}プリフィックス}
2931 %<zh>\subsection{\texttt{psft}前缀}
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
2942 \texttt{file:}と\texttt{name:}のプリフィックスに加えて,
2943 \verb+\jfont+ プリミティブ(と \verb+\font+ プリミティブ)では
2944 \texttt{psft:}プリフィックスを用いることができる.
2945 このプリフィックスを用いることで,PDFには埋め込まれない「名前だけの」
2946 和文フォントを指定することができる.「標準的な」和文フォント,
2947 つまり`Ryumin-Light'と`GothicBBB-Medium'の指定でこのプリフィックスが使われる.
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字体,如中文和韩文。
2957 %<en>\paragraph{\texttt{cid} key}
2958 %<ja>\paragraph{\texttt{cid}キー}
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
2973 Note that the code above specifies \texttt{jfm-jis.lua}, which is for Japanese fonts,
2974 as JFM for Chinese and Korean fonts.
2977 標準で\texttt{psft:}プリフィックスで定義されるフォントは日本語用のもので
2978 あり,Adobe-Japan1-6のCIDに対応したものとなる.しかし,\LuaTeX-jaは中国語
2979 の組版にも威力を発揮することが分かり,日本語フォントでない非埋込フォント
2980 の対応も必要となった.そのために追加されたのが\texttt{cid}キーである.
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} % 韓国語
2990 上のコードでは中国語・韓国語用フォントに対してもJFMに
2991 日本語用の\texttt{jfm-jis.lua}を指定しているので注意されたい.
2995 At present, \LuaTeX-ja supports only 4 values written in the sample code above.
2996 Specifying other values, e.g.,
2999 今のところ,\LuaTeX-jaは上のサンプルコード中に書いた4つの値しかサポートしていない.
3002 \jfont\test={psft:Ryumin-Light:cid=Adobe-Japan2;jfm=jis}
3005 occurs the following error:
3010 \begin{lstlisting}[numbers=left]
3011 ! Package luatexja Error: bad cid key `Adobe-Japan2'.
3013 See the luatexja package documentation for explanation.
3014 Type H <return> for immediate help.
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.
3029 %<en>\subsection{Structure of JFM file}
3030 %<ja>\subsection{JFMファイルの構造}
3031 %<zh>\subsection{JFM结构}
3034 A JFM file is a Lua script which has only one function call:
3037 JFMファイルはただ一つの関数呼び出しを含むLuaスクリプトである:
3043 luatexja.jfont.define_jfm { ... }
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.
3052 実際のデータは上で \verb+{ ... }+ で示されたテーブルの中に格納されている.
3053 以下ではこのテーブルの構造について記す.
3054 なお,JFMファイル中の長さは全てdesign-sizeを単位とする浮動小数点数であることに
3058 实际的数据保存在表中,即如上的\verb!{ ... }!。
3060 请注意,在JFM中的所有长度都是按照以design-size为单位的浮点数。
3063 \begin{list}{}{\def\makelabel{\ttfamily}\def\{{\char`\{}\def\}{\char`\}}\advance\leftmargin1\zw}
3065 \item[dir=<direction>]
3070 %<en>The direction of JFM. At the present, only \texttt{'yoko'} is supported.
3071 %<ja>JFMの書字方向.現時点では\texttt{'yoko'}のみがサポートされる.
3072 %<zh>JFM的方向,现在只支持\texttt{yoko}(水平)。
3079 %<en>The amount of the length of the `full-width'.
3088 %<en>The amount of the length of the `full-height' (height + depth).
3089 %<ja>「全角高さ」(height + depth)の長さ.
3090 %<zh>“全角高度”(height + depth)长度。
3092 \item[kanjiskip=\{<natural>, <stretch>, <shrink>\}]
3098 This field specifies the `ideal' amount of \Param{kanjiskip}. As noted
3099 in Subsection~\ref{subs-kskip}, if the parameter
3100 \Param{kanjiskip} is \verb+\maxdimen+, the value specified
3101 in this field is actually used (if this field is not specified in
3102 JFM, it is regarded as 0\,pt). Note that <stretch> and <shrink>
3103 fields are in design-size unit too.
3106 「理想的な」\Param{kanjiskip}の量を指定する.\ref{subs-kskip}節で述べたように,
3107 もし\Param{kanjiskip}が \verb+\maxdimen+ の値ならば,このフィールドで指定された
3108 値が実際には用いられる(もしこのフィールドがJFMで指定されていなければ,
3109 0\,ptであるものとして扱われる).<stretch>と<shrink>のフィールドもdesign-size
3113 这部分为“理想长度”\Param{kanjiskip}。\ref{subs-kskip}节有详述,如果参数\Param{kanjiskip}
3114 为\verb!\maxdimen!,则值设定将会被使用(若再JFM中未设定,则被视为0\,pt)。
3115 请注意,<stretch>和<shrink>的长度均为design-size单位。
3118 \item[xkanjiskip=\{<natural>, <stretch>, <shrink>\}]
3124 Like the \Param{kanjiskip} field, this field specifies the `ideal'
3125 amount of \Param{xkanjiskip}.
3128 \Param{kanjiskip}フィールドと同様に,\Param{xkanjiskip}の「理想的な」量を
3132 和\Param{kanjiskip}类似,此部分设定\Param{xkanjiskip}的“理想长度”。
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:
3147 上記のフィールドに加えて,JFMファイルはそのインデックスが自然数であるいくつかの
3148 サブテーブルを持つ.インデックスが$i\in\omega$であるテーブルは「文字クラス」$i$の
3149 情報を格納する.少なくとも,文字クラス0は常に存在するので,JFMファイルはインデックス
3150 が\texttt{[0]}のサブテーブルを持たなければならない.それぞれのサブテーブル
3151 (そのインデックスを$i$で表わす)は以下のフィールドを持つ:
3154 \paragraph{Character classes}
3155 除了上面涉及到的内容,JFM文件中还有几个以自然数进行声明的次级表。
3156 这些表依靠满足$i\in\omega$的“字符类”$i$来索引。
3157 一般,最少需要的是字符类0,故每一个JFM文件必须有次级表索引为\texttt{[0]}。
3160 \begin{list}{}{\def\makelabel{\ttfamily}\def\{{\char`\{}\def\}{\char`\}}\advance\leftmargin1\zw}
3161 \item[chars=\{<character>, ...\}]
3162 %<en>(required except character class~0)
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:
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.)
3181 このフィールドは文字クラス$i$に属する文字のリストである.このフィールドは$i=0$の
3182 場合には任意である(文字クラス0には,0以外の文字クラスに属するものを
3183 除いた全ての\textbf{JAchar}が属するから).このリスト中で文字を指定するには,以下の方法がある:
3185 \item Unicode におけるコード番号
3186 \item 「\verb+'あ'+」のような,文字それ自体
3187 \item 「\verb+'あ*'+」のような,文字それ自体の後にアスタリスクをつけたもの
3188 \item いくつかの「仮想的な文字」(後に説明する)
3192 这部分为字符集$i$的字符列表。当$i=0$时不需要设定此部分,因为不在字符集0种的\textbf{JAchar}
3193 字符都包含在字符集0中(也就是字符集0包含大多数的\textbf{JAchar})。在这个字符列表中,每一个
3194 字符据可以使用其编码,或者字符本身(长度为1的字符串)。另外还有部分“假想字符”可在此列表中
3198 \item[width=<length>, height=<length>, depth=<length>, italic=<length>]
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
3210 文字クラス$i$に属する文字の幅,高さ,深さ,イタリック補正の量を指定する.
3211 文字クラス$i$に属する全ての文字は,その幅,高さ,深さがこのフィールドで指定した
3213 しかし,例外が一つある:もし\texttt{'prop'}が\texttt{width}フィールドに
3214 指定された場合,文字の幅はその「実際の」グリフの幅となる.
3217 设定字符类$i$的宽度,高度和深度以及意大利体校正。在字符集$i$中,所有字符的宽度,高度
3218 和深度的值为上述设定之值。不过还有例外,如果\texttt{'prop'}设定了\texttt{width}部分,那么
3222 \item[left=<length>, down=<length>, align=<align>]\
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
3231 The effects of these 3~fields are indicated in Figure~\ref{fig-pos}.
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}で説明する.
3242 此部分为“真实”字形对齐位置。\texttt{align}的合法值为\texttt{'left'},
3243 \texttt{'middle'}和\texttt{'right'}。如此三项被省略,则\texttt{left}和
3244 \texttt{down}被视作0,\texttt{align}被视作\texttt{'left'}。
3245 此部分三个域的作用,请参见图\ref{fig-pos}。
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'.
3255 多くの場合,\texttt{left}と\texttt{down}は0である一方,
3256 \texttt{align}フィールドが\texttt{'middle'}や\texttt{'right'}であることは
3258 例えば,\texttt{align}フィールドを\texttt{'right'}に指定することは,
3259 文字クラスが開き括弧類であるときに実際必要である.
3262 在大多数情况下,\texttt{left}和\texttt{down}域为0,但是在\texttt{align}域为
3263 \texttt{'middle'}或者\texttt{'right'}时则是不正常的。例如,必须设定\texttt{align}
3264 为\texttt{'right'}时,则当前字符类必须为开定界符。
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}
3273 \color{red!20!white}% real glyph :step1
3274 \put(-1,-1.5){\vrule width 6\unitlength height 7\unitlength depth 2.5\unitlength}
3276 \color{red}% real glyph
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}}
3283 \color{green!20!white}% real glyph :step1
3284 \put(3,0){\vrule width 6\unitlength height 7\unitlength depth 2.5\unitlength}
3286 \color{black}% real glyph :step1
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}}}
3296 \color{green!50!black}% real glyph :step1
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]{%
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}}
3310 \color{blue}% shifted
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}}}
3319 \begin{minipage}{0.6\textwidth}%
3321 Consider a node containing Japanese character whose value of the \texttt{align}
3322 field is \texttt{'middle'}.
3325 \texttt{align}フィールドの値が\texttt{'middle'}である和文文字を含むノードを
3329 假定一个node包含日语字符,且其值为\texttt{align}的\texttt{'middle'}。
3334 The black rectangle is a frame of the node.
3335 Its width, height and depth are specified by JFM.
3339 その幅,高さ,深さはJFMによって指定される.
3342 黑色长方形为node框。其宽度,高度,深度均为JFM所设定。
3346 Since the \texttt{align} field is \texttt{'middle'},
3347 the `real' glyph is centered horizontally (the green rectangle).
3350 \texttt{align}フィールドは\texttt{middle}なので,「実際の」グリフは
3351 水平方向の中心に配置される(緑色の長方形).
3354 因\texttt{align}被设定为\texttt{middle},故“真实”字形为水平居中(绿长方形中)。
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.
3363 さらに,グリフは\texttt{left}と\texttt{down}の値に従ってシフトされる.
3364 最終的な実際のグリフの位置は赤色の長方形で示された位置になる.
3367 此外,字形移位由\texttt{left}和\texttt{down}决定。最终字形位置为红长方形所示。
3374 %<en>The position of the `real' glyph.
3381 \item[kern={\{[$j$]=<kern>, [$j'$]=\{<kern>, [<dir>]\}...\}}]
3383 \item[glue={\{[$j$]=\{<width>, <stretch>, <shrink>, [<priority>], [<dir>]\}, ...\}}]
3385 文字クラス$i$の文字と$j$の文字の間に挿入されるkernやglueの量を指定する.
3387 <priority>は\texttt{luatexja-adjust.sty} による優先順位付き
3388 行長調整(\ref{ssec-adj}節)が有効なときのみ意味を持つ.
3389 このフィールドは省略可能であり,行調整処理におけるこのglueの優先
3390 度を$-2$から$+2$の間の整数で指定する.<priority>の省略時の値
3391 は0であり,範囲外の値が指定されたときの動作は未定義である).
3393 <dir>も省略可能フィールドであり,$-1$から$+1$の実数値をとる.省略時の値は0である.
3395 \item $-1$はこのグルーが「前の文字」由来であることを示す.
3396 \item $+1$はこのグルーが「後の文字」由来であることを示す.
3397 \item それ以外の値は,「前の文字」由来のグルーと「後の文字」由来の
3400 なお,このフィールドの値は\Param{differentjfm}の値が\texttt{pleft},~\texttt{pright},~\texttt{paverage}の値のときのみ実際に用いられる.
3402 例えば,\cite{x4051}では,句点と中点の間には,
3403 句点由来の二分空きと中点由来の四分空きが挿入されるが,この場合には
3405 \item <width>には$0.5+0.25=0.75$を指定する.
3406 \item <dir>には次の値を指定する.
3408 -1\cdot \frac{0.5}{0.5+0.25} + 1 \cdot \frac{0.25}{0.5+0.25} = -\frac13
3414 \item[end\_stretch=<kern>]
3415 \item[end\_shrink=<kern>]
3418 優先順位付き行長調整が有効であり,かつ現在の文字クラスの文字が行
3419 末に来た時に,行長を詰める調整・伸ばす調整のた
3420 めにこの文字と行末の間に挿入可能なカーンの大きさを指定する.
3426 \paragraph{文字クラスの決定}
3427 文字クラスの決定は少々複雑である.ここでは例を用いて説明しよう.
3430 たとえば,次の内容を一部に含んだ \texttt{jfm-test.lua} を考えよう:
3433 chars = { '漢', 'ヒ*' },
3434 align = 'left', left = 0.0, down = 0.0,
3435 width = 1.0, height = 0.88, depth = 0.12, italic=0.0,
3438 chars = { '。', '、*', 'ヒ' },
3439 align = 'left', left = 0.0, down = 0.0,
3440 width = 0.5, height = 0.88, depth = 0.12, italic=0.0,
3445 \jfont\a=psft:Ryumin-Light:jfm=test;+vert
3446 \setbox0\hbox{\a 。\inhibitglue 漢}
3449 では,全角二分(15.0\,pt)とならなければおかしいが,上の実行結果では20\,ptとなっている.
3452 \item \verb+vert+ featureによって句点が縦書き用のグリフと置き換わる(\Pkg{luaotfload} による処理).
3453 \item しかしこのグリフは「文字コード」U+F0000以降とみなされている
3454 (実際にいくらになるかは,フォントによって異なる).
3455 \item よって,文字クラス0とみなされるため,結果として「。」の幅は全角だと認識されてしまう.
3458 一方,「\texttt{'、*'}」のようにアスタリスクつきの指定があると,
3461 \jfont\a=psft:Ryumin-Light:jfm=test;+vert
3464 ここで,読点「、」の文字クラスは,以下のようにして決まる.
3466 \item とりあえず句点の時と同じように,\Pkg{luaotfload} によって縦書き用読点のグリフに置き換わる.
3467 \item 置換後のグリフの「文字コード」はU+F0000以降であり,
3468 そのままでは文字クラスは0と判定される.
3469 \item ところが,JFMには「\texttt{'、*'}」指定があるので,置換前の横書き用読点のグリフ「、」(文字コードはU+3001)によって文字クラスを判定する.
3470 \item 結果として,上の出力例中の読点の文字クラスは2000となる.
3473 なお,置換後のグリフで判定した文字クラスの値が0でなければ,そちらをそのまま作用する.
3475 \jfont\a=psft:Ryumin-Light:jfm=test;+hwid
3479 \texttt{hwid} featureにより,「ヒ」が半角の「ヒ」に置き換わるが,
3480 文字クラスは「ヒ」の属する0\textbf{ではなく},「ヒ」の属する2000となる.
3483 %<ja>\paragraph{仮想的な文字}
3484 %<!ja>\paragraph{Imaginary characters}
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':
3493 上で説明した通り,\texttt{chars}フィールド中にはいくつかの「特殊文字」も
3494 指定可能である.これらは,大半が\pTeX のJFMグルーの挿入処理ではみな「文字
3495 クラス0の文字」として扱われていた文字であり,その結果として\pTeX より細か
3496 い組版調整ができるようになっている.以下でその一覧を述べる:
3499 如上所述,你可以在\texttt{chars}中设定多个“假想字符”。这些字符中的多数字符在
3500 \pTeX 中式被视作字符集0中字符。故此,\LuaTeX-ja可以比\pTeX 做得更好。
3503 \begin{list}{}{\def\makelabel{\ttfamily}\def\{{\char`\{}\def\}{\char`\}}\advance\leftmargin1\zw}
3505 %%%<en>An ending of a line.
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}间边界。
3515 %<en>The beginning/ending of a horizontal box, and the beginning of a noindented paragraph.
3516 %<ja>水平ボックスの先頭と末尾,及びインデントされていない(\verb+\noindent+ で開始された)段落の先頭を表す.
3517 %<zh>水平合字结束或结尾,以及未缩进段落开头。
3520 %<en>The beginning of an (indented) paragraph.
3521 %<ja>通常の(\verb+\noindent+ で開始されていない)段落の先頭.
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},胶,出格等)边界。
3530 %<en>The left/right boundary of an inline math formula.
3535 %<en>\paragraph{Porting JFM from \pTeX}
3536 %<ja>\paragraph{\pTeX 用和文用TFMの移植}
3537 %<zh>\paragraph{\pTeX 下使用的TFM移植}
3539 % ToDo: English version.
3546 以下に,\pTeX 用に作られた和文用TFMを\LuaTeX-ja用に移植する場合の注意点を挙げておく.
3548 \item 実際に出力される和文フォントのサイズがdesign sizeとなる.
3549 このため,例えば$1\,\textrm{zw}$がdesign sizeの0.962216倍であるJISフォン
3552 \item JFM中の全ての数値を$1/0.962216$倍しておく.
3553 \item \TeX ソース中で使用するところで,サイズ指定を0.962216倍にする.
3554 \LaTeX でのフォント宣言なら,例えば次のように:
3556 \DeclareFontShape{JY3}{mc}{m}{n}{<-> s*[0.962216] psft:Ryumin-Light:jfm=jis}{}
3559 \item 上に述べた特殊文字は,\texttt{'boxbdd'}を除き文字クラスを全部0とする
3561 \item \texttt{'boxbdd'}については,それのみで一つの文字クラスを形成し,その
3562 文字クラスに関してはグルー/カーンの設定はしない.
3565 水平ボックスの先頭・末尾とインデントされていない(\verb+\noindent+ で開始さ
3566 れた)段落の先頭にはJFMグルーは入らないという仕様を実現させるためである.
3567 \item \pTeX の組版を再現させようというのが目的であれば以上の注意を守れば十分である.
3569 ところで,\pTeX では通常の段落の先頭にJFMグルーが残るという仕様があるので,
3570 段落先頭の開き括弧は全角二分下がりになる.全角下がりを実現させるに
3571 は,段落の最初に手動で \verb+\inhibitglue+ を追加するか,あるいは
3572 \ \verb+\everypar+ のハックを行い,それを自動化させるしかなかった.
3574 一方,\LuaTeX-jaでは,\texttt{'parbdd'}によって,それがJFM側で調整できるよ
3575 うになった.例えば,\LuaTeX-ja同梱のJFMのように,\texttt{'boxbdd'}と同じ文字クラスに
3576 \texttt{'parbdd'}を入れれば全角下がりとなる.
3579 \jfont\g=psft:Ryumin-Light:jfm=test \g
3580 \parindent1\zw\noindent{}◆◆◆◆◆
3587 但し,\verb+\everypar+ を利用している場合にはこの仕組みは正しく動かない.
3588 そのような例としては箇条書き中の \verb+\item+ で始まる段落があり,\Pkg{ltjsclasses}では
3589 人工的に「\texttt{'parbdd'}の意味を持つ」whatsitノードを作ることによって対処している%
3590 \footnote{\texttt{no\_runtime/ltjsclasses.dtx} を参照されたい.
3591 JFM側で一部の対処ができることにより,\Pkg{jsclasses}のようにif文の判定はしていない.}
3594 下面,给出用于\pTeX 使用的JFM移植到\LuaTeX-ja过程中需要注意的几点。
3598 %<en>\subsection{Math Font Family}
3599 %<ja>\subsection{数式フォントファミリ}
3600 %<zh>\subsection{数学字体族}
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+.
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+ である.
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.
3625 \LuaTeX-jaの数式中での和文フォントの扱いも同様である.
3626 表\ref{tab-math}は数式フォントファミリに対する \TeX のプリミティブと対応する
3627 ものを示している.\verb+\fam+ と \verb+\jfam+ の値の間には関係はなく,
3628 適切な設定の下では \verb+\fam+ と \verb+\jfam+ の両方に同じ値を設定することができる.
3632 %<en>\caption{Primitives for Japanese math fonts.}
3633 %<ja>\caption{和文数式フォントに対するプリミティブ.}
3634 %<zh>\caption{日语数学字体基本语句}
3637 \def\{{\char`\{}\def\}{\char`\}}\small
3640 %<en>\bf Japanese fonts&\bf alphabetic fonts\\
3641 %<ja>\bf 和文フォント&\bf 欧文フォント\\
3642 %<zh>\bf 日文字体&\bf 西文字体\\
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>\\
3653 %<en>\subsection{Callbacks}
3654 %<ja>\subsection{コールバック}
3655 %<zh>\subsection{回调}
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.
3662 \LuaTeX 自体のものに加えて,\LuaTeX-jaもコールバックを持っている.
3663 これらのコールバックには,他のコールバックと同様に \verb+luatexbase.add_to_callback+
3664 関数などを用いることでアクセスすることができる.
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}回调]
3672 With this callback you can overwrite JFMs.
3673 This callback is called when a new JFM is loaded.
3676 このコールバックを用いることでJFMを上書きすることができる.
3677 このコールバックは新しいJFMが読み込まれるときに呼び出される.
3680 \begin{lstlisting}[numbers=left]
3681 function (<table> jfm_info, <string> jfm_name)
3682 return <table> new_jfm_info
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.
3692 引数 \verb+jfm_info+ はJFMファイルのテーブルと似たものが格納されるが,
3693 クラス0を除いた文字のコードを含んだ\texttt{chars}フィールドを持つ点が異なる.
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}.
3702 このコールバックの使用例は\texttt{ltjarticle}クラスにあり,
3703 \texttt{jfm-min.lua}中の\texttt{'parbdd'}を強制的にクラス0に割り当てている.
3706 %<en>\item[\texttt{luatexja.define\_font} callback]
3707 %<ja>\item[\texttt{luatexja.define\_font}コールバック]
3708 %<zh>\item[\texttt{luatexja.define\_font}回调]
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.
3715 このコールバックと次のコールバックは組をなしており,Unicode中に固定された文字コード
3716 番号を持たない文字を非零の文字クラスに割り当てることができる.
3717 このコールバックは新しい和文フォントが読み込まれたときに呼び出される.
3720 \begin{lstlisting}[numbers=left]
3721 function (<table> jfont_info, <number> font_number)
3722 return <table> new_jfont_info
3727 You may assume that \verb+jfont_info+ has the following fields:
3730 \verb+jfont_info+ は以下の2フィールドを持つ:
3733 \item[\tt size\_cache]
3735 使用されているJFMの情報が格納されているテーブルで,
3736 \textbf{このテーブルを書き換えてはならない}.
3737 中身はほぼJFMファイルに書かれている唯一のテーブルであるが,次のように若干変わっている:
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} フィールドはこのテーブルにはない.
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:
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.
3758 \item There is no \texttt{dir} field in this table.
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=...}值。
3770 The returned table \verb+new_jfont_info+ also should include these two fields.
3771 The \verb+font_number+ is a font number.
3774 戻り値の \verb+new_jfont_info+ テーブルもこれら2つのフィールドを含まなければならないが,
3775 それ以外にユーザが勝手にフィールドを付け加えることは自由である.
3776 \verb+font_number+ はフォント番号である.
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
3786 これと次のコールバックの良い使用例は\Pkg{luatexja-otf}パッケージであり,
3787 JFM中でAdobe-Japan1 CIDの文字を \verb+"AJ1-xxx"+ の形で指定するために
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}回调]
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:
3800 このコールバックは\LuaTeX-jaが \verb+chr_code+ の文字がどの文字クラスに
3801 属するかを決定しようとする際に呼び出される.
3802 このコールバックで呼び出される関数は次の形をしていなければならない:
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
3809 return (<number> new_char_class or 0)
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
3823 引数 \verb+char_class+ は\LuaTeX-jaのデフォルトルーチンか,このコールバックの
3824 直前の関数呼び出しの結果を含んでおり,したがってこの値は0ではないかもしれない.
3825 さらに,戻り値の \verb+new_char_class+ は \verb+char_class+ が非零のときには
3826 \verb+char_class+ の値と同じであるべきで,そうでないときは\LuaTeX-jaの
3827 デフォルトルーチンを書き換えることになる.
3830 %<en>\item[\texttt{luatexja.set\_width} callback]
3831 %<ja>\item[\texttt{luatexja.set\_width}コールバック]
3832 %<zh>\item[\texttt{luatexja.set\_width}回调]
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.
3839 このコールバックは\LuaTeX-jaが\textbf{JAchar}の寸法と位置を調節するために
3840 その\textit{glyph\_node}をカプセル化しようとする際に呼び出される.
3842 \begin{lstlisting}[numbers=left]
3843 function (<table> shift_info, <table> jfont_info, <number> char_class)
3844 return <table> new_shift_info
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.
3854 引数 \verb+shift_info+ と戻り値の \verb+new_shift_info+ は
3855 \texttt{down}と\texttt{left}のフィールドを持ち,これらの値は
3856 文字の下/左へのシフト量(スケールド・ポイント単位)である.
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
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).
3870 Then, the position of glyphs is shifted up by
3872 \frac{88x}{88x+12x} (28y+5y) - 28y = \frac{26}{25}y= 1.04y.
3876 良い例が\Pkg{test/valign.lua}である.このファイルが読み込まれた状態では,
3877 JFM内で規定された文字クラス0の文字における$(\hbox{高
3878 さ}):(\hbox{深さ})$の比になるように,実際のフォントの出力上
3881 \item JFM側の設定:$(\hbox{高さ})=88x$, $(\hbox{深さ})=12x$%
3882 (和文OpenTypeフォントの標準値)
3883 \item 実フォント側の数値:$(\hbox{高さ})=28y$, $(\hbox{深さ})=5y$(和文TrueTypeフォントの標準値)
3885 となっていたとする.すると,実際の文字の出力位置は,
3887 \frac{88x}{88x+12x} (28y+5y) - 28y = \frac{26}{25}y= 1.04y.
3895 %<en>\section{Parameters}
3896 %<ja>\section{パラメータ}
3898 %<en>\subsection{\texttt{\char92 ltjsetparameter} primitive}
3899 %<ja>\subsection{\texttt{\char92 ltjsetparameter}プリミティブ}
3900 %<zh>\subsection{\texttt{\char92 ltjsetparameter}基本参数}
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}.
3911 先に述べたように,\verb+\ltjsetparameter+ と \verb+\ltjgetparameter+ は
3912 \LuaTeX-jaのほとんどのパラメータにアクセスするためのプリミティブである.
3913 \LuaTeX-jaが\pTeX のような文法(例えば,\verb+\prebreakpenalty`)=10000+)を
3914 採用しない理由の一つは,\LuaTeX のソースにおける \verb+hpack_filter+
3915 コールバックの位置にある.\ref{sec-para}節を参照.
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
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.
3932 \verb+\ltjsetparameter+ と \verb+\ltjglobalsetparameter+ はパラメータを
3933 指定するためのプリミティブである.これらは\texttt{<key>=<value>}のリストを
3934 引数としてとる.許されるキーは次の節に記述する.
3935 \verb+\ltjsetparameter+ と \verb+\ltjglobalsetparameter+ の違いはスコープの
3937 \verb+\ltjsetparameter+ はローカルな指定,\verb+\ltjglobalsetparameter+ は
3939 これらは他のパラメータ指定と同様に \verb+\globaldefs+ の値に従う.
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.
3948 \verb+\ltjgetparameter+ はパラメータの値を取得するためのプリミティブであり,
3950 そして,いくつかの場合には加えてさらに引数(例えば文字コード)をとる.
3953 \ltjgetparameter{differentjfm},
3954 \ltjgetparameter{autospacing},
3955 \ltjgetparameter{prebreakpenalty}{`)}.
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).
3964 \textbf{{\normalfont\tt\char92ltjgetparameter}の戻り値は常に文字列である.}
3965 これは\texttt{tex.write()}によって出力しているためで,スペース`\texttt{\char32}'~(U+0020)を除いた文字のカテゴリーコードは全て12~(other)となる.
3966 一方,スペースのカテゴリーコードは10~(space)である.
3969 %<en>\subsection{List of Parameters}
3970 %<ja>\subsection{パラメータ一覧}
3971 %<zh>\subsection{参数一览}
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:
3980 以下は \verb+\ltjsetparameter+ に指定することができるパラメータの一覧である.
3981 [\verb+\cs+]は\pTeX における対応物を示す.
3982 また,それぞれのパラメータの右上にある記号には次の意味がある:
3986 \item % avoiding from error ``Something's wrong--perhaps a missing \item.''.
3989 \item No mark: values at the end of the paragraph or the hbox are
3990 adopted in the whole paragraph/hbox.
3993 \item 記号なし:段落や水平ボックスの終端での値がその段落/水平ボックス全体で用いられる.
3996 \item `\ast' : local parameters, which can change everywhere inside a paragraph/hbox.
3999 \item `\ast':ローカルなパラメータであり,段落/水平ボックス内のどこででも値を変えることができる.
4002 \item `\dagger': assignments are always global.
4005 \item `\dagger':指定は常にグローバルになる.
4009 \begin{list}{}{\def\makelabel{\ttfamily}\def\{{\char`\{}\def\}{\char`\}}\advance\leftmargin1\zw}
4010 \item[\Param{jcharwidowpenalty}\,=<penalty>] [\verb+\jcharwidowpenalty+]
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.
4017 パラグラフの最後の字が孤立して改行されるのを防ぐためのペナルティの値.
4018 このペナルティは(日本語の)句読点として扱われない最後の\textbf{JAchar}の直後に
4022 \item[\Param{kcatcode}\,=\{<chr\_code>,<natural number>\}]\
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).
4030 文字コードが<chr\_code>の文字が持つ付加的な属性値(attribute).
4031 現在のバージョンでは,<natural number>の最下位ビットが,その文字が句読点と
4032 みなされるかどうかを表している(上の\Param{jcharwidowpenalty}の記述を参照).
4035 \item[\Param{prebreakpenalty}\,=\{<chr\_code>,<penalty>\}] [\verb+\prebreakpenalty+]\
4037 文字コード<chr\_code>の\textbf{JAchar}が行頭にくることを抑止するために,
4038 この文字の前に挿入/追加されるペナルティの量を指定する.
4040 例えば閉じ括弧「〗」は絶対に行頭にきてはならないので,標準で読み込まれる
4041 \texttt{luatexja-kinsoku.tex}において
4043 \ltjsetparameter{prebreakpenalty={`〙,10000}}
4045 と,最大値の10000が指定されている.他にも,小書きのカナなど,絶対禁止とい
4046 うわけではないができれば行頭にはきて欲しくない場合に,0と
4047 10000の間の値を指定するのも有用であろう.
4049 \ltjsetparameter{prebreakpenalty={`ゕ,150}}
4053 \item[\Param{postbreakpenalty}\,=\{<chr\_code>,<penalty>\}] [\verb+\postbreakpenalty+]
4055 文字コード<chr\_code>の\textbf{JAchar}が行末にくることを抑止するために,
4056 この文字の後に挿入/追加されるペナルティの量を指定する.
4058 \pTeX では,\verb+\prebreakpenalty+, \verb+\postbreakpenalty+において,
4060 \item 一つの文字に対して,pre, postどちらか一つしか指定することができなかっ
4062 \item pre, post合わせて256文字分の情報を格納することしかできなかった.
4064 という制限があったが,\LuaTeX-jaではこれらの制限は解消されている.
4067 \item[\Param{jatextfont}\,=\{<jfam>,<jfont\_cs>\}]
4068 %<en>[\verb+\textfont+ in \TeX]
4069 %<ja>[\TeX の \verb+\textfont+]
4070 %<zh>[\TeX 的\verb+\textfont+]
4071 \item[\Param{jascriptfont}\,=\{<jfam>,<jfont\_cs>\}]
4072 %<en>[\verb+\scriptfont+ in \TeX]
4073 %<ja>[\TeX の \verb+\scriptfont+]
4074 %<zh>[\TeX 中的\verb+\scriptfont+]
4075 \item[\Param{jascriptscriptfont}\,=\{<jfam>,<jfont\_cs>\}]
4076 %<en>[\verb+\scriptscriptfont+ in \TeX]
4077 %<ja>[\TeX の \verb+\scriptscriptfont+]
4078 %<zh>[\TeX 中的\verb+\scriptscriptfont+]
4079 \item[\Param{yjabaselineshift}\,=<dimen>$^\ast$]\
4080 \item[\Param{yalbaselineshift}\,=<dimen>$^\ast$] [\verb+\ybaselineshift+]
4082 \item[\Param{jaxspmode}\,=\{<chr\_code>,<mode>\}]
4085 Setting whether inserting \Param{xkanjiskip} is allowed before/after a \textbf{JAchar} whose character code is <chr\_code>.
4086 The followings are allowed for <mode>:
4089 文字コードが<chr\_code>の\textbf{JAchar}の前/後ろに\Param{xkanjiskip}の
4094 %<en>\item[0, \texttt{inhibit}] Insertion of \Param{xkanjiskip} is inhibited before the character, nor after the character.
4095 %<ja>\item[0, \texttt{inhibit}] \Param{xkanjiskip}の挿入は文字の前/後ろのいずれでも禁止される.
4096 %<zh>\item[0, \texttt{inhibit}] 插入文字前/后的\Param{xkanjiskip}均被禁止。
4097 %<en>\item[1, \texttt{preonly}] Insertion of \Param{xkanjiskip} is allowed before the character, but not after.
4098 %<ja>\item[1, \texttt{preonly}] \Param{xkanjiskip}の挿入は文字の前では許されるが,後ろでは許されない.
4099 %<zh>\item[1, \texttt{preonly}] 文字前允许插入\Param{xkanjiskip},但其后不允许插入。
4100 %<en>\item[2, \texttt{postonly}] Insertion of \Param{xkanjiskip} is allowed after the character, but not before.
4101 %<ja>\item[2, \texttt{postonly}] \Param{xkanjiskip}の挿入は文字の後ろでは許されるが,前では許されない.
4102 %<zh>\item[2, \texttt{postonly}] 文字后允许插入\Param{xkanjiskip},但之前不允许插入。
4103 %<en>\item[3, \texttt{allow}] Insertion of \Param{xkanjiskip} is allowed both before the character and after the character. This is the default value.
4104 %<ja>\item[3, \texttt{allow}] \Param{xkanjiskip}の挿入は文字の前/後ろのいずれでも許される.これがデフォルトの値である.
4105 %<zh>\item[3, \texttt{allow}] 文字前后均可插入\Param{xkanjiskip}。此为默认值。
4108 This parameter is similar to the \verb+\inhibitxspcode+ primitive of \pTeX, but not compatible with \verb+\inhibitxspcode+.
4111 このパラメータは\pTeX の \verb+\inhibitxspcode+ プリミティブと似ているが,
4115 此参数类似\pTeX 基本语句\verb!\inhibitxspcode!,但是和\verb!\inhibitxspcode!不兼容。
4117 \item[\Param{alxspmode}\,=\{<chr\_code>,<mode>\}] [\verb+\xspcode+]
4120 Setting whether inserting \Param{xkanjiskip} is allowed before/after a
4121 \textbf{ALchar} whose character code is <chr\_code>.
4122 The followings are allowed for <mode>:
4125 文字コードが<chr\_code>の\textbf{ALchar}の前/後ろに\Param{xkanjiskip}の
4130 %<en>\item[0, \texttt{inhibit}] Insertion of \Param{xkanjiskip} is inhibited before the character, nor after the character.
4131 %<ja>\item[0, \texttt{inhibit}] \Param{xkanjiskip}の挿入は文字の前/後ろのいずれでも禁止される.
4132 %<zh>\item[0, \texttt{inhibit}] 插入文字前/后的\Param{xkanjiskip}均被禁止。
4133 %<en>\item[1, \texttt{preonly}] Insertion of \Param{xkanjiskip} is allowed before the character, but not after.
4134 %<ja>\item[1, \texttt{preonly}] \Param{xkanjiskip}の挿入は文字の前では許されるが,後ろでは許されない.
4135 %<zh>\item[1, \texttt{preonly}] 文字前允许插入\Param{xkanjiskip},但其后不允许插入。
4136 %<en>\item[2, \texttt{postonly}] Insertion of \Param{xkanjiskip} is allowed after the character, but not before.
4137 %<ja>\item[2, \texttt{postonly}] \Param{xkanjiskip}の挿入は文字の後ろでは許されるが,前では許されない.
4138 %<zh>\item[2, \texttt{postonly}] 文字后允许插入\Param{xkanjiskip},但之前不允许插入。
4139 %<en>\item[3, \texttt{allow}] Insertion of \Param{xkanjiskip} is allowed before the character and after the character. This is the default value.
4140 %<ja>\item[3, \texttt{allow}] \Param{xkanjiskip}の挿入は文字の前/後ろのいずれでも許される.これがデフォルトの値である.
4141 %<zh>\item[3, \texttt{allow}] 文字前后均可插入\Param{xkanjiskip}。此为默认值。
4144 Note that parameters \Param{jaxspmode} and \Param{alxspmode} use a common table, hence these two parameters are synonyms of each other.
4147 \Param{jaxspmode}と\Param{alxspmode}は共通のテーブルを用いているため,
4148 これら2つのパラメータは互いの異名となっていることに注意する.
4151 注意参数\Param{jaxspmode}和\Param{alxspmode}公用一个表,故这两个参数互为同义语。
4154 \item[\Param{autospacing}\,=<bool>$^\ast$] [\verb+\autospacing+]
4155 \item[\Param{autoxspacing}\,=<bool>$^\ast$] [\verb+\autoxspacing+]
4156 \item[\Param{kanjiskip}\,=<skip>] [\verb+\kanjiskip+]
4157 \item[\Param{xkanjiskip}\,=<skip>] [\verb+\xkanjiskip+]
4159 \item[\Param{differentjfm}\,=<mode>$^\dagger$]
4162 Specify how glues/kerns between two \textbf{JAchar}s whose JFM (or size) are different.
4163 The allowed arguments are the followings:
4166 JFM(もしくはサイズ)が異なる2つの\textbf{JAchar}の間にグルー/カーンをどのように
4171 对于处理不同大小或者JFM的两种\textbf{JAchar}之间的胶/出格。
4175 \item[\texttt{average}]
4176 \item[\texttt{both}]
4177 \item[\texttt{large}]
4178 \item[\texttt{small}]
4179 \item[\texttt{pleft}]
4180 \item[\texttt{pright}]
4181 \item[\texttt{paverage}]
4184 \item[\Param{jacharrange}\,=<ranges>$^\ast$]
4185 \item[\Param{kansujichar}\,=\{<digit>, <chr\_code>\}] [\verb+\kansujichar+]
4189 %<en>\section{Other Primitives}
4190 %<ja>\section{その他のプリミティブ}
4191 %<zh>\section{其他基本语句}
4192 %<en>\subsection{Primitives for Compatibility}
4193 %<ja>\subsection{互換プリミティブ}
4194 %<zh>\subsection{基本语句兼容性}
4197 The following primitives are implemented for compatibility with \pTeX.
4198 Note that these primitives don't support JIS~X~0213, but only JIS~X~0208.
4201 以下のプリミティブは\pTeX との互換性のために実装されている:
4206 \begin{list}{}{\def\makelabel{\ttfamily\char92 }\advance\leftmargin1\zw}
4215 %<en>\subsection{\texttt{\char92 inhibitglue} primitive}
4216 %<ja>\subsection{\texttt{\char92 inhibitglue}プリミティブ}
4217 %<zh>\subsection{\texttt{\char92 inhibitglue}基本语句}
4219 The primitive \verb+\inhibitglue+ suppresses the insertion of \textbf{JAglue}.
4220 The following is an example, using a special JFM that there will be a glue between
4221 the beginning of a box and `あ', and also between `あ' and `ウ'.
4224 \verb+\inhibitglue+ プリミティブは\textbf{JAglue}の挿入を抑制する.
4225 以下は,ボックスの始めと`あ'の間,`あ'と`ウ'の間にグルーが入る特別なJFMを用いた例で
4229 基本语句\verb!\inhibitglue!会压缩\textbf{JAchar}的插入。
4230 下面的例子使用了特殊的JFM。在一个盒子和“あ”之间,以及“あ”和“ウ”之间存在胶。
4234 \jfont\g=psft:Ryumin-Light:jfm=test \g
4235 \fbox{\hbox{あウあ\inhibitglue ウ}}
4236 \inhibitglue\par\noindent あ1
4237 \par\inhibitglue\noindent あ2
4238 \par\noindent\inhibitglue あ3
4239 \par\hrule\noindent あoff\inhibitglue ice
4243 With the help of this example, we remark the specification of \verb+\inhibitglue+:
4246 この例を援用して,\verb+\inhibitglue+ の仕様について述べる.
4249 如上例子,我们注意到\verb!\inhibtglue!的用法。
4256 \item The call of \verb+\inhibitglue+ in the (internal) vertical mode is
4260 \item \verb+\inhibitglue+ の垂直モード中での呼び出しは意味を持たない.
4261 4行目の入力で有効にならないのは,\verb+\inhibitglue+ の時点では垂直モードであり,
4262 \verb+\noindent+ の時点で水平モードになるからである.
4266 \item The call of \verb+\inhibitglue+ in the (restricted) horizontal
4267 mode is only effective on the spot; does not get over boundary of
4268 paragraphs. Moreover, \verb+\inhibitglue+ cancels ligatures and
4269 kernings, as shown in the last line of above example.
4272 \item \verb+\inhibitglue+ の(制限された)水平モード中での呼び出しはその場でのみ
4274 さらに,\verb+\inhibitglue+ は上の例の最終行のように(欧文における)リガチャとカーニングを
4275 打ち消す.これは,\verb+\inhibitglue+ が内部的には「現在のリスト中にwhatsitノードを
4276 追加する」ことを行なっているからである.
4280 \item The call of \verb+\inhibitglue+ in math mode is just ignored.
4283 \item \verb+\inhibitglue+ を数式モード中で呼び出した場合はただ無視される.
4287 %<en>\section{Control Sequences for \LaTeXe}
4288 %<ja>\section{\LaTeXe 用のコントロールシーケンス}
4289 %<zh>\section{\LaTeXe 下使用的控制序列}
4291 %<en>\subsection{Patch for NFSS2}
4292 %<ja>\subsection{NFSS2へのパッチ}
4293 %<zh>\subsection{NFSS2补丁}
4294 \label{ssub-nfsspat}
4297 As described in Subsection~\ref{ssec-ltx}, \LuaTeX-ja simply adopted
4298 \texttt{plfonts.dtx} in \pLaTeXe\ for the Japanese patch for NFSS2.
4299 For an convenience, we will describe
4300 commands which are not described in Subsection~\ref{ssub-chgfnt}.
4303 \ref{ssec-ltx}節で述べたように,\LuaTeX-jaはNFSS2への日本語パッチである
4304 \pLaTeXe の\texttt{plfonts.dtx}を単純に取り入れている.
4305 便宜のため,ここでは\ref{ssub-chgfnt}節で述べていなかったコマンドについて
4310 \item[DeclareYokoKanjiEncoding\{<encoding>\}\{<text-settings>\}\{<math-settings>\}]
4313 In NFSS2 under \LuaTeX-ja, distinction between alphabetic font families
4314 and Japanese font families are only made by their
4315 encodings. For example, encodings OT1 and T1 are for
4316 alphabetic font families, and a Japanese font family cannot
4317 have these encodings. This command defines a new encoding
4318 scheme for Japanese font family (in horizontal direction).
4321 \LuaTeX-jaのNFSS2においては,欧文フォントファミリと和文フォントファミリは
4323 例えば,OT1とT1のエンコーディングは欧文フォントファミリに対するものであり,
4324 和文フォントファミリはこれらのエンコーディングを持つことはできない.
4325 このコマンドは和文フォントファミリ(横書き用)のための新しいエンコーディングを
4329 \item[DeclareKanjiEncodingDefaults\{<text-settings>\}\{<math-settings>\}]
4330 \item[DeclareKanjiSubstitution\{<encoding>\}\{<family>\}\{<series>\}\{<shape>\}]
4331 \item[DeclareErrorKanjiFont\{<encoding>\}\{<family>\}\{<series>\}\{<shape>\}\{<size>\}]
4334 The above 3~commands are just the counterparts for \verb+DeclareFontEncodingDefaults+ and~others.
4337 上記3つのコマンドはちょうど \verb+DeclareFontEncodingDefaults+ などに対応するものである.
4340 \item[reDeclareMathAlphabet\{<unified-cmd>\}\{<al-cmd>\}\{<ja-cmd>\}]
4344 和文・欧文の数式用フォントファミリを一度に変更する命令を作成する.
4345 具体的には,欧文数式用フォントファミリ変更の命令<al-cmd>(\verb+\mathrm+ 等)と,和文数式用フォ
4346 ントファミリ変更の命令<ja-cmd>(\verb+\mathmc+ 等)の2つを同時に行う命令として
4347 <unified-cmd>を(再)定義する.実際の使用では<unified-cmd>と
4348 <al-cmd>に同じものを指定する,すなわち,<al-cmd>で和文側も変
4349 更させるようにするのが一般的と思われる.
4351 {\let\item=\origitem
4354 <unified-cmd>\{<arg>\}\quad$\longrightarrow$\quad
4355 (<al-cmd>を1段展開したもの)\{<ja-cmd>を1段展開したもの)\{<arg>\}\}
4357 と定義を行うので,使用には注意が必要である:
4359 \item <al-cmd>,~<ja-cmd>は既に定義されていなければならない.\verb+\reDeclareMathAlphabet+後に
4360 両命令の内容を再定義しても,<unified-cmd>の内容にそれは反映されない.
4361 \item <al-cmd>,~<ja-cmd>に\verb+\@mathrm+などと\texttt{@}をつけた命令を指定した時の動作は保証できない.
4365 \item[DeclareRelationFont\{<ja-encoding>\}\{<ja-family>\}\{<ja-series>\}\{<ja-shape>\}\\
4366 \hfill\{<al-encoding>\}\{<al-family>\}\{<al-series>\}\{<al-shape>\}]
4368 This command sets the `accompanied' alphabetic font family (given by the latter 4~arguments)
4369 with respect to a Japanese font family given by the former 4~arguments.
4372 いわゆる「従属欧文」を設定するための命令である.前半の4引数で表される和文フォントファミリに対して,
4373 そのフォントに対応する「従属欧文」フォントファミリを後半の4引数により与える.
4375 \item[SetRelationFont]
4377 This command is almost same as \verb+\DeclareRelationFont+, except that this command does a local
4378 assignment, where \verb+\DeclareRelationFont+ does a global assignment.
4381 このコマンドは \verb+\DeclareRelationFont+ とローカルな指定であることを除いて
4382 ほとんど同じである(\verb+\DeclareRelationFont+ はグローバル).
4387 Change current alphabetic font encoding/family/\dots\ to the `accompanied' alphabetic
4388 font family with respect to current Japanese font family,
4390 \verb+\DeclareRelationFont+ or \verb+\SetRelationFont+.
4391 Like \verb+\fontfamily+, \verb+\selectfont+ is required to take an effect.
4394 現在の欧文フォントエンコーディング/ファミリ/…… を,
4395 \verb+\DeclareRelationFont+ か \verb+\SetRelationFont+ で指定された
4396 現在の和文フォントファミリに対応する「従属欧文」フォントファミリに変更する.
4397 \verb+\fontfamily+ のように,有効にするためには \verb+\selectfont+ が必要である.
4400 \item[adjustbaseline]
4403 \item[fontfamily\{<family>\}]
4406 As in \LaTeXe, this command changes current font family (alphabetic, Japanese,~\emph{or both})
4407 to <family>. Which family will be changed is determined as follows:
4410 元々の\LaTeXe におけるものと同様に,このコマンドは現在のフォントファミリ(欧文,
4411 和文,\textbf{もしくは両方})を<family>に変更する.
4412 どのファミリが変更されるかは以下のようにして決定される:
4419 \item Let current encoding scheme for Japanese fonts be
4420 <ja-enc>. Current Japanese font family will be changed to
4421 <family>, if one of the following two conditions is met:
4424 \item 現在の和文フォントに対するエンコーディングが<ja-enc>であるとしよう.
4425 現在の和文フォントファミリは,以下の2つの条件のうちの1つが満たされているときに
4430 \item The family <fam> under the encoding <ja-enc> has been already defined by
4431 \verb+\DeclareKanijFamily+.
4434 \item エンコーディング<ja-enc>におけるファミリ<fam>が既に \verb+\DeclareKanjiFamily+ によって定義されている.
4437 \item A font definition named \texttt{<enc><ja-enc>.fd} (the file name is
4438 all lowercase) exists.
4444 \item フォント定義ファイル\texttt{<enc><ja-enc>.fd}(ファイル名は全て小文字)が存在する.
4448 \item Let current encoding scheme for alphabetic fonts be
4449 <al-enc>. For alphabetic font family, the criterion as above is used.
4452 \item 現在の欧文フォントに対するエンコーディングを<al-enc>とする.
4453 欧文フォントファミリに対しても,上記の基準が用いられる.
4456 \item There is a case which none of the above applies, that is, the font
4457 family named <family> doesn't seem to be defined neither under the
4458 encoding <ja-enc>, nor under <al-enc>.
4459 In this case, the default family for font substitution is used for
4460 alphabetic and Japanese fonts. Note that current encoding will not
4461 be set to <family>, unlike the original implementation in \LaTeX.
4464 \item 上記のいずれもが適用されない,つまり<family>が<ja-enc>と<al-enc>の
4465 どちらでも定義されないような場合がある.
4466 この場合,代替フォントに用いられるデフォルトのフォントファミリが欧文フォントと
4467 和文フォントに用いられる.\LaTeX のオリジナルの実装とは異なり,
4468 現在のエンコーディングは<family>には設定されないことに注意する.
4475 As closing this subsection, we shall introduce an example of
4476 \verb+\SetRelationFont+ and \verb+\userelfont+:
4479 この節の終わりに,\verb+\SetRelationFont+ と \verb+\userelfont+ の例を
4480 紹介しておこう.\verb+\userelfont+ の使用によって,「abc」の部分のフォントが
4481 Avant Garde (OT1/pag/m/n) に変わっていることがわかる.
4484 \kanjifamily{gt}\selectfont あいうxyz
4485 \SetRelationFont{JY3}{gt}{m}{n}{OT1}{pag}{m}{n}
4486 \userelfont\selectfont あいうabc
4489 %<en>\section{Extensions}
4491 \subsection{\texttt{luatexja-fontspec.sty}}
4494 As described in Subsection~\ref{ssec-fontspec}, this optional package
4495 provides the counterparts for several commands defined in the
4496 \Pkg{fontspec} package.
4497 In addition to `font features' in the original \Pkg{fontspec},
4498 the following `font features' specifications are allowed for
4499 the commands of Japanese version:
4502 \ref{ssec-fontspec}節で述べたように,この追加パッケージは\Pkg{fontspec}
4503 パッケージで定義されているコマンドに対応する和文フォント用のコマンドを提供する.
4504 オリジナルの\Pkg{fontspec}での`font feature'に加えて,和文版のコマンドには
4505 以下の`font feature'を指定することができる:
4509 \begin{list}{}{\def\makelabel{\ttfamily}\def\{{\char`\{}\def\}{\char`\}}\advance\leftmargin1\zw}
4512 \item[JFM-var=<name>] \
4515 These 3 font features correspond to \texttt{cid}, \texttt{jfm} and
4516 \texttt{jfmvar} keys for \verb+\jfont+ primitive, respectively.
4517 \texttt{CID} is effective only when with \texttt{NoEmbed}
4519 See Subsections~\ref{ssec-jfont} and \ref{ssec-psft} for details.
4522 これら3つのキーはそれぞれ \verb+\jfont+ プリミティブに対する
4523 \texttt{cid}, \texttt{jfm}, \texttt{jfmvar}キーとそれぞれ対応する.
4524 \texttt{CID} は下の \texttt{NoEmbed} と合わせて用いられたときのみ有効である.
4525 \verb+\jfont+ プリミティブに対する
4526 \texttt{cid}, \texttt{jfm}, \texttt{jfmvar}キーの詳細は\ref{ssec-jfont}節
4527 と\ref{ssec-psft}節を参照.
4532 By specifying this font feature, one can use `name-only' Japanese font which
4533 will not be embedded in the output PDF file. See Subsection~\ref{ssec-psft}.
4536 これを指定することで,PDFに埋め込まれない「名前だけ」のフォントを指定することが
4537 できる.\ref{ssec-psft}節を参照.
4541 \subsection{\texttt{luatexja-otf.sty}}
4544 This optional package supports typesetting characters in
4545 Adobe-Japan1. \texttt{luatexja-otf.sty} offers the following 2~low-level
4549 この追加パッケージはAdobe-Japan1の文字の出力をサポートする.
4550 \texttt{luatexja-otf.sty}は以下の2つの低レベルコマンドを提供する:
4552 \begin{list}{}{\def\makelabel{\ttfamily}\def\{{\char`\{}\def\}{\char`\}}\advance\leftmargin1\zw}
4553 \item[\char92CID\{<number>\}]
4555 Typeset a character whose CID number is <number>.
4558 CID番号が<number>の文字を出力する.
4561 \item[\char92UTF\{<hex\_number>\}]
4563 Typeset a character whose character code is <hex\_number> (in hexadecimal).
4564 This command is similar to \verb+\char"+<hex\_number>,\ %"
4565 but please remind remarks below.
4568 文字コードが(16進で)<hex\_number>の文字を出力する.
4569 このコマンドは \verb+\char"+<hex\_number>と似ているが,下の記述に注意すること.%"
4573 %<en>\paragraph{Remarks}
4576 Characters by \verb+\CID+ and \verb+\UTF+ commands are different from
4577 ordinary characters in the following points:
4580 \verb+\CID+ と \verb+\UTF+ コマンドによって出力される文字は
4588 \item Always treated as \textbf{JAchar}s.
4591 \item 常に\textbf{JAchar}として扱われる.
4594 \item Processing codes for supporting OpenType features (\textit{e.g.},
4595 glyph replacement and kerning) by the \Pkg{luaotfload} package
4596 is not performed to these characters.
4599 \item OpenType feature(例えばグリフ置換やカーニング)をサポートするための
4600 \Pkg{luaotfload}パッケージのコードはこれらの文字には働かない.
4605 %<en>\paragraph{Additional Syntax of JFM}
4606 %<ja>\paragraph{JFMへの記法の追加}
4609 \texttt{luatexja-otf.sty} extends the syntax of JFM; the entries of \texttt{
4610 chars} table in JFM now allows a string in the form
4611 \verb+'AJ1-xxx'+, which stands for the character
4612 whose CID number in Adobe-Japan1 is \verb+xxx+.
4615 \texttt{luatexja-otf.sty}はJFMの記法を拡張する.
4616 JFMの\texttt{chars}テーブルのエントリとして \verb+'AJ1-xxx'+ の形の文字列が
4617 使えるようになる.これはAdobe-Japan1におけるCID番号が \verb+xxx+ の文字を表す.
4620 \subsection{\texttt{luatexja-adjust.sty}}
4624 \hbox to 1\zw{\hss\fboxsep=-.5\fboxrule\fbox{%
4625 \hskip\dimexpr-.5\zw-.2pt\vrule width.4pt height.08\zw depth.12\zw%
4626 \hskip\dimexpr.5\zw-.2pt\relax}\hss}}
4627 \def\sb{\hbox to 1\zw{\hss\fboxsep=-.5\fboxrule\fbox{%
4628 ■\hskip\dimexpr-.5\zw-.2pt\vrule width.4pt height.08\zw depth.12\zw%
4629 \hskip\dimexpr.5\zw-.2pt\relax}\hss}}
4631 \def\outbox#1{{\Large%
4632 \ltjsetparameter{kanjiskip=0pt plus .2\zw minus .2\zw}%
4633 \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}%
4634 \hbox{\textcolor{cyan!50!white}{\copy\gridbox}\hskip-20\zw%
4635 \vbox{\hsize=20\zw\noindent\leftskip0pt\rightskip0pt\parfillskip0pt#1}\vrule}%
4641 no adjustment&\outbox{以上の原理は,「包除原理」とよく呼ばれるが\hskip-.5\zw\null}\\
4644 \outbox{以上の原理は,「包除原理」とよく呼ばれるが}%
4647 \outbox{以上の原理は,「包除原理」とよく呼ばれるが}
4648 %<!ja>\ltjdisableadjust
4655 \Param{kanjiskip} is 0\,pt${}^{+1/5\,\mathrm{em}}_{-1/5\,\mathrm{em}}$ in this figure,
4656 for making the difference obvious.
4657 %<ja>\caption{行長調整}\label{fig-adj}
4658 %<en>\caption{Line adjustment}\label{fig-adj}
4666 \pTeX では,行長調整において優先度の概念が存在しなかったため,図
4667 \ref{fig-adj}上段における半角分の半端は,図\ref{fig-adj}中段のように,鍵
4668 括弧周辺の空白と和文間空白(\Param{kanjiskip})の両方によって負担される.し
4669 かし,「日本語組版処理の要件」\cite{jlreq}やJIS~X~4051~\cite{x4051}におい
4670 ては,このような状況では半端は鍵括弧周辺の空白のみで負担し,その他の和文
4671 文字はベタ組で組まれる(図\ref{fig-adj}下段)ことになっている.この追加
4672 パッケージは\cite{jlreq}や\cite{x4051}における規定のような,優先順位付き
4673 の行長調整を提供する.詳細な仕様については\ref{sec-adjspec}を参照.
4676 \texttt{luatexja-adjust.sty}は,以下の命令を提供する.これらはすべてグローバルに効力を発揮する.
4678 \begin{list}{}{\def\makelabel{\ttfamily}\def\{{\char`\{}\def\}{\char`\}}\advance\leftmargin1\zw}
4679 \item[\char92ltjdisableadjust]
4682 \item[\char92ltjenableadjust]
4697 %<en>\part{Implementations}
4700 %<en>\section{Storing Parameters}
4701 %<ja>\section{パラメータの保持}
4703 %<en>\subsection{Used Dimensions, Attributes and whatsit nodes}
4704 %<ja>\subsection{\LuaTeX-jaで用いられる寸法レジスタ,属性レジスタ,whatsitノード}
4707 Here the following is the list of dimensions and attributes which are used in \LuaTeX-ja.
4710 以下は\LuaTeX-jaで用いられる寸法レジスタ(dimension),属性レジスタ(attribute)の
4714 \def\makelabel{\ttfamily}\advance\leftmargin1\zw
4715 \def\dim#1{\item[\char92 #1\ \textrm{(dimension)}]}
4716 \def\attr#1{\item[\char92 #1\ \textrm{(attribute)}]}
4721 \verb+\jQ+ is equal to
4722 $1\,\textrm{Q}=0.25\,\textrm{mm}$, where `Q'~(also called `級') is
4723 a unit used in Japanese phototypesetting. So one should not change the value of this dimension.
4726 \verb+\jQ+ は$1\,\textrm{Q}=0.25\,\textrm{mm}$
4727 と等しい.ここで,`Q'(もしくは「級」)は日本の写植で用いられる単位である.したがって,
4728 この寸法レジスタの値を変更してはならない.
4733 There is also a unit called `歯' which equals to $0.25\,\textrm{mm}$ and
4734 used in Japanese phototypesetting. This
4735 \verb+\jH+ is a synonym of \verb+\jQ+.
4738 同じく写植で用いられていた単位として「歯」があり,これも$0.25\,\textrm{mm}$と
4739 等しい.\verb+\jH+ は \verb+\jQ+ の別名である.
4744 A temporal register for the `full-width' of current Japanese font.
4747 現在の和文フォントの「全角幅」を保持する一時レジスタ.
4752 A temporal register for the `full-height' (usually the sum of height of imaginary body and its depth) of current Japanese font.
4755 現在の和文フォントの「全角高さ」(通常,高さと深さの和)を保持する一時レジスタ.
4760 Current number of Japanese font family for math formulas.
4763 数式用の和文フォントファミリの現在の番号.
4768 The font index of current Japanese font.
4774 \attr{ltj@charclass}
4776 The character class of Japanese \textit{glyph\_node}.
4779 和文文字の\textit{glyph\_node}の文字クラス.
4782 \attr{ltj@yablshift}
4784 The amount of shifting the baseline of alphabetic fonts in scaled point ($2^{-16}\,\textrm{pt}$).
4787 スケールド・ポイント($2^{-16}\,\textrm{pt}$)を単位とした欧文フォントのベースラインの移動量.
4790 \attr{ltj@ykblshift}
4792 The amount of shifting the baseline of Japanese fonts in scaled point ($2^{-16}\,\textrm{pt}$).
4795 スケールド・ポイント($2^{-16}\,\textrm{pt}$)を単位とした和文フォントのベースラインの移動量.
4800 Whether the auto insertion of \Param{kanjiskip} is allowed at the node.
4803 そのノードで\Param{kanjiskip}の自動挿入が許されるかどうか.
4808 Whether the auto insertion of \Param{xkanjiskip} is allowed at the node.
4811 そのノードで\Param{xkanjiskip}の自動挿入が許されるかどうか.
4816 An attribute for distinguishing `kinds' of a node. One of the following value is
4817 assigned to this attribute:
4820 ノードの「種類」を区別するための属性.以下のうちのひとつが値として割り当てられる:
4823 \item[\textit{italic} (1)]
4825 Glues from an italic correction
4826 (\verb+\/+). This distinction of origins of glues
4827 (from explicit \verb+\kern+, or from \verb+\/+)
4828 is needed in the insertion process of \Param{xkanjiskip}.
4831 イタリック補正(\verb+\/+)によるグルー.このグルーの由来の区別(\verb+\kern+ か
4832 \verb+\/+ か)は\Param{xkanjiskip}の挿入過程において必要になる.
4835 \item[\textit{packed} (2)]
4837 \item[\textit{kinsoku} (3)]
4839 Penalties inserted for the word-wrapping process of Japanese characters (\emph{kinsoku}).
4842 和文文字のワードラップ過程において挿入されたペナルティ(\emph{kinsoku}).
4845 \item[\textit{from\_jfm} (6)]
4847 Glues/kerns from JFM.
4853 %%\item[\textit{line\_end} (5)]
4858 %%和文文字が行末にきたとき,行末との間に挿入されるカーンである.
4862 \item[\textit{kanji\_skip} (9)]
4864 Glues for \Param{kanjiskip}.
4867 \Param{kanjiskip}のグルー.
4870 \item[\textit{xkanji\_skip} (10)]
4872 Glues for \Param{xkanjiskip}.
4875 \Param{xkanjiskip}のグルー.
4878 \item[\textit{processed} (11)]
4880 Nodes which is already processed by \ldots.
4883 \LuaTeX-ja の内部処理によって既に処理されたノード.
4886 \item[\textit{ic\_processed} (12)]
4888 Glues from an italic correction, but also already processed.
4891 イタリック補正に由来するグルーであるが,まだ処理されていないもの.
4894 \item[\textit{boxbdd} (15)]
4896 Glues/kerns that inserted just the beginning or the ending of an hbox or a paragraph.
4899 ある水平ボックスか段落の最初か最後に挿入されたグルー/カーン.
4905 Where $i$~is a natural number which is less than~7.
4906 These 7~attributes store bit~vectors indicating which character block is regarded as a block of \textbf{JAchar}s.
4910 これら7つの属性レジスタは,どの文字ブロックが\textbf{JAchar}のブロックとして
4911 扱われるかを示すビットベクトルを格納する.
4916 Furthermore, \LuaTeX-ja uses several `user-defined' whatsit nodes for
4917 inrernal processing. All those nodes store a natural number (hence the node's
4918 \texttt{type} is 100). The following \verb+user_id+s are used:
4921 さらに,\LuaTeX-jaはいくつかの「ユーザ定義の」whatsit ノードを内部処理に用いる.
4922 これらの全てのノードは自然数を格納している(したがってノードの\texttt{type}は
4923 100である).次の \verb+user_id+ が使用される:
4928 Nodes for indicating that \verb+\inhibitglue+ is
4929 specified. The \texttt{value} field of these nodes doesn't matter.
4932 \verb+\inhibitglue+ が指定されたことを示すノード.これらのノードの
4933 \texttt{value}フィールドは意味を持たない.
4938 Nodes for \LuaTeX-ja's stack system (see the next
4939 subsection). The \texttt{value} field of these nodes is
4943 \LuaTeX-jaのスタックシステム(次の節を参照)のためのノード.
4944 これらのノードの\texttt{value}フィールドは現在のグループを表す.
4949 Nodes for Japanese Characters which the callback process of
4950 \Pkg{luaotfload} won't be applied, and the character code is
4951 stored in the \texttt{value} field. Each node having this
4952 \verb+user_id+ is converted to a `glyph\_node' \emph{after}
4953 the callback process of luaotfload.
4954 This \verb+user_id+ is only used by the \Pkg{luatexja-otf} package.
4957 \Pkg{luaotfload}のコールバックによる処理が適用されない和文文字のためのノードで,
4958 \texttt{value}フィールドにその文字のコードが格納されている.
4959 この \verb+user_id+ を持つノードはそれぞれが\Pkg{luaotfload}のコールバックの処理の
4960 \textbf{後で}`glyph\_node'に変換される.この \verb+user_id+ は %
4961 \Pkg{luatexja-otf} パッケージでのみ使用される.
4965 Nodes for indicating beginning of a paragraph.
4966 A paragraph which is started by \verb+\item+ in list-like environments has a horizontal box
4967 for its label before the actual contents. So \dots
4970 These whatsits will be removed during the process of inserting \textbf{JAglue}s.
4973 これらのwhatsitノードは\textbf{JAglue}の挿入処理の間に取り除かれる.
4976 %<en>\subsection{Stack System of \LuaTeX-ja}
4977 %<ja>\subsection{\LuaTeX-jaのスタックシステム}
4980 %<en>\paragraph{Background}
4983 \LuaTeX-ja has its own stack system, and most parameters of \LuaTeX-ja
4984 are stored in it. To clarify the reason, imagine the parameter
4985 \Param{kanjiskip} is stored by a skip, and consider the following
4989 \LuaTeX-jaは独自のスタックシステムを持ち,\LuaTeX-jaのほとんどのパラメータは
4990 これを用いて保持されている.その理由を明らかにするために,
4991 \Param{kanjiskip}パラメータがスキップレジスタで保持されているとし,
4995 \ltjsetparameter{kanjiskip=0pt}ふがふが.%
4996 \setbox0=\hbox{\ltjsetparameter{kanjiskip=5pt}ほげほげ}
5001 As described in Subsection~\ref{ssec-param}, the only effective value of
5002 \Param{kanjiskip} in an hbox is the latest value, so the value of
5003 \Param{kanjiskip} which applied in the entire hbox should be 5\,pt.
5004 However, by the implementation method of \LuaTeX, this `5\,pt' cannot be
5005 known from any callbacks. In the \texttt{tex/packaging.w} (which is a
5006 file in the source of \LuaTeX), there are the following codes:
5009 \ref{ssec-param}節で述べたように,ある水平ボックスの中で効力を持つ
5010 \Param{kanjiskip}の値は最後に現れた値のみであり,したがってボックス全体に適用される
5011 \Param{kanjiskip}は5\,ptであるべきである.しかし,\LuaTeX の実装のために,
5012 この`5\,pt'はどのコールバックからも知ることはできない.
5013 \texttt{tex/packaging.w}(これは\LuaTeX のソースファイルである)の中に,
5019 scaled h; /* height of box */
5020 halfword p; /* first node in a box */
5021 scaled d; /* max depth */
5027 if (cur_list.mode_field == -hmode) {
5028 cur_box = filtered_hpack(cur_list.head_field,
5029 cur_list.tail_field, saved_value(1),
5030 saved_level(1), grp, saved_level(2));
5031 subtype(cur_box) = HLIST_SUBTYPE_HBOX;
5034 Notice that \verb+unsave+ is executed \emph{before}
5035 \verb+filtered_hpack+ (this is where \verb+hpack_filter+ callback is
5036 executed): so `5\,pt' in the above source is orphaned at
5037 \verb+unsave+, and hence it can't be accessed from \verb+hpack_filter+
5041 \verb+unsave+ が \verb+filtered_hpack+(これは \verb+hpack_filter+ コールバックが
5042 実行されるところである)の\textbf{前に}実行されていることに注意する.
5043 したがって,上記ソース中で`5\,pt'は \verb+unsave+ のところで捨てられ,
5044 \verb+hpack_filter+ からはアクセスすることができない.
5047 %<en>\paragraph{The method}
5048 %<ja>\paragraph{解決法}
5049 %<zh>\paragraph{解决方法}
5052 The code of stack system is based on that in a post of Dev-luatex mailing list\footnote{%
5053 \texttt{[Dev-luatex] tex.currentgrouplevel}, a post at 2008/8/19 by Jonathan Sauer.}.
5056 スタックシステムのコードはDev-luatexメーリングリストのある投稿\footnote{\texttt{[Dev-luatex] tex.currentgrouplevel}: Jonathan Sauerによる2008/8/19の投稿.}を
5061 These are two \TeX\ count registers for maintaining information:
5062 \verb+\ltj@@stack+ for the stack level, and \verb+\ltj@@group@level+ for
5063 the \TeX's group level when the last assignment was done. Parameters
5064 are stored in one big table named \texttt{charprop\_stack\_table}, where
5065 \texttt{charprop\_stack\_table[$i$]} stores data of stack level~$i$. If
5066 a new stack level is created by \verb+\ltjsetparameter+, all data of the
5067 previous level is copied.
5070 情報を保持するために,2つの\TeX の整数レジスタを用いている:
5071 \verb+\ltj@@stack+ でスタックレベル,\verb+\ltj@@group@level+ で最後の代入が
5072 なされた時点での\TeX のグループレベルを保持している.
5073 パラメータは\texttt{charprop\_stack\_table}という名前のひとつの大きなテーブルに
5074 格納される.ここで,\texttt{charprop\_stack\_table[$i$]}はスタックレベル$i$の
5075 データを格納している.もし新しいスタックレベルが \verb+\ltjsetparameter+ によって
5076 生成されたら,前のレベルの全てのデータがコピーされる.
5080 To resolve the problem mentioned in `Background' above, \LuaTeX-ja uses
5081 another thing: When a new stack level is about to be created, a whatsit
5082 node whose type, subtype and value are 44~(\textit{user\_defined}),
5083 30112, and current group level respectively is appended to the current
5084 list (we refer this node by \textit{stack\_flag}). This enables us to
5085 know whether assignment is done just inside a hbox. Suppose that the
5086 stack level is~$s$ and the \TeX's group level is~$t$ just after the hbox
5090 上の「背景」で述べた問題を解決するために,\LuaTeX-jaではもう一つの手法を導入する:
5091 新しいスタックレベルが生成されようとするとき,type, subtype, valueがそれぞれ
5092 44~(\textit{user\_defined}), 30112,そして現在のグループレベルであるwhatsitノード
5093 を現在のリストに付け加える(このノードを\textit{stack\_flag}とする).
5094 これにより,ある水平ボックスの中で代入がなされたかどうかを知ることが可能
5095 となる.スタックレベルを$s$,その水平ボックスグループの直後の\TeX のグループレベルを
5103 \item If there is no \textit{stack\_flag} node in the list of the hbox, then
5104 no assignment was occurred inside the hbox. Hence values of
5105 parameters at the end of the hbox are stored in the stack
5109 \item もしその水平ボックスのリストの中に\textit{stack\_flag}ノードがなければ,
5110 水平ボックスの中では代入は起こらなかったということになる.
5111 したがって,その水平ボックスの終わりにおけるパラメータの値はスタックレベル$s$に
5116 \item If there is a \textit{stack\_flag} node whose value is~$t+1$, then
5117 an assignment was occurred just inside the hbox group. Hence
5118 values of parameters at the end of the hbox are stored in the
5122 \item もし値が$t+1$の\textit{stack\_flag}ノードがあれば,その
5123 水平ボックスグループの中で代入が起こったことになる.
5124 したがって,水平ボックスの終わりにおけるパラメータの値はスタックレベル$s+1$に
5129 \item If there are \textit{stack\_flag} nodes but all of their values
5130 are more than~$t+1$, then an assignment was occurred in the box,
5131 but it is done is `more internal' group. Hence values of
5132 parameters at the end of the hbox are stored in the stack
5136 \item もし\textit{stack\_flag}ノードがあるがそれらの値が全て$t+1$より大きい
5137 場合,そのボックスの中で代入が起こったが,それは「より内部の」グループで
5138 起こったということになる.したがって,水平ボックスの終わりでのパラメータの
5139 値はスタックレベル$s$に格納されている.
5144 Note that to work this trick correctly, assignments to
5145 \verb+\ltj@@stack+ and \verb+\ltj@@group@level+ have to be local always,
5146 regardless the value of \verb+\globaldefs+.
5147 This problem is resolved by using
5148 \hbox{\verb+\directlua{tex.globaldefs=0}+} (this assignment is local).
5151 このトリックを正しく働かせるためには,\verb+\ltj@@stack+ と \verb+\ltj@@group@level+ への
5152 代入は \verb+\globaldefs+ の値によらず常にローカルでなければならないことに注意する.
5153 この問題は \hbox{\verb+\directlua{tex.globaldefs=0}+}(この代入は常にローカル)を
5157 %<en>\section{Linebreak after Japanese Character}
5158 %<ja>\section{和文文字直後の改行}
5159 %<zh>\section{日文字符后断行}
5161 %<en>\subsection{Reference: Behavior in \pTeX}
5162 %<ja>\subsection{参考:\pTeX の動作}
5163 %<zh>\subsection{参考: \pTeX 行为}
5165 In~\pTeX, a line break after a Japanese character doesn't emit a space,
5166 since words are not separated by spaces in Japanese writings. However,
5167 this feature isn't fully implemented in \LuaTeX-ja due to the
5168 specification of callbacks in~\LuaTeX. To clarify the difference between
5169 \pTeX~and~\LuaTeX, We briefly describe the handling of a line break in~\pTeX, in
5172 \pTeX's input processor can be described in terms of a finite state
5173 automaton, as that of~\TeX\ in~Section~2.5 of~\cite{texbytopic}. The
5174 internal states are as follows:
5176 \item State~$N$: new line
5177 \item State~$S$: skipping spaces
5178 \item State~$M$: middle of line
5179 \item State~$K$: after a Japanese character
5181 The first three states---$N$, $S$~and~$M$---are as same as \TeX's input
5182 processor. State~$K$ is similar to state~$M$, and is entered after
5183 Japanese characters. The diagram of state transitions are indicated in
5184 Figure~\ref{fig-ptexipro}. Note that \pTeX\ doesn't leave state~$K$
5185 after `beginning/ending of a group' characters.
5189 欧文では文章の改行は単語間でしか行わない.そのため,\TeX では,(文字の直後の)改行は
5190 空白文字と同じ扱いとして扱われる.一方,和文ではほとんどどこでも改行が可能なため,
5191 \pTeX では和文文字の直後の改行は単純に無視されるようになっている.
5193 このような動作は,\pTeX が\TeX からエンジンとして拡張されたことによって可能になったことである.
5194 \pTeX の入力処理部は,\TeX におけるそれと同じように,有限オートマトンとして記述することができ,
5198 \item State~$N$: 行の開始.
5199 \item State~$S$: 空白読み飛ばし.
5200 \item State~$M$: 行中.
5201 \item State~$K$: 行中(和文文字の後).
5203 また,状態遷移は,図\ref{fig-ptexipro}のようになっており,図中の数字は
5204 カテゴリーコードを表している.最初の3状態は\TeX の入力処理部と同じであり,
5205 図中から状態$K$と「$j$」と書かれた矢印を取り除けば,\TeX の入力処理部と同
5210 行が和文文字(とグループ境界文字)で終わっていれば,改行は無視される
5216 \let\sp\textvisiblespace\small
5217 \begin{minipage}{.6\textwidth}%
5219 \unitlength=6.5mm\sf\mathversion{bold}
5220 \begin{tikzpicture}[
5221 ->, auto, shorten >=1pt
5223 \node [shape=rectangle, font=\scriptsize] (init) at (2,7) {start};
5224 \node [shape=circle,draw, fill=blue!20] (newline) at (4,7) {$N$};
5225 \node [shape=circle,draw, fill=blue!20] (midline) at (4,4) {$M$};
5226 \node [shape=circle,draw, fill=blue!20] (skipspc) at (8,7) {$S$};
5227 \node [shape=circle,draw, fill=red!20] (kanji) at (8,4) {$K$};
5228 \node [shape=rectangle,draw, fill=green!20] (scanacs) at (6,8) {scan a c.s.};
5229 \node (endk) at (8,2.5) {} ;
5230 \node (endm) at (4,2.5) {} ;
5231 \node (ends) at (8,8.5) {} ;
5232 \node (endn) at (4,8.5) {} ;
5233 \begin{scope}[font=\scriptsize]
5234 \path (newline) edge [bend right] node [left]{G, O} (midline)
5235 (init) edge node {} (newline)
5236 (midline) edge [bend right=10] node {10} (skipspc)
5237 (skipspc) edge [bend right] node [left,right=10,above=7]{G, O} (midline)
5238 (skipspc) edge [loop right] node {10} (skipspc)
5239 (newline) edge [loop right] node {10} (newline)
5240 (scanacs) edge [bend left] node [left=3,below]{$(*)$} (skipspc)
5241 (scanacs) edge [bend right] node [right=30,above=20]{$(*)$} (midline)
5242 (midline) edge node {5\ [\sp]} (endm)
5243 (midline) edge [loop left] node {G, O} (midline)
5244 (skipspc) edge node [right] {5} (ends)
5245 (newline) edge node {5 [{\tt\char92par}]} (endn);
5247 \path (newline) edge [bend right] node [right=25,below=3]{J} (kanji)
5248 (midline) edge node [below]{J} (kanji)
5249 (kanji) edge [bend left] node {O} (midline)
5250 (kanji) edge node {10} (skipspc)
5251 (kanji) edge [loop right] node {G, J} (kanji)
5252 (skipspc) edge [bend left] node {J} (kanji)
5253 (kanji) edge node {5} (endk)
5260 \begin{minipage}{.4\textwidth}
5262 \item[\textsf{G}] Beginning of group (usually \verb+{+)\\
5263 and ending of group (usually \verb+}+).
5264 \item[\textsf{J}] Japanese characters.
5265 \item[\textsf{5}] \textit{end-of-line} (usually \verb+^^J+).
5266 \item[\textsf{10}] space (usually \sp).
5267 \item[\textsf{O}] other characters, whose category code is in $\{3,4,6,7,8,11,12,13\}$.
5268 \item[\textsf{[\sp]}, \textsf{[{\tt\char92par}]}]
5269 emits a space, or~\verb+\par+.
5273 \item We omitted about category codes
5274 9~(\textit{ignored}), 14~(\textit{comment})~and~15~(\textit{invalid})
5275 from the above diagram. We also ignored the input like `\verb+^^A+' or `\verb+^+\verb+^df+'.
5276 \item When a character whose category code is 0 (\textit{escape character}) is seen by \TeX,
5277 the input processor scans a control sequence (\textsf{scan a c.s.}).
5278 These paths are not shown in the above diagram.
5280 After that, the state is changed to State~$S$ (skipping blanks) in most cases, but
5281 to State~$M$ (middle of line) sometimes.
5283 %<en>\caption{State transitions of \pTeX's input processor.}
5284 %<ja>\caption{\pTeX の入力処理部の状態遷移.}
5285 \label{fig-ptexipro}
5289 %<en>\subsection{Behavior in \LuaTeX-ja}
5290 %<ja>\subsection{\LuaTeX-jaの動作}
5291 %<zh>\subsection{\LuaTeX-ja行为}
5293 States in the input processor of \LuaTeX\ is the same as that of \TeX,
5294 and they can't be customized by any callbacks. Hence, we can only use
5295 \verb+process_input_buffer+ and \verb+token_filter+ callbacks for to
5296 suppress a space by a line break which is after Japanese characters.
5298 However, \verb+token_filter+ callback cannot be used either, since a
5299 character in category code 5~(end-of-line) is converted into an space
5300 token \emph{in the input processor}. So we can use only the
5301 \verb+process_input_buffer+ callback. This means that suppressing a
5302 space must be done \emph{just before} an input line is read.
5304 Considering these situations, handling of an end-of-line in \LuaTeX-ja are as follows:
5306 A character U+FFFFF (its category code is set to 14~(comment) by
5307 \LuaTeX-ja) is appended to an input line, \emph{before \LuaTeX\ actually
5308 process it}, if and only if the following three conditions are satisfied:
5310 \item The category code of \verb+\endlinechar+%
5311 \footnote{Usually, it is $\langle${return}$\rangle$
5312 (whose character code is 13).} is 5~(end-of-line).
5313 \item The category code of U+FFFFF itself is 14~(comment).
5314 \item The input line matches the following `regular expression':
5316 (\text{any char})^*(\textbf{JAchar})
5317 \bigl(\{\text{catcode}=1\}\cup\{\text{catcode}=2\}\bigr)^*
5323 The following example shows the major difference from the behavior of \pTeX:
5325 \ltjsetparameter{autoxspacing=false}
5326 \ltjsetparameter{jacharrange={-6}}xあ
5327 y\ltjsetparameter{jacharrange={+6}}zあ
5331 \item There is no space between `x' and `y', since the line~2 ends with a \textbf{JAchar} `あ'
5332 (this `あ' considered as an \textbf{JAchar} at the ending of line~1).
5333 \item There is no space between `あ' (in the line~3) and `u', since the
5334 line~3 ends with an \textbf{ALchar}
5335 (the letter `あ' considered as an \textbf{ALchar} at the ending of line~2).
5340 \LuaTeX の入力処理部は\TeX のそれと全く同じであり,コールバックによりユーザが
5341 カスタマイズすることはできない.このため,改行抑制の目的でユーザが利用で
5342 きそうなコールバックとしては,\verb+process_input_buffer+や
5343 \verb+token_filter+に限られてしまう.しかし,\TeX の入力処理部をよく見る
5344 と,後者も役には経たないことが分かる:改行文字は,入力処理部によってトー
5345 クン化される時に,カテゴリーコード10の32番文字へと置き換えられてしまうた
5346 め,\verb+token_filter+で非標準なトークン読み出しを行おうとしても,空白文
5347 字由来のトークンと,改行文字由来のトークンは区別できないのだ.
5349 すると,我々のとれる道は,\verb+process_input_buffer+を用いて
5350 \LuaTeX の入力処理部に引き渡される前に入力文字列を編集するというものしかない.
5351 以上を踏まえ,\LuaTeX-jaにおける「和文文字直後の改行抑制」の処理は,次のようになっている:
5354 各入力行に対し,\textbf{その入力行が読まれる前の内部状態で}
5355 以下の3条件が満たされている場合,\LuaTeX-jaはU+FFFFF番の文字
5356 \footnote{この文字はコメント文字として扱われるように\LuaTeX-ja内部で設定をしている.}
5357 を末尾に追加する.よって,その場合に改行は空白とは見做されないこととなる.
5359 \item \verb+\endlinechar+の文字\footnote{普通は,改行文字(文字コード13番)である.}
5360 のカテゴリーコードが5~(end-of-line)である.
5361 \item U+FFFFFのカテゴリーコードが14~(comment)である.
5362 \item 入力行は次の「正規表現」にマッチしている:
5364 (\text{any char})^*(\textbf{JAchar})
5365 \bigl(\{\text{catcode}=1\}\cup\{\text{catcode}=2\}\bigr)^*
5370 この仕様は,前節で述べた\pTeX の仕様にできるだけ近づけたものとなっている.最初の条件は,
5371 \texttt{verbatim}系環境などの日本語対応マクロを書かなくてすませるためのものである.
5372 しかしながら,完全に同じ挙動が実現できたわけではない.
5373 差異は,次の例が示すように,和文文字の範囲を変更した行の改行において見られる:
5375 \ltjsetparameter{autoxspacing=false}
5376 \ltjsetparameter{jacharrange={-6}}xあ
5377 y\ltjsetparameter{jacharrange={+6}}zあ
5380 もし\pTeX とまったく同じ挙動を示すならば,出力は
5381 「\hbox{\ltjsetparameter{autoxspacing=false}x yzあu}」となるべきである.しかし,実際には
5384 \item 2行目は「あ」という和文文字で終わる(2行目を処理する前の時点では,
5385 「あ」は和文文字扱いである)ため,直後の改行文字は無視される.
5386 \item 3行目は「あ」という欧文文字で終わる(2行目を処理する前の時点では,
5387 「あ」は欧文文字扱いである)ため,直後の改行文字は空白に置き換わる.
5389 このため,トラブルを避けるために,和文文字の範囲を\verb+\ltjsetparameter+で編集した場合,
5390 その行はそこで改行するようにした方がいいだろう.
5394 %<en>\section{Insertion of JFM glues, \Param{kanjiskip} and \Param{xkanjiskip}}
5395 %<ja>\section{JFMグルーの挿入,\Param{kanjiskip}と\Param{xkanjiskip}}
5396 %<zh>\section{JFM的胶插入,\Param{kanjiskip}和\Param{xkanjiskip}}
5398 %<en>\subsection{Overview}
5399 %<ja>\subsection{概要}
5400 %<zh>\subsection{概要}
5402 \LuaTeX-jaにおける \textbf{JAglue} の挿入方法は,\pTeX のそれとは全く異なる.
5403 \pTeX では次のような仕様であった:
5405 \item JFMグルーの挿入は,和文文字を表すトークンを元に水平リストに(文字を表す)<char\_node>を
5407 \item \Param{xkanjiskip}の挿入は,水平ボックスへのパッケージングや行分割前に行われる.
5408 \item \Param{kanjiskip}はノードとしては挿入されない.パッケージングや行分割の計算時に
5409 「和文文字を表す2つの<char\_node>の間には\Param{kanjiskip}がある」ものとみなされる.
5411 しかし,\LuaTeX-jaでは,水平ボックスへのパッケージングや行分割前に全ての
5412 \textbf{JAglue},即ちJFMグルー・\Param{xkanjiskip}・\Param{kanjiskip}の
5413 3種類を一度に挿入することになっている.これは,\LuaTeX において欧文の合字・
5414 カーニング処理がノードベースになったことに対応する変更である.
5416 \LuaTeX-jaにおける\textbf{JAglue}挿入処理では,次節で定義する
5417 「クラスタ」を単位にして行われる.大雑把にいうと,「クラスタ」は文字とそれに付随す
5418 るノード達(アクセント位置補正用のカーンや,イタリック補正)をまとめたもの
5419 であり,2つのクラスタの間には,ペナルティ,\verb+\vadjust+,whatsitなど,行組版
5423 %<en>\subsection{definition of a `cluster'}
5424 %<ja>\subsection{「クラスタ」の定義}
5425 %<zh>\subsection{“cluster”定义}
5427 \def\OA{$\text{\sf O}_{\text{\sf A}}$}
5428 \def\OB{$\text{\sf O}_{\text{\sf B}}$}
5431 A \emph{cluster} is a list of consecutive nodes in one of the following forms,
5432 with the \textit{id} of it:
5435 \textbf{クラスタ}は以下の形のうちのどれかひとつをとる連続的なノードのリストである:
5439 \item Nodes whose value of\ \verb+\ltj@icflag+ is in $[3,15)$. These
5440 nodes come from a hbox which is already packaged, by unpackaging
5442 The \textit{id} is \textit{id\_pbox}.
5445 \item その \verb+\ltj@icflag+ の値が$[3,15)$に入るノードのリスト.
5446 これらのノードはある既にパッケージングされた水平ボックスから \verb+\unhbox+ で
5448 その\textit{id}は\textit{id\_pbox}である.
5452 \item A inline math formula, including two \textit{math\_node}s at the boundary of it.
5453 The \textit{id} is \textit{id\_math}.
5456 \item インライン数式でその境界に2つの\textit{math\_node}を含むもの.
5457 その\textit{id}は\textit{id\_math}である.
5461 \item A \textit{glyph\_node}~$p$ with nodes which relate with it:
5464 \item \textit{glpyh\_node}~$p$とそれに関係するノード:
5468 \item A kern for the italic correction of~$p$.
5471 \item $p$のイタリック補正のためのカーン.
5475 \item An accent attached to $p$ by \verb+\accent+.
5478 \item \verb+\accent+ による$p$に付随したアクセント.
5483 \Node{kern}{$\mathit{subtype}=2$}\longrightarrow
5484 \left\{\begin{array}{c}
5485 \Node{glyph}{accent}\\\noalign{\medskip}
5486 \Node{hbox}{accent (shifted vert.)}
5487 \end{array}\right\}\longrightarrow
5488 \Node{kern}{$\mathit{subtype}=2$}}^{\text{(a)}}
5490 \Node{glyph}{$p$}\longrightarrow
5492 \Node{kern}{italic corr.}}^{\text{(b)}}
5496 The \textit{id} is \textit{id\_jglyph} or
5497 \textit{id\_glyph}, according to whether the \textit{glyph\_node}
5498 represents a Japanese character or not.
5501 \textit{id}は\textit{glyph\_node}が和文文字を表すかどうかによって
5502 \textit{id\_jglyph},もしくは\textit{id\_glyph}となる.
5506 \item An box-like node, that is, an hbox, a vbox, a rule (\verb+\vrule+) and an \textit{unset\_node}.
5507 The \textit{id} is \textit{id\_hlist} if the node is an
5508 hbox which is not shifted vertically, or \textit{id\_box\_like}
5512 \item ボックス様のノード,つまり水平ボックス,垂直ボックス,罫線 (\verb+\vrule+),
5513 そして\textit{unset\_node}.
5514 その\textit{id}は垂直に移動していない水平ボックスならば\textit{id\_hlist},
5515 そうでなければ\textit{id\_box\_like}となる.
5519 \item A glue, a kern whose subtype is not 2~(\textit{accent}), and a discretionary break.
5520 The \textit{id} is \textit{id\_glue}, \textit{id\_kern}
5521 and \textit{id\_disc}, respectively.
5524 \item グルー,subtypeが 2~(\textit{accent})ではないカーン,そして任意改行.
5525 その\textit{id}はそれぞれ\textit{id\_glue}, \textit{id\_kern},そして
5526 \textit{id\_disc}である.
5530 Let \textit{Np}, \textit{Nq} and \textit{Nr} denote a cluster.
5533 以下では\textit{Np}, \textit{Nq}, \textit{Nr}でクラスタを表す.
5537 \paragraph{\textit{id}の意味}
5538 $\mathit{Np}.\mathit{id}$の意味を述べるとともに,
5539 「先頭の文字」を表す\textit{glyph\_node}~$\mathit{Np}.\mathit{head}$と,
5540 「最後の文字」を表す\textit{glyph\_node}~$\mathit{Np}.\mathit{tail}$を次のように定義する.
5541 直感的に言うと,\textit{Np}は$\mathit{Np}.\mathit{head}$で始まり$\mathit{Np}.\mathit{tail}$で終わるような単語,
5542 と見做すことができる.これら$\mathit{Np}.\mathit{head}$, $\mathit{Np}.\mathit{tail}$は
5543 説明用に準備した概念であって,実際のLuaコード中にそのように書かれているわけではないことに注意.
5546 \item[\textit{id\_jglyph}] 和文文字.\\
5547 $\mathit{Np}.\mathit{head}$, $\mathit{Np}.\mathit{tail}$は,その和文文字を表している
5548 \textit{glyph\_node}そのものである.
5549 \item[\textit{id\_glyph}] 和文文字を表していない\textit{glyph\_node}~$p$.\\
5550 多くの場合,$p$は欧文文字を格納しているが,`ffi'などの合字によって作られた
5551 \textit{glyph\_node}である可能性もある.
5552 前者の場合,$\mathit{Np}.\mathit{head}$,~$\mathit{Np}.\mathit{tail} = p$である.
5555 \item $\mathit{Np}.\mathit{head}$は,
5556 合字の構成要素の先頭→(その\textit{glyph\_node}における)合字の構成要素の先頭→……
5557 と再帰的に検索していってたどり着いた\textit{glyph\_node}である.
5558 \item $\mathit{Np}.\mathit{last}$は,同様に末尾→末尾→と検索してたどり着いた\textit{glyph\_node}である.
5560 \item[\textit{id\_math}] インライン数式.\\
5561 便宜的に,$\mathit{Np}.\mathit{head}$, $\mathit{Np}.\mathit{tail}$ともに
5562 「文字コード$-1$の欧文文字」とおく.
5563 \item[\textit{id\_hlist}] 縦方向にシフトされていない水平ボックス.\\
5564 この場合,$\mathit{Np}.\mathit{head}$, $\mathit{Np}.\mathit{tail}$はそれぞれ$p$の内容を表すリストの,
5567 \item 状況によっては,\TeX ソースで言うと
5569 \hbox{\hbox{abc}...\hbox{\lower1pt\hbox{xyz}}}
5571 のように,$p$の内容が別の水平ボックスで開始・終了している可能性も十分あり得る.そのような場合,
5572 $\mathit{Np}.\mathit{head}$, $\mathit{Np}.\mathit{tail}$の算出は,\textbf{垂直方向にシフトされていない}水平ボックスの
5573 場合だけ内部を再帰的に探索する.例えば上の例では,$\mathit{Np}.\mathit{head}$は文字「a」を表すノードであり,
5574 一方$\mathit{Np}.\mathit{tail}$は垂直方向にシフトされた水平ボックス,\verb+\lower1pt\hbox{xyz}+に対応するノードである.
5575 \item また,先頭にアクセント付きの文字がきたり,末尾にイタリック補正用のカーンが
5576 来ることもあり得る.この場合は,クラスタの定義のところにもあったように,それらは無視して算出を行う.
5577 \item 最初・最後のノードが合字によって作られた\textit{glyph\_node}のときは,それぞれに対して\textit{id\_glyph}%
5578 と同様に再帰的に構成要素をたどっていく.
5580 \item[\textit{id\_pbox}] 「既に処理された」ノードのリストであり,これらのノードが二度処理を受けないために
5581 まとめて1つのクラスタとして取り扱うだけである.
5582 \textit{id\_hlist}と同じ方法で$\mathit{Np}.\mathit{head}$, $\mathit{Np}.\mathit{tail}$を算出する,
5583 \item[\textit{id\_disc}] discretionary break (\verb+\discretionary{pre}{post}{nobreak}+).\\
5584 \textit{id\_hlist}と同じ方法で$\mathit{Np}.\mathit{head}$, $\mathit{Np}.\mathit{tail}$を算出するが,
5585 第3引数の \texttt{nobreak}(行分割が行われない時の内容)を使う.言い換えれば,ここで行分割が発生した時の状況は
5587 \item[\textit{id\_box\_like}] \textit{id\_hlist}とならないboxや,rule.\\
5588 この場合は,$\mathit{Np}.\mathit{head}$, $\mathit{Np}.\mathit{tail}$のデータは利用されないので,2つの算出は無意味である.
5589 敢えて明示するならば,$\mathit{Np}.\mathit{head}$, $\mathit{Np}.\mathit{tail}$は共にnil値である.
5590 \item[他] 以上にない\textit{id}に対しても,$\mathit{Np}.\mathit{head}$, $\mathit{Np}.\mathit{tail}$の算出は無意味.
5593 \paragraph{クラスタの別の分類}
5594 さらに,JFMグルー挿入処理の実際の説明により便利なように,\textit{id}とは別のクラスタの分類を行っておく.
5595 挿入処理では2つの隣り合ったクラスタの間に
5596 空白等の実際の挿入を行うことは前に書いたが,ここでの説明では,問題にしているクラスタ\textit{Np}は「後ろ側」のクラスタである
5597 とする.「前側」のクラスタについては,以下の説明で\textit{head}が\textit{last}に置き換わることに注意すること.
5599 \item[和文A] リスト中に直接出現している和文文字.
5600 \textit{id}が\textit{id\_jglyph}であるか,\\
5601 \textit{id}が\textit{id\_pbox}であって$\mathit{Np}.\mathit{head}$が\textbf{JAchar}であるとき.
5603 \item[和文B] リスト中の水平ボックスの中身の先頭として出現した和文文字.和文Aとの違いは,これの前に
5604 JFMグルーの挿入が行われない(\Param{xkanjiskip},~\Param{kanjiskip}は入り得る)ことである.\\
5605 \textit{id}が\textit{id\_hlist}か\textit{id\_disc}であって$\mathit{Np}.\mathit{head}$が\textbf{JAchar}であるとき.
5607 \item[欧文] リスト中に直接/水平ボックスの中身として出現している欧文文字.次の3つの場合が該当:
5609 \item \textit{id}が\textit{id\_glyph}である.
5610 \item \textit{id}が\textit{id\_math}である.
5611 \item \textit{id}が\textit{id\_pbox}か\textit{id\_hlist}か\textit{id\_disc}であって,$\mathit{Np}.\mathit{head}$が\textbf{ALchar}.
5613 \item[箱] box,またはそれに類似するもの.次の2つが該当:
5615 \item \textit{id}が\textit{id\_pbox}か\textit{id\_hlist}か\textit{id\_disc}であって,$\mathit{Np}.\mathit{head}$が\textit{glyph\_node}でない.
5616 \item \textit{id}が\textit{id\_box\_like}である.
5621 \subsection{段落/水平ボックスの先頭や末尾}
5623 まず,段落/水平ボックスの一番最初にあるクラスタ\textit{Np}を探索する.
5624 水平ボックスの場合は何の問題もないが,段落の場合では以下のノード達を事前に読み飛ばしておく:
5626 \verb+\parindent+由来の水平ボックス ($\mathit{subtype}=3$),及び\textit{subtype}が44~(\textit{user\_defined})でない
5629 これは,\verb+\parindent+由来の水平ボックスがクラスタを構成しないようにするためである.
5631 次に,\textit{Np}の直前に空白$g$を必要なら挿入する:
5633 \item この処理が働くような\textit{Np}は\textsf{和文A}である.
5634 \item 問題のリストが字下げありの段落(\verb+\parindent+由来の水平ボックスあり)の場合は,
5635 この空白$g$は「文字コード\texttt{'parbdd'}の文字」と\textit{Np}の間に入るグルー/カーンである.
5636 \item そうでないとき(\verb+noindent+で開始された段落や水平ボックス)は,
5637 $g$は「文字コード\texttt{'boxbdd'}の文字」と\textit{Np}の間に入るグルー/カーンである.
5639 ただし,もし$g$がglueであった場合,この挿入によって\textit{Np}による行分割が新たに可能になるべきではない.
5640 そこで,以下の場合には,$g$の直前に\verb+\penalty10000+を挿入する:
5642 \item 問題にしているリストが段落であり,かつ
5643 \item \textit{Np}の前には予めペナルティがなく,$g$はglue.
5647 末尾の処理は,問題のリストが段落のものか水平ボックスのものかによって異なる.
5648 後者の場合は容易い:最後のクラスタを\textit{Nq}とおくと,\textit{Nq}と「文字コード\texttt{'boxbdd'}の文字」の間に入るグルー/カーンを,
5649 \textit{Nq}の直後に挿入するのみである.
5651 一方.前者(段落)の場合は,リストの末尾は常に\verb+\penalty10000+と,
5652 \verb+\parfillskip+由来のグルーが存在する.よって,最後のクラスタ\textit{Np}は
5653 この\verb+\parfillskip+由来のグルーとなり,実質的な中身の最後はその1つ前のクラスタ\textit{Nq}となる.
5655 \item まず\textit{Nq}の直後に(後に述べる)\textsf{line-end~[E]}によって定まる空白を挿入する.
5656 \item 次に,段落の最後の「通常の和文文字${}+{}$句点」が独立した行となるのを防ぐために,
5657 \Param{jcharwidowpenalty}の値の分だけ適切な場所のペナルティを増やす.
5659 ペナルティ量を増やす場所は,\textit{head}が\textbf{JAchar}であり,かつその文字の\Param{kcatcode}が偶数であるような
5660 最後のクラスタの直前にあるものたちである\footnote{大雑把に言えば,\Param{kcatcode}が奇数であるような\textbf{JAchar}
5661 を約物として考えていることになる.\Param{kcatcode}の最下位ビットはこの\Param{jcharwidowpenalty}用にのみ利用される.}.
5664 \subsection{概観と典型例:2つの「和文A」の場合}
5665 先に述べたように,2つの隣り合ったクラスタ,\textit{Nq}と\textit{Np}の間には,
5666 ペナルティ,\verb+\vadjust+,whatsitなど,行組版には関係しないものがある.模式的に表すと,
5668 \Node{cluster}{\textit{Nq}}\longrightarrow
5670 \Node{penalty}{$p$}\longrightarrow \cdots\longrightarrow \Node{whatsit}{}}^{(a)}
5671 \longrightarrow \Node{cluster}{\textit{Np}}
5673 のようになっている.間の(a)に相当する部分には,何のノードもない場合ももちろんあり得る.
5674 そうして,JFMグルー挿入後には,この2クラスタ間は次のようになる:
5676 \Node{cluster}{\textit{Nq}}\longrightarrow\Node{kern}{左空白}\longrightarrow
5678 \Node{penalty}{$p+x$}\longrightarrow \cdots\longrightarrow \Node{whatsit}{}}^{(a)}
5679 \longrightarrow \Node{glue or kern}{右空白}\longrightarrow \Node{cluster}{\textit{Np}}
5682 以後,\textbf{典型的な例として,クラスタ\textit{Nq}と\textit{Np}が共に\textsf{\textmd{和文A}}である場合を見ていこう,}
5685 \paragraph{「右空白」の算出}
5686 まず,「右空白」にあたる量を算出する.通常はこれが,隣り合った2つの和文文字間に入る空白量となる.
5688 \item[JFM由来{[M]}] JFMの文字クラス指定によって入る空白を以下によって求める.この段階で空白量が未定義(未指定)だった場合,
5689 デフォルト値\Param{kanjiskip}を採用することとなるので,次へ.
5691 \item もし両クラスタの間で\verb+\inhibitglue+が実行されていた場合(証としてwhatsitノードが自動挿入される),
5692 代わりに\Param{kanjiskip}が挿入されることとなる.次へ.
5693 \item \textit{Nq}と\textit{Np}が同じJFM・同じ\texttt{jfmvar}キー・同じサイズの和文フォントであったならば,
5694 共通に使っているJFM内で挿入される空白(グルーかカーン)が決まっているか調べ,決まっていればそれを採用.
5695 \item 1.でも2.でもない場合は,\textit{Nq}と\textit{Np}が違うJFM/\texttt{jfmvar}/サイズである.
5698 \vcenter{\halign{\hfil$#:={}$&\inhibitglue#\inhibitglue\cr
5699 gb&(\textit{Nq}と「使用フォントが\textit{Nq}のそれと同じで,\hfil\cr
5700 \omit&\quad 文字コードが\textit{Np}のそれの文字」との間に入るグルー/カーン)\hfil\cr
5701 ga&(\inhibitglue 「使用フォントが\textit{Np}のそれと同じで,\hfil\cr
5702 \omit&\quad 文字コードが\textit{Nq}のそれの文字」と\textit{Np}との間に入るグルー/カーン)\hfil\cr
5705 として,前側の文字のJFMを使った時の空白(グルー/カーン)と,後側の文字のJFMを使った時のそれを求める.
5707 $\mathit{gb}$,~$\mathit{ga}$それぞれに対する<dir>の値を$d_b$,~$d_a$とする.
5710 $\mathit{ga}$と$\mathit{gb}$の両方が未定義であるならば,JFM由来のグルーは挿入されず,\Param{kanjiskip}を採用することとなる.どちらか片方のみが未定義であるならば,次のステップでその未定義の方は長さ0のkernで,<dir>の値は0であるかのように扱われる.
5712 \Param{differentjfm}の値が\texttt{pleft}, \texttt{pright}, \texttt{paverage}のとき,
5713 <dir>の指定に従って比例配分を行う.
5714 JFM由来のグルー/カーンは以下の値となる:
5716 f\left(\frac{1-d_b}2\textit{gb} + \frac{1+d_b}2\textit{ga},
5717 \frac{1-d_a}2\textit{gb} + \frac{1+d_a}2\textit{ga}\right)
5721 f(x,y)=\begin{cases}
5722 x&\text{if\ }\Param{differentjfm}=\texttt{pleft};\\
5723 y&\text{if\ }\Param{differentjfm}=\texttt{pright};\\
5724 (x+y)/2&\text{if\ }\Param{differentjfm}=\texttt{paverage};
5728 \Param{differentmet}がそれ以外の値の時は,<dir>の値は無視され,JFM由来のグルー/カーンは以下の値となる:
5730 f(\textit{gb},\textit{ga})
5734 f(x,y)=\begin{cases}
5735 \min(x,y)&\text{if\ }\Param{differentjfm}=\texttt{small};\\
5736 \max(x,y)&\text{if\ }\Param{differentjfm}=\texttt{large};\\
5737 (x+y)/2&\text{if\ }\Param{differentjfm}=\texttt{average};\\
5738 x+y&\text{if\ }\Param{differentjfm}=\texttt{both};
5746 \jfont\foo=psft:Ryumin-Light:jfm=ujis
5747 \jfont\bar=psft:GothicBBB-Medium:jfm=ujis
5748 \jfont\baz=psft:GothicBBB-Medium:jfm=ujis;jfmvar=piyo
5752 \overbrace{\Node{glyph}{{\tt\char92 foo}, `あ'}}^{p}
5753 \longrightarrow \overbrace{\Node{glyph}{{\tt\char92 bar}, `い'}}^{q}
5754 \longrightarrow \overbrace{\Node{glyph}{{\tt\char92 baz}, `う'}}^{r}
5756 という3ノードを考える(それぞれ単独でクラスタをなす).
5757 この場合,$p$と$q$の間は,実フォントが異なるにもかかわらず(2)の状況となる一方で,
5758 $q$と$r$の間は(実フォントが同じなのに)\texttt{jfmvar}キーの内容が異なるので(3)の状況となる.
5759 \item[\Param{kanjiskip}~{[K]}] 上の[M]において空白が定まらなかった場合,
5760 \Param{kanjiskip}の値を以下で定め,それを「右空白」として採用する.
5761 この段階においては,\verb+\inhibitglue+は効力を持たないため,
5762 結果として,2つの和文文字間には常に何らかのグルー/カーンが挿入されることとなる.
5764 \item 両クラスタ(厳密には$\mathit{Nq}.\mathit{tail}$,$\mathit{Np}.\mathit{head}$)の中身の文字コードに対する
5765 \Param{autospacing}パラメタが両方ともfalseだった場合は,長さ0のglueとする.
5766 \item ユーザ側から見た\Param{kanjiskip}パラメタの自然長が${\tt \char92 maxdimen}=(2^{30}-1)\,{\rm sp}$で
5767 なければ,\Param{kanjiskip}パラメタの値を持つglueを採用する.
5768 \item 2.でない場合は,\textit{Nq}, \textit{Np}で使われているJFMに指定されている\Param{kanjiskip}の値を用いる.
5769 どちらか片方のクラスタだけが和文文字(\textsf{和文A}・\textsf{和文B})のときは,そちらのクラスタで使われている
5770 JFM由来の値だけを用いる.もし両者で使われているJFMが異なった場合は,上の[M]~3.と同様の方法を用いて調整する.
5773 \paragraph{「左空白」の算出とそれに伴う補正}
5774 「左空白」は過去のバージョンでは定義していたが,このバージョンでは挿入は一切行われない(機能自体削除している).しかし,仕様は流動的であり,将来復活する可能性もあるため,マニュアル中の記述は今のところ極力変更しない.
5775 % 次に,「左空白」にあたる量を算出する:
5776 % \begin{description}
5777 % \item[line-end~{[E]}]
5778 % \textit{Nq}と\textit{Np}の間で行分割が起きたときに,
5779 % \textit{Nq}と行末の間に入る空白である.ぶら下げ組の組版などに用いられることを期待している.
5781 % \item 既に算出した「右空白」がカーンである場合は,「左空白」は挿入されない.
5782 % \item 「右空白」がglueか未定義(長さ0のglueとみなす)の場合は,「左空白」は
5783 % \textit{Nq}と「文字コード\texttt{'lineend'}の文字」との間に入るカーンとして,JFMから決定される.
5784 % \item 2.で決まった「左空白」の長さが0でなければ,その分だけ先ほど算出した「右空白」の自然長を引く.
5787 \paragraph{禁則用ペナルティの挿入}
5790 a:=(\text{\textit{Nq}{\footnotemark}の文字に対する\Param{postbreakpenalty}の値})
5791 +(\text{\textit{Np}{\footnotemark}の文字に対する\Param{prebreakpenalty}の値})
5793 とおく\footnotetext{厳密にはそれぞれ$\mathit{Nq}.\mathit{tail}$,$\mathit{Np}.\mathit{head}$.}.
5794 ペナルティは通常$[-10000,10000]$の整数値をとり,また$\pm 10000$は正負の無限大を意味することになっているが,この$a$の
5797 $a$は禁則処理用に\textit{Nq}と\textit{Np}の間に加えられるべきペナルティ量である.
5799 \item[P-normal~{[PN]}]
5800 \textit{Nq}と\textit{Np}の間の(a)部分にペナルティ(\textit{penalty\_node})があれば処理は簡単である:
5801 それらの各ノードにおいて,ペナルティ値を($\pm 10000$を無限大として扱いつつ)$a$だけ増加させればよい.
5802 また,$10000 + (-10000) = 0$としている.
5804 少々困るのは,(a)部分にペナルティが存在していない場合である.
5805 直感的に,補正すべき量$a$が0でないとき,その値をもつ\textit{penalty\_node}を作って
5806 「右空白」の(もし未定義なら\textit{Np}の)直前に挿入……
5807 ということになるが,実際には僅かにこれより複雑である.
5809 \item 「右空白」がカーンであるとき,
5810 それは「\textit{Nq}と\textit{Np}の間で改行は許されない」ことを意図している.そのため,
5811 この場合は$a\neq 0$であってもペナルティの挿入はしない.
5812 \item 「左空白」がカーンとしてきっちり定義されている時(このとき,「右空白」はカーンでない),
5813 この「左空白」の直後での行分割を許容しないといけないので,$a=0$であっても
5814 \textit{penalty\_node}を作って挿入する.
5815 \item 以上のどれでもないときは,$a\neq 0$ならば\textit{penalty\_node}を作って挿入する.
5819 \def\gkf#1#2#3{\sf$\displaystyle\vphantom{\Bigg(}%
5820 \frac{\hbox to 1\zw{#1}\hbox to 4.5\zw{\hss #2}}{\hbox{#3}}$}
5822 %<en>\caption{Summary of JFM glues.}
5823 %<ja>\caption{JFM グルーの概要.}
5824 %<zh>\caption{JFM胶总结。}
5828 \begin{tabular}{c|cccccc}
5830 {\bf\textit{Np}}↓&\sf 和文A&\sf 和文B&\sf 欧文&\sf 箱&\sf glue&\sf kern\\\midrule
5833 \gkf{---}{\OA →K}{PN}&
5834 \gkf{---}{\OA →X}{PN}&
5837 \gkf{---}{\OA}{PS}\\
5843 \gkf{E}{\OB →X}{PA}&
5845 \sf 箱&\gkf{E}{\OB}{PA}\\
5846 \sf glue&\gkf{E}{\OB}{PN}\\
5847 \sf kern&\gkf{E}{\OB}{PS}\\
5853 Here {\small\gkf{E}{M→K}{PN}} means that
5856 ここで {\small\gkf{E}{M→K}{PN}} は次の意味である:
5860 \item To determine the `right-space', \LuaTeX-ja first attempts by the method `\textsf{JFM-origin~[M]}'.
5861 If this attempt fails, \LuaTeX-ja use the method `\textsf{\Param{kanjiskip}~[K]}'.
5864 \item 「右空白」を決めるために,\LuaTeX-ja はまず「JFM由来{[M]}」の方法を試みる.
5865 これが失敗したら,\LuaTeX-ja は「\Param{kanjiskip}~{[K]}」の方法を試みる.
5869 \item The `left space' between \textit{Nq}~and~\textit{Np} is determined by the method `\textsf{line-end~[E]}'.
5872 \item \textit{Nq} と \textit{Np} の間の「左空白」は「\textsf{line-end~[E]}」の
5877 \item \LuaTeX-ja adopts the method `\textsf{P-normal~[PN]}' to adjust the penalty between two clusters for \emph{kinsoku shori}.
5880 \item \LuaTeX-jaは2つのクラスタの間の禁則処理用のペナルティを調節するために「\textsf{P-normal~[PN]}」の方法を採用する.
5887 本節の内容は表\ref{tab-jfmglue}にまとめてある.
5889 \paragraph{和文Aと欧文の間}
5890 \textit{Nq}が\textsf{和文A}で,\textit{Np}が\textsf{欧文}の場合,JFMグルー挿入処理は次のようにして行われる.
5892 \item 「右空白」については,まず以下に述べる\textsf{Boundary-B~[\OB]}により空白を決定しようと試みる.
5893 それが失敗した場合は,\textsf{\Param{xkanjiskip}~[X]}によって定める.
5894 \item 「左空白」については,既に述べた\textsf{line-end~[E]}をそのまま採用する.それに伴う「右空白」の補正も同じ.
5895 \item 禁則用ペナルティも,以前述べた\textsf{P-normal~[PN]}と同じである.
5898 \item[Boundary-B~{[\OB]}] 和文文字と「和文でないもの」との間に入る空白を以下によって求め,
5899 未定義でなければそれを「右空白」として採用する.
5900 \textsf{JFM-origin~[M]}の変種と考えて良い.
5901 これによって定まる空白の典型例は,和文の閉じ括弧と欧文文字の間に入る半角アキである.
5903 \item もし両クラスタの間で\verb+\inhibitglue+が実行されていた場合(証としてwhatsitノードが自動挿入される),次へ.
5905 \textit{Nq}と「文字コードが{\tt'jcharbdd'}の文字」との間に入るグルー/カーンとして定まる.
5907 \item[\Param{xkanjiskip}~{[X]}]
5908 この段階では,\textsf{\Param{kanjiskip}~[K]}のときと同じように,
5909 \Param{xkanjiskip}の値を以下で定め,それを「右空白」として採用する.
5910 この段階で\verb+\inhibitglue+は効力を持たないのも同じである.
5912 \item 以下のいずれかの場合は,\Param{xkanjiskip}の挿入は抑止される.しかし,実際には行分割を許容するために,長さ0のglueを採用する:
5914 \item 両クラスタにおいて,それらの中身の文字コードに対する\Param{autoxspacing}パラメタが共にfalseである.
5915 \item \textit{Nq}の中身の文字コードについて,「直後への\Param{xkanjiskip}の挿入」が禁止されている
5916 (つまり,\Param{jaxspmode}~(or \Param{alxspmode})パラメタが2以上).
5917 \item \textit{Np}の中身の文字コードについて,「直前への\Param{xkanjiskip}の挿入」が禁止されている
5918 (つまり,\Param{jaxspmode}~(or \Param{alxspmode})パラメタが偶数).
5920 \item ユーザ側から見た\Param{xkanjiskip}パラメタの自然長が${\tt \char92 maxdimen}=(2^{30}-1)\,{\rm sp}$で
5921 なければ,\Param{xkanjiskip}パラメタの値を持つglueを採用する.
5922 \item 2.でない場合は,\textit{Nq}, \textit{Np}(\textsf{和文A}/\textsf{和文B}なのは片方だけ)
5923 で使われているJFMに指定されている\Param{xkanjiskip}の値を用いる.
5927 \paragraph{欧文と和文Aの間}
5928 \textit{Nq}が\textsf{欧文}で,\textit{Np}が\textsf{和文A}の場合,JFMグルー挿入処理は上の場合とほぼ同じである.
5929 \textsf{和文A}のクラスタが逆になるので,\textsf{Boundary-A~[\OA]}の部分が変わるだけ.
5931 \item 「右空白」については,まず以下に述べる\textsf{Boundary-A~[\OA]}により空白を決定しようと試みる.
5932 それが失敗した場合は,\textsf{\Param{xkanjiskip}~[X]}によって定める.
5933 \item \textit{Nq}が和文でないので,「左空白」は算出されない.
5934 \item 禁則用ペナルティは,以前述べた\textsf{P-normal~[PN]}と同じである.
5937 \item[Boundary-A~{[\OA]}] 「和文でないもの」と和文文字との間に入る空白を以下によって求め,
5938 未定義でなければそれを「右空白」として採用する.
5939 \textsf{JFM-origin~[M]}の変種と考えて良い.
5940 これによって定まる空白の典型例は,欧文文字と和文の開き括弧との間に入る半角アキである.
5942 \item もし両クラスタの間で\verb+\inhibitglue+が実行されていた場合(証としてwhatsitノードが自動挿入される),次へ.
5944 「文字コードが{\tt'jcharbdd'}の文字」と\textit{Np}との間に入るグルー/カーンとして定まる.
5948 \paragraph{和文Aと箱・グルー・カーンの間}
5949 \textit{Nq}が\textsf{和文A}で,\textit{Np}が\textsf{箱}・グルー・カーンのいずれかであった場合,
5950 両者の間に挿入されるJFMグルーについては同じ処理である.しかし,そこでの行分割に対する仕様が異なるので,
5951 ペナルティの挿入処理は若干異なったものとなっている.
5954 \item 「右空白」については,既に述べた\textsf{Boundary-B~[\OB]}により空白を決定しようと試みる.
5955 それが失敗した場合は,「右空白」は挿入されない.
5956 \item 「左空白」については,既に述べた\textsf{line-end~[E]}の算出方法をそのまま採用する.それに伴う「右空白」の補正も同じ.
5957 \item 禁則用ペナルティの処理は,後ろのクラスタ\textit{Np}の種類によって異なる.
5958 なお,$\mathit{Np}.\mathit{head}$は無意味であるから,
5959 「$\mathit{Np}.\mathit{head}$に対する\Param{prebreakpenalty}の値」は0とみなされる.言い換えれば,
5961 a:=(\text{\textit{Nq}{\footnotemark}の文字に対する\Param{postbreakpenalty}の値}).
5964 \item[箱] \textit{Np}が\textsf{箱}であった場合は,両クラスタの間での行分割は
5965 (明示的に両クラスタの間に\verb+\penalty10000+があった場合を除き)いつも許容される.そのため,
5966 ペナルティ処理は,後に述べる\textsf{P-allow~[PA]}が\textsf{P-normal~[PN]}の代わりに用いられる.
5967 \item[グルー] \textit{Np}がグルーの場合,ペナルティ処理は\textsf{P-normal~[PN]}を用いる.
5968 \item[カーン] \textit{Np}がカーンであった場合は,両クラスタの間での行分割は
5969 (明示的に両クラスタの間にペナルティがあった場合を除き)許容されない.
5970 ペナルティ処理は,後に述べる\textsf{P-suppress~[PS]}を使う.
5972 これらの\textsf{P-normal~[PN]},\textsf{P-allow~[PA]},\textsf{P-suppress~[PS]}の違いは,
5973 \textit{Nq}と\textit{Np}の間(以前の図だと(a)の部分)にペナルティが存在しない場合にのみ存在する.
5977 \item[P-allow~{[PA]}]
5978 \textit{Nq}と\textit{Np}の間の(a)部分にペナルティがあれば,\textsf{P-normal~[PN]}と同様に,
5979 それらの各ノードにおいてペナルティ値を$a$だけ増加させる.
5981 (a)部分にペナルティが存在していない場合,
5982 \LuaTeX-ja は\textit{Nq}と\textit{Np}の間の行分割を可能にしようとする.
5983 そのために,以下の場合に$a$をもつ\textit{penalty\_node}を作って
5984 「右空白」の(もし未定義なら\textit{Np}の)直前に挿入する:
5986 \item 「右空白」がグルーでない(カーンか未定義)であるとき.
5987 \item 「左空白」がカーンとしてきっちり定義されている時.
5990 \item[P-suppress~{[PS]}]
5991 \textit{Nq}と\textit{Np}の間の(a)部分にペナルティがあれば,\textsf{P-normal~[PN]}と同様に,
5992 それらの各ノードにおいてペナルティ値を$a$だけ増加させる.
5994 (a)部分にペナルティが存在していない場合,
5995 \textit{Nq}と\textit{Np}の間の行分割は元々不可能のはずだったのであるが,
5996 \LuaTeX-ja はそれをわざわざ行分割可能にはしない.
5997 そのため,「右空白」がglueであれば,その直前に\verb+\penalty10000+を挿入する.
6000 なお,「右空白」はカーン,「左空白」は未定義の
6002 \overbrace{\Node{glyph}{`あ'}}^{\mathit{Nq}}\longrightarrow \overbrace{\Node{glue}{1\,pt}}^{\mathit{Np}}
6005 このとき,$a$,即ち「あ」の\Param{postbreakpenalty}がいかなる値であっても,
6008 \overbrace{\Node{glyph}{`あ'}}^{\mathit{Nq}}\longrightarrow
6009 \Node{kern}{右空白}\longrightarrow \overbrace{\Node{glue}{1\,pt}}^{\mathit{Np}}
6012 となり,$a$分のペナルティは挿入されないことに注意して欲しい.
6013 \Param{postbreakpenalty}は($a$は)殆どの場合が非負の値と考えられ,そのような場合では
6016 \overbrace{\Node{glyph}{`あ'}}^{\mathit{Nq}}\longrightarrow
6017 \Node{penalty}{$a$}\longrightarrow
6018 \Node{kern}{右空白}\longrightarrow \overbrace{\Node{glue}{1\,pt}}^{\mathit{Np}}
6021 \footnote{kern$\rightarrow$glueが1つの行分割可能点(行分割に伴うペナルティは0)
6022 であるため,たとえ$a=10000$であっても,\textit{Nq}と\textit{Np}の間で行分割を禁止することはできない.}.
6024 \paragraph{箱・グルー・カーンと和文Aの間}
6025 \textit{Np}が\textsf{箱}・グルー・カーンのいずれかで,\textit{Np}が\textsf{和文A}であった場合は,
6026 すぐ上の(\textit{Nq}と\textit{Np}の順序が逆になっている)場合とほぼ同じであるが,「左空白」がなくなることにのみ注意.
6028 \item 「右空白」については,既に述べた\textsf{Boundary-A~[\OA]}により空白を決定しようと試みる.
6029 それが失敗した場合は,「右空白」は挿入されない.
6030 \item \textit{Nq}が和文でないので,「左空白」は算出されない.
6031 \item 禁則用ペナルティの処理は,\textit{Nq}の種類によって異なる.
6032 $\mathit{Nq}.\mathit{tail}$は無意味なので,
6034 a:=(\text{\textit{Np}{\footnotemark}の文字に対する\Param{prebreakpenalty}の値}).
6037 \item[箱] \textit{Nq}が\textsf{箱}の場合は,\textsf{P-allow~[PA]}を用いる.
6038 \item[グルー] \textit{Nq}がグルーの場合は,\textsf{P-normal~[PN]}を用いる.
6039 \item[カーン] \textit{Nq}がカーンの場合は,\textsf{P-suppress~[PS]}を用いる.
6043 \paragraph{和文Aと和文Bの違い}
6044 先に述べたように,\textsf{和文B}は水平ボックスの中身の先頭(or 末尾)として出現している
6045 和文文字である.リスト内に直接ノードとして現れている和文文字(\textsf{和文A})との違いは,
6047 \item \textsf{和文B}に対しては,JFMの文字クラス指定から定まる空白
6048 \textsf{JFM-origin~[M]},\textsf{Boundary-A~[\OA]},\textsf{Boundary-B~[\OB]})の挿入は行われない.
6051 \item 片方が\textsf{和文A},もう片方が\textsf{和文B}のクラスタの場合,
6052 \textsf{Boundary-A~[\OA]}または\textsf{Boundary-B~[\OB]}の挿入を試み,それがダメなら
6053 \Param{kanjiskip}~\textsf{[K]}の挿入を行う.
6054 \item \textsf{和文B}の2つのクラスタの間には,\Param{kanjiskip}~\textsf{[K]}が自動的に入る.
6056 \item \textsf{和文B}と箱・グルー・カーンが隣接したとき(どちらが前かは関係ない),間にJFMグルー・ペナルティの挿入は一切しない.
6057 \item \textsf{和文B}と\textsf{和文B},また\textsf{和文B}と\textsf{欧文}とが隣接した時は,禁則用ペナルティ挿入処理は
6058 \textsf{P-suppress~[PS]}が用いられる.
6059 \item \textsf{和文B}の文字に対する\Param{prebreakpenalty},~\Param{postbreakpenalty}の値は使われず,0として計算される.
6070 \item 1行目の\verb+\inhibitglue+は\textsf{Boundary-B~[\OB]}の処理のみを抑止するので,ピリオドと「A」の間には
6071 \Param{xkanjiskip}(四分アキ)が入ることに注意.
6072 \item 2行目のピリオドと「A」の間においては,前者が\textsf{和文B}となる(水平ボックスの中身の末尾として登場しているから)ので,
6073 そもそも\textsf{Boundary-B~[\OB]}の処理は行われない.よって,\Param{xkanjiskip}が入ることとなる.
6074 \item 3行目では,ピリオドの属するクラスタは\textsf{和文A}である.これによって,
6075 ピリオドと「A」の間には\textsf{Boundary-B~[\OB]}由来の半角アキが入ることになる.
6080 %<en>\section{Patch for the \Pkg{listings} package}
6081 %<ja>\section{\Pkg{listings} パッケージへの対応}
6084 It is well-known that the \Pkg{listings} package outputs weird results
6086 The \Pkg{listings} package makes most of letters active and assigns
6087 output command for each letter \cite{listings}.
6088 But Japanese characters are not included in these activated letters.
6089 For \pTeX{} series, there is no method to make Japanese characters active;
6090 a patch \Pkg{jlisting.sty} \cite{jlisting} resolves the problem forcibly.
6093 \Pkg{listings} パッケージが,そのままでは日本語をまともに出力できないこと
6094 はよく知られている.きちんと整形して出力するために,\Pkg{listings}パッケー
6095 ジは内部で「ほとんどの文字」をアクティブにし,各文字に対してその文字の出
6096 力命令を割り当てている \cite{listings}.
6097 しかし,そこでアクティブにする文字の中に,和文文
6098 字がないためである.\pTeX 系列では,和文文字をアクティブにする手法がなく,
6099 \Pkg{jlisting.sty} というパッチ\cite{jlisting}を用いることで無理やり解決していた.
6103 In \LuaTeX-ja, the problem is resolved by using \verb+process_input_buffer+ callback.
6104 The callback function inserts the output command before each letter above U+0080.
6105 This method can omits the process to make all Japanese characters active
6106 (most of the activated characters are not used in many cases).
6109 \LuaTeX-jaでは,\verb+process_input_buffer+ コールバックを利用することで,
6110 「各行に出現するU+0080以降の文字に対して,それらの出力命令を前置する」という方法をとっている.
6111 これにより,(入力には使用されていないかもしれない)和文文字をもすべてアクティブ化する手間もなく,
6116 If \Pkg{listings.sty} and \LuaTeX-ja were loaded,
6117 then the patch \Pkg{lltjp-listings.sty} is loaded automatically at \verb+\begin{document}+.
6120 \LuaTeX-ja で利用される \Pkg{listings} パッケージへのパッチ \Pkg{lltjp-listings.sty} は,
6121 \Pkg{listings.sty} と\LuaTeX-jaを読み込んでおけば,
6122 \verb+\begin{document}+ の箇所において自動的に読み込まれるので,通常はあまり
6126 %<en>\paragraph{Class of characters}
6127 %<ja>\paragraph{文字種}
6130 Roughly speaking, the \Pkg{listings} package processes input as follows:
6133 \Pkg{listings} パッケージの内部では,大雑把に言うと
6137 \item Collects \textit{letters} and \textit{digits}, which can be used for the name of identifiers.
6140 \item 識別子として使える文字 (``letter'',~``digit'') たちを
6145 \item When reading an \textit{other}, outputs the collected character string (with modification, if needed).
6148 \item letterでもdigitでもない文字が現れた時に,収集した文字列を(必要なら修飾して)出力する.
6152 \item Collects \textit{others}.
6155 \item 今度は逆に,letterでない文字たちをletterが現れるまで集める.
6159 \item When reading a \textit{letter} or a \textit{digit}, outputs the collected character string.
6162 \item letterが出現したら集めた文字列を出力する.
6166 \item Turns back to 1.
6173 By the above process, line breaks inside of an identifier are blocked.
6174 A flag \verb+\lst@ifletter+ indicates whether the previous character can be used
6175 for the name of identifiers or not.
6178 という処理が行われている.これにより,識別子の途中では行分割が行われないようになっている.
6179 直前の文字が識別子として使えるか否かは \verb+\lst@ifletter+ というフラグに格納されている.
6183 For Japanese characters, line breaks are permitted on both sides
6184 except for parentheses, dashes, etc.
6185 To process Japanese characters,
6186 The pacth \Pkg{lltjp-listings.sty} introduces a new flag \verb+\lst@ifkanji+, which indicates
6187 whether the previous character is Japanese character or not.
6188 For illustration, we introduce the following classes of character:
6191 さて,日本語の処理である.殆どの和文文字の前後では行分割が可能であるが,その一方で
6192 括弧類や音引きなどでは禁則処理が必要なことから,\Pkg{lltjp-listings.sty} では,
6193 直前が和文文字であるかを示すフラグ \verb+\lst@ifkanji+ を新たに導入した.
6194 以降,説明のために以下のように文字を分類する:
6198 \begin{tabular}{lccccc}
6200 &Letter&Other&Kanji&Open&Close\\\midrule
6201 \verb+\lst@ifletter+&T&F&T&F&T\\
6202 \verb+\lst@ifkanji+&F&F&T&T&F\\
6203 %<en>Meaning&identifier char&other alphabet&most of Japanese char&open paren&close paren\\
6204 %<ja>意図&識別子中の文字&その他欧文文字&殆どの和文文字&開き括弧類&閉じ括弧類\\
6209 Note that \textit{digits} in the \Pkg{listings} package can be Letter or
6210 Other according to circumstances.
6213 なお,本来の\Pkg{listings} パッケージでの分類``digit''は,
6214 出現状況によって,上の表のLetterとOtherのどちらにもなりうる.
6215 また,KanjiとCloseは \verb+\lst@ifletter+ と \verb+\lst@ifkanji+ の値が一致しているが,
6220 For example, let us consider the case an Open comes after a Letter.
6221 Since an Open represents Japanese open parenthesis,
6222 it is preferred to be permitted to insert line break after the Letter.
6223 Therefore, the collected character string is output in this case.
6226 例えば,Letterの直後にOpenが来た場合を考える.
6227 文字種Openは和文開き括弧類を想定しているので,Letterの直後では行分割が可能であることが望ましい.
6228 そのため,この場合では,すでに収集されている文字列を出力することで行分割を許容するようにした.
6232 The following table summarizes $5\times 5=25$ cases:
6235 同じように,$5\times 5=25$通り全てについて書くと,次のようになる:
6239 \begin{tabular}{llccccc}
6242 &&\multicolumn{4}{c}{Next}\\\cmidrule(lr){3-7}
6243 &&\hbox to 4em{\hss Letter\hss}&\hbox to 4em{\hss Other\hss}
6244 &\hbox to 4em{\hss Kanji\hss}&\hbox to 4em{\hss Open\hss}&Close\\\midrule
6245 &Letter&collects&\multicolumn{3}{c}{\hrulefill \ outputs\ \hrulefill}&collects\\
6246 &Other&outputs&collects&\multicolumn{2}{c}{\hrulefill \ outputs\ \hrulefill}&collects\\
6247 Prev&Kanji&\multicolumn{4}{c}{\hrulefill \ outputs\ \hrulefill}&collects\\
6248 &Open&\multicolumn{5}{c}{\hrulefill \ collects\ \hrulefill}\\
6249 &Close&\multicolumn{4}{c}{\hrulefill \ outputs\ \hrulefill}&collects\\
6252 &&\multicolumn{4}{c}{後ろ側の文字}\\\cmidrule(lr){3-7}
6253 &&\hbox to 4em{\hss Letter\hss}&\hbox to 4em{\hss Other\hss}
6254 &\hbox to 4em{\hss Kanji\hss}&\hbox to 4em{\hss Open\hss}&Close\\\midrule
6255 直&Letter&収集&\multicolumn{3}{c}{\hrulefill \ 出力\ \hrulefill}&収集\\
6256 前&Other&出力&収集&\multicolumn{2}{c}{\hrulefill \ 出力\ \hrulefill}&収集\\
6257 文&Kanji&\multicolumn{4}{c}{\hrulefill \ 出力\ \hrulefill}&収集\\
6258 字&Open&\multicolumn{5}{c}{\hrulefill \ 収集\ \hrulefill}\\
6259 種&Close&\multicolumn{4}{c}{\hrulefill \ 出力\ \hrulefill}&収集\\
6264 %<en>In the above table,
6267 %<en>\item ``outputs'' means to output the collected character string (i.e., line breaking is permitted there).
6268 %<ja>\item 「出力」は,それまでに集めた文字列を出力(≒ここで行分割可能)を意味する.
6270 %<en>\item ``collects'' means to append the next character to the collected character string (i.e., line breaking is prohibited there).
6271 %<ja>\item 「収集」は,後側の文字を,現在収集された文字列に追加(行分割不可)を意味する.
6274 %<en>\paragraph{Classification of characters}
6275 %<ja>\paragraph{和文文字扱いとなる文字}
6278 Characters are classified according to \Param{jacharrange} parameter (see Section \ref{ssec-setrange}):
6281 \Pkg{listings} パッケージにおいて和文文字と扱われる
6282 (前に述べたKanji, Open,あるいは「閉じ括弧類」分類)か否かは,
6283 通常の\textbf{JAchar}/\textbf{Alchar}の範囲の設定(\Param{jacharrange} パラメータ,\ref{ssec-setrange}節を参照)に従って行われる:
6286 %<en>\item \textbf{ALchars} above U+0080 are Letter.
6287 %<ja>\item (U+0080以降の)\textbf{ALchar}は,すべてLetter扱いである.
6289 %<en>\item \textbf{JAchars} are classified in the order as follows:
6290 %<ja>\item (U+0080以降の)\textbf{JAchar}については,以下の順序に従って文字種を決める:
6292 %<en>\item Characters whose \Param{prebreakpenalty} is greater than or equal to 0 are Open.
6293 %<ja>\item \Param{prebreakpenalty} が0以上の文字はOpen扱いである.
6295 %<en>\item Characters whose \Param{postbreakpenalty} is greater than or equal to 0 are Close.
6296 %<ja>\item \Param{postbreakpenalty} が0以上の文字はClose扱いである.
6298 %<en>\item Characters that don't satisfy the above two conditions are Kanji.
6299 %<ja>\item 上の2条件のどちらにも当てはまらなかった文字は,Kanji扱いである.
6304 The width of halfwidth kana (U+FF61--U+FF9F) is same as the width of \textbf{ALchar};
6305 the width of the other \textbf{JAchars} is double the width of \textbf{ALchar}.
6308 なお,半角カナ(U+FF61--U+FF9F)以外の\textbf{JAchar}は欧文文字2文字分の幅をとるものとみなされる.
6313 The classification process is executed every time a character appears in
6314 listing environments.
6317 これらの文字種決定は,実際に \texttt{lstlisting} 環境などの内部で文字が出てくるたびに行われる.
6323 \texttt{luatexja-adjust.sty} で提供される優先順位付きの行長調整の詳細を述
6324 べる.大まかに述べると,次のようになる.
6326 \item 通常の\TeX の行分割方法に従って,段落を行分割する.この段階では,行
6327 長に半端が出た場合,その半端分は\Param{xkanjiskip},
6328 \Param{kanjiskip},JFMグルーの全てで(優先順位なく)負担される.
6329 \item その後,\texttt{post\_linebreak\_filter} callbackを使い,\textbf{段
6330 落中の各行ごとに},行末文字の位置を調整したり,優先度付きの行長調整
6331 を実現するためにグルーの伸縮度を調整する.
6332 \texttt{luatexja-adjust.sty} の作用は,このcallbackを追加するだけであり,
6333 この章の残りではcallbackでの処理について解説する.
6336 \paragraph{準備:合計伸縮量の計算}
6337 グルーの伸縮度(\texttt{plus} や \texttt{minus} で指定されている値)には,
6338 有限値の他に,\texttt{fi},\texttt{fil},\texttt{fill},\texttt{filll}と
6339 いう4つの無限大レベル(後ろの方ほど大きい)があり,行の調整に
6340 \texttt{fi} などの\textbf{無限大レベルの伸縮度が用いられている場合は,そ
6343 よって,以降,問題にしている行の行長調整は伸縮度が有限長のグルーを用いて
6344 行われているとして良い.まず,段落中の行中のグルーを
6346 \item 下のどれにも該当しないグルー
6347 \item 和欧文間空白(\Param{xkanjiskip})
6348 \item JFMグルー(優先度別にまとめられる)
6349 \item 和文間空白(\Param{kanjiskip})
6351 の$1+1+5+1=8$つに類別し,それぞれの種別ごとに許容されている伸縮度の合計を計算する.
6352 また,行長と自然長との差の絶対値を計算し,それを\textit{total}とおく.
6354 \subsection{行末文字の位置調整}
6355 まず,行末が和文文字であった場合,それを動かすことによって,\textbf{JAglue} が負担する調整量を
6361 \section{Advanced line-adjustment for Japanese characters}
6368 \begin{thebibliography}{99}
6369 \addcontentsline{toc}{section}{\refname}
6370 \bibitem{texbytopic}
6371 Victor Eijkhout, \emph{\TeX\ by Topic, A \TeX nician's Reference}, Addison-Wesley, 1992.
6372 \bibitem{listings} C.\ Heinz, B.\ Moses. The \textsf{Listings} Package.
6373 \bibitem{jlisting} Thor Watanabe. Listings\ -\ MyTeXpert. \newblock
6374 \url{http://mytexpert.sourceforge.jp/index.php?Listings}
6375 \bibitem{min10} 乙部厳己,min10フォントについて.
6376 \url{http://argent.shinshu-u.ac.jp/~otobe/tex/files/min10.pdf}
6377 \bibitem{jlreq} W3C Japanese Layout Task Force~(ed), Requirements for Japanese Text Layout (W3C Working Group Note), 2011, 2012. \newblock
6378 \url{http://www.w3.org/TR/jlreq/}%
6379 %<ja> \\日本語訳の書籍版:W3C日本語組版タスクフォース(編),『W3C技術ノート 日本語組版処理の要件』,東京電機大学出版局,2012.
6380 \bibitem{x4051} 日本工業規格(Japanese Industrial Standard) JIS~X~4051,
6381 日本語文書の組版方法(Formatting rules for Japanese documents), 1993, 1995, 2004.
6382 \end{thebibliography}
6388 %<en>\section{The category code of non-kanji characters defined in JIS~X~0213}
6389 %<ja>\section{\LuaTeX-jaにおけるJIS~X~0213非漢字のcatcode}
6392 In these tables, the default catcode (\LuaTeX-ja) and kcatcode ((u)\pTeX) of non-kanji
6393 characters defined in JIS~X~0213 from row 1 to row 13 is summarized.
6394 Each character is printed as follows:
6397 ここでは,JIS~X~0213の非漢字部分(第1区〜第13区)のうち,
6398 どの文字が(u)\pTeX や\LuaTeX-jaで制御綴内に使用可能かを表にしてまとめる.
6402 \tt\fboxsep=1pt\fbox{\hbox to \zw{\gt あ\hss}}\,\scriptsize LUP
6405 のように表示しており,各文字は次の意味を持っている.
6406 この表の生成は,JIS~X~0208の範囲内の文字については\verb+\jis+命令を使って行なっている.
6409 The tables are generated by using \verb+\jis+ command for characters included in
6411 Each character in the tables means:
6415 \item The background of a character regarded as \textbf{ALchar} in \LuaTeX-ja
6416 is colored light blue.
6419 \item 背景が薄く青く塗られている文字は,
6420 \LuaTeX-ja の標準で\textbf{ALchar}として認識されている文字である.
6424 \item The first letter {\tt L} means that the character is available for
6425 the name of a control sequence in \XeTeX{} and \LuaTeX-ja (its catcode is 11).
6428 \item 1文字目の {\tt L} は,\XeTeX や\LuaTeX-jaにおいてこの文字が制御綴内に
6429 使用可能(catcodeが11)であることを表している.
6433 \item The second letter {\tt U} means that the character is available for
6434 the name of a control sequence in \upTeX{} (its kcatcode is 16 or 17).
6435 \upTeX{} regards these characters as Japanese character.
6438 \item 2文字目の{\tt U} は,\upTeX においてこの文字が制御綴内に使用可能(kcatcodeは16,~17)であることを
6439 表している.この範囲内では,\upTeX は標準で全文字を和文文字として扱うようである.
6443 \item The third letter {\tt P} means that the character is available for
6444 the name of a control sequence in \pTeX{} (its kcatcode is 16 or 17).
6447 \item 3文字目の {\tt P} は,\pTeX においてこの文字が制御綴内に使用可能(kcatcodeは16,~17)であることを
6452 \item If the third letter is {\tt -} (or the character is printed in red),
6453 the character is not included in JIS~X~0208.
6454 Therefore, you can consider the character is not available in \pTeX.
6457 \item 3文字目が{\tt -}となっているもの(本体の文字も赤身がかっている)は,
6458 JIS~X~0208にないため\pTeX では使用不能と考えて良いものである.
6462 \item The kana for bidakuon in row 4 and 5 are omitted.
6465 \item 第4区と第5区にある,鼻濁音の仮名については省略した.
6471 \def\uplist{% upTeX で \kcatcode!=18 なもの
6472 \@elt {8486}\@elt {8491}\@elt {8492}\@elt {8499}\@elt {8500}\@elt {8501}%
6473 \@elt {8502}\@elt {8504}\@elt {8508}\@elt {9008}\@elt {9009}\@elt {9010}%
6474 \@elt {9011}\@elt {9012}\@elt {9013}\@elt {9014}\@elt {9015}\@elt {9016}%
6475 \@elt {9017}\@elt {9025}\@elt {9026}\@elt {9027}\@elt {9028}\@elt {9029}%
6476 \@elt {9030}\@elt {9031}\@elt {9032}\@elt {9033}\@elt {9034}\@elt {9035}%
6477 \@elt {9036}\@elt {9037}\@elt {9038}\@elt {9039}\@elt {9040}\@elt {9041}%
6478 \@elt {9042}\@elt {9043}\@elt {9044}\@elt {9045}\@elt {9046}\@elt {9047}%
6479 \@elt {9048}\@elt {9049}\@elt {9050}\@elt {9057}\@elt {9058}\@elt {9059}%
6480 \@elt {9060}\@elt {9061}\@elt {9062}\@elt {9063}\@elt {9064}\@elt {9065}%
6481 \@elt {9066}\@elt {9067}\@elt {9068}\@elt {9069}\@elt {9070}\@elt {9071}%
6482 \@elt {9072}\@elt {9073}\@elt {9074}\@elt {9075}\@elt {9076}\@elt {9077}%
6483 \@elt {9078}\@elt {9079}\@elt {9080}\@elt {9081}\@elt {9082}\@elt {9249}%
6484 \@elt {9250}\@elt {9251}\@elt {9252}\@elt {9253}\@elt {9254}\@elt {9255}%
6485 \@elt {9256}\@elt {9257}\@elt {9258}\@elt {9259}\@elt {9260}\@elt {9261}%
6486 \@elt {9262}\@elt {9263}\@elt {9264}\@elt {9265}\@elt {9266}\@elt {9267}%
6487 \@elt {9268}\@elt {9269}\@elt {9270}\@elt {9271}\@elt {9272}\@elt {9273}%
6488 \@elt {9274}\@elt {9275}\@elt {9276}\@elt {9277}\@elt {9278}\@elt {9279}%
6489 \@elt {9280}\@elt {9281}\@elt {9282}\@elt {9283}\@elt {9284}\@elt {9285}%
6490 \@elt {9286}\@elt {9287}\@elt {9288}\@elt {9289}\@elt {9290}\@elt {9291}%
6491 \@elt {9292}\@elt {9293}\@elt {9294}\@elt {9295}\@elt {9296}\@elt {9297}%
6492 \@elt {9298}\@elt {9299}\@elt {9300}\@elt {9301}\@elt {9302}\@elt {9303}%
6493 \@elt {9304}\@elt {9305}\@elt {9306}\@elt {9307}\@elt {9308}\@elt {9309}%
6494 \@elt {9310}\@elt {9311}\@elt {9312}\@elt {9313}\@elt {9314}\@elt {9315}%
6495 \@elt {9316}\@elt {9317}\@elt {9318}\@elt {9319}\@elt {9320}\@elt {9321}%
6496 \@elt {9322}\@elt {9323}\@elt {9324}\@elt {9325}\@elt {9326}\@elt {9327}%
6497 \@elt {9328}\@elt {9329}\@elt {9330}\@elt {9331}\@elt {9505}\@elt {9506}%
6498 \@elt {9507}\@elt {9508}\@elt {9509}\@elt {9510}\@elt {9511}\@elt {9512}%
6499 \@elt {9513}\@elt {9514}\@elt {9515}\@elt {9516}\@elt {9517}\@elt {9518}%
6500 \@elt {9519}\@elt {9520}\@elt {9521}\@elt {9522}\@elt {9523}\@elt {9524}%
6501 \@elt {9525}\@elt {9526}\@elt {9527}\@elt {9528}\@elt {9529}\@elt {9530}%
6502 \@elt {9531}\@elt {9532}\@elt {9533}\@elt {9534}\@elt {9535}\@elt {9536}%
6503 \@elt {9537}\@elt {9538}\@elt {9539}\@elt {9540}\@elt {9541}\@elt {9542}%
6504 \@elt {9543}\@elt {9544}\@elt {9545}\@elt {9546}\@elt {9547}\@elt {9548}%
6505 \@elt {9549}\@elt {9550}\@elt {9551}\@elt {9552}\@elt {9553}\@elt {9554}%
6506 \@elt {9555}\@elt {9556}\@elt {9557}\@elt {9558}\@elt {9559}\@elt {9560}%
6507 \@elt {9561}\@elt {9562}\@elt {9563}\@elt {9564}\@elt {9565}\@elt {9566}%
6508 \@elt {9567}\@elt {9568}\@elt {9569}\@elt {9570}\@elt {9571}\@elt {9572}%
6509 \@elt {9573}\@elt {9574}\@elt {9575}\@elt {9576}\@elt {9577}\@elt {9578}%
6510 \@elt {9579}\@elt {9580}\@elt {9581}\@elt {9582}\@elt {9583}\@elt {9584}%
6511 \@elt {9585}\@elt {9586}\@elt {9587}\@elt {9588}\@elt {9589}\@elt {9590}%
6513 \@elt {8760}\@elt {8761}\@elt {9083}\@elt {9332}\@elt {9333}\@elt {9334}%
6514 \@elt {9335}\@elt {9336}\@elt {9337}\@elt {9338}\@elt {9339}\@elt {9591}%
6515 \@elt {9592}\@elt {9593}\@elt {9594}\@elt {9595}\@elt {9596}\@elt {9597}%
6516 \@elt {9598}\@elt {9838}\@elt {9839}\@elt {9840}\@elt {9841}\@elt {9842}%
6517 \@elt {9843}\@elt {9844}\@elt {9845}\@elt {9846}\@elt {9847}\@elt {9848}%
6518 \@elt {9849}\@elt {9850}\@elt {9851}\@elt {9852}\@elt {9853}\@elt {9854}%
6519 \@elt {10098}\@elt {10099}\@elt {10100}\@elt {10101}%
6521 \def\plist{% pTeX で \kcatcode!=18 なもの
6522 \@elt {8993}\@elt {8994}\@elt {8995}\@elt {8996}\@elt {8997}\@elt {8998}%
6523 \@elt {8999}\@elt {9000}\@elt {9001}\@elt {9002}\@elt {9003}\@elt {9004}%
6524 \@elt {9005}\@elt {9006}\@elt {9007}\@elt {9008}\@elt {9009}\@elt {9010}%
6525 \@elt {9011}\@elt {9012}\@elt {9013}\@elt {9014}\@elt {9015}\@elt {9016}%
6526 \@elt {9017}\@elt {9018}\@elt {9019}\@elt {9020}\@elt {9021}\@elt {9022}%
6527 \@elt {9023}\@elt {9024}\@elt {9025}\@elt {9026}\@elt {9027}\@elt {9028}%
6528 \@elt {9029}\@elt {9030}\@elt {9031}\@elt {9032}\@elt {9033}\@elt {9034}%
6529 \@elt {9035}\@elt {9036}\@elt {9037}\@elt {9038}\@elt {9039}\@elt {9040}%
6530 \@elt {9041}\@elt {9042}\@elt {9043}\@elt {9044}\@elt {9045}\@elt {9046}%
6531 \@elt {9047}\@elt {9048}\@elt {9049}\@elt {9050}\@elt {9051}\@elt {9052}%
6532 \@elt {9053}\@elt {9054}\@elt {9055}\@elt {9056}\@elt {9057}\@elt {9058}%
6533 \@elt {9059}\@elt {9060}\@elt {9061}\@elt {9062}\@elt {9063}\@elt {9064}%
6534 \@elt {9065}\@elt {9066}\@elt {9067}\@elt {9068}\@elt {9069}\@elt {9070}%
6535 \@elt {9071}\@elt {9072}\@elt {9073}\@elt {9074}\@elt {9075}\@elt {9076}%
6536 \@elt {9077}\@elt {9078}\@elt {9079}\@elt {9080}\@elt {9081}\@elt {9082}%
6537 \@elt {9083}\@elt {9084}\@elt {9085}\@elt {9086}\@elt {9249}\@elt {9250}%
6538 \@elt {9251}\@elt {9252}\@elt {9253}\@elt {9254}\@elt {9255}\@elt {9256}%
6539 \@elt {9257}\@elt {9258}\@elt {9259}\@elt {9260}\@elt {9261}\@elt {9262}%
6540 \@elt {9263}\@elt {9264}\@elt {9265}\@elt {9266}\@elt {9267}\@elt {9268}%
6541 \@elt {9269}\@elt {9270}\@elt {9271}\@elt {9272}\@elt {9273}\@elt {9274}%
6542 \@elt {9275}\@elt {9276}\@elt {9277}\@elt {9278}\@elt {9279}\@elt {9280}%
6543 \@elt {9281}\@elt {9282}\@elt {9283}\@elt {9284}\@elt {9285}\@elt {9286}%
6544 \@elt {9287}\@elt {9288}\@elt {9289}\@elt {9290}\@elt {9291}\@elt {9292}%
6545 \@elt {9293}\@elt {9294}\@elt {9295}\@elt {9296}\@elt {9297}\@elt {9298}%
6546 \@elt {9299}\@elt {9300}\@elt {9301}\@elt {9302}\@elt {9303}\@elt {9304}%
6547 \@elt {9305}\@elt {9306}\@elt {9307}\@elt {9308}\@elt {9309}\@elt {9310}%
6548 \@elt {9311}\@elt {9312}\@elt {9313}\@elt {9314}\@elt {9315}\@elt {9316}%
6549 \@elt {9317}\@elt {9318}\@elt {9319}\@elt {9320}\@elt {9321}\@elt {9322}%
6550 \@elt {9323}\@elt {9324}\@elt {9325}\@elt {9326}\@elt {9327}\@elt {9328}%
6551 \@elt {9329}\@elt {9330}\@elt {9331}\@elt {9332}\@elt {9333}\@elt {9334}%
6552 \@elt {9335}\@elt {9336}\@elt {9337}\@elt {9338}\@elt {9339}\@elt {9340}%
6553 \@elt {9341}\@elt {9342}\@elt {9505}\@elt {9506}\@elt {9507}\@elt {9508}%
6554 \@elt {9509}\@elt {9510}\@elt {9511}\@elt {9512}\@elt {9513}\@elt {9514}%
6555 \@elt {9515}\@elt {9516}\@elt {9517}\@elt {9518}\@elt {9519}\@elt {9520}%
6556 \@elt {9521}\@elt {9522}\@elt {9523}\@elt {9524}\@elt {9525}\@elt {9526}%
6557 \@elt {9527}\@elt {9528}\@elt {9529}\@elt {9530}\@elt {9531}\@elt {9532}%
6558 \@elt {9533}\@elt {9534}\@elt {9535}\@elt {9536}\@elt {9537}\@elt {9538}%
6559 \@elt {9539}\@elt {9540}\@elt {9541}\@elt {9542}\@elt {9543}\@elt {9544}%
6560 \@elt {9545}\@elt {9546}\@elt {9547}\@elt {9548}\@elt {9549}\@elt {9550}%
6561 \@elt {9551}\@elt {9552}\@elt {9553}\@elt {9554}\@elt {9555}\@elt {9556}%
6562 \@elt {9557}\@elt {9558}\@elt {9559}\@elt {9560}\@elt {9561}\@elt {9562}%
6563 \@elt {9563}\@elt {9564}\@elt {9565}\@elt {9566}\@elt {9567}\@elt {9568}%
6564 \@elt {9569}\@elt {9570}\@elt {9571}\@elt {9572}\@elt {9573}\@elt {9574}%
6565 \@elt {9575}\@elt {9576}\@elt {9577}\@elt {9578}\@elt {9579}\@elt {9580}%
6566 \@elt {9581}\@elt {9582}\@elt {9583}\@elt {9584}\@elt {9585}\@elt {9586}%
6567 \@elt {9587}\@elt {9588}\@elt {9589}\@elt {9590}\@elt {9591}\@elt {9592}%
6568 \@elt {9593}\@elt {9594}\@elt {9595}\@elt {9596}\@elt {9597}\@elt {9598}%
6569 \@elt {9761}\@elt {9762}\@elt {9763}\@elt {9764}\@elt {9765}\@elt {9766}%
6570 \@elt {9767}\@elt {9768}\@elt {9769}\@elt {9770}\@elt {9771}\@elt {9772}%
6571 \@elt {9773}\@elt {9774}\@elt {9775}\@elt {9776}\@elt {9777}\@elt {9778}%
6572 \@elt {9779}\@elt {9780}\@elt {9781}\@elt {9782}\@elt {9783}\@elt {9784}%
6573 \@elt {9785}\@elt {9786}\@elt {9787}\@elt {9788}\@elt {9789}\@elt {9790}%
6574 \@elt {9791}\@elt {9792}\@elt {9793}\@elt {9794}\@elt {9795}\@elt {9796}%
6575 \@elt {9797}\@elt {9798}\@elt {9799}\@elt {9800}\@elt {9801}\@elt {9802}%
6576 \@elt {9803}\@elt {9804}\@elt {9805}\@elt {9806}\@elt {9807}\@elt {9808}%
6577 \@elt {9809}\@elt {9810}\@elt {9811}\@elt {9812}\@elt {9813}\@elt {9814}%
6578 \@elt {9815}\@elt {9816}\@elt {9817}\@elt {9818}\@elt {9819}\@elt {9820}%
6579 \@elt {9821}\@elt {9822}\@elt {9823}\@elt {9824}\@elt {9825}\@elt {9826}%
6580 \@elt {9827}\@elt {9828}\@elt {9829}\@elt {9830}\@elt {9831}\@elt {9832}%
6581 \@elt {9833}\@elt {9834}\@elt {9835}\@elt {9836}\@elt {9837}\@elt {9838}%
6582 \@elt {9839}\@elt {9840}\@elt {9841}\@elt {9842}\@elt {9843}\@elt {9844}%
6583 \@elt {9845}\@elt {9846}\@elt {9847}\@elt {9848}\@elt {9849}\@elt {9850}%
6584 \@elt {9851}\@elt {9852}\@elt {9853}\@elt {9854}%
6587 \def\jlist{% JIS X 0213 だけにあるもの
6588 \@elt{"222F}{"FF07}\@elt{"2230}{"FF02}\@elt{"2231}{"FF0D}\@elt{"2232}{"FF5E}%
6589 \@elt{"2233}{"3033}\@elt{"2234}{"3034}\@elt{"2235}{"3035}\@elt{"2236}{"303B}%
6590 \@elt{"2237}{"303C}\@elt{"2238}{"30FF}\@elt{"2239}{"309F}\@elt{"2242}{"2284}%
6591 \@elt{"2243}{"2285}\@elt{"2244}{"228A}\@elt{"2245}{"228B}\@elt{"2246}{"2209}%
6592 \@elt{"2247}{"2205}\@elt{"2248}{"2305}\@elt{"2249}{"2306}\@elt{"2251}{"2295}%
6593 \@elt{"2252}{"2296}\@elt{"2253}{"2297}\@elt{"2254}{"2225}\@elt{"2255}{"2226}%
6594 \@elt{"2256}{"FF5F}\@elt{"2257}{"FF60}\@elt{"2258}{"3018}\@elt{"2259}{"3019}%
6595 \@elt{"225A}{"3016}\@elt{"225B}{"3017}\@elt{"226B}{"2262}\@elt{"226C}{"2243}%
6596 \@elt{"226D}{"2245}\@elt{"226E}{"2248}\@elt{"226F}{"2276}\@elt{"2270}{"2277}%
6597 \@elt{"2271}{"2194}\@elt{"227A}{"266E}\@elt{"227B}{"266B}\@elt{"227C}{"266C}%
6598 \@elt{"227D}{"2669}\@elt{"2321}{"25B7}\@elt{"2322}{"25B6}\@elt{"2323}{"25C1}%
6599 \@elt{"2324}{"25C0}\@elt{"2325}{"2197}\@elt{"2326}{"2198}\@elt{"2327}{"2196}%
6600 \@elt{"2328}{"2199}\@elt{"2329}{"21C4}\@elt{"232A}{"21E8}\@elt{"232B}{"21E6}%
6601 \@elt{"232C}{"21E7}\@elt{"232D}{"21E9}\@elt{"232E}{"2934}\@elt{"232F}{"2935}%
6602 \@elt{"233A}{"29BF}\@elt{"233B}{"25C9}\@elt{"233C}{"303D}\@elt{"233D}{"FE46}%
6603 \@elt{"233E}{"FE45}\@elt{"233F}{"25E6}\@elt{"2340}{"2022}\@elt{"235B}{"2213}%
6604 \@elt{"235C}{"2135}\@elt{"235D}{"210F}\@elt{"235E}{"33CB}\@elt{"235F}{"2113}%
6605 \@elt{"2360}{"2127}\@elt{"237B}{"30A0}\@elt{"237C}{"2013}\@elt{"237D}{"29FA}%
6606 \@elt{"237E}{"29FB}\@elt{"2474}{"3094}\@elt{"2475}{"3095}\@elt{"2476}{"3096}%
6607 \@elt{"2639}{"2664}\@elt{"263A}{"2660}\@elt{"263B}{"2662}%
6608 \@elt{"263C}{"2666}\@elt{"263D}{"2661}\@elt{"263E}{"2665}\@elt{"263F}{"2667}%
6609 \@elt{"2640}{"2663}\@elt{"2659}{"03C2}\@elt{"265A}{"24F5}\@elt{"265B}{"24F6}%
6610 \@elt{"265C}{"24F7}\@elt{"265D}{"24F8}\@elt{"265E}{"24F9}\@elt{"265F}{"24FA}%
6611 \@elt{"2660}{"24FB}\@elt{"2661}{"24FC}\@elt{"2662}{"24FD}\@elt{"2663}{"24FE}%
6612 \@elt{"2664}{"2616}\@elt{"2665}{"2617}\@elt{"2666}{"3020}\@elt{"2667}{"260E}%
6613 \@elt{"2668}{"2600}\@elt{"2669}{"2601}\@elt{"266A}{"2602}\@elt{"266B}{"2603}%
6614 \@elt{"266C}{"2668}\@elt{"266D}{"25B1}\@elt{"266E}{"31F0}\@elt{"266F}{"31F1}%
6615 \@elt{"2670}{"31F2}\@elt{"2671}{"31F3}\@elt{"2672}{"31F4}\@elt{"2673}{"31F5}%
6616 \@elt{"2674}{"31F6}\@elt{"2675}{"31F7}\@elt{"2676}{"31F8}\@elt{"2677}{"31F9}%
6617 \@elt{"2678}{"31F7}\@elt{"2679}{"31FA}\@elt{"267A}{"31FB}\@elt{"267B}{"31FC}%
6618 \@elt{"267C}{"31FD}\@elt{"267D}{"31FE}\@elt{"267E}{"31FF}\@elt{"2742}{"23BE}%
6619 \@elt{"2743}{"23BF}\@elt{"2744}{"23C0}\@elt{"2745}{"23C1}\@elt{"2746}{"23C2}%
6620 \@elt{"2747}{"23C3}\@elt{"2748}{"23C4}\@elt{"2749}{"23C5}\@elt{"274A}{"23C6}%
6621 \@elt{"274B}{"23C7}\@elt{"274C}{"23C8}\@elt{"274D}{"23C9}\@elt{"274E}{"23CA}%
6622 \@elt{"274F}{"23CB}\@elt{"2750}{"23CC}\@elt{"2772}{"30F7}\@elt{"2773}{"30F8}%
6623 \@elt{"2774}{"30F9}\@elt{"2775}{"30FA}\@elt{"2776}{"22DA}\@elt{"2777}{"22DB}%
6624 \@elt{"2778}{"2153}\@elt{"2779}{"2154}\@elt{"277A}{"2155}\@elt{"277B}{"2713}%
6625 \@elt{"277C}{"2318}\@elt{"277D}{"2423}\@elt{"277E}{"23CE}\@elt{"2841}{"3251}%
6626 \@elt{"2842}{"3252}\@elt{"2843}{"3253}\@elt{"2844}{"3254}\@elt{"2845}{"3255}%
6627 \@elt{"2846}{"3256}\@elt{"2847}{"3257}\@elt{"2848}{"3258}\@elt{"2849}{"3259}%
6628 \@elt{"284A}{"325A}\@elt{"284B}{"325B}\@elt{"284C}{"325C}\@elt{"284D}{"325D}%
6629 \@elt{"284E}{"325E}\@elt{"284F}{"325F}\@elt{"2850}{"32B1}\@elt{"2851}{"32B2}%
6630 \@elt{"2852}{"32B3}\@elt{"2853}{"32B4}\@elt{"2854}{"32B5}\@elt{"2855}{"32B6}%
6631 \@elt{"2856}{"32B7}\@elt{"2857}{"32B8}\@elt{"2858}{"32B9}\@elt{"2859}{"32BA}%
6632 \@elt{"285A}{"32BB}\@elt{"285B}{"32BC}\@elt{"285C}{"32BD}\@elt{"285D}{"32BE}%
6633 \@elt{"285E}{"32BF}\@elt{"2867}{"25D0}\@elt{"2868}{"25D1}\@elt{"2869}{"25D2}%
6634 \@elt{"286A}{"25D3}\@elt{"286B}{"203C}\@elt{"286C}{"2047}\@elt{"286D}{"2048}%
6635 \@elt{"286E}{"2049}\@elt{"286F}{"01CD}\@elt{"2870}{"01CE}\@elt{"2871}{"01D0}%
6636 \@elt{"2872}{"1E3E}\@elt{"2873}{"1E3F}\@elt{"2874}{"01F8}\@elt{"2875}{"01F9}%
6637 \@elt{"2876}{"01D1}\@elt{"2877}{"01D2}\@elt{"2878}{"01D4}\@elt{"2879}{"01D6}%
6638 \@elt{"287A}{"01D8}\@elt{"287B}{"01DA}\@elt{"287C}{"01DC}\@elt{"2921}{"20AC}%
6639 \@elt{"2922}{"00A0}\@elt{"2923}{"00A1}\@elt{"2924}{"00A4}\@elt{"2925}{"00A6}%
6640 \@elt{"2926}{"00A9}\@elt{"2927}{"00AA}\@elt{"2928}{"00AB}\@elt{"2929}{"00AD}%
6641 \@elt{"292A}{"00AE}\@elt{"292B}{"00AF}\@elt{"292C}{"00B2}\@elt{"292D}{"00B3}%
6642 \@elt{"292E}{"00B7}\@elt{"292F}{"00B8}\@elt{"2930}{"00B9}\@elt{"2931}{"00BA}%
6643 \@elt{"2932}{"00BB}\@elt{"2933}{"00BC}\@elt{"2934}{"00BD}\@elt{"2935}{"00BE}%
6644 \@elt{"2936}{"00BF}\@elt{"2937}{"00C0}\@elt{"2938}{"00C1}\@elt{"2939}{"00C2}%
6645 \@elt{"293A}{"00C3}\@elt{"293B}{"00C4}\@elt{"293C}{"00C5}\@elt{"293D}{"00C6}%
6646 \@elt{"293E}{"00C7}\@elt{"293F}{"00C8}\@elt{"2940}{"00C9}\@elt{"2941}{"00CA}%
6647 \@elt{"2942}{"00CB}\@elt{"2943}{"00CC}\@elt{"2944}{"00CD}\@elt{"2945}{"00CE}%
6648 \@elt{"2946}{"00CF}\@elt{"2947}{"00D0}\@elt{"2948}{"00D1}\@elt{"2949}{"00D2}%
6649 \@elt{"294A}{"00D3}\@elt{"294B}{"00D4}\@elt{"294C}{"00D5}\@elt{"294D}{"00D6}%
6650 \@elt{"294E}{"00D8}\@elt{"294F}{"00D9}\@elt{"2950}{"00DA}\@elt{"2951}{"00DB}%
6651 \@elt{"2952}{"00DC}\@elt{"2953}{"00DD}\@elt{"2954}{"00DE}\@elt{"2955}{"00DF}%
6652 \@elt{"2956}{"00E0}\@elt{"2957}{"00E1}\@elt{"2958}{"00E2}\@elt{"2959}{"00E3}%
6653 \@elt{"295A}{"00E4}\@elt{"295B}{"00E5}\@elt{"295C}{"00E6}\@elt{"295D}{"00E7}%
6654 \@elt{"295E}{"00E8}\@elt{"295F}{"00E9}\@elt{"2960}{"00EA}\@elt{"2961}{"00EB}%
6655 \@elt{"2962}{"00EC}\@elt{"2963}{"00ED}\@elt{"2964}{"00EE}\@elt{"2965}{"00EF}%
6656 \@elt{"2966}{"00F0}\@elt{"2967}{"00F1}\@elt{"2968}{"00F2}\@elt{"2969}{"00F3}%
6657 \@elt{"296A}{"00F4}\@elt{"296B}{"00F5}\@elt{"296C}{"00F6}\@elt{"296D}{"00F8}%
6658 \@elt{"296E}{"00F9}\@elt{"296F}{"00FA}\@elt{"2970}{"00FB}\@elt{"2971}{"00FC}%
6659 \@elt{"2972}{"00FD}\@elt{"2973}{"00FE}\@elt{"2974}{"00FF}\@elt{"2975}{"0100}%
6660 \@elt{"2976}{"012A}\@elt{"2977}{"016A}\@elt{"2978}{"0112}\@elt{"2979}{"014C}%
6661 \@elt{"297A}{"0101}\@elt{"297B}{"012B}\@elt{"297C}{"016B}\@elt{"297D}{"0113}%
6662 \@elt{"297E}{"014D}\@elt{"2A21}{"0104}\@elt{"2A22}{"02D8}\@elt{"2A23}{"0141}%
6663 \@elt{"2A24}{"013D}\@elt{"2A25}{"015A}\@elt{"2A26}{"0160}\@elt{"2A27}{"015E}%
6664 \@elt{"2A28}{"0164}\@elt{"2A29}{"0179}\@elt{"2A2A}{"017D}\@elt{"2A2B}{"017B}%
6665 \@elt{"2A2C}{"0105}\@elt{"2A2D}{"02DB}\@elt{"2A2E}{"0142}\@elt{"2A2F}{"013E}%
6666 \@elt{"2A30}{"015B}\@elt{"2A31}{"02C7}\@elt{"2A32}{"0161}\@elt{"2A33}{"015F}%
6667 \@elt{"2A34}{"0165}\@elt{"2A35}{"017A}\@elt{"2A36}{"02DD}\@elt{"2A37}{"017E}%
6668 \@elt{"2A38}{"017C}\@elt{"2A39}{"0154}\@elt{"2A3A}{"0102}\@elt{"2A3B}{"0139}%
6669 \@elt{"2A3C}{"0106}\@elt{"2A3D}{"010C}\@elt{"2A3E}{"0118}\@elt{"2A3F}{"011A}%
6670 \@elt{"2A40}{"010E}\@elt{"2A41}{"0143}\@elt{"2A42}{"0147}\@elt{"2A43}{"0150}%
6671 \@elt{"2A44}{"0158}\@elt{"2A45}{"016E}\@elt{"2A46}{"0170}\@elt{"2A47}{"0162}%
6672 \@elt{"2A48}{"0155}\@elt{"2A49}{"0103}\@elt{"2A4A}{"013A}\@elt{"2A4B}{"0107}%
6673 \@elt{"2A4C}{"010D}\@elt{"2A4D}{"0119}\@elt{"2A4E}{"011B}\@elt{"2A4F}{"010F}%
6674 \@elt{"2A50}{"0111}\@elt{"2A51}{"0144}\@elt{"2A52}{"0148}\@elt{"2A53}{"0151}%
6675 \@elt{"2A54}{"0159}\@elt{"2A55}{"016F}\@elt{"2A56}{"0171}\@elt{"2A57}{"0163}%
6676 \@elt{"2A58}{"02D9}\@elt{"2A59}{"0108}\@elt{"2A5A}{"011C}\@elt{"2A5B}{"0124}%
6677 \@elt{"2A5C}{"0134}\@elt{"2A5D}{"015C}\@elt{"2A5E}{"016C}\@elt{"2A5F}{"0109}%
6678 \@elt{"2A60}{"011D}\@elt{"2A61}{"0125}\@elt{"2A62}{"0135}\@elt{"2A63}{"015D}%
6679 \@elt{"2A64}{"016D}\@elt{"2A65}{"0271}\@elt{"2A66}{"028B}\@elt{"2A67}{"027E}%
6680 \@elt{"2A68}{"0283}\@elt{"2A69}{"0292}\@elt{"2A6A}{"026C}\@elt{"2A6B}{"026E}%
6681 \@elt{"2A6C}{"0279}\@elt{"2A6D}{"0288}\@elt{"2A6E}{"0256}\@elt{"2A6F}{"0273}%
6682 \@elt{"2A70}{"027D}\@elt{"2A71}{"0282}\@elt{"2A72}{"0290}\@elt{"2A73}{"027B}%
6683 \@elt{"2A74}{"026D}\@elt{"2A75}{"025F}\@elt{"2A76}{"0272}\@elt{"2A77}{"029D}%
6684 \@elt{"2A78}{"028E}\@elt{"2A79}{"0261}\@elt{"2A7A}{"014B}\@elt{"2A7B}{"0270}%
6685 \@elt{"2A7C}{"0281}\@elt{"2A7D}{"0127}\@elt{"2A7E}{"0295}\@elt{"2B21}{"0294}%
6686 \@elt{"2B22}{"0266}\@elt{"2B23}{"0298}\@elt{"2B24}{"01C2}\@elt{"2B25}{"0253}%
6687 \@elt{"2B26}{"0257}\@elt{"2B27}{"0284}\@elt{"2B28}{"0260}\@elt{"2B29}{"0193}%
6688 \@elt{"2B2A}{"0153}\@elt{"2B2B}{"0152}\@elt{"2B2C}{"0268}\@elt{"2B2D}{"0289}%
6689 \@elt{"2B2E}{"0258}\@elt{"2B2F}{"0275}\@elt{"2B30}{"0259}\@elt{"2B31}{"025C}%
6690 \@elt{"2B32}{"025E}\@elt{"2B33}{"0250}\@elt{"2B34}{"026F}\@elt{"2B35}{"028A}%
6691 \@elt{"2B36}{"0264}\@elt{"2B37}{"028C}\@elt{"2B38}{"0254}\@elt{"2B39}{"0251}%
6692 \@elt{"2B3A}{"0252}\@elt{"2B3B}{"028D}\@elt{"2B3C}{"0265}\@elt{"2B3D}{"02A2}%
6693 \@elt{"2B3E}{"02A1}\@elt{"2B3F}{"0255}\@elt{"2B40}{"0291}\@elt{"2B41}{"027A}%
6694 \@elt{"2B42}{"0267}\@elt{"2B43}{"025A}\@elt{"2B44}{"00E6}\@elt{"2B45}{"01FD}%
6695 \@elt{"2B46}{"1F70}\@elt{"2B47}{"1F71}\@elt{"2B48}{"0254}\@elt{"2B49}{"0254}%
6696 \@elt{"2B4A}{"028C}\@elt{"2B4B}{"028C}\@elt{"2B4C}{"0259}\@elt{"2B4D}{"0259}%
6697 \@elt{"2B4E}{"025A}\@elt{"2B4F}{"025A}\@elt{"2B50}{"1F72}\@elt{"2B51}{"1F73}%
6698 \@elt{"2B52}{"0361}\@elt{"2B53}{"02C8}\@elt{"2B54}{"02CC}\@elt{"2B55}{"02D0}%
6699 \@elt{"2B56}{"02D1}\@elt{"2B57}{"0306}\@elt{"2B58}{"203F}\@elt{"2B59}{"030B}%
6700 \@elt{"2B5A}{"0301}\@elt{"2B5B}{"0304}\@elt{"2B5C}{"0300}\@elt{"2B5D}{"030F}%
6701 \@elt{"2B5E}{"030C}\@elt{"2B5F}{"0302}\@elt{"2B60}{"02E5}\@elt{"2B61}{"02E6}%
6702 \@elt{"2B62}{"02E7}\@elt{"2B63}{"02E8}\@elt{"2B64}{"02E9}\@elt{"2B65}{"02E9}%
6703 \@elt{"2B66}{"02E5}\@elt{"2B67}{"0325}\@elt{"2B68}{"032C}\@elt{"2B69}{"0339}%
6704 \@elt{"2B6A}{"031C}\@elt{"2B6B}{"031F}\@elt{"2B6C}{"0320}\@elt{"2B6D}{"0308}%
6705 \@elt{"2B6E}{"033D}\@elt{"2B6F}{"0329}\@elt{"2B70}{"032F}\@elt{"2B71}{"02DE}%
6706 \@elt{"2B72}{"0324}\@elt{"2B73}{"0330}\@elt{"2B74}{"033C}\@elt{"2B75}{"0334}%
6707 \@elt{"2B76}{"031D}\@elt{"2B77}{"031E}\@elt{"2B78}{"0318}\@elt{"2B79}{"0319}%
6708 \@elt{"2B7A}{"032A}\@elt{"2B7B}{"033A}\@elt{"2B7C}{"033B}\@elt{"2B7D}{"0303}%
6709 \@elt{"2B7E}{"031A}\@elt{"2C21}{"2776}\@elt{"2C22}{"2777}\@elt{"2C23}{"2778}%
6710 \@elt{"2C24}{"2779}\@elt{"2C25}{"277A}\@elt{"2C26}{"277B}\@elt{"2C27}{"277C}%
6711 \@elt{"2C28}{"277D}\@elt{"2C29}{"277E}\@elt{"2C2A}{"277F}\@elt{"2C2B}{"24EB}%
6712 \@elt{"2C2C}{"24EC}\@elt{"2C2D}{"24ED}\@elt{"2C2E}{"24EE}\@elt{"2C2F}{"24EF}%
6713 \@elt{"2C30}{"24F0}\@elt{"2C31}{"24F1}\@elt{"2C32}{"24F2}\@elt{"2C33}{"24F3}%
6714 \@elt{"2C34}{"24F4}\@elt{"2C35}{"2170}\@elt{"2C36}{"2171}\@elt{"2C37}{"2172}%
6715 \@elt{"2C38}{"2173}\@elt{"2C39}{"2174}\@elt{"2C3A}{"2175}\@elt{"2C3B}{"2176}%
6716 \@elt{"2C3C}{"2177}\@elt{"2C3D}{"2178}\@elt{"2C3E}{"2179}\@elt{"2C3F}{"217A}%
6717 \@elt{"2C40}{"217B}\@elt{"2C41}{"24D0}\@elt{"2C42}{"24D1}\@elt{"2C43}{"24D2}%
6718 \@elt{"2C44}{"24D3}\@elt{"2C45}{"24D4}\@elt{"2C46}{"24D5}\@elt{"2C47}{"24D6}%
6719 \@elt{"2C48}{"24D7}\@elt{"2C49}{"24D8}\@elt{"2C4A}{"24D9}\@elt{"2C4B}{"24DA}%
6720 \@elt{"2C4C}{"24DB}\@elt{"2C4D}{"24DC}\@elt{"2C4E}{"24DD}\@elt{"2C4F}{"24DE}%
6721 \@elt{"2C50}{"24DF}\@elt{"2C51}{"24E0}\@elt{"2C52}{"24E1}\@elt{"2C53}{"24E2}%
6722 \@elt{"2C54}{"24E3}\@elt{"2C55}{"24E4}\@elt{"2C56}{"24E5}\@elt{"2C57}{"24E6}%
6723 \@elt{"2C58}{"24E7}\@elt{"2C59}{"24E8}\@elt{"2C5A}{"24E9}\@elt{"2C5B}{"32D0}%
6724 \@elt{"2C5C}{"32D1}\@elt{"2C5D}{"32D2}\@elt{"2C5E}{"32D3}\@elt{"2C5F}{"32D4}%
6725 \@elt{"2C60}{"32D5}\@elt{"2C61}{"32D6}\@elt{"2C62}{"32D7}\@elt{"2C63}{"32D8}%
6726 \@elt{"2C64}{"32D9}\@elt{"2C65}{"32DA}\@elt{"2C66}{"32DB}\@elt{"2C67}{"32DC}%
6727 \@elt{"2C68}{"32DD}\@elt{"2C69}{"32DE}\@elt{"2C6A}{"32DF}\@elt{"2C6B}{"32E0}%
6728 \@elt{"2C6C}{"32E1}\@elt{"2C6D}{"32E2}\@elt{"2C6E}{"32E3}\@elt{"2C6F}{"32FA}%
6729 \@elt{"2C70}{"32E9}\@elt{"2C71}{"32E5}\@elt{"2C72}{"32ED}\@elt{"2C73}{"32EC}%
6730 \@elt{"2C7D}{"2051}\@elt{"2C7E}{"2042}\@elt{"2D21}{"2460}\@elt{"2D22}{"2461}%
6731 \@elt{"2D23}{"2462}\@elt{"2D24}{"2463}\@elt{"2D25}{"2464}\@elt{"2D26}{"2465}%
6732 \@elt{"2D27}{"2466}\@elt{"2D28}{"2467}\@elt{"2D29}{"2468}\@elt{"2D2A}{"2469}%
6733 \@elt{"2D2B}{"246A}\@elt{"2D2C}{"246B}\@elt{"2D2D}{"246C}\@elt{"2D2E}{"246D}%
6734 \@elt{"2D2F}{"246E}\@elt{"2D30}{"246F}\@elt{"2D31}{"2470}\@elt{"2D32}{"2471}%
6735 \@elt{"2D33}{"2472}\@elt{"2D34}{"2473}\@elt{"2D35}{"2160}\@elt{"2D36}{"2161}%
6736 \@elt{"2D37}{"2162}\@elt{"2D38}{"2163}\@elt{"2D39}{"2164}\@elt{"2D3A}{"2165}%
6737 \@elt{"2D3B}{"2166}\@elt{"2D3C}{"2167}\@elt{"2D3D}{"2168}\@elt{"2D3E}{"2169}%
6738 \@elt{"2D3F}{"216A}\@elt{"2D40}{"3349}\@elt{"2D41}{"3314}\@elt{"2D42}{"3322}%
6739 \@elt{"2D43}{"334D}\@elt{"2D44}{"3318}\@elt{"2D45}{"3327}\@elt{"2D46}{"3303}%
6740 \@elt{"2D47}{"3336}\@elt{"2D48}{"3351}\@elt{"2D49}{"3357}\@elt{"2D4A}{"330D}%
6741 \@elt{"2D4B}{"3326}\@elt{"2D4C}{"3323}\@elt{"2D4D}{"332B}\@elt{"2D4E}{"334A}%
6742 \@elt{"2D4F}{"333B}\@elt{"2D50}{"339C}\@elt{"2D51}{"339D}\@elt{"2D52}{"339E}%
6743 \@elt{"2D53}{"338E}\@elt{"2D54}{"338F}\@elt{"2D55}{"33C4}\@elt{"2D56}{"33A1}%
6744 \@elt{"2D57}{"216B}\@elt{"2D5F}{"337B}\@elt{"2D60}{"301D}\@elt{"2D61}{"301F}%
6745 \@elt{"2D62}{"2116}\@elt{"2D63}{"33CD}\@elt{"2D64}{"2121}\@elt{"2D65}{"32A4}%
6746 \@elt{"2D66}{"32A5}\@elt{"2D67}{"32A6}\@elt{"2D68}{"32A7}\@elt{"2D69}{"32A8}%
6747 \@elt{"2D6A}{"3231}\@elt{"2D6B}{"3232}\@elt{"2D6C}{"3239}\@elt{"2D6D}{"337E}%
6748 \@elt{"2D6E}{"337D}\@elt{"2D6F}{"337C}\@elt{"2D73}{"222E}\@elt{"2D78}{"221F}%
6749 \@elt{"2D79}{"22BF}\@elt{"2D7D}{"2756}\@elt{"2D7E}{"261E}%
6755 \def\chk@in@#1#2{{\global\flag=0\relax%
6756 \def\@elt##1{\ifnum#2=##1\global\flag=1 \fi}%
6759 \global\flag=0\relax%
6760 \def\@elt##1##2{\ifnum#2=##1\global\flag##2 \fi}%
6764 \get@in@{\jlist}{\cntA}\cntB=\flag
6768 \ifnum\ltjgetparameter{jacharrange}{\ltjgetparameter{chartorange}{\cntB}}=0
6769 \def\@@@tmp{white}\else\def\@@@tmp{white!85!blue}\fi
6770 \fcolorbox{black}{\@@@tmp}{%
6771 \hbox to \zw{\gt \hskip-\zw\ltjjachar\cntB \hss}}\,\scriptsize%
6772 \ifnum\catcode\cntB=11 L\else\ \fi
6773 \chk@in@{\uplist}{\cntA}\ifnum\flag=1 U\else~\fi
6774 \chk@in@{\plist}{\cntA}\ifnum\flag=1 P\else~\fi
6777 \ifnum\ltjgetparameter{jacharrange}{\ltjgetparameter{chartorange}{\cntB}}=0
6778 \def\@@@tmp{white}\else\def\@@@tmp{white!85!blue}\fi
6779 \fcolorbox{black}{\@@@tmp}{\color{red!50!black}%
6780 \hbox to \zw{\gt \hskip-\zw\ltjjachar\cntB \hss}}\,\scriptsize%
6781 \ifnum\catcode\cntB=11 L\else~\fi
6782 \chk@in@{\uplist}{\cntA}\ifnum\flag=1 U\else~\fi-%
6783 \fi\global\advance\cntA1 }
6786 \midrule\global\cntA=\numexpr 8192+#1*256+#2*16\relax
6787 "#2{}x&\ifnum#2=2\global\advance\cntA1\else\outi\fi&\outi&\outi&\outi&\outi&\outi&\outi&\outi%"
6788 &\outi&\outi&\outi&\outi&\outi&\outi&\outi&\ifnum#2=7\global\advance\cntA1\else\outi\fi\\
6792 %<en>\subsection*{Row #1}
6793 %<ja>\subsection*{第#1区}
6794 \tt\small\fboxsep=1pt\centering\tabcolsep=0.25\zw
6795 \begin{tabular}{ccccccccccccccccc}\toprule&"0&"1&"2&"3&"4&"5&"6&"7&"8&"9&"A&"B&"C&"D&"E&"F\\
6796 \out{#1}{2}\out{#1}{3}\out{#1}{4}\out{#1}{5}\out{#1}{6}\out{#1}{7}\bottomrule
6797 \end{tabular}\par}\medskip}
6799 \test{1}\test{2}\test{3}\test{4}\test{5}\test{6}\test{7}\test{8}
6800 \test{9}\test{10}\test{11}\test{12}\test{13}
6803 \section{Package versions used in this document}
6804 This document was typeset using the following packages:
6808 {\makeatletter\tt\footnotesize
6810 \filename@parse{#1}\def\@temp{sty}
6811 \ifx\@temp\filename@ext
6814 \ifx\filename@ext\relax tex\else\filename@ext\fi}%
6815 \leavevmode\hskip-13em\hbox to 13em{\filename@area\reserved@a\hss}%
6816 \csname ver@\reserved@a\endcsname\par
6819 \parindent0pt\leftskip13em
6827 %% config file for showexpl.sty
6829 %% Copyright The LuaTeX-ja project team, 2012
6831 \ProvidesFile{showexpl.cfg}
6832 [2012/05/20 v0.01 Definitions for the showexpl package (luatexja)]