2 %#! lualatex -shell-escape
5 \documentclass[a4paper,titlepage]{article}
6 \usepackage[margin=25mm,footskip=5mm]{geometry}
10 \documentclass[a4paper,titlepage]{ltjsarticle}
11 \usepackage[textwidth=45\zw, lines=45, footskip=5mm]{geometry}
12 \advance\leftmargini-1\zw\advance\leftmarginii-1\zw
15 \documentclass[a4paper,titlepage]{ltjsarticle}
16 \usepackage[margin=25mm, footskip=5mm]{geometry}
17 \advance\leftmargini-1\zw\advance\leftmarginii-1\zw
19 \DeclareYokoKanjiEncoding{ZH}{}{}
20 \DeclareKanjiEncodingDefaults{}{}
21 \DeclareErrorKanjiFont{ZH}{song}{m}{n}{10}
22 \DeclareKanjiSubstitution{ZH}{song}{m}{n}
23 \newcommand\songdefault{song}
24 \newcommand\heidefault{hei}
25 \newcommand\minchodefault{mincho}
26 \renewcommand\kanjiencodingdefault{ZH}
27 \renewcommand\kanjifamilydefault{\songdefault}
28 \renewcommand\kanjiseriesdefault{\mddefault}
29 \renewcommand\kanjishapedefault{\updefault}
30 \DeclareKanjiFamily{ZH}{song}{}
31 \DeclareFontShape{ZH}{song}{m}{n}{<->name:AdobeSongStd-Light:jfm=jis}{}
32 \DeclareFontShape{ZH}{song}{m}{it}{<->ssub*song/m/n}{}
33 \DeclareFontShape{ZH}{song}{bx}{n}{<->ssub*hei/m/n}{}
34 \DeclareKanjiFamily{ZH}{hei}{}
35 \DeclareFontShape{ZH}{hei}{m}{n}{<->name:SimHei:jfm=jis}{}
36 \DeclareFontShape{ZH}{hei}{bx}{n}{<->ssub*hei/m/n}{}
37 \DeclareKanjiFamily{ZH}{mincho}{}
38 \DeclareFontShape{ZH}{mincho}{m}{n}{<->psft:KozMinPr6N-Regular:cid=Adobe-Japan1-6;jfm=jis}{}
39 \fontencoding{ZH}\selectfont
40 \DeclareTextFontCommand{\textsong}{\songfamily}
41 \DeclareTextFontCommand{\texthei}{\heifamily}
42 \DeclareTextFontCommand{\textmincho}{\minchofamily}
43 \DeclareOldFontCommand{\song}{\normalfont\songfamily}{}
44 \DeclareOldFontCommand{\hei}{\normalfont\heifamily}{}
45 \DeclareOldFontCommand{\mincho}{\normalfont\minchofamily}{}
46 \DeclareSymbolFont{songti}{ZH}{song}{m}{n}
48 \SetSymbolFont{songti}{bold}{ZH}{hei}{m}{n}
49 \DeclareSymbolFontAlphabet{\mathsong}{songti}
50 \DeclareMathAlphabet{\mathhei}{ZH}{hei}{m}{n}
52 \DeclareRobustCommand\songfamily{\not@math@alphabet\songfamily\mathsong\kanjifamily\songdefault\selectfont}
53 \DeclareRobustCommand\heifamily{\not@math@alphabet\heifamily\mathhei\kanjifamily\heidefault\selectfont}
54 \DeclareRobustCommand\minchofamily{\not@math@alphabet\minchofamily\mathhei\kanjifamily\minchodefault\selectfont}
55 \DeclareRobustCommand\rmfamily{\not@math@alphabet\rmfamily\mathrm\romanfamily\rmdefault\kanjifamily\songdefault\selectfont}
56 \DeclareRobustCommand\sffamily{\not@math@alphabet\sffamily\mathsf\romanfamily\sfdefault\kanjifamily\heidefault\selectfont}
60 \usepackage{amsmath,amssymb,xcolor,pict2e,multienum,amsthm,float,makecell}
61 \usepackage{booktabs,listings,showexpl,multicol,metalogo}
62 \usepackage{luatexja-otf}
63 \usepackage{luatexja-fontspec}
68 allbordercolors=1 1 1,
71 pdfauthor={The LuaTeX-ja project team},
72 pdftitle={The LuaTeX-ja package}
75 pdfauthor={LuaTeX-jaプロジェクトチーム},
76 pdftitle={LuaTeX-jaパッケージ}
79 pdfauthor={LuaTeX-ja项目团队},
80 pdftitle={LuaTeX-ja宏包}
84 %<ja> \SelectTips{cm}{}
86 \setmainfont[Ligatures=TeX]{TeX Gyre Termes}
87 \setsansfont[Ligatures=TeX]{TeX Gyre Heros}
90 \def\labelenumii{(\arabic{enumii})}
92 \DeclareRobustCommand\eTeX{\ensuremath{\varepsilon}-\kern-.125em\TeX}
93 \DeclareRobustCommand\LuaTeX{Lua\TeX}
94 \DeclareRobustCommand\pdfTeX{pdf\TeX}
95 \DeclareRobustCommand\pTeX{p\kern-.05em\TeX}
96 \DeclareRobustCommand\upTeX{up\kern-.05em\TeX}
97 \DeclareRobustCommand\pLaTeX{p\kern-.05em\LaTeX}
98 \DeclareRobustCommand\pLaTeXe{p\kern-.05em\LaTeXe}
99 \DeclareRobustCommand\epTeX{\ensuremath{\varepsilon}-\kern-.125em\pTeX}
101 \theoremstyle{definition}
102 %<en>\newtheorem{defn}{Definition}
103 %<ja>\newtheorem{defn}{定義}
104 %<zh>\newtheorem{defn}{定义}
106 \newenvironment{cslist}{%
107 \leftskip2em\parindent=0pt\def\makelabel##1{{\tt\char92##1}}
108 \def\{{\char`\{}\def\}{\char`\}}
110 \def\item[##1]{\par\smallskip\par\hskip-\leftskip\makelabel{##1}\par}
114 \long\def\@makecaption#1#2{%
115 \vskip\abovecaptionskip
116 \sbox\@tempboxa{{\small #1. #2}}%
117 \ifdim \wd\@tempboxa >\hsize
120 \global \@minipagefalse
121 \hb@xt@\hsize{\hfil\box\@tempboxa\hfil}%
123 \vskip\belowcaptionskip}
124 % Suppress output from showexpl to stdout.
128 \def\Node#1#2{\,\vcenter{\hbox{\fboxsep=1pt\fbox{\vbox{\small\halign{\hfil##\hfil\cr
129 #1\mathstrut\cr\noalign{\hrule height.4pt}\strut#2\cr}}}}\,}}
132 \title{The \LuaTeX-ja package}
133 \author{The \LuaTeX-ja project team}
136 \title{\LuaTeX-jaパッケージ}
137 \author{\LuaTeX-jaプロジェクトチーム}
141 \author{\LuaTeX-ja项目团队}
144 basicstyle=\ttfamily\small, pos=r, breaklines=true,
145 numbers=none, rframe={}, basewidth=0.5em
148 \parskip=\smallskipamount
149 \protected\def\Param#1{\textsf{#1}} % parameter name
150 \protected\def\Pkg#1{\underline{\smash{\texttt{#1}}}} % packages/classes
154 \def<#1>{{\normalfont\rm\itshape$\langle$#1$\rangle$}}
161 \textbf{This documentation is far from complete. It may have many
162 grammatical (and contextual) errors.} Also, several parts
163 (especially, Section~\ref{sec-jfmglue}) are written in Japanese only.
166 \textbf{\large 本ドキュメントはまだまだ未完成です.}
169 \textbf{\large 本文档尚未完成。}
173 %<en>\part{User's manual}
174 %<ja>\part{ユーザーズマニュアル}
177 %<en>\section{Introduction}
183 The \LuaTeX-ja package is a macro package for typesetting high-quality
184 Japanese documents when using \LuaTeX.
187 \LuaTeX-jaパッケージは,次世代標準\TeX である\LuaTeX の上で,\pTeX と同等
188 /それ以上の品質の日本語組版を実現させようとするマクロパッケージである.
191 \LuaTeX-ja宏包是应用于下一代标准\TeX 引擎亦即\LuaTeX 引擎上的高质量日语文档排版宏包。
194 %<en>\subsection{Backgrounds}
200 Traditionally, ASCII \pTeX, an extension of \TeX, and its derivatives
201 are used to typeset Japanese documents in \TeX. \pTeX\ is an engine
202 extension of \TeX: so it can produce high-quality Japanese documents
203 without using very complicated macros. But this point is a mixed
204 blessing: \pTeX\ is left behind from other extensions of \TeX,
205 especially \eTeX\ and \pdfTeX, and from changes about
206 Japanese processing in computers (\textit{e.g.}, the UTF-8 encoding).
209 従来,「\TeX を用いて日本語組版を行う」といったとき,エンジンとしては
210 ASCII \pTeX やそれの拡張物が用いられることが一般的であった.\pTeX は\TeX
211 のエンジン拡張であり,(少々仕様上不便な点はあるものの)商業印刷の分野に
212 も用いられるほどの高品質な日本語組版を可能としている.だが,それは弱点に
213 もなってしまった:\pTeX という(組版的に)満足なものがあったため,海外で
214 行われている数々の\TeX の拡張――例えば\eTeX や\pdfTeX ――や,TrueType,
215 OpenType, Unicodeといった計算機で日本語を扱う際の状況の変化に追従すること
219 一般情况下,\TeX 下的日语文档输出,是ASCII \pTeX(\TeX 的一个扩展)及其衍生
220 软件来完成的。\pTeX 作为\TeX 的一个扩展引擎,在生成高质量的日语文档时,规避
221 了繁杂的宏编写。但是在和同时期的引擎相比之下,\pTeX 的处境未免有些尴尬:\pTeX
222 已经远远落后于\eTeX 和pdf\TeX,此外也没有跟上计算机上对日文处理的演进(比如,
223 UTF-8编码,TrueType字体,OpenType字体)。
227 Recently extensions of \pTeX, namely \upTeX\ (Unicode-implementation
228 of \pTeX) and \epTeX\ (merging of \pTeX\ and
229 \eTeX\ extension), have developed to fill those gaps to some
230 extent, but gaps still exist.
233 ここ数年,若干状況は改善されてきた.現在手に入る大半の\pTeX バイナリでは
234 外部UTF-8入力が利用可能となり,さらにUnicode化を推進し,\pTeX の内部処理
235 までUnicode化した\upTeX も開発されている.また,\pTeX に\eTeX 拡張をマー
236 ジした\epTeX も登場し,\TeX\ Live\ 2011では\pLaTeX が\epTeX の上で動作す
237 るようになった.だが,\pdfTeX 拡張(PDF直接出力やmicro-typesetting)を
238 \pTeX に対応させようという動きはなく,海外とのgapは未だにあるのが現状であ
242 最近开发的\pTeX 扩展,即\upTeX(Unicode下的\pTeX 实现)和\epTeX(\pTeX 和
243 \eTeX 的融合版本),虽然在部分情况上弥补了上述的差距,但是差距依然存在。
247 However, the appearance of \LuaTeX\ changed the whole situation. With
248 using Lua `callbacks', users can customize the internal processing of
249 \LuaTeX. So there is no need to modify sources of engines to
250 support Japanese typesetting: to do this, we only have to write Lua
251 scripts for appropriate callbacks.
254 しかし,\LuaTeX の登場で,状況は大きく変わることになった.Luaコードで
255 `callback'を書くことにより,\LuaTeX の内部処理に割り込みをかけることが可
256 能となった.これは,エンジン拡張という真似をしなくても,Luaコードとそれに
257 関する\TeX マクロを書けば,エンジン拡張とほぼ同程度のことができるようになっ
258 たということを意味する.\LuaTeX-jaは,このアプローチによってLuaコード・
259 \TeX マクロによって日本語組版を\LuaTeX の上で実現させようという目的で開発
263 不过,\LuaTeX 的出现改变了整个状况。用户可以通过使用Lua语言的“callback”来
264 调整\LuaTeX 的内部处理机制。所以,没有必要去通过修改引擎的源代码来支持日文
265 排版,相反,我们需要做的仅仅是编写其当处理callback的Lua脚本。
268 %<en>\subsection{Major Changes from \pTeX}
269 %<ja>\subsection{\pTeX からの主な変更点}
270 %<zh>\subsection{与\pTeX 的差异所在}
273 The \LuaTeX-ja package is under much influence of \pTeX\ engine. The initial
274 target of development was to implement features of \pTeX. However,
275 \emph{\LuaTeX-ja is not a just porting of \pTeX; unnatural
276 specifications/behaviors of \pTeX\ were not adopted}.
279 \LuaTeX-jaは,\pTeX に多大な影響を受けている.初期の開発目標は,\pTeX の機
280 能をLuaコードにより実装することであった.しかし,開発が進むにつれ,\pTeX
281 の完全な移植は不可能であり,また\pTeX における実装がいささか不可解になっ
282 ているような状況も発見された.そのため,\textbf{\LuaTeX-jaは,もはや
283 \pTeX の完全な移植は目標とはしない.\pTeX における不自然な仕様・挙動があ
287 \LuaTeX-ja宏包在设计上,受\pTeX 影响很大。最初开发的主要议题是实现\pTeX 的特性。
288 不过,{\bf\LuaTeX-ja不是简简单单的移植\pTeX,很多不自然的特征和现象都被移出了。}
292 The followings are major changes from \pTeX:
295 以下は \pTeX からの主な変更点である.
303 \item A Japanese font is a tuple of a `real' font, a Japanese font
304 metric (\textbf{JFM}, for short), and an optional string called
308 \item 和文フォントは(小塚明朝,IPA明朝などの)実際のフォント,和文フォントメトリック(JFMと呼ぶ\footnote{混乱を防ぐため,p\TeX の意味でのJFM (\texttt{min10.tfm}) などは本ドキュメントでは\textbf{和文用TFM}とよぶことにする.}),そ
309 して`variation'と呼ばれる文字列の組である.
312 \item 一个日文字体是由三部分构成的元组:实际的字体(如小塚明
313 朝,IPA明朝),日文字体测度(\textbf{JFM})和变体字串。
317 \item In \pTeX, a line break after Japanese character is ignored (and
318 doesn't yield a space), since line breaks (in source files) are
319 permitted almost everywhere in Japanese texts. However, \LuaTeX-ja
320 doesn't have this function completely, because of a specification
324 \item 日本語の文書中では改行はほとんどどこでも許されるので,\pTeX では和文文字
325 直後の改行は無視される(スペースが入らない)ようになっていた.しかし,
326 \LuaTeX-ja では \LuaTeX の仕様のためにこの機能は完全には実装されていない.
329 \item \pTeX 中,日文字符之后的断行并不允许(也不产生空格),其他在源码中的断行
330 是可以随处允许的。不过,因为\LuaTeX 的特殊关系,\LuaTeX-ja并没有这个功能。
334 \item The insertion process of glues/kerns between two Japanese
335 characters and between a Japanese character and other characters
336 (we refer these glues/kerns as \textbf{JAglue}) is rewritten from
340 \item 2つの和文文字の間,和文文字と欧文文字の間に入るグルー/カーン
341 (\textbf{JAglue}と呼ぶ)の挿入処理が0から書き直されている.
344 \item 插在日文字符和其他字符言之间的胶/出格(我们将此称为\textbf{JAglue})是重新实现的。
349 \item As \LuaTeX's internal character handling is `node-based'
350 (\textit{e.g.}, \verb+of{}fice+ doesn't prevent ligatures), the
351 insertion process of \textbf{JAglue} is now `node-based'.
354 \item \LuaTeX の内部での文字の扱いが「ノードベース」になっているように(例えば,
355 \verb+of{}fice+ で合字は抑制されない),\textbf{JAglue}の挿入処理も
359 \item 在\LuaTeX 中,内部的字符处理是“基于node的”(例如:\verb!of{}fice!不会避免合字),
360 \textbf{JAglue}的插入处理,现在也是“基于node的”。
364 \item Furthermore, nodes between two characters which have no effects in
365 line break (\textit{e.g.}, \verb+\special+ node) and kerns from
366 italic correction are ignored in the insertion process.
369 \item さらに,2つの文字の間にある行末では効果を持たないノード(例えば \verb+\special+ ノード)や,
370 イタリック補正に伴い挿入されるカーンは挿入処理中では無視される.
373 \item 此外,两个字符之间的node在断行时不起作用的(例如,\verb!\special!node),还有
374 意大利体校正带来的出格在插入处理中也是被忽略的。
378 \item \emph{Caution: due to above two points, many methods which did for the
379 dividing the process of the insertion of \textbf{JAglue} in \pTeX\ are not
380 effective anymore.} In concrete terms, the following two methods are not effective anymore:
383 \item \textbf{注意:上の2つの変更により,従来\textbf{JAglue}の挿入処理を分断するのに
384 使われていたいくつかの方法は用いることができない.具体的には,次の方法はもはや無効である:}
387 \item \textbf{警告:鉴于以上两点,在\pTeX 中分割\textbf{JAglue}处理的多种方法不再生效。}
394 If you want to do so, please put an empty hbox between it instead:
397 もし同じことをやりたければ,空の水平ボックスを間に挟めばよい:
408 \item In the process, two Japanese fonts which only differ in their `real'
409 fonts are identified.
412 \item 処理中では,2つの和文フォントは,「実際の」フォントのみが異なる場合に同一視
416 \item 处理过程中,两个在“真实”字体上具区别的日文字体可以被识别出来。
421 \item \LuaTeX-jaでは,\pTeX と同様に漢字・仮名を制御綴内に用いることができ,
422 \verb+\西暦+ などが正しく動作するようにしている.
423 但し,制御綴中に使える和文文字が\pTeX・\upTeX と全く同じではないことに注意すること.
427 \item At the present, vertical typesetting (\emph{tategaki}), is not
428 supported in \LuaTeX-ja.
431 \item 現時点では,縦書きは\LuaTeX-jaではサポートされていない.
434 \item 当下,\LuaTeX-ja并不支持直行排版。
440 For detailed information, see Part~\ref{part-imp}.
443 詳細については第\ref{part-imp}部を参照.
446 详细的描述,请参见第\ref{part-imp}编。
449 %<en>\subsection{Notations}
450 %<ja>\subsection{用語と記法}
451 %<zh>\subsection{一些约定}
455 In this document, the following terms and notations are used:
458 本ドキュメントでは,以下の用語と記法を用いる:
466 \item Characters are divided into two types:
476 \item \textbf{JAchar}: standing for Japanese characters such as
477 Hiragana, Katakana, Kanji and other punctuation marks for
481 \item \textbf{JAchar}: ひらがな,カタカナ,漢字,和文用の約物といった和文文字の
485 \item \textbf{JAchar}:表示日文字符,如平假名,片假名,汉字,日文标点。
489 \item \textbf{ALchar}: standing for all other characters like alphabets.
492 \item \textbf{ALchar}: アルファベットを始めとする,その他全ての文字を指す.
495 \item \textbf{ALchar}:代表其他字母字符。
500 We say `alphabetic fonts' for fonts used in \textbf{ALchar}, and `Japanese fonts' for fonts used in \textbf{JAchar}.
503 そして,\textbf{ALchar}の出力に用いられるフォントを「欧文フォント」と呼び,
504 \textbf{JAchar}の出力に用いられるフォントを「和文フォント」と呼ぶ.
507 我们将用于\textbf{ALchar}的字体称为“字母字体”,用于\textbf{JAchar}的字体称为“日文字体”。
511 \item A word in a sans-serif font (like \Param{prebreakpenalty})
512 means an internal parameter for Japanese typesetting, and it
513 is used as a key in \verb+\ltjsetparameter+ command.
516 \item サンセリフ体で書かれた語(例:\Param{prebreakpenalty})は日本語組版用の
517 パラメータを表し,これらは \verb+\ltjsetparameter+ コマンドのキーとして
521 \item 用无衬线字体表示的词(如:\Param{prebreakpenalty})表示
522 日文排版中的内部便利iang,并用做\verb!\ltjsetparameter!命令一个键。
526 \item A word in typewriter font with underline (like \Pkg{fontspec})
527 means a package or a class of \LaTeX.
530 \item 下線付きのタイプライタ体で書かれた語(例:\Pkg{fontspec})は\LaTeX の
534 \item 用下划线表示的词(如:\Pkg{fontspec})表示\LaTeX 的宏包或者文档类。
538 \item The word `primitive' is used not only for primitives in \LuaTeX,
539 but also for control sequences that defined in the core module of
543 \item 「プリミティブ」という語を,\LuaTeX のプリミティブだけではなく \LuaTeX-ja
544 のコアモジュールで定義されたコントロールシーケンスに対しても用いる.
547 \item “primitive”,该词在本文档中不仅表示\LuaTeX 的基本控制命令,也包括\LuaTeX-ja的相关的基本控制命令
551 \item In this document, natural numbers start from~0.
554 \item 本ドキュメントでは,自然数は0から始まる.
561 %<en>\subsection{About the project}
562 %<ja>\subsection{プロジェクトについて}
563 %<zh>\subsection{关于本项目}
566 \paragraph{Project Wiki} Project Wiki is under construction.
569 \paragraph{プロジェクトWiki} プロジェクトWikiは構築中である.
572 \paragraph{项目wiki} 本项目wiki正在编写中。
577 \item \url{http://sourceforge.jp/projects/luatex-ja/wiki/FrontPage%28en%29} (English)
578 \item \url{http://sourceforge.jp/projects/luatex-ja/wiki/FrontPage} (Japanese)
579 \item \url{http://sourceforge.jp/projects/luatex-ja/wiki/FrontPage%28zh%29} (Chinese)
584 \item \url{http://sourceforge.jp/projects/luatex-ja/wiki/FrontPage}(日本語)
585 \item \url{http://sourceforge.jp/projects/luatex-ja/wiki/FrontPage%28en%29}(英語)
586 \item \url{http://sourceforge.jp/projects/luatex-ja/wiki/FrontPage%28zh%29}(中国語)
591 \item \url{http://sourceforge.jp/projects/luatex-ja/wiki/FrontPage}(日语)
592 \item \url{http://sourceforge.jp/projects/luatex-ja/wiki/FrontPage%28en%29}(英语)
593 \item \url{http://sourceforge.jp/projects/luatex-ja/wiki/FrontPage%28zh%29}(汉语)
597 This project is hosted by SourceForge.JP.
600 本プロジェクトはSourceForge.JPのサービスを用いて運営されている.
603 本项目由SourceForge.JP托管。
606 %<en>\paragraph{Members}\
607 %<ja>\paragraph{開発メンバー}\
608 %<zh>\paragraph{开发者}\
611 \begin{multienumerate}
612 \def\labelenumi{$\bullet$}
613 \mitemxxx{Hironori KITAGAWA}{Kazuki MAEDA}{Takayuki YATO}
614 \mitemxxx{Yusuke KUROKI}{Noriyuki ABE}{Munehiro YAMAMOTO}
615 \mitemxxx{Tomoaki HONDA}{Shuzaburo SAITO}{MA Qiyuan}
619 \begin{multienumerate}
620 \def\labelenumi{$\bullet$}
621 \mitemxxx{北川 弘典}{前田 一貴}{八登 崇之}
622 \mitemxxx{黒木 裕介}{阿部 紀行}{山本 宗宏}
623 \mitemxxx{本田 知亮}{齋藤 修三郎}{馬 起園}
627 \begin{multienumerate}
628 \def\labelenumi{$\bullet$}
629 \mitemxxx{北川 弘典}{前田 一贵}{八登 崇之}
630 \mitemxxx{黒木 裕介}{阿部 纪行}{山本 宗宏}
631 \mitemxxx{本田 知亮}{斋藤 修三郎}{马 起园}
635 % \paragraph{Acknowledgments} -- 挿入するならここ
638 %<en>\section{Getting Started}
641 %<en>\subsection{Installation}
642 %<ja>\subsection{インストール}
646 To install the \LuaTeX-ja\ package, you will need:
649 \LuaTeX-jaパッケージのインストールには,次のものが必要である.
656 \item \LuaTeX\ (version 0.65.0-beta or later) and its supporting packages.\\
657 If you are using \TeX~Live~2011 or current W32\TeX, you don't have to worry.
660 \item \LuaTeX(バージョン 0.65.0-beta 以降)とその支援パッケージ.
661 \TeX~Live~2011やW32\TeX の最新版ならば問題ない.
664 \item \LuaTeX(版本号为大于0.65)和相关支持宏包。\\
665 如果用户使用的是\TeX Live2011以及最新版本的W32\TeX,可不考虑此项。
668 \item The source archive of \LuaTeX-ja, of course\texttt{:)}
671 \item \LuaTeX-jaのソースアーカイブ(もちろん\texttt{:)}).
674 \item \LuaTeX-ja的源码(当然喽\texttt{:)})。
677 \item The \Pkg{xunicode} package, which version is \emph{just v0.981 (2011/09/09)}.\\
678 If you have the \Pkg{fontspec} package, this \Pkg{xunicode} package must be exist.
679 But be careful about the version; other versions may not work correctly with \LuaTeX-ja.
682 \item \Pkg{xunicode}パッケージ(\textbf{2011/09/09,~v0.981}).\\
683 \Pkg{fontspec}パッケージが導入されていればこのパッケージも導入されているはずであるが,
684 このv0.981以外のバージョンでは\LuaTeX-ja上で正しく動作しない危険性がある.
687 \Pkg{xunicode}宏包,当前版本必须为\textit{v0.981(2011/09/09)}。\\
688 如果你使用\Pkg{fontspec}宏包,\Pkg{xunicode}就必须存在。但是请注意该包的
694 The installation methods are as follows:
704 \item Download the source archive, by one of the following method.
705 At the present, \LuaTeX-ja has no \emph{stable} release.
708 \item Copy the Git repository:
710 $ git clone git://git.sourceforge.jp/gitroot/luatex-ja/luatexja.git
712 \item Download the \texttt{tar.gz} archive of HEAD in the \texttt{master} branch from
714 \url{http://git.sourceforge.jp/view?p=luatex-ja/luatexja.git;a=snapshot;h=HEAD;sf=tgz}.
716 \item Now \LuaTeX-ja is available from the following archive and distributions:
718 \item CTAN (in the \texttt{macros/luatex/generic/luatexja} directory)
719 \item MiK\TeX\ (in \texttt{luatexja.tar.lzma})
720 \item \TeX\ Live (in \texttt{texmf-dist/tex/luatex/luatexja})
721 \item W32\TeX\ (in \texttt{luatexja.tar.xz})
723 These are based on the \texttt{master} branch.
726 Note that the \texttt{master} branch, and hence the archive in CTAN, are not updated frequently;
727 the forefront of development is not the \texttt{master} branch.
730 \item ソースアーカイブを以下のいずれかの方法で取得する.現在公開されているのはあくまでも
734 \item Gitリポジトリの内容をコピーする:
736 $ git clone git://git.sourceforge.jp/gitroot/luatex-ja/luatexja.git
738 \item \texttt{master}ブランチのスナップショット(\texttt{tar.gz}形式)をダウンロードする.
740 \url{http://git.sourceforge.jp/view?p=luatex-ja/luatexja.git;a=snapshot;h=HEAD;sf=tgz}.
742 \item 今や,\LuaTeX-jaは以下のアーカイブ,およびディストリビューションにも収録されている:
744 \item CTAN (\texttt{macros/luatex/generic/luatexja})
745 \item MiK\TeX\ (\texttt{luatexja.tar.lzma})
746 \item \TeX\ Live (\texttt{texmf-dist/tex/luatex/luatexja})
747 \item W32\TeX\ (\texttt{luatexja.tar.xz})
749 これらは\texttt{master}ブランチの内容を元にしている.
752 \texttt{master}ブランチ(従って,CTAN内のアーカイブも)はたまにしか更新されないことに注意.
753 主な開発は\texttt{master}の外で行われ,比較的まとまってきたらそれを\texttt{master}に
757 \item 按照如下方法下载源码归档。现在,\LuaTeX-ja没有稳定版本。
762 $ git clone git://git.sourceforge.jp/gitroot/luatex-ja/luatexja.git
764 \item 下载\texttt{master} HEAD版本的\texttt{tar.gz}归档:
766 \url{http://git.sourceforge.jp/view?p=luatex-ja/luatexja.git;a=snapshot;h=HEAD;sf=tgz}.
768 \item 现在\LuaTeX-ja可以在下列仓库和发行版中获取::
770 \item CTAN ( \texttt{macros/luatex/generic/luatexja})
771 \item MiK\TeX\ (\texttt{luatexja.tar.lzma})
772 \item \TeX\ Live (\texttt{texmf-dist/tex/luatex/luatexja})
773 \item W32\TeX\ (\texttt{luatexja.tar.xz})
775 这些版本都基于\texttt{master}分支。
778 注意\texttt{master}分支和CTAN仓库中的版本,升级并不频繁。
779 前段开发并未在\texttt{master}分支。
783 \item Extract the archive. You will see \texttt{src/} and several other sub-directories.
784 But only the contents in \texttt{src/} are needed to work \LuaTeX-ja.
787 \item 「Gitリポジトリをコピー」以外の方法でアーカイブを取得したならば,それを展開する.
788 \texttt{src/}をはじめとしたいくつかのディレクトリができるが,
789 動作には\texttt{src/}以下の内容だけで十分.
792 \item 解压归档。你会看到\texttt{src/}和其他相关文件夹。
793 但是只有\texttt{src/}文件夹下的相关文件是\LuaTeX-ja运行所必须的。
797 \item Copy all the contents of \texttt{src/} into one of your \texttt{TEXMF} tree.
798 \texttt{TEXMF/tex/luatex/luatexja/} is an example location.
799 If you cloned entire Git repository, making a symbolic link of \texttt{src/}
800 instead copying is also good.
803 \item \texttt{src/}の中身を自分の\texttt{TEXMF}ツリーにコピーする.
804 場所の例としては,例えば\texttt{TEXMF/tex/luatex/luatexja/}がある.
805 シンボリックリンクが利用できる環境で,かつリポジトリを直接取得したのであれば,
806 (更新を容易にするために)コピーではなくリンクを貼ることを勧める.
809 \item 复制\texttt{src/}文件夹下内容至\texttt{TEXMF}数下。
810 \texttt{TEXMF/tex/luatex/luatexja/}为例。
811 如果你复制了整个Git仓库,为\texttt{src/}制作软链接来替代复制也是可以的。
815 \item If \texttt{mktexlsr} is needed to update the file name database, make it so.
818 \item 必要があれば,\texttt{mktexlsr}を実行する.
821 \item 如有必要,执行\texttt{mktexlsr}。
826 %<en>\subsection{Cautions}
827 %<ja>\subsection{注意点}
833 \item The encoding of your source file must be UTF-8. No other
834 encodings, such as EUC-JP or Shift-JIS, are not supported.
837 \item 原稿のソースファイルの文字コードはUTF-8固定である.
838 従来日本語の文字コードとして用いられてきたEUC-JPやShift-JISは使用できない.
841 \item 源文档编码必须是UTF-8。其他的编码,如EUC-JP和Shift-JIS都不被支持。
845 %<en>\subsection{Using in plain \TeX}
846 %<ja>\subsection{plain \TeX で使う}
847 %<zh>\subsection{plain \TeX 下使用}
851 To use \LuaTeX-ja in plain \TeX, simply put the following at the beginning of the document:
854 \LuaTeX-jaを plain \TeX で使うためには,単に次の行をソースファイルの冒頭に追加すればよい:
857 在plain \TeX 下使用\LuaTeX-ja相当简易,在文档开头放置一行:
863 This does minimal settings (like \texttt{ptex.tex}) for typesetting Japanese documents:
866 これで(\texttt{ptex.tex}のように)日本語組版のための最低限の設定がなされる:
869 这里做出了做小的日文文档排版设定(如\texttt{ptex.tex}):
874 \item The following 6~Japanese fonts are preloaded:
876 \begin{tabular}{ccccc}
878 \textbf{classification}&\textbf{font name}&\bf `10\,pt'&\bf`7\,pt'&\bf`5\,pt'\\\midrule
879 \emph{mincho}&Ryumin-Light &\verb+\tenmin+&\verb+\sevenmin+&\verb+\fivemin+\\
880 \emph{gothic}&GothicBBB-Medium&\verb+\tengt+ &\verb+\sevengt+ &\verb+\fivegt+\\
886 \item 以下の6つの和文フォントが定義される:
888 \begin{tabular}{ccccc}
890 \textbf{字体}&\textbf{フォント名}&\bf `10\,pt'&\bf`7\,pt'&\bf`5\,pt'\\\midrule
891 明朝体&Ryumin-Light &\verb+\tenmin+&\verb+\sevenmin+&\verb+\fivemin+\\
892 ゴシック体&GothicBBB-Medium&\verb+\tengt+ &\verb+\sevengt+ &\verb+\fivegt+\\
898 \item 提前加载了六种日文字体,如下:
900 \begin{tabular}{ccccc}
902 \textbf{字体}&\textbf{字体名}&\bf `10\,pt'&\bf`7\,pt'&\bf`5\,pt'\\\midrule
903 明朝体&Ryumin-Light &\verb+\tenmin+&\verb+\sevenmin+&\verb+\fivemin+\\
904 哥特体&GothicBBB-Medium&\verb+\tengt+ &\verb+\sevengt+ &\verb+\fivegt+\\
911 \item It is widely accepted that the font `Ryumin-Light' and
912 `GothicBBB-Medium' aren't embedded into PDF files, and PDF reader
913 substitute them by some external Japanese fonts (\textit{e.g.},
914 Kozuka Mincho is used for Ryumin-Light in Adobe Reader). We adopt this custom to
918 \item `Ryumin-Light'と`GothicBBB-Medium'はPDFファイルに埋め込まずに
919 名前参照のみで用いることが広く受け入れられており,この場合PDFリーダーが
920 適切な外部フォントで代用する(例えば,Adobe ReaderではRyumin-Lightは
921 小塚明朝で代替される).そこで,これらを引き続きデフォルトのフォントと
925 \item 广为接受的“Ryumin-Light”和“GothicBBB-Medium”字体不嵌入PDF文件,
926 而PDF阅读器则会使用外部日文字体替代(例如,在Adobe Reader中使用
927 Kozuka Mincho字体替代Ryumin-Light)。我们使用默认设定。
931 \item A character in an alphabetic font is generally smaller than a
932 Japanese font in the same size. So actual size specification of
933 these Japanese fonts is in fact smaller than that of alphabetic
934 fonts, namely scaled by 0.962216.
937 \item 欧文フォントの文字は和文フォントの文字よりも,同じ文字サイズでも
938 一般に小さくデザインされている.そこで,標準ではこれらの和文フォントの実際のサイズは指定された値よりも
939 小さくなるように設定されており,具体的には指定の0.962216倍にスケールされる.
940 この0.962216という数値も,\pTeX におけるスケーリングを踏襲した値である.
943 \item 一般情况下,相同大小日文字体比西文字体要大一下。所以实际的日文字体尺寸需哟小于西文字
949 \item The amount of glue that are inserted between a \textbf{JAchar} and
950 an \textbf{ALchar} (the parameter \Param{xkanjiskip}) is set to
953 \item \textbf{JAchar}と\textbf{ALchar}の間に入るグルー(\Param{xkanjiskip})の
957 \item 在\textbf{JAchar}和\textbf{ALchar}之间插入的胶(\textsf{xkanjiskip}参数)大小为:
960 (0.25\cdot 0.962216\cdot 10\,\mathrm{pt})^{+1\,\text{pt}}_{-1\,\text{pt}}
961 = 2.40554\,\mathrm{pt}^{+1\,\text{pt}}_{-1\,\text{pt}}.
965 %<en>\subsection{Using in \LaTeX}
966 %<ja>\subsection{\LaTeX で使う}
967 %<zh>\subsection{\LaTeX 下使用}
973 Using in \LaTeXe\ is basically same. To set up the minimal environment
974 for Japanese, you only have to load \texttt{luatexja.sty}:
977 \LaTeXe を用いる場合も基本的には同じである.日本語組版のための最低限の環境を
978 設定するためには,\texttt{luatexja.sty}を読み込むだけでよい:
981 在\LaTeXe 下使用基本相同。设定日文的最小环境,你只需加载\texttt{luatexja.sty}:
984 \usepackage{luatexja}
987 It also does minimal settings (counterparts in \pLaTeX\ are \texttt{
988 plfonts.dtx} and \texttt{pldefs.ltx}):
991 これで\pLaTeX の\texttt{plfonts.dtx}と\texttt{pldefs.ltx}に相当する最低限の設定が
995 这些做了最小的设定(作用相当于\pLaTeX 中的\texttt{plfonts.dtx}和\texttt{pldefs.ltx}):
1000 \item \texttt{JY3} is the font encoding for Japanese fonts (in horizontal direction).\\
1001 When vertical typesetting is supported by \LuaTeX-ja in the future, \texttt{JT3} will be used for vertical fonts.
1004 \item \texttt{JY3}は和文フォント用のフォントエンコーディングである(横書き用).\\
1005 将来的に,\LuaTeX-jaで縦書きがサポートされる際には,\texttt{JT3}を縦書き用として
1009 \item \texttt{JY3}是日文字体编码(在水平方向)。\\
1010 在将来\LuaTeX-ja要支持直行排版的时候,\texttt{JT3}会用于直行字体。
1014 \item Two font families \texttt{mc} and \texttt{gt} are defined:
1016 \begin{tabular}{ccccc}
1018 \textbf{classification}&\textbf{family}&\verb+\mdseries+&\verb+\bfseries+&\textbf{scale}\\\midrule
1019 \emph{mincho}&\tt mc&Ryumin-Light &GothicBBB-Medium&0.962216\\
1020 \emph{gothic}&\tt gt&GothicBBB-Medium&GothicBBB-Medium&0.962216\\
1024 Remark that the bold series in both family are same as the medium series of \emph{gothic} family.
1025 This is a convention in \pLaTeX. This is a trace that there were only 2~fonts (these are Ryumin-Light
1026 and GothicBBB-Medium) in early years of DTP.
1029 \item 2つのフォントファミリ\texttt{mc}と\texttt{gt}が定義されている:
1031 \begin{tabular}{ccccc}
1033 \textbf{字体}&\textbf{ファミリ}&\verb+\mdseries+&\verb+\bfseries+&\textbf{スケール}\\\midrule
1034 明朝体&\tt mc&Ryumin-Light &GothicBBB-Medium&0.962216\\
1035 ゴシック体&\tt gt&GothicBBB-Medium&GothicBBB-Medium&0.962216\\
1039 どちらのファミリにおいても,そのboldシリーズはゴシック体のmediumシリーズで
1040 あることに注意.これは初期のDTPにおいて和文フォントが2つ(それがちょうど\
1041 Ryumin-Light, GothicBBB-Mediumだった)しか利用できなかった時の名残であり,\pLaTeX{}
1045 \item 定义了两个字体族:\texttt{mc}!和\texttt{gt}:\\
1047 \begin{tabular}{ccccc}
1049 \textbf{字体}&\textbf{字体族}&\verb!\mdseries!&\verb!\bfseries!&缩放率\\
1051 \textit{mincho}&\verb!mc!&Ryumin-Light&GothicBBB-Medium&0.962216\\
1052 \textit{gothic}&\verb!gt!&GothicBBB-Medium&GothicBBB-Medium&0.962216\\
1056 注意的是两个字体族的粗体系列同为中等系列的\textbf{哥特}族。这\pLaTeX 中的规定。在近些年
1057 中的DTP实务中有仅使用2个字体的趋向(是为Ryumin-Light和GothicBBB-Medium)。
1061 \item Japanese characters in math mode are typeset by the font family \texttt{mc}.
1064 \item 数式モード中の和文文字は\texttt{mc}ファミリで出力される.
1067 \item 在数学模式下,日文字符使用\verb!mc!字体族来排印。
1072 However, above settings are not sufficient for Japanese-based
1073 documents. To typeset Japanese-based documents, you are better to use
1074 class files other than \texttt{article.cls}, \texttt{book.cls}, and so on. At
1075 the present, we have the counterparts of \Pkg{jclasses} (standard
1076 classes in \pLaTeX) and \Pkg{jsclasses} (classes by Haruhiko
1077 Okumura), namely, \Pkg{ltjclasses} and \Pkg{ltjsclasses}.
1080 しかしながら,上記の設定は日本語の文書にとって十分とは言えない.
1081 日本語文書を組版するためには,\texttt{article.cls}, \texttt{book.cls}といった
1082 欧文用のクラスファイルではなく,和文用のクラスファイルを用いた方がよい.
1083 現時点では,\Pkg{jclasses}(\pLaTeX の標準クラス)と\Pkg{jsclasses}
1084 (奥村晴彦氏によるクラスファイル)に対応するものとして,\Pkg{ltjclasses},
1085 \Pkg{ltjsclasses}がそれぞれ用意されている.
1088 不过,上述设定并不能满足排版基于日文的文档。为了排印基于日文的文
1089 档,你最好不要使用\texttt{article.cls},\texttt{book.cls}等文档类文件。
1090 现在,我们有相当于\Pkg{jclasses}(\pLaTeX 标准文档类)和\Pkg{jsclasses}
1091 (奥村晴彦)的文档类,即\Pkg{ltjclasses}和\Pkg{ltjsclasses}。
1094 %<en>\subsection{Changing Fonts}
1095 %<ja>\subsection{フォントの変更}
1096 %<zh>\subsection{字体更改}
1100 \paragraph{Remark: Japanese Characters in Math Mode}
1101 Since \pTeX\ supports Japanese characters in math mode, there are
1102 sources like the following:
1105 \paragraph{意見:数式モード中の和文文字}
1106 \pTeX では,特に何もしないでも数式中に和文文字を記述することができた.そのため,
1110 \paragraph{注记:数学模式下的日文字符}
1111 \pTeX 支持在数学模式下的日文字符,如以下源码:
1115 $f_{高温}$~($f_{\text{high temperature}}$).
1116 \[ y=(x-1)^2+2\quad よって\quad y>0 \]
1117 $5\in 素:=\{\,p\in\mathbb N:\text{$p$ is a prime}\,\}$.
1120 We (the project members of \LuaTeX-ja) think that using
1121 Japanese characters in math mode are allowed if and only if these are used as identifiers.
1122 In this point of view,
1125 \LuaTeX-jaプロジェクトでは,数式モード中での和文文字はそれらが識別子として用いられる
1130 我们(\LuaTeX-ja项目成员)认为在数学模式下使用日文字符,只有在这些字符充当标识符时才是正确的。在这点下:
1134 \item The lines 1~and~2 above are not correct, since `高温' in above is used as a textual label, and
1135 `よって' is used as a conjunction.
1138 \item 上記数式のうち1, 2行目は正しくない.なぜならば`高温'が意味のあるラベルと
1139 して,`よって'が接続詞として用いられているからである.
1142 \item 第1行和第2行是不正确的,因为“高温”的作用为文本标签,“よって”用作为连词。
1145 \item However, the line~3 is correct, since `素' is used as an identifier.
1148 \item しかしながら,3行目は`素'が識別子として用いられているので正しい.
1151 \item 不过,第3行是正确的,因为“素”是作为标识符的。
1155 Hence, in our opinion, the above input should be corrected as:
1158 したがって,\LuaTeX-jaプロジェクトの意見としては,上記の入力は次のように直されるべき
1162 那么,根据我们的观点,上述输入应当校正为:
1166 ($f_{\text{high temperature}}$).
1168 \mathrel{\text{よって}}\quad y>0 \]
1169 $5\in 素:=\{\,p\in\mathbb N:\text{$p$ is a prime}\,\}$.
1171 %BUG?: \{\}がなければ「素」がでない.上の段落の「よって」もでてない.
1173 We also believe that using Japanese characters as identifiers is rare,
1174 hence we don't describe how to change Japanese fonts in math mode in
1175 this chapter. For the method, please see Subsection~\ref{ssec-math}.
1178 また\LuaTeX-jaプロジェクトでは,和文文字が識別子として用いられることはほとんどない
1179 と考えており,したがってこの節では数式モード中の和文フォントを変更する方法については
1180 記述しない.この方法については\ref{ssec-math}節を参照のこと.
1183 我们也认为使用日文字符作为标识符的情况极为少见,所以我们不在此章节描述如何在数学模式下改变日文字体。
1184 关于此方法,请参见\ref{ssec-math}。
1188 \paragraph{plain \TeX}
1189 To change Japanese fonts in plain \TeX, you must use the primitive
1190 \verb+\jfont+. So please see Subsection~\ref{ssec-jfont}.
1193 \paragraph{plain \TeX}
1194 plain \TeX で和文フォントを変更するためには,\verb+\jfont+ プリミティブを用いなけれ
1195 ばならない.\ref{ssec-jfont}節を参照.
1198 \paragraph{plain \TeX}
1199 在plain \TeX 下改变日文字体,你必须使用基本语句\verb!\jfont!。请参见\ref{ssec-jfont}。
1204 For \LaTeXe, \LuaTeX-ja adopted most of the font selection system of \pLaTeXe\ (in \texttt{plfonts.dtx}).
1208 \LaTeXe については,\LuaTeX-jaではフォント選択システムを\pLaTeXe\ (\texttt{plfonts.dtx})
1213 对于\LaTeXe,\LuaTeX-ja采用了\pLaTeXe 中(即\texttt{plfonts.dtx})大部分字体选择系统。
1217 \item Two control sequences \verb+\mcdefault+ and \verb+\gtdefault+ are
1218 used to specify the default font families for \emph{mincho} and
1219 \emph{gothic}, respectively. Default values: \texttt{mc} for
1220 \verb+\mcdefault+ and \texttt{gt} for \verb+\gtdefault+.
1223 \item 2つのコントロールシーケンス \verb+\mcdefault+ と \verb+\gtdefault+ がそれぞ
1224 れ明朝体とゴシック体のデフォルトのフォントファミリを指定するために用いられる.
1225 初期値:\verb+\mcdefault+ は\texttt{mc},\verb+\gtdefault+ は\texttt{gt}.
1228 \item \verb!\mcdefault!和\verb!\gtdefault!控制语句用来分别控制默认的\textit{mincho}和\textit{gothic}字体族。
1229 默认值:\texttt{mc}用于\verb!\mcdefault!,\texttt{gt}用于\verb!\gtdefault!。
1232 \item Commands \verb+\fontfamily+, \verb+\fontseries+,
1233 \verb+\fontshape+ and \verb+\selectfont+ can be used to change
1234 attributes of Japanese fonts.
1237 \item \verb+\fontfamily+, \verb+\fontseries+, \verb+\fontshape+, そして
1238 \verb+\selectfont+ が和文フォントの属性を変更するために使用できる.
1241 \item 命令\verb!\fontfamily!,\verb!\fontseries!,\verb!\fontshape!个\verb!\selectfont!用来改变日文字体属性。
1246 \begin{tabular}{cccccc}
1248 &\textbf{encoding}&\textbf{family}&\textbf{series}&\textbf{shape}&\textbf{selection}\\\midrule
1250 &\verb+\romanencoding+&\verb+\romanfamily+&\verb+\romanseries+&\verb+\romanshape+
1253 &\verb+\kanjiencoding+&\verb+\kanjifamily+&\verb+\kanjiseries+&\verb+\kanjishape+
1255 both&---&--&\verb+\fontseries+&\verb+\fontshape+&---\\
1256 auto select&\verb+\fontencoding+&\verb+\fontfamily+&---&---&\verb+\usefont+\\
1263 \begin{tabular}{cccccc}
1265 &\textbf{エンコーディング}&\textbf{ファミリ}&\textbf{シリーズ}&\textbf{シェープ}&\textbf{選択}\\\midrule
1267 &\verb+\romanencoding+&\verb+\romanfamily+&\verb+\romanseries+&\verb+\romanshape+
1270 &\verb+\kanjiencoding+&\verb+\kanjifamily+&\verb+\kanjiseries+&\verb+\kanjishape+
1272 両方&---&--&\verb+\fontseries+&\verb+\fontshape+&---\\
1273 自動選択&\verb+\fontencoding+&\verb+\fontfamily+&---&---&\verb+\usefont+\\
1280 \begin{tabular}{cccccc}
1282 &\textbf{编码}&\textbf{族}&\textbf{系列}&\textbf{形状}&\textbf{选择}\\\midrule
1284 &\verb+\romanencoding+&\verb+\romanfamily+&\verb+\romanseries+&\verb+\romanshape+
1287 &\verb+\kanjiencoding+&\verb+\kanjifamily+&\verb+\kanjiseries+&\verb+\kanjishape+
1289 两者&---&--&\verb+\fontseries+&\verb+\fontshape+&---\\
1290 自动选择&\verb+\fontencoding+&\verb+\fontfamily+&---&---&\verb+\usefont+\\
1297 \verb+\fontencoding{<encoding>}+ changes the encoding of alphabetic fonts
1298 or Japanese fonts depending on the argument. For example,
1299 \verb+\fontencoding{JY3}+ changes the encoding of Japanese fonts to
1300 \texttt{JY3} and \verb+\fontencoding{T1}+ changes the encoding of
1301 alphabetic fonts to \texttt{T1}.
1302 \verb+\fontfamily+ also changes the family of Japanese fonts, alphabetic
1303 fonts, \emph{or both}. For detail, see Subsection~\ref{ssub-nfsspat}.
1306 ここで,\verb+\fontencoding{<encoding>}+ は,引数により和文側か欧文
1307 側かのどちらかのエンコーディングを変更する.例えば,
1308 \verb+\fontencoding{JY3}+ は和文フォントのエンコーディングを
1309 \texttt{JY3}に変更し,\verb+\fontencoding{T1}+ は欧文フォント側を
1310 \texttt{T1}へと変更する.\verb+\fontfamily+ も引数により和文側,欧文
1311 側,\textbf{あるいは両方}のフォントファミリを変更する.詳細は
1312 \ref{ssub-nfsspat}節を参照すること.
1315 \verb!\fontencoding{<encoding>}!依赖于参数以改变西文字体或者日文字体。
1316 例如,\verb!\fontencoding{JY3}!改变当前日文字体至\texttt{JY3},
1317 \verb!\fontencoding{T1}!改变西文字体至\texttt{T1}。
1318 \verb!\fontfamily!也会改变日文字体或西文字体的族,抑或二者。
1319 细节详见\ref{ssub-nfsspat}。
1323 \item For defining a Japanese font family, use
1324 \verb+\DeclareKanjiFamily+ instead of
1325 \verb+\DeclareFontFamily+. However, in the present implementation,
1326 using \verb+\DeclareFontFamily+ doesn't cause any problem.
1329 \item 和文フォントファミリの定義には \verb+\DeclareFontFamily+ の
1330 代わりに \verb+\DeclareKanjiFamily+ を用いる.しかし,現在の
1331 実装では \verb+\DeclareFontFamily+ を用いても問題は生じない.
1334 \item 对于定义日文字体族,使用\verb!\DeclareKanjiFamily!代替\verb!\DeclareFontFamily!。
1335 不过,在现在的实现中,使用\verb!\DeclareFontFamily!不会引起任何问题。
1339 \subsection{fontspec}
1340 \label{ssec-fontspec}
1342 To coexist with the \Pkg{fontspec} package, it is needed to load
1343 \Pkg{luatexja-fontspec} package in the preamble. This additional
1344 package automatically loads \Pkg{luatexja} and \Pkg{fontspec}
1348 \Pkg{fontspec}パッケージと同様の機能を和文フォントに対しても用いるためには,
1349 \Pkg{luatexja-fontspec}パッケージをプリアンブルで読み込む必要がある.このパッケージ
1350 は必要ならば自動で\Pkg{luatexja}パッケージと\Pkg{fontspec}パッケージを読み込む.
1353 为与\Pkg{fontspec}宏包共存,需要在导言区中使用\Pkg{luatexja-fontspec}宏包。
1354 这个附加宏包会自动加载\Pkg{luatexja}和\Pkg{fontspec}。
1358 In \Pkg{luatexja-fontspec} package, the following 7~commands are defined as
1359 counterparts of original commands in the \Pkg{fontspec} package:
1362 \Pkg{luatexja-fontspec}パッケージでは,以下の7つのコマンドを\Pkg{fontspec}
1363 パッケージの元のコマンドに対応するものとして定義している:
1366 在\Pkg{luatexja-fontspec}中,定义了如下七条命令,这些命令和\Pkg{fontspec}的相关命令对比如下:
1370 \begin{tabular}{ccccc}
1373 &\verb+\jfontspec+&\verb+\setmainjfont+&\verb+\setsansjfont+&\verb+\newjfontfamily+\\
1375 &\verb+\fontspec+&\verb+\setmainfont+&\verb+\setsansfont+&\verb+\newfontfamily+\\
1378 &\verb+\newjfontface+&\verb+\defaultjfontfeatures+&\verb+\addjfontfeatures+\\
1380 &\verb+\newfontface+&\verb+\defaultfontfeatures+&\verb+\addfontfeatures+\\
1387 \begin{tabular}{ccccc}
1390 &\verb+\jfontspec+&\verb+\setmainjfont+&\verb+\setsansjfont+&\verb+\newjfontfamily+\\
1392 &\verb+\fontspec+&\verb+\setmainfont+&\verb+\setsansfont+&\verb+\newfontfamily+\\
1395 &\verb+\newjfontface+&\verb+\defaultjfontfeatures+&\verb+\addjfontfeatures+\\
1397 &\verb+\newfontface+&\verb+\defaultfontfeatures+&\verb+\addfontfeatures+\\
1404 \begin{tabular}{ccccc}
1406 日文字体&\verb+\jfontspec+&\verb+\setmainjfont+&\verb+\setsansjfont+&\verb+\newjfontfamily+\\
1407 西文字体&\verb+\fontspec+&\verb+\setmainfont+&\verb+\setsansfont+&\verb+\newfontfamily+\\
1409 日文字体&\verb+\newjfontface+&\verb+\defaultjfontfeatures+&\verb+\addjfontfeatures+&\\
1410 西文字体&\verb+\newfontface+&\verb+\defaultfontfeatures+&\verb+\addfontfeatures+&\\
1417 \fontspec[Numbers=OldStyle]{TeX Gyre Termes}
1418 \jfontspec{IPAexMincho}
1421 \addjfontfeatures{CJKShape=JIS1990}
1426 Note that there is no command named \verb+\setmonojfont+, since it is
1427 popular for Japanese fonts that nearly all Japanese glyphs have same
1428 widths. Also note that the kerning feature is set off by default in
1429 these 7~commands, since this feature and \textbf{JAglue} will clash (see
1433 和文フォントについては全ての和文文字のグリフがほぼ等幅であるのが普通であるため,
1434 \verb+\setmonojfont+ コマンドは存在しないことに注意.また,これらの和文用の7つのコマ
1435 ンドではKerning featureはデフォルトではoffとなっている.これはこの
1436 featureが\textbf{JAglue}と衝突するためである(\ref{para-kern}節を参照).
1439 请注意并没有\verb!\setmonofont!命令,因为流行的日文字体几乎全部是等宽的。
1440 另注意,出格特性在这7个命令中默认关闭,因为此特性会与\textbf{JAglue}冲突(参见\ref{para-kern})。
1444 \subsection{\texttt{\char92 CID}, \texttt{\char92 UTF} and macros in \Pkg{otf} package}
1445 Under \pLaTeX, \Pkg{otf} package (developed by Shuzaburo Saito) is
1446 used for typesetting characters which is in Adobe-Japan1-6 CID but not
1447 in JIS~X~0208. Since this package is widely used, \LuaTeX-ja
1448 supports some of functions in \Pkg{otf} package.
1449 If you want to use these functions, load \Pkg{luatexja-otf} package.
1452 \subsection{\texttt{\char92 CID}, \texttt{\char92 UTF}と\Pkg{otf}パッケージのマクロ}
1453 \pLaTeX では,JIS~X~0208にないAdobe-Japan1-6の文字を出力するために,
1454 齋藤修三郎氏による\Pkg{otf}パッケージが用いられていた.このパッケージは
1455 広く用いられているため,\LuaTeX-jaにおいても\Pkg{otf}パッケージの機能の
1456 一部をサポートしている.これらの機能を用いるためには\Pkg{luatexja-otf}パッケージ
1460 \subsection{\Pkg{otf}包中的\texttt{\char92CID},\texttt{\char92UTF}及其他宏}
1461 \pLaTeX 下,\underline{\texttt{otf}}宏包(斋藤修三郎开发)是用来排印存在
1462 于Adobe-Japan1-6但不存在于JIS X 0208中的字符。
1463 该包已经广泛使用,\LuaTeX-ja支持部分\Pkg{otf}包中的部分功能。
1464 如果你想使用这些功能,加载\Pkg{luatexja-otf}宏包。
1466 \fontencoding{JY3}\selectfont
1470 森\UTF{9DD7}外と内田百\UTF{9592}とが\UTF{9AD9}島屋に行く。
1472 \CID{7652}飾区の\CID{13706}野家,
1480 \Pkg{otf}パッケージでは,それぞれ次のようなオプションが存在した:
1482 \item[\texttt{deluxe}] 明朝体・ゴシック体各2ウェイトと,丸ゴシック体を扱えるようになる.
1483 \item[\texttt{expert}] 仮名が横組・縦組専用のものに切り替わり,ルビ用仮名も扱えるようになる.
1484 \item[\texttt{bold}] ゴシック体を標準で太いウェイトのものに設定する.
1486 これらは,\Pkg{otf}パッケージが文書中で使用する
1487 和文用TFMを自前の物に置き換えていることで可能になっている.
1489 一方,\Pkg{luatexja-otf}パッケージでは,文書中で使用する和文用JFMを置き換えることはしない.
1490 そのため,上に述べた3つのオプションと同等のことを実現するには,\ref{ssub-chgfnt}節 (NFSS2) や
1491 \ref{ssec-fontspec}節 (\Pkg{fontspec}) によって\textbf{事前に}設定しておかなければならない.
1493 TODO: 設定方法と例を載せる.フォントの関係上(複数の)別ファイルでよい?
1496 %<en>\section{Changing Parameters}
1497 %<ja>\section{パラメータの変更}
1501 There are many parameters in \LuaTeX-ja. And due to the behavior of \LuaTeX,
1502 most of them are not stored as internal register of \TeX, but as an
1503 original storage system in \LuaTeX-ja. Hence, to assign or acquire those
1504 parameters, you have to use commands \verb+\ltjsetparameter+ and
1505 \verb+\ltjgetparameter+.
1508 \LuaTeX-jaには多くのパラメータが存在する.そして\LuaTeX の仕様のために,
1509 その多くは\TeX のレジスタにではなく,\LuaTeX-ja独自の方法で保持されている.
1510 そのため,これらのパラメータを設定・取得するためには \verb+\ltjsetparameter+ と \verb+\ltjgetparameter+ を
1514 \LuaTeX-ja包含大量的参数,以控制排版细节。
1515 设定这些参数需要使用命令:\verb!\ltjsetparameter!和\verb!\ltjgetparameter!命令。
1518 %<en>\subsection{Editing the range of \textbf{JAchar}s}
1519 %<ja>\subsection{\textbf{JAchar}の範囲の設定}
1520 %<zh>\subsection{\textbf{JAchar}范围设定}
1524 To edit the range of \textbf{JAchar}s, you have to assign a non-zero
1525 natural number which is less than 217 to the character range first. This
1526 can be done by using \verb+\ltjdefcharrange+ primitive. For example, the
1527 next line assigns whole characters in Supplementary Ideographic Plane
1528 and the character `漢' to the range number~100.
1531 \textbf{JAchar}の範囲を設定するためには,まず各文字に0より大きく217より小さいindexを
1532 割り当てる必要がある.これには \verb+\ltjdefcharrange+ プリミティブを用いる.
1533 例えば,次のように書くことで追加漢字面(SIP)にある全ての文字と`漢'が
1534 「100番の文字範囲」に属するように設定される.
1537 在设定\textbf{JAchar}之前,需要分配一个小于217的自然数。
1538 这个可以由\verb!\ltjdefcharrange!基本语句来完成。例如,
1539 下面就分配了整个表意文字补充平面和汉字“漢”为100。
1542 \ltjdefcharrange{100}{"10000-"1FFFF,`漢}
1545 This assignment of numbers to ranges are always global, so you should
1546 not do this in the middle of a document.
1549 この文字範囲の割り当ては常にグローバルであり,したがって文書の途中で
1553 范围数的分配是全局的,故你不可在文档中使用。
1557 If some character has been belonged to some non-zero numbered range,
1558 this will be overwritten by the new setting. For example, whole SIP
1559 belong to the range~4 in the default setting of \LuaTeX-ja, and if you
1560 specify the above line, then SIP will belong to the range~100 and be
1561 removed from the range~4.
1564 もし指定されたある文字がある非零番号の範囲に属していたならば,これは新しい設定で
1565 上書きされる.例えば,SIPは全て\LuaTeX-jaのデフォルトでは4番の文字範囲に
1566 属しているが,上記の指定を行えばSIPは100番に属すようになり,4番からは除かれる.
1569 如果某些字符被改变为新的非零数范围,将会被新设定重写。
1570 例如,整个SIP在\LuaTeX-ja默认设定中属于范围4,如果你使用如上设定,
1571 SIP将会被设定为范围100,且从范围4种移除。
1575 After assigning numbers to ranges, the \textsf{jacharrange} parameter can
1576 be used to customize which character range will be treated as ranges of
1577 \textbf{JAchar}s, as the following line (this is just the default
1578 setting of \LuaTeX-ja):
1581 文字範囲に番号を割り当てた後は,\textsf{jacharrange}パラメータが\textbf{JAchar}と
1582 して扱われる文字の範囲を設定するために用いられる.例えば,以下は\LuaTeX-jaの
1586 分配了范围数之后,\textsf{jacharrange}参数将用于设定字符范围为\textbf{JAchar},
1587 如下(为\LuaTeX-ja默认设定):
1590 \ltjsetparameter{jacharrange={-1, +2, +3, -4, -5, +6, +7, +8}}
1593 The argument to \textsf{jacharrange} parameter is a list of integer.
1594 Negative integer $-n$ in the list means that `the characters that belong to
1595 range~$n$ are treated as \textbf{ALchar}', and positive integer $+n$ means
1596 that `the characters that belong to range~$n$ are treated as \textbf{JAchar}'.
1599 \textsf{jacharrange}パラメータには整数のリストを与える.
1600 リスト中の負の整数$-n$は「文字範囲$n$に属する文字は\textbf{ALchar}として
1601 扱われる」ことを意味し,正の整数$+n$は\textbf{JAchar}として扱うことを意味する.
1604 \textsf{jacharrange}参数的变量未整数数组。
1605 负数$-n$在数组中表示“字符范围$n$中的字符被视作\textbf{ALchar}”,
1606 正数$+n$则表示“字符范围$n$被视作\textbf{JAchar}”。
1610 \paragraph{Default Setting}
1611 \LuaTeX-ja predefines eight character ranges for convenience. They are
1612 determined from the following data:
1616 \LuaTeX-jaでは8つの文字範囲を設定している.これらは以下のデータに基づいて決定して
1621 \LuaTeX-ja默认设定了8个字符范围。如下设定:
1625 \item Blocks in Unicode~6.0.
1628 \item Unicode~6.0のブロック.
1634 \item The \texttt{Adobe-Japan1-UCS2} mapping between a CID Adobe-Japan1-6 and Unicode.
1637 \item \texttt{Adobe-Japan1-UCS2}によるAdobe-Japan1-6のCIDとUnicodeの間の
1641 \item 在CID Adobe-Japan1-6和Unicode之间的映射\texttt{Adobe-Japan1-UCS2}。
1644 \item The \texttt{PXbase} bundle for \upTeX\ by Takayuki Yato.
1647 \item 八登崇之氏による\upTeX 用の\texttt{PXbase}バンドル.
1650 \item 八登崇之的\texttt{PXbase}宏包(\upTeX 下使用)。
1655 Now we describe these eight ranges. The alphabet `J' or `A' after the
1656 number shows whether characters in the range is treated as
1657 \textbf{JAchar}s or not by default. These settings are similar to the
1658 \texttt{prefercjk} settings defined in \texttt{PXbase} bundle.
1661 以下ではこれら8つの文字範囲について記述する.番号のあとのアルファベット`J'と`A'
1662 はデフォルトで\textbf{JAchar}か\textbf{ALchar}かを表している.これらの設定は
1663 \texttt{PXbase}バンドルで定義されている\texttt{prefercjk}と類似のものである.
1666 现在我们描述8个字符范围。在数字后的“J”和“A”表明代表\textbf{JAchar}或者未跟随默认设定。
1667 这些设定类似于\texttt{PXbase}中的\texttt{prefercjk}设定。
1671 \item[Range~8${}^{\text{J}}$] Symbols in the intersection of the upper half of ISO~8859-1
1672 (Latin-1 Supplement) and JIS~X~0208 (a basic character set for Japanese). This character range
1673 consists of the following characters:
1676 \item[範囲8${}^{\text{J}}$] ISO~8859-1の上位領域(ラテン1補助)と
1677 JIS~X~0208の共通部分にある記号.この文字範囲は
1681 \item[范围8${}^\text{J}$] ISO 8859-1(Latin-1补充)的上半部和JIS X 0208(日文基本字符集)的重叠部分,包含下列字符:
1683 \begin{multicols}{2}
1685 \def\ch#1#2{\item \char"#1\ (\texttt{U+00#1}, #2)}%"
1687 \ch{A7}{Section Sign}
1689 \ch{B0}{Degree sign}
1690 \ch{B1}{Plus-minus sign}
1691 \ch{B4}{Spacing acute}
1692 \ch{B6}{Paragraph sign}
1693 \ch{D7}{Multiplication sign}
1694 \ch{F7}{Division Sign}
1701 \ch{B4}{アキュート・アクセント}
1720 \item[Range~1${}^{\text{A}}$] Latin characters that some of them are included in Adobe-Japan1-6.
1721 This range consist of the following Unicode ranges, \emph{except characters in the range~8 above}:
1724 \item[範囲1${}^{\text{A}}$] ラテン文字.一部はAdobe-Japan1-6にも含まれている.
1725 この範囲は以下のUnicodeのブロックから構成されている.
1726 \textbf{ただし,範囲8は除く.}
1729 \item[范围1${}^\text{A}$] 包含于Adobe-Japan1-6中的拉丁字符,此范围包含下列
1730 Unicode区域,但\textbf{不包括上述提到过的范围8}:
1732 \begin{multicols}{2}
1735 \item \texttt{U+0080}--\texttt{U+00FF}: Latin-1 Supplement
1736 \item \texttt{U+0100}--\texttt{U+017F}: Latin Extended-A
1737 \item \texttt{U+0180}--\texttt{U+024F}: Latin Extended-B
1738 \item \texttt{U+0250}--\texttt{U+02AF}: IPA Extensions
1739 \item \texttt{U+02B0}--\texttt{U+02FF}: Spacing Modifier Letters
1740 \item \texttt{U+0300}--\texttt{U+036F}: Combining Diacritical Marks
1741 \item \texttt{U+1E00}--\texttt{U+1EFF}: Latin Extended Additional
1744 \item \texttt{U+0080}--\texttt{U+00FF}: ラテン1補助
1745 \item \texttt{U+0100}--\texttt{U+017F}: ラテン文字拡張A
1746 \item \texttt{U+0180}--\texttt{U+024F}: ラテン文字拡張B
1747 \item \texttt{U+0250}--\texttt{U+02AF}: IPA拡張(国際音声記号)
1748 \item \texttt{U+02B0}--\texttt{U+02FF}: 前進を伴う修飾文字
1749 \item \texttt{U+0300}--\texttt{U+036F}: ダイアクリティカルマーク(合成可能)
1750 \item \texttt{U+1E00}--\texttt{U+1EFF}: ラテン文字拡張追加
1753 \item \texttt{U+0080}--\texttt{U+00FF}: 拉丁字母补充-1
1754 \item \texttt{U+0100}--\texttt{U+017F}: 拉丁字母扩充-A
1755 \item \texttt{U+0180}--\texttt{U+024F}: 拉丁字母扩充-B
1756 \item \texttt{U+0250}--\texttt{U+02AF}: 国际音标扩充
1757 \item \texttt{U+02B0}--\texttt{U+02FF}: 进格修饰符元
1758 \item \texttt{U+0300}--\texttt{U+036F}: 组合音标附加符号
1759 \item \texttt{U+1E00}--\texttt{U+1EFF}: 拉丁字母扩充附加
1765 \item[Range~2${}^{\text{J}}$] Greek and Cyrillic letters. JIS~X~0208 (hence most of Japanese
1766 fonts) has some of these characters.
1769 \item[範囲2${}^{\text{J}}$] ギリシャ文字とキリル文字.JIS~X~0208(したがって多くの
1773 \item[范围2${}^\text{J}$] 希腊文和西里尔字母,使用JIS X 0208的大部分日文字体包含这些字符:
1775 \begin{multicols}{2}
1778 \item \texttt{U+0370}--\texttt{U+03FF}: Greek and Coptic
1779 \item \texttt{U+0400}--\texttt{U+04FF}: Cyrillic
1780 \item \texttt{U+1F00}--\texttt{U+1FFF}: Greek Extended
1783 \item \texttt{U+0370}--\texttt{U+03FF}: ギリシア文字及びコプト文字
1784 \item \texttt{U+0400}--\texttt{U+04FF}: キリル文字
1785 \item \texttt{U+1F00}--\texttt{U+1FFF}: キリル文字補助
1788 \item \texttt{U+0370}--\texttt{U+03FF}: 希腊字母
1789 \item \texttt{U+0400}--\texttt{U+04FF}: 西里尔字母
1790 \item \texttt{U+1F00}--\texttt{U+1FFF}: 希腊文扩充
1796 \item[Range~3${}^{\text{J}}$] Punctuations and Miscellaneous symbols. The block list is
1797 indicated in Table~\ref{table-rng3}.
1800 \item[範囲3${}^{\text{J}}$] 句読点と記号類.ブロックのリストは表\ref{table-rng3}%
1804 \item[范围3${}^\text{J}$] 标点以及杂项符号,参见表\ref{table-rng3}。
1808 \caption{Unicode blocks in predefined character range~3.}
1811 \caption{文字範囲3に指定されているUnicodeブロック.}
1814 \caption{字符范围3定义的Unicode范围}
1817 \catcode`\"=13\def"#1#2#3#4{\texttt{U+#1#2#3#4}}%"
1818 \begin{center}\small
1819 \begin{tabular}{llll}
1821 "2000--"206F&General Punctuation&
1822 "2070--"209F&Superscripts and Subscripts\\
1823 "20A0--"20CF&Currency Symbols&
1824 "20D0--"20FF&Comb.\ Diacritical Marks for Symbols\\
1825 "2100--"214F&Letterlike Symbols&
1826 "2150--"218F&Number Forms\\
1827 "2190--"21FF&Arrows&
1828 "2200--"22FF&Mathematical Operators\\
1829 "2300--"23FF&Miscellaneous Technical&
1830 "2400--"243F&Control Pictures\\
1831 "2500--"257F&Box Drawing&
1832 "2580--"259F&Block Elements\\
1833 "25A0--"25FF&Geometric Shapes&
1834 "2600--"26FF&Miscellaneous Symbols\\
1835 "2700--"27BF&Dingbats&
1836 "2900--"297F&Supplemental Arrows-B\\
1837 "2980--"29FF&Misc.\ Mathematical Symbols-B&
1838 "2B00--"2BFF&Miscellaneous Symbols and Arrows\\
1839 "E000--"F8FF&Private Use Area&
1843 "2070--"209F&上付き・下付き\\
1845 "20D0--"20FF&記号用ダイアクリティカルマーク(合成可能)\\
1847 "2150--"218F&数字に準じるもの\\
1849 "2200--"22FF&数学記号(演算子)\\
1850 "2300--"23FF&その他の技術用記号&
1851 "2400--"243F&制御機能用記号\\
1853 "2580--"259F&ブロック要素\\
1855 "2600--"26FF&その他の記号\\
1857 "2900--"297F&補助矢印B\\
1858 "2980--"29FF&その他の数学記号B&
1859 "2B00--"2BFF&その他の記号及び矢印\\
1860 "E000--"F8FF&私用領域(外字領域)&
1863 "2000--"206F&一般标点符号&
1864 "2070--"209F&上标及下标\\
1866 "20D0--"20FF& 符号用组合附加符号\\
1870 "2200--"22FF&数学运算符号\\
1871 "2300--"23FF&杂项技术符号&
1878 "2900--"297F&补充性箭头-B\\
1879 "2980--"29FF&混合数学符号-B&
1880 "2B00--"2BFF&杂项符号和箭头符号\\
1887 \item[Range~4${}^{\text{A}}$] Characters usually not in Japanese fonts. This range consists
1888 of almost all Unicode blocks which are not in other
1889 predefined ranges. Hence, instead of showing the block list,
1890 we put the definition of this range itself:
1893 \item[範囲4${}^{\text{A}}$] 通常和文フォントには含まれていない文字.
1894 この範囲は他の範囲にないほとんど全てのUnicodeブロック
1895 で構成されている.したがって,ブロックのリストを示す
1899 \item[范围4${}^\text{A}$] 通常情况下不包含于日文字体的部分。本范围包含有其他
1900 范围尚未涵盖部分。故,我们直接给出定义:
1903 \ltjdefcharrange{4}{%
1904 "500-"10FF, "1200-"1DFF, "2440-"245F, "27C0-"28FF, "2A00-"2AFF,
1905 "2C00-"2E7F, "4DC0-"4DFF, "A4D0-"A82F, "A840-"ABFF, "FB50-"FE0F,
1906 "FE20-"FE2F, "FE70-"FEFF, "FB00-"FB4F, "10000-"1FFFF} % non-Japanese
1909 \item[Range~5${}^{\text{A}}$] Surrogates and Supplementary Private Use Areas.
1912 \item[範囲5${}^{\text{A}}$] 代用符号と補助私用領域.
1915 \item[范围5${}^\text{A}$] 代替以及补充私有使用区域。
1918 \item[Range~6${}^{\text{J}}$] Characters used in Japanese. The block list is indicated in Table~\ref{table-rng6}.
1921 \item[範囲6${}^{\text{J}}$] 日本語で用いられる文字.ブロックのリストは
1922 表\ref{table-rng6}に示す.
1925 \item[范围6${}^\text{J}$] 日文字符。
1929 \caption{Unicode blocks in predefined character range~6.}
1932 \caption{文字範囲6に指定されているUnicodeブロック.}
1935 \caption{字符范围6定义的Unicode范围}
1938 \catcode`\"=13\def"#1#2#3#4{\texttt{U+#1#2#3#4}}%"
1939 \begin{center}\small
1940 \begin{tabular}{llll}
1942 "2460--"24FF&Enclosed Alphanumerics&
1943 "2E80--"2EFF&CJK Radicals Supplement\\
1944 "3000--"303F&CJK Symbols and Punctuation&
1945 "3040--"309F&Hiragana\\
1946 "30A0--"30FF&Katakana&
1947 "3190--"319F&Kanbun\\
1948 "31F0--"31FF&Katakana Phonetic Extensions&
1949 "3200--"32FF&Enclosed CJK Letters and Months\\
1950 "3300--"33FF&CJK Compatibility&
1951 "3400--"4DBF&CJK Unified Ideographs Extension A\\
1952 "4E00--"9FFF&CJK Unified Ideographs&
1953 "F900--"FAFF&CJK Compatibility Ideographs\\
1954 "FE10--"FE1F&Vertical Forms&
1955 "FE30--"FE4F&CJK Compatibility Forms\\
1956 "FE50--"FE6F&Small Form Variants&
1957 "{20}000--"{2F}FFF&(Supplementary Ideographic Plane)
1961 "2E80--"2EFF&CJK部首補助\\
1962 "3000--"303F&CJKの記号及び句読点&
1965 "3190--"319F&漢文用記号(返り点)\\
1967 "3200--"32FF&囲みCJK文字・月\\
1968 "3300--"33FF&CJK互換用文字&
1969 "3400--"4DBF&CJK統合漢字拡張A\\
1970 "4E00--"9FFF&CJK統合漢字&
1971 "F900--"FAFF&CJK互換漢字\\
1973 "FE30--"FE4F&CJK互換形\\
1975 "{20}000--"{2F}FFF&(追加漢字面)
1978 "2460--"24FF&圈状字母数字&
1979 "2E80--"2EFF&CJK部首补充\\
1980 "3000--"303F&CJK标点符号&
1983 "3190--"319F&汉文标注号\\
1984 "31F0--"31FF&片假名音标补充&
1985 "3200--"32FF&圈状CJK字母及月份\\
1987 "3400--"4DBF&CJK统一表意文字扩充A\\
1988 "4E00--"9FFF&CJK统一表意文字&
1989 "F900--"FAFF&CJK兼容表意文字\\
1991 "FE30--"FE4F&CJK兼容形式\\
1993 "{20}000--"{2F}FFF&(补充字符)
1999 \item[Range~7${}^{\text{J}}$] Characters used in CJK languages, but not included in Adobe-Japan1-6.
2000 The block list is indicated in Table~\ref{table-rng7}.
2003 \item[範囲7${}^{\text{J}}$] CJK言語で用いられる文字のうち,Adobe-Japan1-6に
2005 ブロックのリストは表\ref{table-rng7}に示す.
2008 \item[范围7${}^\text{J}$] 不包含于Adobe-Japan1-6的CJK字符,参见表\ref{table-rng7}。
2012 \caption{Unicode blocks in predefined character range~7.}
2015 \caption{文字範囲7に指定されているUnicodeブロック.}
2018 \caption{字符范围7定义的Unicode范围}
2021 \catcode`\"=13\def"#1#2#3#4{\texttt{U+#1#2#3#4}}%"
2022 \begin{center}\small
2023 \begin{tabular}{llll}
2025 "1100--"11FF&Hangul Jamo&
2026 "2F00--"2FDF&Kangxi Radicals\\
2027 "2FF0--"2FFF&Ideographic Description Characters&
2028 "3100--"312F&Bopomofo\\
2029 "3130--"318F&Hangul Compatibility Jamo&
2030 "31A0--"31BF&Bopomofo Extended\\
2031 "31C0--"31EF&CJK Strokes&
2032 "A000--"A48F&Yi Syllables\\
2033 "A490--"A4CF&Yi Radicals&
2034 "A830--"A83F&Common Indic Number Forms\\
2035 "AC00--"D7AF&Hangul Syllables&
2036 "D7B0--"D7FF&Hangul Jamo Extended-B
2039 "1100--"11FF&ハングル字母&
2041 "2FF0--"2FFF&漢字構成記述文字&
2042 "3100--"312F&注音字母 (注音符号)\\
2043 "3130--"318F&ハングル互換字母&
2044 "31A0--"31BF&注音字母拡張\\
2045 "31C0--"31EF&CJKの筆画&
2048 "A830--"A83F&共通インド数字に準じるもの\\
2049 "AC00--"D7AF&ハングル音節文字&
2050 "D7B0--"D7FF&ハングル字母拡張B
2055 "2FF0--"2FFF&汉字结构描述字符&
2057 "3130--"318F&谚文兼容字母&
2058 "31A0--"31BF&注音字母扩充\\
2062 "A830--"A83F&一般印度数字\\
2064 "D7B0--"D7FF&谚文字母扩充-B
2072 %<en>\subsection{\Param{kanjiskip} and \Param{xkanjiskip}}
2073 %<ja>\subsection{\Param{kanjiskip}と\Param{xkanjiskip}}
2074 %<zh>\subsection{\Param{kanjiskip}和\Param{xkanjiskip}}
2078 \textbf{JAglue} is divided into the following three categories:
2081 \textbf{JAglue}は以下の3つのカテゴリに分類される:
2084 \textbf{JAglue}分为以下三个范畴:
2088 \item Glues/kerns specified in JFM. If \verb+\inhibitglue+ is issued
2089 around a Japanese character, this glue will not be inserted at the
2093 \item JFMで指定されたグルー/カーン.もし \verb+\inhibitglue+ が和文文字の周りで
2094 発行されていれば,このグルーは挿入されない.
2097 \item JFM设定的胶或出格值。如果在一个日文字符附近使用\verb!\inhibitglue!,则胶便不会插入。
2100 \item The default glue which inserted between two \textbf{JAchar}s (\Param{%
2104 \item デフォルトで2つの\textbf{JAchar}の間に挿入されるグルー(\Param{kanjiskip}).
2107 \item 两个\textbf{JAchar}之间默认插入的胶(\Param{kanjiskip})。
2110 \item The default glue which inserted between a \textbf{JAchar} and an
2111 \textbf{ALchar} (\Param{xkanjiskip}).
2114 \item デフォルトで\textbf{JAchar}と\textbf{ALchar}の間に挿入されるグルー(\Param{xkanjiskip}).
2117 \item \textbf{JAchar}和\textbf{ALchar}之间默认插入的胶(\Param{xkanjiskip})。
2121 The value (a skip) of \Param{kanjiskip} or \Param{xkanjiskip} can be
2122 changed as the following.
2125 \Param{kanjiskip}や\Param{xkanjiskip}の値は以下のようにして変更可能である.
2128 \Param{kanjiskip}和\Param{xkanjiskip}的设定如下所示:
2131 \ltjsetparameter{kanjiskip={0pt plus 0.4pt minus 0.4pt},
2132 xkanjiskip={0.25\zw plus 1pt minus 1pt}}
2136 It may occur that JFM contains the data of `ideal width of \Param{kanjiskip}'
2137 and/or `ideal width of \Param{xkanjiskip}'.
2138 To use these data from JFM, set the value of \Param{kanjiskip} or
2139 \Param{xkanjiskip} to \verb+\maxdimen+.
2142 JFMは「望ましい\Param{kanjiskip}の値」や「望ましい\Param{xkanjiskip}の値」を
2144 これらのデータを使うためには,\Param{kanjiskip}や\Param{xkanjiskip}の
2145 値を \verb+\maxdimen+ の値に設定すればよい.
2148 当JFM包含“\Param{kanjiskip}理想宽度”和/或“\Param{xkanjiskip}理想宽度”数据时,
2149 上述设定产生作用。如果想用JFM中的数据,请设定\Param{kanjiskip}或\textsf{xkanjiskip}为\verb!\maxdimen!。
2152 %<en>\subsection{Insertion Setting of \Param{xkanjiskip}}
2153 %<ja>\subsection{\Param{xkanjiskip} の設定の挿入}
2154 %<zh>\subsection{\Param{xkanjiskip}插入设定}
2157 It is not desirable that \Param{xkanjiskip} is inserted into every
2158 boundary between \textbf{JAchar}s and \textbf{ALchar}s. For example,
2159 \Param{xkanjiskip} should not be inserted after opening parenthesis
2160 (\textit{e.g.}, compare `(あ' and `(\hskip\ltjgetparameter{xkanjiskip}あ').
2161 \LuaTeX-ja can control whether \Param{xkanjiskip} can be inserted
2162 before/after a character, by changing \Param{jaxspmode} for \textbf{JAchar}s and
2163 \Param{alxspmode} parameters \textbf{ALchar}s respectively.
2166 \Param{xkanjiskip}がすべての\textbf{JAchar}と\textbf{ALchar}の境界に
2167 挿入されるのは望ましいことではない.例えば,\Param{xkanjiskip}は開き括弧の
2168 後には挿入されるべきではない(`(あ'と`(\hskip\ltjgetparameter{xkanjiskip}あ'を
2170 \LuaTeX-jaでは\Param{xkanjiskip}をある文字の前/後に挿入するかどうかを,
2171 \textbf{JAchar}に対しては\Param{jaxspmode}を,\textbf{ALchar}に対しては
2172 \Param{alxspmode}をそれぞれ変えることで制御することができる.
2175 并不是在所有的\textbf{JAchar}和\textbf{ALchar}周围插入\textsf{xkanjiskip}都是合适的。
2176 比如,在开标点之后插入\Param{xkanjiskip}并不合适[如,比较“(あ”和“(\hskip\ltjgetparameter{xkanjiskip}あ”]。
2177 \LuaTeX-ja可以通过设定\textbf{JAchar}的\Param{jaxspmode}以及\textbf{ALchar}的\Param{alxspmode}来控制
2178 \Param{xkanjiskip}在字符前后的插入。
2181 \ltjsetparameter{jaxspmode={`あ,preonly}, alxspmode={`\!,postonly}}
2186 The second argument \texttt{preonly} means `the insertion of
2187 \Param{xkanjiskip} is allowed before this character, but not after'.
2188 the other possible values are \texttt{postonly}, \texttt{allow} and \texttt{
2192 2つ目の引数の \texttt{preonly}は「\Param{xkanjiskip}の挿入はこの文字の
2193 前でのみ許され,後では許さない」ことを意味する.他に指定可能な値は
2194 \texttt{postonly}, \texttt{allow}, \texttt{inhibit}である.
2197 第二个参数\textsf{preonly}表示的含义为“允许在该字符前插入\textsf{xkanjiskip},但不允许在该字符之后插入”。
2198 其他参数还有\textsf{postonly},\textsf{allow}和\textsf{inhibit}。
2202 \Param{jaxspmode} and \Param{alxspmode} use a same table to store the parameters
2203 on the current version. Therefore, line 1 in the code above can be rewritten
2208 仕様では,\Param{jaxspmode}, \Param{alxspmode}はテーブルを共有しており,
2209 上のコードの1行目を次のように変えても同じことになる:
2212 当前版本的\Param{jaxspmode}和\Param{alxspmode}使用相同的的表保存参数。
2216 \ltjsetparameter{alxspmode={`あ,preonly}, jaxspmode={`\!,postonly}}
2219 One can use also numbers to specify these two parameters (see Subsection~\ref{ssec-param}).
2222 また,これら2パラメータには数値で値を指定することもできる(\ref{ssec-param}節を参照).
2225 你也可以使用数字来定义两个参数(参见\ref{ssec-param})。
2229 If you want to enable/disable all insertions of \Param{kanjiskip} and
2230 \Param{xkanjiskip}, set \Param{autospacing} and \Param{autoxspacing}
2231 parameters to \texttt{true}/\texttt{false}, respectively.
2234 もし全ての\Param{kanjiskip}と\Param{xkanjiskip}の挿入を有効化/無効化
2235 したければ,それぞれ\Param{autospacing}と\Param{autoxspacing}を
2236 \texttt{true}/\texttt{false}に設定すればよい.
2239 如果你想要启用/屏蔽所有的\Param{kanjiskip}和\Param{xkanjiskip}插入,设定
2240 \Param{autospacing}和\Param{autoxspcing}为\texttt{ture}/\texttt{false}即可。
2243 %<en>\subsection{Shifting Baseline}
2244 %<ja>\subsection{ベースラインの移動}
2245 %<zh>\subsection{基线浮动}
2247 To make a match between a Japanese font and an alphabetic font, sometimes
2248 shifting of the baseline of one of the pair is needed. In \pTeX, this is achieved
2249 by setting \verb+\ybaselineshift+ to a non-zero length (the
2250 baseline of alphabetic fonts is shifted below). However, for documents
2251 whose main language is not Japanese, it is good to shift the baseline of
2252 Japanese fonts, but not that of alphabetic fonts.
2253 Because of this, \LuaTeX-ja can independently set the shifting amount
2254 of the baseline of alphabetic fonts (\Param{yalbaselineshift}
2255 parameter) and that of Japanese fonts (\Param{yjabaselineshift}
2259 和文フォントと欧文フォントを合わせるためには,時々どちらかのベースラインの移動が
2260 必要になる.\pTeX ではこれは \verb+\ybaselineshift+ を非零の長さに設定することで
2261 なされていた(欧文フォントのベースラインが下がる).しかし,日本語が主ではない
2262 文書に対しては,欧文フォントではなく和文フォントのベースラインを移動した方がよい.
2263 このため,\LuaTeX-jaでは欧文フォントのベースラインのシフト量
2264 (\Param{yalbaselineshift}パラメータ)と和文フォントのベースラインのシフト量
2265 (\Param{yjabaselineshift}パラメータ)を独立に設定できるようになっている.
2268 为了确保日文字体和西文字体能够对其,有时需要浮动其中一者的基线。
2269 在\pTeX 中,此项设定由设定\verb!\yabaselineshift!为非零长度(西文字体基线应向下浮动)。
2270 不过,如果文档的中主要语言不是日文,那么最好上浮日文字体的基线,西文字体不变。
2271 如上所述,\LuaTeX-ja可以独立设定西文字体的基线(\Param{yabaselineshift}参数)和日文字体的基线(\Param{yjabaselineshift}参数)。
2275 \vrule width 150pt height 0.4pt depth 0pt\hskip-120pt
2276 \ltjsetparameter{yjabaselineshift=0pt, yalbaselineshift=0pt}abcあいう
2277 \ltjsetparameter{yjabaselineshift=5pt, yalbaselineshift=2pt}abcあいう
2280 Here the horizontal line in above is the baseline of a line.
2283 上の例において引かれている水平線がベースラインである.
2290 There is an interesting side-effect: characters in different size can be
2291 vertically aligned center in a line, by setting two parameters appropriately.
2292 The following is an example (beware the value is not well tuned):
2295 この機能には面白い使い方がある:2つのパラメータを適切に設定することで,サイズの
2296 異なる文字を中心線に揃えることができるのだ.
2297 以下は一つの例である(値はあまり調整されていないことに注意):
2300 这里还有一个有趣的副作用:不同大小的字符可以通过适当调整这两个参数而在一行中垂直居中。
2301 下面是一个例子(注意,参数值并没有刻意调整):
2306 \ltjsetparameter{yjabaselineshift=-1pt,
2307 yalbaselineshift=-1pt}
2313 %<en>\subsection{Cropmark}
2314 %<ja>\subsection{トンボ}
2315 %<zh>\subsection{裁剪框标记}
2318 Cropmark is a mark for indicating 4~corners and horizontal/vertical
2319 center of the paper. In Japanese, we call cropmark as tombo(w).
2320 \pLaTeX\ and this \LuaTeX-ja support `tombow' by their kernel.
2321 The following steps are needed to typeset cropmark:
2324 トンボは用紙の四つ角と水平/垂直方向の中心を表す印である.
2325 \pLaTeX と \LuaTeX-jaではトンボの出力をサポートしている.
2326 トンボを出力するためには以下の手順が必要である:
2329 裁剪框标记是在一页的四角和水平/垂直中央放置的标记。在日文中,裁剪框被称为“トンボ”。
2330 \pLaTeX 和\LuaTeX-ja均在底层支持裁剪框标记。需要下列步骤来实现:
2335 \item First, define the banner which will be printed at the upper left
2336 of the paper. This is done by assigning a token list to
2337 \verb+\@bannertoken+.
2339 For example, the following sets banner as `\texttt{filename (YYYY-MM-DD hh:mm)}':
2342 \item まず,用紙の左上に印刷されるバナーを定義する.これは \verb+\@bannertoken+
2343 にトークンリストを与えることでなされる.
2345 例えば,以下はバナーとして`\texttt{filename (YYYY-MM-DD hh:mm)}'を設定する:
2348 \item 首先,首先定义页面左上角将会出现的注记。这由向\verb!@bannertoken!分配一个token列完成。\\
2349 例如,下列所示将会设定注记为“\textsf{filename (YYYY-MM-DD hh:mm)}”:
2355 \hour\time \divide\hour by 60 \@tempcnta\hour \multiply\@tempcnta 60\relax
2356 \minute\time \advance\minute-\@tempcnta
2358 \jobname\space(\number\year-\two@digits\month-\two@digits\day
2359 \space\two@digits\hour:\two@digits\minute)}%
2366 %<en>\part{Reference}
2370 %<en>\section{Font Metric and Japanese Font}
2371 %<ja>\section{フォントメトリックと和文フォント}
2372 %<zh>\section{字体测度和日文字体}
2373 %<en>\subsection{\texttt{\char92jfont} primitive}
2374 %<ja>\subsection{\texttt{\char92jfont}プリミティブ}
2375 %<zh>\subsection{\texttt{\char92jfont}基本语句}
2379 To load a font as a Japanese font, you must use the
2380 \verb+\jfont+ primitive instead of~\verb+\font+, while
2381 \verb+\jfont+ admits the same syntax used in~\verb+\font+.
2382 \LuaTeX-ja automatically loads \Pkg{luaotfload} package,
2383 so TrueType/OpenType fonts with features can be used for Japanese fonts:
2386 フォントを和文フォントとして読み込むためには,\verb+\jfont+ プリミティブを
2387 \verb+\font+ プリミティブの代わりに用いる.
2388 \verb+\jfont+ プリミティブの文法は \verb+\font+ と同じである.
2389 \LuaTeX-jaは\Pkg{luaotfload}パッケージを自動的に読み込むので,
2390 TrueType/OpenTypeフォントにfeatureを指定したものを和文フォントとして用いる
2394 为了加载日文字体,需要使用\verb!\jfont!基本语句替代\verb!\font!,前者支持后者所有相同句法。
2395 \LuaTeX-ja自动加载\Pkg{luaotfload}宏包,故TrueType/OpenType字体的特性可以使用于日文字体:
2398 \jfont\tradgt={file:ipaexg.ttf:script=latn;%
2399 +trad;-kern;jfm=ujis} at 14pt
2404 Note that the defined control sequence
2405 (\verb+\tradgt+ in the example above) using \verb+\jfont+ is not a
2406 \textit{font\_def} token, hence the input like \verb+\fontname\tradgt+
2407 causes a error. We denote control sequences which are defined in
2408 \verb+\jfont+ by <jfont\_cs>.
2411 なお,\verb+\jfont+ で定義されたコントロールシーケンス(上の例だと \verb+\tradgt+)
2412 は\textit{font\_def}トークンではないので,\verb+\fontname\tradgt+ のような
2413 入力はエラーとなることに注意する.以下では \verb+\jfont+ で定義された
2414 コントロールシーケンスを<jfont\_cs>で表す.
2417 注意定义的控制序列(上例中的\verb!\tradgt!)使用的\verb!\jfont!并不是一个\textit{font\_def}标记,
2418 故类似\verb!\fontname\tradgt!输入会引起错误。
2419 我们将定义\verb!\jfont!采用<jfont\_cs>。
2424 As noted in Introduction, a JFM has measurements of characters and
2425 glues/kerns that are automatically inserted for Japanese
2426 typesetting. The structure of JFM will be described in the next
2427 subsection. At the calling of \verb+\jfont+ primitive, you must specify
2428 which JFM will be used for this font by the following keys:
2431 「はじめに」の節で述べたように,JFMは文字と和文組版で自動的に挿入される
2432 グルー/カーンの寸法情報を持っている.JFMの構造は次の小節で述べる.
2433 \verb+\jfont+ プリミティブの呼び出しの際には,どのJFMを用いるのかを以下のキーで
2437 在引言中已提及此项,所谓JFM是字符亮度和日文排版中自动插入的胶/出格。
2438 JFM的结构将在下节进行描述。在使用\verb!\jfont!基本语句时,必须设定JFM如下两个键:
2441 \begin{list}{}{\def\makelabel{\ttfamily}\def\{{\char`\{}\def\}{\char`\}}\advance\leftmargin1\zw}
2444 Specify the name of JFM. If specified JFM has not been loaded, \LuaTeX-ja search and load
2445 a file named \texttt{jfm-<name>.lua}.
2447 The following JFMs are shipped with \LuaTeX-ja:
2450 JFMの名前を指定する.もし以前に指定されたJFMが読み込まれていなければ,
2451 \texttt{jfm-<name>.lua}を読み込む.
2453 以下のJFMが\LuaTeX-jaには同梱されている:
2456 设定JFM名称。设定的JFM如未加载,\LuaTeX-ja会搜寻并加载一个命名为\texttt{jfm-}<\textit{name}>\texttt{.lua}的文件。
2462 \item[\tt jfm-ujis.lua] A standard JFM in \LuaTeX-ja. This JFM is
2463 based on \verb+upnmlminr-h.tfm+, a metric for UTF/OTF package that
2464 is used in \upTeX. When you use the \Pkg{luatexja-otf} package, you should use this JFM.
2467 \item[\tt jfm-ujis.lua] \LuaTeX-jaの標準JFMである.このJFMは\upTeX で
2468 用いられるUTF/OTFパッケージ用の和文用TFMである \verb+upnmlminr-h.tfm+ を
2469 元にしている.\Pkg{luatexja-otf}パッケージを使うときはこのJFMを指定するべきである.
2472 \item[\tt jfm-ujis.lua] \LuaTeX-ja标准JFM。次JFM基于\upTeX 使用的UTF/OTF宏包的\verb!upnmlminr-h.tfm!。
2473 如果你使用\Pkg{luatexja-otf}宏包,你将会用到此JFM。
2476 \item[\tt jfm-jis.lua] A counterpart for \verb+jis.tfm+, `JIS font
2477 metric' which is widely used in \pTeX. A major difference of
2478 \texttt{jfm-ujis.lua} and this \texttt{jfm-jis.lua} is that
2479 most characters under \texttt{jfm-ujis.lua} are square-shaped,
2480 while that under \texttt{jfm-jis.lua} are horizontal
2484 \item[\tt jfm-jis.lua] \pTeX で広く用いられている「JISフォントメトリック」
2485 \verb+jis.tfm+ に相当するJFMである.\texttt{jfm-ujis.lua}とこの
2486 \texttt{jfm-jis.lua}の主な違いは,\texttt{jfm-ujis.lua}ではほとんどの文字が
2487 正方形状であるのに対し,\texttt{jfm-jis.lua}では横長の長方形状である.
2490 \item[\tt jfm-jis.lua] 相当于\pTeX 使用的\verb!jis.tfm!(“JIS font metric”)。
2491 \texttt{jfm-ujis.lua}和\texttt{jfm-jis.lua}主要区别是:
2492 \texttt{jfm-ujis.lua}下的大部分字符是方形,
2493 \texttt{jfm-jis.lua}下则为长方形。
2496 \item[\tt jfm-min.lua] A counterpart for \verb+min10.tfm+, which is one
2497 of the default Japanese font metric shipped with \pTeX. There
2498 are notable difference between this JFM and other 2~JFMs, as
2499 shown in Table~\ref{tab-difjfm}.
2502 \item[\tt jfm-min.lua] \pTeX に同梱されているデフォルトの和文用TFM
2503 である \verb+min10.tfm+ に相当するJFMである.このJFMと他の2つのJFMの間には
2504 表\ref{tab-difjfm}に示すような特筆すべき違いがある.
2507 \item[\tt jfm-min.lua] 相当于\pTeX 中默认的\verb!min10.tfm!。
2508 这个JFM与其他2个JFM的区别如表\ref{tab-difjfm}所示。
2512 \item[jfmvar=<string>] Sometimes there is a need that \ldots.
2516 %<en>\caption{Differences between JFMs shipped with \LuaTeX-ja}
2517 %<ja>\caption{\LuaTeX-ja に同梱されている JFM の違い}
2518 %<zh>\caption{\LuaTeX-ja下不同JFM表现}
2520 \ltjsetparameter{jacharrange={+3}}
2522 \def\r#1{{\jfont\g=psft:Ryumin-Light:jfm=#1 at 14.43324pt \g
2523 \setbox0=\vtop{\hsize=7\zw\noindent ◆◆◆◆◆◆◆
2524 ある日モモちゃんがお使いで迷子になって泣きました.}\copy0
2525 \vrule height 0pt depth \dp0}}
2526 \def\s#1{{\jfont\g=psft:Ryumin-Light:jfm=#1 at 14.43324pt \g
2527 \setbox0=\vtop{\hsize=7\zw\noindent ちょっと!何}\copy0}}
2528 \def\t#1{{\jfont\g=psft:Ryumin-Light:jfm=#1 at 19.24432pt \g
2530 \vrule width 0.4pt height\ht0 depth\dp0\kern-.2pt\copy0
2531 \kern-\wd0\vrule width\wd0height .2pt depth .2pt
2532 \kern-\wd0\raise\ht0\hbox{\vrule width\wd0height .2pt depth .2pt}%
2533 \kern-\wd0\lower\dp0\hbox{\vrule width\wd0height .2pt depth .2pt}%
2534 \kern-.2pt\vrule width 0.4pt height\ht0 depth \dp0}}
2535 \begin{tabular}{rccc}
2537 &\tt jfm-ujis.lua&\tt jfm-jis.lua&\tt jfm-min.lua\\
2539 %<en>Example~1\footnotemark
2540 %<ja>例1\footnotemark
2541 %<zh>例1\footnotemark
2542 &\r{ujis}&\r{jis}&\r{min}\\
2546 &\s{ujis}&\s{jis}&\s{min}\\
2547 Bounding Box&\t{ujis}&\t{jis}&\t{min}\\
2551 \ltjsetparameter{jacharrange={-3}}
2553 \footnotetext{from: 乙部厳己, min10フォントについて.
2554 \texttt{http://argent.shinshu-u.ac.jp/\~{\ }otobe/tex/files/min10.pdf}.}
2556 %<en>\paragraph{Note: kern feature}
2557 %<ja>\paragraph{注意:kern feature}
2558 %<zh>\paragraph{注意:kern feature}
2561 Some fonts have information for inter-glyph spacing. However, this
2562 information is not well-compatible with \LuaTeX-ja. More concretely,
2563 this kerning space from this information are inserted \emph{before} the
2564 insertion process of \textbf{JAglue}, and this causes incorrect spacing
2565 between two characters when both a glue/kern from the data in the font
2566 and it from JFM are present.
2569 いくつかのフォントはグリフ間のスペースについての情報を持っている.しかし,
2570 この情報は\LuaTeX-ja とはあまり相性がよくない.具体的には,この情報に基づいて挿入
2571 されるカーニングスペースは\textbf{JAglue}の挿入過程の\textbf{前に}挿入され,
2572 JFMに基づくグルー/カーンも挿入される場合には2文字間の意図しないスペースの原因と
2576 一些字体具有内部字形间距信息。但是,这些信息在\LuaTeX-ja下并不良好兼容。
2577 仔细些说,出格间距是在\textbf{JAglue}插入\textbf{之前}而先行插入的,
2578 这就造成了字体数据中和JFM中的胶/出格在两个字符间插入出错。
2582 \item You should specify \texttt{-kern} in
2583 \verb+jfont+ primitive, when you want to use other font features,
2584 such as \texttt{script=...}\,.
2587 \item \texttt{script=...}といったfeatureを使いたい場合には,\verb+\jfont+
2588 プリミティブに\texttt{-kern}を指定するべきである.
2591 \item 当你想使用其他字体特性如\texttt{script=...}的时候,可以在\verb!jfont!基本语句中设置\texttt{-kern}
2594 \item If you want to use Japanese fonts in proportional width, and use
2595 information from this font, use \texttt{jfm-prop.lua} for its JFM, and\ldots.
2598 \item もしプロポーショナル幅の和文フォントをそのフォントの情報に基づいて使いたい
2599 ならば,\texttt{jfm-prop.lua}をJFMとして指定し,……
2602 \item 如果你想使用比例宽度的日文字体,并且使用此字体信息,使用\texttt{jfm-prop.lua}为其JFM,……
2608 %<en>\subsection{Prefix \texttt{psft}}
2609 %<ja>\subsection{\texttt{psft}プリフィックス}
2610 %<zh>\subsection{\texttt{psft}前缀}
2613 Besides \texttt{file:}\ and \texttt{name:}\ prefixes, one can use \texttt{psft:}\
2614 prefix in \verb+\jfont+ (and~\verb+\font+) primitive,
2615 to specify a `name-only' Japanese font which
2616 will not be embedded to PDF. Typical use of this prefix is to specify
2617 the `standard' Japanese fonts, namely, `Ryumin-Light' and
2621 \texttt{file:}と\texttt{name:}のプリフィックスに加えて,
2622 \verb+\jfont+ プリミティブ(と \verb+\font+ プリミティブ)では
2623 \texttt{psft:}プリフィックスを用いることができる.
2624 このプリフィックスを用いることで,PDFには埋め込まれない「名前だけの」
2625 和文フォントを指定することができる.「標準的な」和文フォント,
2626 つまり`Ryumin-Light'と`GothicBBB-Medium'の指定でこのプリフィックスが使われる.
2629 除使用\texttt{file:}和\texttt{name:}外,我们还可以在\verb!\jfont!(以及\verb!\font!)
2630 中使用\texttt{psft:}来设定一个“名义上”的并不嵌入PDF中的日文字体。
2631 此前缀的典型使用是定义“标准”日文字体,即“Ryumin-Light”和“GothicBBB-Medium”。
2632 \paragraph{\texttt{cid}键} 默认使用\texttt{psft:}前缀定义的字体是为Adobe-Japan1-6 CID字体。
2633 也可以使用\texttt{cid}键来使用其他的CID字体,如中文和韩文。
2636 %<en>\paragraph{\texttt{cid} key}
2637 %<ja>\paragraph{\texttt{cid}キー}
2641 The default font defined by using \texttt{psft:} prefix is for Japanese typesetting;
2642 it is Adobe-Japan1-6 CID-keyed font.
2643 One can specify \texttt{cid} key to use other CID-keyed non-embedded fonts
2644 for Chinese or Korean typesetting.
2645 \begin{lstlisting}[numbers=left]
2646 \jfont\testJ={psft:Ryumin-Light:cid=Adobe-Japan1-6;jfm=jis} % Japanese
2647 \jfont\testD={psft:Ryumin-Light:jfm=jis} % default value is Adobe-Japan1-6
2648 \jfont\testC={psft:AdobeMingStd-Light:cid=Adobe-CNS1-5;jfm=jis} % Traditional Chinese
2649 \jfont\testG={psft:SimSun:cid=Adobe-GB1-5;jfm=jis} % Simplified Chinese
2650 \jfont\testK={psft:Batang:cid=Adobe-Korea1-2;jfm=jis} % Korean
2652 Note that the code above specifies \texttt{jfm-jis.lua}, which is for Japanese fonts,
2653 as JFM for Chinese and Korean fonts.
2656 標準で\texttt{psft:}プリフィックスで定義されるフォントは日本語用のもので
2657 あり,Adobe-Japan1-6のCIDに対応したものとなる.しかし,\LuaTeX-jaは中国語
2658 の組版にも威力を発揮することが分かり,日本語フォントでない非埋込フォント
2659 の対応も必要となった.そのために追加されたのが\texttt{cid}キーである.
2661 \texttt{cid}キーに値を指定すると,そのCIDを持った非埋込フォントを定義することができる:
2662 \begin{lstlisting}[numbers=left]
2663 \jfont\testJ={psft:Ryumin-Light:cid=Adobe-Japan1-6;jfm=jis} % 日本語
2664 \jfont\testD={psft:Ryumin-Light:jfm=jis} % 無指定時は Adobe-Japan1-6
2665 \jfont\testC={psft:AdobeMingStd-Light:cid=Adobe-CNS1-5;jfm=jis} % 中国語繁体字
2666 \jfont\testG={psft:SimSun:cid=Adobe-GB1-5;jfm=jis} % 中国語簡体字
2667 \jfont\testK={psft:Batang:cid=Adobe-Korea1-2;jfm=jis} % 韓国語
2669 上のコードでは中国語・韓国語用フォントに対してもJFMに
2670 日本語用の\texttt{jfm-jis.lua}を指定しているので注意されたい.
2674 At present, \LuaTeX-ja supports only 4 values written in the sample code above.
2675 Specifying other values, e.g.,
2678 今のところ,\LuaTeX-jaは上のサンプルコード中に書いた4つの値しかサポートしていない.
2681 \jfont\test={psft:Ryumin-Light:cid=Adobe-Japan2;jfm=jis}
2684 occurs the following error:
2689 \begin{lstlisting}[numbers=left]
2690 ! Package luatexja Error: bad cid key `Adobe-Japan2'.
2692 See the luatexja package documentation for explanation.
2693 Type H <return> for immediate help.
2699 I couldn't find any non-embedded font information for the CID
2700 `Adobe-Japan2'. For now, I'll use `Adobe-Japan1-6'.
2701 Please contact the LuaTeX-ja project team.
2708 %<en>\subsection{Structure of JFM file}
2709 %<ja>\subsection{JFMファイルの構造}
2710 %<zh>\subsection{JFM结构}
2713 A JFM file is a Lua script which has only one function call:
2716 JFMファイルはただ一つの関数呼び出しを含むLuaスクリプトである:
2722 luatexja.jfont.define_jfm { ... }
2725 Real data are stored in the table which indicated above by
2726 \verb+{ ... }+. So, the rest of this subsection are devoted to describe the
2727 structure of this table. Note that all lengths in a JFM file are
2728 floating-point numbers in design-size unit.
2731 実際のデータは上で \verb+{ ... }+ で示されたテーブルの中に格納されている.
2732 以下ではこのテーブルの構造について記す.
2733 なお,JFMファイル中の長さは全てdesign-sizeを単位とする浮動小数点数であることに
2737 实际的数据保存在表中,即如上的\verb!{ ... }!。
2739 请注意,在JFM中的所有长度都是按照以design-size为单位的浮点数。
2742 \begin{list}{}{\def\makelabel{\ttfamily}\def\{{\char`\{}\def\}{\char`\}}\advance\leftmargin1\zw}
2744 \item[dir=<direction>]
2749 %<en>The direction of JFM. At the present, only \texttt{'yoko'} is supported.
2750 %<ja>JFMの書字方向.現時点では\texttt{'yoko'}のみがサポートされる.
2751 %<zh>JFM的方向,现在只支持\texttt{yoko}(水平)。
2758 %<en>The amount of the length of the `full-width'.
2767 %<en>The amount of the length of the `full-height' (height + depth).
2768 %<ja>「全角高さ」(height + depth)の長さ.
2769 %<zh>“全角高度”(height + depth)长度。
2771 \item[kanjiskip=\{<natural>, <stretch>, <shrink>\}]
2777 This field specifies the `ideal' amount of \Param{kanjiskip}. As noted
2778 in Subsection~\ref{subs-kskip}, if the parameter
2779 \Param{kanjiskip} is \verb+\maxdimen+, the value specified
2780 in this field is actually used (if this field is not specified in
2781 JFM, it is regarded as 0\,pt). Note that <stretch> and <shrink>
2782 fields are in design-size unit too.
2785 「理想的な」\Param{kanjiskip}の量を指定する.\ref{subs-kskip}節で述べたように,
2786 もし\Param{kanjiskip}が \verb+\maxdimen+ の値ならば,このフィールドで指定された
2787 値が実際には用いられる(もしこのフィールドがJFMで指定されていなければ,
2788 0\,ptであるものとして扱われる).<stretch>と<shrink>のフィールドもdesign-size
2792 这部分为“理想长度”\Param{kanjiskip}。\ref{subs-kskip}节有详述,如果参数\Param{kanjiskip}
2793 为\verb!\maxdimen!,则值设定将会被使用(若再JFM中未设定,则被视为0\,pt)。
2794 请注意,<stretch>和<shrink>的长度均为design-size单位。
2797 \item[xkanjiskip=\{<natural>, <stretch>, <shrink>\}]
2803 Like the \Param{kanjiskip} field, this field specifies the `ideal'
2804 amount of \Param{xkanjiskip}.
2807 \Param{kanjiskip}フィールドと同様に,\Param{xkanjiskip}の「理想的な」量を
2811 和\Param{kanjiskip}类似,此部分设定\Param{xkanjiskip}的“理想长度”。
2816 Besides from above fields, a JFM file have several sub-tables those
2817 indices are natural numbers. The table indexed by~$i\in\omega$ stores
2818 information of `character class'~$i$. At least, the character class~0 is
2819 always present, so each JFM file must have a sub-table whose index is
2820 \texttt{[0]}. Each sub-table (its numerical index is denoted by $i$) has
2821 the following fields:
2824 上記のフィールドに加えて,JFMファイルはそのインデックスが自然数であるいくつかの
2825 サブテーブルを持つ.インデックスが$i\in\omega$であるテーブルは「文字クラス」$i$の
2826 情報を格納する.少なくとも,文字クラス0は常に存在するので,JFMファイルはインデックス
2827 が\texttt{[0]}のサブテーブルを持たなければならない.それぞれのサブテーブル
2828 (そのインデックスを$i$で表わす)は以下のフィールドを持つ:
2831 除了上面涉及到的内容,JFM文件中还有几个以自然数进行声明的次级表。
2832 这些表依靠满足$i\in\omega$的“字符类”$i$来索引。
2833 一般,最少需要的是字符类0,故每一个JFM文件必须有次级表索引为\texttt{[0]}。
2836 \begin{list}{}{\def\makelabel{\ttfamily}\def\{{\char`\{}\def\}{\char`\}}\advance\leftmargin1\zw}
2837 \item[chars=\{<character>, ...\}]
2838 %<en>(required except character class~0)
2843 This field is a list of characters which are in this character
2844 type~$i$. This field is not required if $i=0$, since all
2845 \textbf{JAchar} which are not in any character class other
2846 than 0 are in the character class 0
2847 (hence, the character class~0 contains most of
2848 \textbf{JAchar}s). In the list, a character can be
2849 specified by its code number, or by the character itself
2850 (as a string of length~1). Moreover, there are `imaginary
2851 characters' which specified in the list. We will describe these later.
2854 このフィールドは文字クラス$i$に属する文字のリストである.このフィールドは$i=0$の
2855 場合には必須ではない.なぜならば,文字クラス0には,0以外の文字クラスに属するものを
2856 除いた全ての\textbf{JAchar}が属するからである(よって,文字クラス0はほとんどの
2857 \textbf{JAchar}を含む).このリストでは,文字はその文字コードを用いて,もしくは
2858 文字それ自体(長さ1の文字列)によって指定される.さらに,このリストで指定される
2859 「仮想的な文字」も存在する.これらについては後に記す.
2862 这部分为字符集$i$的字符列表。当$i=0$时不需要设定此部分,因为不在字符集0种的\textbf{JAchar}
2863 字符都包含在字符集0中(也就是字符集0包含大多数的\textbf{JAchar})。在这个字符列表中,每一个
2864 字符据可以使用其编码,或者字符本身(长度为1的字符串)。另外还有部分“假想字符”可在此列表中
2868 \item[width=<length>, height=<length>, depth=<length>, italic=<length>]
2874 Specify width of characters in character class~$i$, height, depth and
2875 the amount of italic correction. All characters in character class~$i$ are regarded that its width, height and depth are
2876 as values of these fields.
2877 But there is one exception: if \texttt{'prop'} is specified in \texttt{width} field, width of a character becomes that of its `real' glyph
2880 文字クラス$i$に属する文字の幅,高さ,深さ,イタリック補正の量を指定する.
2881 文字クラス$i$に属する全ての文字は,その幅,高さ,深さがこのフィールドで指定した
2883 しかし,例外が一つある:もし\texttt{'prop'}が\texttt{width}フィールドに
2884 指定された場合,文字の幅はその「実際の」グリフの幅となる.
2887 设定字符类$i$的宽度,高度和深度以及意大利体校正。在字符集$i$中,所有字符的宽度,高度
2888 和深度的值为上述设定之值。不过还有例外,如果\texttt{'prop'}设定了\texttt{width}部分,那么
2892 \item[left=<length>, down=<length>, align=<align>]\
2895 These fields are for adjusting the position of the `real' glyph. Legal
2896 values of \texttt{align} field are \texttt{'left'},
2897 \texttt{'middle'} and \texttt{'right'}. If one of these
2898 3~fields are omitted, \texttt{left} and \texttt{down} are
2899 treated as~0, and \texttt{align} field is treated as
2901 The effects of these 3~fields are indicated in Figure~\ref{fig-pos}.
2904 これらのフィールドは「実際の」グリフの位置を調整するためにある.
2905 \texttt{align}フィールドに指定できる値は\texttt{'left'}, \texttt{'middle'},
2906 \texttt{'right'}のいずれかである.もしこれら3つのフィールドのうちの1つが省かれた
2907 場合,\texttt{left}と\texttt{down}は0,\texttt{align}フィールドは
2908 \texttt{'left'}であるものとして扱われる.
2909 これら3つのフィールドの意味については図\ref{fig-pos}で説明する.
2912 此部分为“真实”字形对齐位置。\texttt{align}的合法值为\texttt{'left'},
2913 \texttt{'middle'}和\texttt{'right'}。如此三项被省略,则\texttt{left}和
2914 \texttt{down}被视作0,\texttt{align}被视作\texttt{'left'}。
2915 此部分三个域的作用,请参见图\ref{fig-pos}。
2919 In most cases, \texttt{left} and \texttt{down} fields are~0, while
2920 it is not uncommon that the \texttt{align} field is \texttt{'middle'} or \texttt{'right'}.
2921 For example, setting the \texttt{align} field to \texttt{'right'} is practically needed
2922 when the current character class is the class for opening delimiters'.
2925 多くの場合,\texttt{left}と\texttt{down}は0である一方,
2926 \texttt{align}フィールドが\texttt{'middle'}や\texttt{'right'}であることは
2928 例えば,\texttt{align}フィールドを\texttt{'right'}に指定することは,
2929 文字クラスが開き括弧類であるときに実際必要である.
2932 在大多数情况下,\texttt{left}和\texttt{down}域为0,但是在\texttt{align}域为
2933 \texttt{'middle'}或者\texttt{'right'}时则是不正常的。例如,必须设定\texttt{align}
2934 为\texttt{'right'}时,则当前字符类必须为开定界符。
2937 \begin{minipage}{0.4\textwidth}%
2938 \begin{center}\unitlength=10pt\small
2939 \begin{picture}(15,12)(-1,-4)
2940 \color{black!10!white}% real glyph :step1
2941 \put(0,0){\vrule width 12\unitlength height 8\unitlength depth 3\unitlength}
2943 \color{red!20!white}% real glyph :step1
2944 \put(-1,-1.5){\vrule width 6\unitlength height 7\unitlength depth 2.5\unitlength}
2946 \color{red}% real glyph
2948 \put(-1,-1.5){\vector(0,1){7}\vector(0,-1){2.5}\vector(1,0){6}}
2949 \put(5,-1.5){\line(0,1){7}\line(0,-1){2.5}}
2950 \put(-1,5.5){\line(1,0){6}}
2951 \put(-1,-4){\line(1,0){6}}
2953 \color{green!20!white}% real glyph :step1
2954 \put(3,0){\vrule width 6\unitlength height 7\unitlength depth 2.5\unitlength}
2956 \color{black}% real glyph :step1
2958 \put(0,0){\vector(0,1){8}\line(0,-1){3}\vector(1,0){12}}
2959 \put(12,0){\line(0,1){8}\vector(0,-1){3}}
2960 \put(0,8){\line(1,0){12}}
2961 \put(0,-3){\line(1,0){12}}
2962 \put(0.2,4){\makebox(0,0)[l]{\texttt{height}}}
2963 \put(12.2,-1.5){\makebox(0,0)[l]{\texttt{depth}}}
2964 \put(6,0.2){\makebox(0,0)[b]{\texttt{width}}}
2966 \color{green!50!black}% real glyph :step1
2968 \put(3,0){\vector(0,1){7}\vector(0,-1){2.5}\vector(1,0){6}}
2969 \put(9,0){\line(0,1){7}\line(0,-1){2.5}}
2970 \put(3,7){\line(1,0){6}}
2971 \put(3,-2.5){\line(1,0){6}}
2972 \newsavebox{\eqdist}
2973 \savebox{\eqdist}(0,0)[b]{%
2975 \put(-0.08,0.2){\line(0,-1){0.4}}%
2976 \put(0.08,0.2){\line(0,-1){0.4}}}
2977 \put(1.5,0){\usebox{\eqdist}}
2978 \put(10.5,0){\usebox{\eqdist}}
2980 \color{blue}% shifted
2982 \put(3,-1.5){\vector(-1,0){4}}
2983 \put(1,-1.7){\makebox(0,0)[t]{\texttt{left}}}
2984 \put(3,0){\vector(0,-1){1.5}}
2985 \put(3.2,-0.75){\makebox(0,0)[l]{\texttt{down}}}
2989 \begin{minipage}{0.6\textwidth}%
2991 Consider a node containing Japanese character whose value of the \texttt{align}
2992 field is \texttt{'middle'}.
2995 \texttt{align}フィールドの値が\texttt{'middle'}である和文文字を含むノードを
2999 假定一个node包含日语字符,且其值为\texttt{align}的\texttt{'middle'}。
3004 The black rectangle is a frame of the node.
3005 Its width, height and depth are specified by JFM.
3009 その幅,高さ,深さはJFMによって指定される.
3012 黑色长方形为node框。其宽度,高度,深度均为JFM所设定。
3016 Since the \texttt{align} field is \texttt{'middle'},
3017 the `real' glyph is centered horizontally (the green rectangle).
3020 \texttt{align}フィールドは\texttt{middle}なので,「実際の」グリフは
3021 水平方向の中心に配置される(緑色の長方形).
3024 因\texttt{align}被设定为\texttt{middle},故“真实”字形为水平居中(绿长方形中)。
3028 Furthermore, the glyph is shifted according to values of fields
3029 \texttt{left} and \texttt{down}. The ultimate position of the real
3030 glyph is indicated by the red rectangle.
3033 さらに,グリフは\texttt{left}と\texttt{down}の値に従ってシフトされる.
3034 最終的な実際のグリフの位置は赤色の長方形で示された位置になる.
3037 此外,字形移位由\texttt{left}和\texttt{down}决定。最终字形位置为红长方形所示。
3042 %<en>The position of the `real' glyph.
3050 \item[kern={\{[$j$]=<kern>, ...\}}]
3052 \item[glue={\{[$j$]=\{<width>, <stretch>, <shrink>\}, ...\}}]
3056 As described before, you can specify several `imaginary characters' in
3057 \texttt{chars} field. The most of these characters are regarded as the
3058 characters of class 0 in \pTeX.
3059 As a result, \LuaTeX-ja can control typesetting finer than \pTeX.
3060 The following is the list of `imaginary characters':
3063 上で説明した通り,\texttt{chars}フィールド中にはいくつかの「特殊文字」も
3064 指定可能である.これらは,大半が\pTeX のJFMグルーの挿入処理ではみな「文字
3065 クラス0の文字」として扱われていた文字であり,その結果として\pTeX より細か
3066 い組版調整ができるようになっている.以下でその一覧を述べる:
3069 如上所述,你可以在\texttt{chars}中设定多个“假想字符”。这些字符中的多数字符在
3070 \pTeX 中式被视作字符集0中字符。故此,\LuaTeX-ja可以比\pTeX 做得更好。
3073 \begin{list}{}{\def\makelabel{\ttfamily}\def\{{\char`\{}\def\}{\char`\}}\advance\leftmargin1\zw}
3075 %<en>An ending of a line.
3080 %<en>Used at a boundary between two \textbf{JAchar}s whose JFM or size is different.
3081 %<ja>JFMやサイズが異なる2つの\textbf{JAchar}の間の境界として用いられる.
3082 %<zh>用于两个不同大小或不同JFM的两个\textbf{JAchar}间边界。
3085 %<en>The beginning/ending of a horizontal box, and the beginning of a noindented paragraph.
3086 %<ja>水平ボックスの先頭と末尾,及びインデントされていない(\verb+\noindent+ で開始された)段落の先頭を表す.
3087 %<zh>水平合字结束或结尾,以及未缩进段落开头。
3090 %<en>The beginning of an (indented) paragraph.
3091 %<ja>通常の(\verb+\noindent+ で開始されていない)段落の先頭.
3095 %<en>A boundary between \textbf{JAchar} and anything else (such as \textbf{ALchar}, kern, glue,\,\ldots).
3096 %<ja>和文文字と「その他のもの」(欧文文字,glue,kern等)との境界.
3097 %<zh>日文字符和其他(如\textbf{ALchar},胶,出格等)边界。
3100 %<en>The left/right boundary of an inline math formula.
3105 %<en>\paragraph{Porting JFM from \pTeX}
3106 %<ja>\paragraph{\pTeX 用和文用TFMの移植}
3107 %<zh>\paragraph{\pTeX 下使用的TFM移植}
3109 % ToDo: English version.
3116 以下に,\pTeX 用に作られた和文用TFMを\LuaTeX-ja用に移植する場合の注意点を挙げておく.
3118 \item 実際に出力される和文フォントのサイズがdesign sizeとなる.
3119 このため,例えば$1\,\textrm{zw}$がdesign sizeの0.962216倍であるJISフォン
3122 \item JFM中の全ての数値を$1/0.962216$倍しておく.
3123 \item \TeX ソース中で使用するところで,サイズ指定を0.962216倍にする.
3124 \LaTeX でのフォント宣言なら,例えば次のように:
3126 \DeclareFontShape{JY3}{mc}{m}{n}{<-> s*[0.962216] psft:Ryumin-Light:jfm=jis}{}
3129 \item 上に述べた特殊文字は,\texttt{'boxbdd'}を除き文字クラスを全部0とする
3131 \item \texttt{'boxbdd'}については,それのみで一つの文字クラスを形成し,その
3132 文字クラスに関してはグルー/カーンの設定はしない.
3135 水平ボックスの先頭・末尾とインデントされていない(\verb+\noindent+ で開始さ
3136 れた)段落の先頭にはJFMグルーは入らないという仕様を実現させるためである.
3137 \item \pTeX の組版を再現させようというのが目的であれば以上の注意を守れば十分である.
3139 ところで,\pTeX では通常の段落の先頭にJFMグルーが残るという仕様があるので,
3140 段落先頭の開き括弧は全角二分下がりになる.全角下がりを実現させるに
3141 は,段落の最初に手動で \verb+\inhibitglue+ を追加するか,あるいは
3142 \ \verb+\everypar+ のハックを行い,それを自動化させるしかなかった.
3144 一方,\LuaTeX-jaでは,\texttt{'parbdd'}によって,それがJFM側で調整できるよ
3145 うになった.例えば,\LuaTeX-ja同梱のJFMのように,\texttt{'boxbdd'}と同じ文字クラスに
3146 \texttt{'parbdd'}を入れれば全角下がりとなる.
3149 \jfont\g=psft:Ryumin-Light:jfm=test \g
3150 \parindent1\zw\noindent{}◆◆◆◆◆
3157 但し,\verb+\everypar+ を利用している場合にはこの仕組みは正しく動かない.
3158 そのような例としては箇条書き中の \verb+\item+ で始まる段落があり,\Pkg{ltjsclasses}では
3159 人工的に「\texttt{'parbdd'}の意味を持つ」whatsitノードを作ることによって対処している%
3160 \footnote{\texttt{no\_runtime/ltjsclasses.dtx} を参照されたい.
3161 JFM側で一部の対処ができることにより,\Pkg{jsclasses}のようにif文の判定はしていない.}
3164 下面,给出用于\pTeX 使用的JFM移植到\LuaTeX-ja过程中需要注意的几点。
3168 %<en>\subsection{Math Font Family}
3169 %<ja>\subsection{数式フォントファミリ}
3170 %<zh>\subsection{数学字体族}
3174 \TeX\ handles fonts in math formulas by 16~font families\footnote{Omega,
3175 Aleph, \LuaTeX~and $\varepsilon$-\kern-.125em(u)\pTeX\ can handles 256~families, but
3176 an external package is needed to support this in plain \TeX\ and
3177 \LaTeX.}, and each family has three fonts:
3178 \verb+\textfont+, \verb+\scriptfont+ and \verb+\scriptscriptfont+.
3181 \TeX\ は数式フォントを16のファミリ\footnote{Omega, Aleph, \LuaTeX,そして
3182 $\varepsilon$-\kern-.125em(u)\pTeX\ では256の数式ファミリを扱うことができるが,
3183 これをサポートするためにplain \TeX と\LaTeX では外部パッケージを読み込む必要が
3184 ある.}で管理し,それぞれのファミリは3つのフォントを持っている:\verb+\textfont+, \verb+\scriptfont+ そして \verb+\scriptscriptfont+ である.
3188 \LuaTeX-ja's handling of Japanese fonts in math formulas is similar;
3189 Table~\ref{tab-math} shows counterparts to \TeX's primitives for math
3190 font families. There is no relation between the value of
3191 \verb+\fam+ and that of \verb+\jfam+; with appropriate settings,
3192 you can set both \verb+\fam+ and \verb+\jfam+ to the same value.
3195 \LuaTeX-jaの数式中での和文フォントの扱いも同様である.
3196 表\ref{tab-math}は数式フォントファミリに対する \TeX のプリミティブと対応する
3197 ものを示している.\verb+\fam+ と \verb+\jfam+ の値の間には関係はなく,
3198 適切な設定の下では \verb+\fam+ と \verb+\jfam+ の両方に同じ値を設定することができる.
3202 %<en>\caption{Primitives for Japanese math fonts.}
3203 %<ja>\caption{和文数式フォントに対するプリミティブ.}
3204 %<zh>\caption{日语数学字体基本语句}
3206 \begin{center}\def\{{\char`\{}\def\}{\char`\}}
3207 \begin{tabular}{lll}
3209 %<en>&Japanese fonts&alphabetic fonts\\
3210 %<ja>&和文フォント&欧文フォント\\
3213 font family&\verb+\jfam+${}\in [0,256)$&\verb+\fam+\\
3214 text size&\tt\Param{jatextfont}\,=\{<jfam>,<jfont\_cs>\}&\tt\verb+\textfont+<fam>=<font\_cs>\\
3215 script size&\tt\Param{jascriptfont}\,=\{<jfam>,<jfont\_cs>\}&\tt\verb+\scriptfont+<fam>=<font\_cs>\\
3216 scriptscript size&\tt\Param{jascriptscriptfont}\,=\{<jfam>,<jfont\_cs>\}&\tt\verb+\scriptscriptfont+<fam>=<font\_cs>\\
3222 %<en>\subsection{Callbacks}
3223 %<ja>\subsection{コールバック}
3224 %<zh>\subsection{回调}
3227 Like \LuaTeX\ itself, \LuaTeX-ja also has callbacks. These callbacks can
3228 be accessed via \verb+luatexbase.add_to_callback+ function and so on, as other callbacks.
3231 \LuaTeX 自体のものに加えて,\LuaTeX-jaもコールバックを持っている.
3232 これらのコールバックには,他のコールバックと同様に \verb+luatexbase.add_to_callback+
3233 関数などを用いることでアクセスすることができる.
3236 {\def\makelabel#1{\bfseries#1}}
3237 %<en>\item[\texttt{luatexja.load\_jfm} callback]
3238 %<ja>\item[\texttt{luatexja.load\_jfm}コールバック]
3239 %<zh>\item[\texttt{luatexja.load\_jfm}回调]
3241 With this callback you can overwrite JFMs.
3242 This callback is called when a new JFM is loaded.
3245 このコールバックを用いることでJFMを上書きすることができる.
3246 このコールバックは新しいJFMが読み込まれるときに呼び出される.
3249 \begin{lstlisting}[numbers=left]
3250 function (<table> jfm_info, <string> jfm_name)
3251 return <table> new_jfm_info
3256 The argument \verb+jfm_info+ contains a table similar to the table in a JFM file, except
3257 this argument has \texttt{chars} field which contains character codes
3258 whose character class is not~0.
3261 引数 \verb+jfm_info+ はJFMファイルのテーブルと似たものが格納されるが,
3262 クラス0を除いた文字のコードを含んだ\texttt{chars}フィールドを持つ点が異なる.
3266 An example of this callback is the \texttt{ltjarticle} class, with
3267 forcefully assigning character class~0 to \texttt{'parbdd'}
3268 in the JFM \texttt{jfm-min.lua}. This callback doesn't
3269 replace any code of \LuaTeX-ja.
3272 このコールバックの使用例は\texttt{ltjarticle}クラスにあり,
3273 \texttt{jfm-min.lua}中の\texttt{'parbdd'}を強制的にクラス0に割り当てている.
3274 このコールバックは\LuaTeX-jaのコードを書き換えない.
3277 %<en>\item[\texttt{luatexja.define\_font} callback]
3278 %<ja>\item[\texttt{luatexja.define\_font}コールバック]
3279 %<zh>\item[\texttt{luatexja.define\_font}回调]
3281 This callback and the next callback form a pair, and you can assign letters which don't have
3282 fixed code points in Unicode to non-zero character classes.
3283 This \texttt{luatexja.define\_font} callback is called just when new Japanese font is loaded.
3286 このコールバックと次のコールバックは組をなしており,Unicode中に固定された文字コード
3287 番号を持たない文字を非零の文字クラスに割り当てることができる.
3288 このコールバックは新しい和文フォントが読み込まれたときに呼び出される.
3291 \begin{lstlisting}[numbers=left]
3292 function (<table> jfont_info, <number> font_number)
3293 return <table> new_jfont_info
3298 You may assume that \verb+jfont_info+ has the following fields:
3301 \verb+jfont_info+ は以下のフィールドを持つ:
3305 %<en>The index number of JFM.
3310 %<en>Font size in a scaled point (${}=2^{-16}\,\textrm{pt}$).
3311 %<ja>スケールド・ポイント(${}=2^{-16}\,\textrm{pt}$)を単位としたフォントのサイズ.
3312 %<zh>以参照点(${}=2^{-16}\,\textrm{pt}$)为点位的字体大小。
3315 %<en>The value specified in \texttt{jfmvar=...} at a call of \verb+\jfont+.
3316 %<ja>\verb+\jfont+ の呼び出しの際に\texttt{jfmvar=...}で指定された値.
3317 %<zh>\verb!\jfont!调用的\texttt{jfmvar=...}值。
3321 The returned table \verb+new_jfont_info+ also should include these three fields.
3322 The \verb+font_number+ is a font number.
3325 戻り値の \verb+new_jfont_info+ テーブルもこれら3つのフィールドを含まなければならない.
3326 \verb+font_number+ はフォント番号である.
3330 A good example of this and the next callbacks is the \Pkg{luatexja-otf}
3331 package, supporting \verb+"AJ1-xxx"+ form for Adobe-Japan1
3332 CID characters in a JFM. This callback doesn't replace any
3336 これと次のコールバックの良い使用例は\Pkg{luatexja-otf}パッケージであり,
3337 JFM中でAdobe-Japan1 CIDの文字を \verb+"AJ1-xxx"+ の形で指定するために
3339 このコールバックは\LuaTeX-jaのコードを書き換えない.
3342 %<en>\item[\texttt{luatexja.find\_char\_class} callback]
3343 %<ja>\item[\texttt{luatexja.find\_char\_class}コールバック]
3344 %<zh>\item[\texttt{luatexja.find\_char\_class}回调]
3346 This callback is called just when \LuaTeX-ja is trying to determine which
3347 character class a character \verb+chr_code+ belongs.
3348 A function used in this callback should be in the following form:
3351 このコールバックは\LuaTeX-jaが \verb+chr_code+ の文字がどの文字クラスに
3352 属するかを決定しようとする際に呼び出される.
3353 このコールバックで呼び出される関数は次の形をしていなければならない:
3355 \begin{lstlisting}[numbers=left]
3356 function (<number> char_class, <table> jfont_info, <number> chr_code)
3357 if char_class~=0 then return char_class
3360 return (<number> new_char_class or 0)
3366 The argument \verb+char_class+ is the result of \LuaTeX-ja's default
3367 routine or previous function calls in this callback, hence
3368 this argument may not be 0. Moreover, the returned
3369 \verb+new_char_class+ should be as same as \verb+char_class+ when \verb+char_class+
3370 is not~0, otherwise you will overwrite the \LuaTeX-ja's
3374 引数 \verb+char_class+ は\LuaTeX-jaのデフォルトルーチンか,このコールバックの
3375 直前の関数呼び出しの結果を含んでおり,したがってこの値は0ではないかもしれない.
3376 さらに,戻り値の \verb+new_char_class+ は \verb+char_class+ が非零のときには
3377 \verb+char_class+ の値と同じであるべきで,そうでないときは\LuaTeX-jaの
3378 デフォルトルーチンを書き換えることになる.
3382 This callback doesn't replace any code of \LuaTeX-ja.
3385 このコールバックは\LuaTeX-jaのコードを書き換えない.
3388 此回调不会替换\LuaTeX-ja中任何代码。
3391 %<en>\item[\texttt{luatexja.set\_width} callback]
3392 %<ja>\item[\texttt{luatexja.set\_width}コールバック]
3393 %<zh>\item[\texttt{luatexja.set\_width}回调]
3395 This callback is called when \LuaTeX-ja is trying to encapsule a
3396 \textbf{JAchar} \textit{glyph\_node}, to adjust its
3397 dimension and position.
3400 このコールバックは\LuaTeX-jaが\textbf{JAchar}の寸法と位置を調節するために
3401 その\textit{glyph\_node}をカプセル化しようとする際に呼び出される.
3403 \begin{lstlisting}[numbers=left]
3404 function (<table> shift_info, <table> jfont_info, <number> char_class)
3405 return <table> new_shift_info
3410 The argument \verb+shift_info+ and the returned \verb+new_shift_info+ have
3411 \texttt{down} and \texttt{left} fields, which are the amount of shifting
3412 down/left the character in a scaled-point.
3415 引数 \verb+shift_info+ と戻り値の \verb+new_shift_info+ は
3416 \texttt{down}と\texttt{left}のフィールドを持ち,これらの値は
3417 文字の下/左へのシフト量(スケールド・ポイント単位)である.
3421 A good example is \Pkg{test/valign.lua}.
3422 After loading this file, the vertical position of glyphs is automatically
3423 adjusted; the ratio $(\hbox{height}:\hbox{depth})$ of glyphs is adjusted
3424 to be that of letters in the character class~0. For example, suppose that
3426 \item The setting of the JFM: $(\hbox{height})=88x$, $(\hbox{depth})=12x$
3427 (the standard values of Japanese OpenType fonts);
3428 \item The value of the real font: $(\hbox{height})=28y$, $(\hbox{depth})=5y$
3429 (the standard values of Japanese TrueType fonts).
3431 Then, the position of glyphs is shifted up by
3433 \frac{88x}{88x+12x} (28y+5y) - 28y = \frac{26}{25}y= 1.04y.
3437 良い例が\Pkg{test/valign.lua}である.このファイルが読み込まれた状態では,
3438 JFM内で規定された文字クラス0の文字における$(\hbox{高
3439 さ}):(\hbox{深さ})$の比になるように,実際のフォントの出力上
3442 \item JFM側の設定:$(\hbox{高さ})=88x$, $(\hbox{深さ})=12x$%
3443 (和文OpenTypeフォントの標準値)
3444 \item 実フォント側の数値:$(\hbox{高さ})=28y$, $(\hbox{深さ})=5y$(和文TrueTypeフォントの標準値)
3446 となっていたとする.すると,実際の文字の出力位置は,
3448 \frac{88x}{88x+12x} (28y+5y) - 28y = \frac{26}{25}y= 1.04y.
3456 %<en>\section{Parameters}
3457 %<ja>\section{パラメータ}
3459 %<en>\subsection{\texttt{\char92 ltjsetparameter} primitive}
3460 %<ja>\subsection{\texttt{\char92 ltjsetparameter}プリミティブ}
3461 %<zh>\subsection{\texttt{\char92 ltjsetparameter}基本参数}
3464 As noted before, \verb+\ltjsetparameter+ and \verb+\ltjgetparameter+ are
3465 primitives for accessing most parameters of \LuaTeX-ja. One of the main
3466 reason that \LuaTeX-ja didn't adopted the syntax similar to that of \pTeX\
3467 (\textit{e.g.},~\verb+\prebreakpenalty`)=10000+)
3468 is the position of \verb+hpack_filter+ callback in the source
3469 of \LuaTeX, see Section~\ref{sec-para}.
3472 先に述べたように,\verb+\ltjsetparameter+ と \verb+\ltjgetparameter+ は
3473 \LuaTeX-jaのほとんどのパラメータにアクセスするためのプリミティブである.
3474 \LuaTeX-jaが\pTeX のような文法(例えば,\verb+\prebreakpenalty`)=10000+)を
3475 採用しない理由の一つは,\LuaTeX のソースにおける \verb+hpack_filter+
3476 コールバックの位置にある.\ref{sec-para}節を参照.
3480 \verb+\ltjsetparameter+ and \verb+\ltjglobalsetparameter+ are primitives
3481 for assigning parameters. These take one argument which is a
3482 \texttt{<key>=<value>} list. Allowed keys are described in the next
3484 The difference between
3485 \verb+\ltjsetparameter+ and \verb+\ltjglobalsetparameter+ is only the
3486 scope of assignment;
3487 \verb+\ltjsetparameter+ does a local assignment and
3488 \verb+\ltjglobalsetparameter+ does a global one.
3489 They also obey the value of \verb+\globaldefs+,
3490 like other assignment.
3493 \verb+\ltjsetparameter+ と \verb+\ltjglobalsetparameter+ はパラメータを
3494 指定するためのプリミティブである.これらは\texttt{<key>=<value>}のリストを
3495 引数としてとる.許されるキーは次の節に記述する.
3496 \verb+\ltjsetparameter+ と \verb+\ltjglobalsetparameter+ の違いはスコープの
3498 \verb+\ltjsetparameter+ はローカルな指定,\verb+\ltjglobalsetparameter+ は
3500 これらは他のパラメータ指定と同様に \verb+\globaldefs+ の値に従う.
3504 \verb+\ltjgetparameter+ is the primitive for acquiring parameters. It
3505 always takes a parameter name as first argument, and also takes the
3506 additional argument---a character code, for example---in some cases.
3509 \verb+\ltjgetparameter+ はパラメータの値を取得するためのプリミティブであり,
3511 そして,いくつかの場合には加えてさらに引数(例えば文字コード)をとる.
3514 \ltjgetparameter{differentjfm},
3515 \ltjgetparameter{autospacing},
3516 \ltjgetparameter{prebreakpenalty}{`)}.
3519 \emph{The return value of\/ {\normalfont\tt\char92ltjgetparameter} is
3520 always a string}. This is outputted by \texttt{tex.write()}, so any
3521 character other than space~`\texttt{\char32}'~(U+0020) has the category code
3522 12~(other), while the space has 10~(space).
3525 \textbf{{\normalfont\tt\char92ltjgetparameter}の戻り値は常に文字列である.}
3526 これは\texttt{tex.write()}によって出力しているためで,スペース`\texttt{\char32}'~(U+0020)を除いた文字のカテゴリーコードは全て12~(other)となる.
3527 一方,スペースのカテゴリーコードは10~(space)である.
3530 %<en>\subsection{List of Parameters}
3531 %<ja>\subsection{パラメータ一覧}
3532 %<zh>\subsection{参数一览}
3536 The following is the list of parameters which can be specified by the
3537 \verb+\ltjsetparameter+ command. [\verb+\cs+] indicates the counterpart
3538 in \pTeX, and symbols beside each parameter has the following meaning:
3541 以下は \verb+\ltjsetparameter+ に指定することができるパラメータの一覧である.
3542 [\verb+\cs+]は\pTeX における対応物を示す.
3543 また,それぞれのパラメータの右上にある記号には次の意味がある:
3547 \item % avoiding from error ``Something's wrong--perhaps a missing \item.''.
3550 \item No mark: values at the end of the paragraph or the hbox are
3551 adopted in the whole paragraph/hbox.
3554 \item 記号なし:段落や水平ボックスの終端での値がその段落/水平ボックス全体で用いられる.
3557 \item `\ast' : local parameters, which can change everywhere inside a paragraph/hbox.
3560 \item `\ast':ローカルなパラメータであり,段落/水平ボックス内のどこででも値を変えることができる.
3563 \item `\dagger': assignments are always global.
3566 \item `\dagger':指定は常にグローバルになる.
3570 \begin{list}{}{\def\makelabel{\ttfamily}\def\{{\char`\{}\def\}{\char`\}}\advance\leftmargin1\zw}
3571 \item[\Param{jcharwidowpenalty}\,=<penalty>] [\verb+\jcharwidowpenalty+]
3573 Penalty value for suppressing orphans. This penalty is inserted just
3574 after the last \textbf{JAchar} which is not regarded as a
3575 (Japanese) punctuation mark.
3578 パラグラフの最後の字が孤立して改行されるのを防ぐためのペナルティの値.
3579 このペナルティは(日本語の)句読点として扱われない最後の\textbf{JAchar}の直後に
3583 \item[\Param{kcatcode}\,=\{<chr\_code>,<natural number>\}]\
3585 An additional attributes which each character whose character code is <chr\_code> has.
3586 At the present version, the lowermost bit of <natural number> indicates
3587 whether the character is considered as a punctuation mark
3588 (see the description of \Param{jcharwidowpenalty} above).
3591 文字コードが<chr\_code>の文字が持つ付加的な属性値(attribute).
3592 現在のバージョンでは,<natural number>の最下位ビットが,その文字が句読点と
3593 みなされるかどうかを表している(上の\Param{jcharwidowpenalty}の記述を参照).
3596 \item[\Param{prebreakpenalty}\,=\{<chr\_code>,<penalty>\}] [\verb+\prebreakpenalty+]\
3598 文字コード<chr\_code>の\textbf{JAchar}が行頭にくることを抑止するために,
3599 この文字の前に挿入/追加されるペナルティの量を指定する.
3601 例えば閉じ括弧「〗」は絶対に行頭にきてはならないので,標準で読み込まれる
3602 \texttt{luatexja-kinsoku.tex}において
3604 \ltjsetparameter{prebreakpenalty={`〙,10000}}
3606 と,最大値の10000が指定されている.他にも,小書きのカナなど,絶対禁止とい
3607 うわけではないができれば行頭にはきて欲しくない場合に,0と
3608 10000の間の値を指定するのも有用であろう.
3610 \ltjsetparameter{prebreakpenalty={`ゕ,150}}
3614 \item[\Param{postbreakpenalty}\,=\{<chr\_code>,<penalty>\}] [\verb+\postbreakpenalty+]
3616 文字コード<chr\_code>の\textbf{JAchar}が行末にくることを抑止するために,
3617 この文字の後に挿入/追加されるペナルティの量を指定する.
3619 \pTeX では,\verb+\prebreakpenalty+, \verb+\postbreakpenalty+において,
3621 \item 一つの文字に対して,pre, postどちらか一つしか指定することができなかっ
3623 \item pre, post合わせて256文字分の情報を格納することしかできなかった.
3625 という制限があったが,\LuaTeX-jaではこれらの制限は解消されている.
3628 \item[\Param{jatextfont}\,=\{<jfam>,<jfont\_cs>\}]
3629 %<en>[\verb+\textfont+ in \TeX]
3630 %<ja>[\TeX の \verb+\textfont+]
3631 %<zh>[\TeX 的\verb+\textfont+]
3632 \item[\Param{jascriptfont}\,=\{<jfam>,<jfont\_cs>\}]
3633 %<en>[\verb+\scriptfont+ in \TeX]
3634 %<ja>[\TeX の \verb+\scriptfont+]
3635 %<zh>[\TeX 中的\verb+\scriptfont+]
3636 \item[\Param{jascriptscriptfont}\,=\{<jfam>,<jfont\_cs>\}]
3637 %<en>[\verb+\scriptscriptfont+ in \TeX]
3638 %<ja>[\TeX の \verb+\scriptscriptfont+]
3639 %<zh>[\TeX 中的\verb+\scriptscriptfont+]
3640 \item[\Param{yjabaselineshift}\,=<dimen>$^\ast$]\
3641 \item[\Param{yalbaselineshift}\,=<dimen>$^\ast$] [\verb+\ybaselineshift+]
3643 \item[\Param{jaxspmode}\,=\{<chr\_code>,<mode>\}]
3646 Setting whether inserting \Param{xkanjiskip} is allowed before/after a \textbf{JAchar} whose character code is <chr\_code>.
3647 The followings are allowed for <mode>:
3650 文字コードが<chr\_code>の\textbf{JAchar}の前/後ろに\Param{xkanjiskip}の
3655 %<en>\item[0, \texttt{inhibit}] Insertion of \Param{xkanjiskip} is inhibited before the character, nor after the character.
3656 %<ja>\item[0, \texttt{inhibit}] \Param{xkanjiskip}の挿入は文字の前/後ろのいずれでも禁止される.
3657 %<zh>\item[0, \texttt{inhibit}] 插入文字前/后的\Param{xkanjiskip}均被禁止。
3658 %<en>\item[1, \texttt{preonly}] Insertion of \Param{xkanjiskip} is allowed before the character, but not after.
3659 %<ja>\item[1, \texttt{preonly}] \Param{xkanjiskip}の挿入は文字の前では許されるが,後ろでは許されない.
3660 %<zh>\item[1, \texttt{preonly}] 文字前允许插入\Param{xkanjiskip},但其后不允许插入。
3661 %<en>\item[2, \texttt{postonly}] Insertion of \Param{xkanjiskip} is allowed after the character, but not before.
3662 %<ja>\item[2, \texttt{postonly}] \Param{xkanjiskip}の挿入は文字の後ろでは許されるが,前では許されない.
3663 %<zh>\item[2, \texttt{postonly}] 文字后允许插入\Param{xkanjiskip},但之前不允许插入。
3664 %<en>\item[3, \texttt{allow}] Insertion of \Param{xkanjiskip} is allowed both before the character and after the character. This is the default value.
3665 %<ja>\item[3, \texttt{allow}] \Param{xkanjiskip}の挿入は文字の前/後ろのいずれでも許される.これがデフォルトの値である.
3666 %<zh>\item[3, \texttt{allow}] 文字前后均可插入\Param{xkanjiskip}。此为默认值。
3669 This parameter is similar to the \verb+\inhibitxspcode+ primitive of \pTeX, but not compatible with \verb+\inhibitxspcode+.
3672 このパラメータは\pTeX の \verb+\inhibitxspcode+ プリミティブと似ているが,
3676 此参数类似\pTeX 基本语句\verb!\inhibitxspcode!,但是和\verb!\inhibitxspcode!不兼容。
3678 \item[\Param{alxspmode}\,=\{<chr\_code>,<mode>\}] [\verb+\xspcode+]
3681 Setting whether inserting \Param{xkanjiskip} is allowed before/after a
3682 \textbf{ALchar} whose character code is <chr\_code>.
3683 The followings are allowed for <mode>:
3686 文字コードが<chr\_code>の\textbf{ALchar}の前/後ろに\Param{xkanjiskip}の
3691 %<en>\item[0, \texttt{inhibit}] Insertion of \Param{xkanjiskip} is inhibited before the character, nor after the character.
3692 %<ja>\item[0, \texttt{inhibit}] \Param{xkanjiskip}の挿入は文字の前/後ろのいずれでも禁止される.
3693 %<zh>\item[0, \texttt{inhibit}] 插入文字前/后的\Param{xkanjiskip}均被禁止。
3694 %<en>\item[1, \texttt{preonly}] Insertion of \Param{xkanjiskip} is allowed before the character, but not after.
3695 %<ja>\item[1, \texttt{preonly}] \Param{xkanjiskip}の挿入は文字の前では許されるが,後ろでは許されない.
3696 %<zh>\item[1, \texttt{preonly}] 文字前允许插入\Param{xkanjiskip},但其后不允许插入。
3697 %<en>\item[2, \texttt{postonly}] Insertion of \Param{xkanjiskip} is allowed after the character, but not before.
3698 %<ja>\item[2, \texttt{postonly}] \Param{xkanjiskip}の挿入は文字の後ろでは許されるが,前では許されない.
3699 %<zh>\item[2, \texttt{postonly}] 文字后允许插入\Param{xkanjiskip},但之前不允许插入。
3700 %<en>\item[3, \texttt{allow}] Insertion of \Param{xkanjiskip} is allowed before the character and after the character. This is the default value.
3701 %<ja>\item[3, \texttt{allow}] \Param{xkanjiskip}の挿入は文字の前/後ろのいずれでも許される.これがデフォルトの値である.
3702 %<zh>\item[3, \texttt{allow}] 文字前后均可插入\Param{xkanjiskip}。此为默认值。
3705 Note that parameters \Param{jaxspmode} and \Param{alxspmode} use a common table, hence these two parameters are synonyms of each other.
3708 \Param{jaxspmode}と\Param{alxspmode}は共通のテーブルを用いているため,
3709 これら2つのパラメータは互いの異名となっていることに注意する.
3712 注意参数\Param{jaxspmode}和\Param{alxspmode}公用一个表,故这两个参数互为同义语。
3715 \item[\Param{autospacing}\,=<bool>$^\ast$] [\verb+\autospacing+]
3716 \item[\Param{autoxspacing}\,=<bool>$^\ast$] [\verb+\autoxspacing+]
3717 \item[\Param{kanjiskip}\,=<skip>] [\verb+\kanjiskip+]
3718 \item[\Param{xkanjiskip}\,=<skip>] [\verb+\xkanjiskip+]
3720 \item[\Param{differentjfm}\,=<mode>$^\dagger$]
3723 Specify how glues/kerns between two \textbf{JAchar}s whose JFM (or size) are different.
3724 The allowed arguments are the followings:
3727 JFM(もしくはサイズ)が異なる2つの\textbf{JAchar}の間にグルー/カーンをどのように
3732 对于处理不同大小或者JFM的两种\textbf{JAchar}之间的胶/出格。
3736 \item[\texttt{average}]
3737 \item[\texttt{both}]
3738 \item[\texttt{large}]
3739 \item[\texttt{small}]
3742 \item[\Param{jacharrange}\,=<ranges>$^\ast$]
3743 \item[\Param{kansujichar}\,=\{<digit>, <chr\_code>\}] [\verb+\kansujichar+]
3747 %<en>\section{Other Primitives}
3748 %<ja>\section{その他のプリミティブ}
3749 %<zh>\section{其他基本语句}
3750 %<en>\subsection{Primitives for Compatibility}
3751 %<ja>\subsection{互換プリミティブ}
3752 %<zh>\subsection{基本语句兼容性}
3755 The following primitives are implemented for compatibility with \pTeX:
3758 以下のプリミティブは\pTeX との互換性のために実装されている:
3763 \begin{list}{}{\def\makelabel{\ttfamily\char92 }\advance\leftmargin1\zw}
3772 %<en>\subsection{\texttt{\char92 inhibitglue} primitive}
3773 %<ja>\subsection{\texttt{\char92 inhibitglue}プリミティブ}
3774 %<zh>\subsection{\texttt{\char92 inhibitglue}基本语句}
3776 The primitive \verb+\inhibitglue+ suppresses the insertion of \textbf{JAglue}.
3777 The following is an example, using a special JFM that there will be a glue between
3778 the beginning of a box and `あ', and also between `あ' and `ウ'.
3781 \verb+\inhibitglue+ プリミティブは\textbf{JAglue}の挿入を抑制する.
3782 以下は,ボックスの始めと`あ'の間,`あ'と`ウ'の間にグルーが入る特別なJFMを用いた例で
3786 基本语句\verb!\inhibitglue!会压缩\textbf{JAchar}的插入。
3787 下面的例子使用了特殊的JFM。在一个盒子和“あ”之间,以及“あ”和“ウ”之间存在胶。
3791 \jfont\g=psft:Ryumin-Light:jfm=test \g
3792 \fbox{\hbox{あウあ\inhibitglue ウ}}
3793 \inhibitglue\par\noindent あ1
3794 \par\inhibitglue\noindent あ2
3795 \par\noindent\inhibitglue あ3
3796 \par\hrule\noindent あoff\inhibitglue ice
3800 With the help of this example, we remark the specification of \verb+\inhibitglue+:
3803 この例を援用して,\verb+\inhibitglue+ の仕様について述べる.
3806 如上例子,我们注意到\verb!\inhibtglue!的用法。
3813 \item The call of \verb+\inhibitglue+ in the (internal) vertical mode is
3817 \item \verb+\inhibitglue+ の垂直モード中での呼び出しは意味を持たない.
3818 4行目の入力で有効にならないのは,\verb+\inhibitglue+ の時点では垂直モードであり,
3819 \verb+\noindent+ の時点で水平モードになるからである.
3823 \item The call of \verb+\inhibitglue+ in the (restricted) horizontal
3824 mode is only effective on the spot; does not get over boundary of
3825 paragraphs. Moreover, \verb+\inhibitglue+ cancels ligatures and
3826 kernings, as shown in the last line of above example.
3829 \item \verb+\inhibitglue+ の(制限された)水平モード中での呼び出しはその場でのみ
3831 さらに,\verb+\inhibitglue+ は上の例の最終行のようにリガチャとカーニングを
3836 \item The call of \verb+\inhibitglue+ in math mode is just ignored.
3839 \item \verb+\inhibitglue+ を数式モード中で呼び出した場合はただ無視される.
3843 %<en>\section{Control Sequences for \LaTeXe}
3844 %<ja>\section{\LaTeXe 用のコントロールシーケンス}
3845 %<zh>\section{\LaTeXe 下使用的控制序列}
3847 %<en>\subsection{Patch for NFSS2}
3848 %<ja>\subsection{NFSS2へのパッチ}
3849 %<zh>\subsection{NFSS2补丁}
3850 \label{ssub-nfsspat}
3853 As described in Subsection~\ref{ssec-ltx}, \LuaTeX-ja simply adopted
3854 \texttt{plfonts.dtx} in \pLaTeXe\ for the Japanese patch for NFSS2.
3855 For an convenience, we will describe
3856 commands which are not described in Subsection~\ref{ssub-chgfnt}.
3859 \ref{ssec-ltx}節で述べたように,\LuaTeX-jaはNFSS2への日本語パッチである
3860 \pLaTeXe の\texttt{plfonts.dtx}を単純に取り入れている.
3861 便宜のため,ここでは\ref{ssub-chgfnt}節で述べていなかったコマンドについて
3866 \item[DeclareYokoKanjiEncoding\{<encoding>\}\{<text-settings>\}\{<math-settings>\}]
3869 In NFSS2 under \LuaTeX-ja, distinction between alphabetic font families
3870 and Japanese font families are only made by their
3871 encodings. For example, encodings OT1 and T1 are for
3872 alphabetic font families, and a Japanese font family cannot
3873 have these encodings. This command defines a new encoding
3874 scheme for Japanese font family (in horizontal direction).
3877 \LuaTeX-jaのNFSS2においては,欧文フォントファミリと和文フォントファミリは
3879 例えば,OT1とT1のエンコーディングは欧文フォントファミリに対するものであり,
3880 和文フォントファミリはこれらのエンコーディングを持つことはできない.
3881 このコマンドは和文フォントファミリ(横書き用)のための新しいエンコーディングを
3885 \item[DeclareKanjiEncodingDefaults\{<text-settings>\}\{<math-settings>\}]
3886 \item[DeclareKanjiSubstitution\{<encoding>\}\{<family>\}\{<series>\}\{<shape>\}]
3887 \item[DeclareErrorKanjiFont\{<encoding>\}\{<family>\}\{<series>\}\{<shape>\}\{<size>\}]
3890 The above 3~commands are just the counterparts for \verb+DeclareFontEncodingDefaults+ and~others.
3893 上記3つのコマンドはちょうど \verb+DeclareFontEncodingDefaults+ などに対応するものである.
3896 \item[reDeclareMathAlphabet\{<unified-cmd>\}\{<al-cmd>\}\{<ja-cmd>\}]
3900 和文・欧文の数式用フォントファミリを一度に変更する命令を作成する.
3901 具体的には,欧文数式用フォントファミリ変更の命令<al-cmd>(\verb+\mathrm+ 等)と,和文数式用フォ
3902 ントファミリ変更の命令<ja-cmd>(\verb+\mathmc+ 等)の2つを同時に行う命令として
3903 <unified-cmd>を(再)定義する.実際の使用では<unified-cmd>と
3904 <al-cmd>に同じものを指定する,すなわち,<al-cmd>で和文側も変
3905 更させるようにするのが一般的と思われる.
3907 {\let\item=\origitem
3910 <unified-cmd>\{<arg>\}\quad$\longrightarrow$\quad
3911 (<al-cmd>を1段展開したもの)\{<ja-cmd>を1段展開したもの)\{<arg>\}\}
3913 と定義を行うので,使用には注意が必要である:
3915 \item <al-cmd>,~<ja-cmd>は既に定義されていなければならない.\verb+\reDeclareMathAlphabet+後に
3916 両命令の内容を再定義しても,<unified-cmd>の内容にそれは反映されない.
3917 \item <al-cmd>,~<ja-cmd>に\verb+\@mathrm+などと\texttt{@}をつけた命令を指定した時の動作は保証できない.
3921 \item[DeclareRelationFont\{<ja-encoding>\}\{<ja-family>\}\{<ja-series>\}\{<ja-shape>\}\\
3922 \hfill\{<al-encoding>\}\{<al-family>\}\{<al-series>\}\{<al-shape>\}]
3924 This command sets the `accompanied' alphabetic font family (given by the latter 4~arguments)
3925 with respect to a Japanese font family given by the former 4~arguments.
3928 いわゆる「従属欧文」を設定するための命令である.前半の4引数で表される和文フォントファミリに対して,
3929 そのフォントに対応する「従属欧文」フォントファミリを後半の4引数により与える.
3931 \item[SetRelationFont]
3933 This command is almost same as \verb+\DeclareRelationFont+, except that this command does a local
3934 assignment, where \verb+\DeclareRelationFont+ does a global assignment.
3937 このコマンドは \verb+\DeclareRelationFont+ とローカルな指定であることを除いて
3938 ほとんど同じである(\verb+\DeclareRelationFont+ はグローバル).
3943 Change current alphabetic font encoding/family/\dots\ to the `accompanied' alphabetic
3944 font family with respect to current Japanese font family,
3946 \verb+\DeclareRelationFont+ or \verb+\SetRelationFont+.
3947 Like \verb+\fontfamily+, \verb+\selectfont+ is required to take an effect.
3950 現在の欧文フォントエンコーディング/ファミリ/…… を,
3951 \verb+\DeclareRelationFont+ か \verb+\SetRelationFont+ で指定された
3952 現在の和文フォントファミリに対応する「従属欧文」フォントファミリに変更する.
3953 \verb+\fontfamily+ のように,有効にするためには \verb+\selectfont+ が必要である.
3956 \item[adjustbaseline]
3959 \item[fontfamily\{<family>\}]
3962 As in \LaTeXe, this command changes current font family (alphabetic, Japanese,~\emph{or both})
3963 to <family>. Which family will be changed is determined as follows:
3966 元々の\LaTeXe におけるものと同様に,このコマンドは現在のフォントファミリ(欧文,
3967 和文,\textbf{もしくは両方})を<family>に変更する.
3968 どのファミリが変更されるかは以下のようにして決定される:
3975 \item Let current encoding scheme for Japanese fonts be
3976 <ja-enc>. Current Japanese font family will be changed to
3977 <family>, if one of the following two conditions is met:
3980 \item 現在の和文フォントに対するエンコーディングが<ja-enc>であるとしよう.
3981 現在の和文フォントファミリは,以下の2つの条件のうちの1つが満たされているときに
3986 \item The family <fam> under the encoding <ja-enc> has been already defined by
3987 \verb+\DeclareKanijFamily+.
3990 \item エンコーディング<ja-enc>におけるファミリ<fam>が既に \verb+\DeclareKanjiFamily+ によって定義されている.
3993 \item A font definition named \texttt{<enc><ja-enc>.fd} (the file name is
3994 all lowercase) exists.
4000 \item フォント定義ファイル\texttt{<enc><ja-enc>.fd}(ファイル名は全て小文字)が存在する.
4004 \item Let current encoding scheme for alphabetic fonts be
4005 <al-enc>. For alphabetic font family, the criterion as above is used.
4008 \item 現在の欧文フォントに対するエンコーディングを<al-enc>とする.
4009 欧文フォントファミリに対しても,上記の基準が用いられる.
4012 \item There is a case which none of the above applies, that is, the font
4013 family named <family> doesn't seem to be defined neither under the
4014 encoding <ja-enc>, nor under <al-enc>.
4015 In this case, the default family for font substitution is used for
4016 alphabetic and Japanese fonts. Note that current encoding will not
4017 be set to <family>, unlike the original implementation in \LaTeX.
4020 \item 上記のいずれもが適用されない,つまり<family>が<ja-enc>と<al-enc>の
4021 どちらでも定義されないような場合がある.
4022 この場合,代替フォントに用いられるデフォルトのフォントファミリが欧文フォントと
4023 和文フォントに用いられる.\LaTeX のオリジナルの実装とは異なり,
4024 現在のエンコーディングは<family>には設定されないことに注意する.
4031 As closing this subsection, we shall introduce an example of
4032 \verb+\SetRelationFont+ and \verb+\userelfont+:
4035 この節の終わりに,\verb+\SetRelationFont+ と \verb+\userelfont+ の例を
4040 \SetRelationFont{JY3}{gt}{m}{n}{OT1}{pag}{m}{n}
4041 \userelfont\selectfont{}あいうabc
4045 %<en>\subsection{Cropmark/`tombow'}
4046 %<ja>\subsection{トンボ}
4049 %<en>\section{Extensions}
4051 \subsection{\texttt{luatexja-fontspec.sty}}
4054 As described in Subsection~\ref{ssec-fontspec}, this optional package
4055 provides the counterparts for several commands defined in the
4056 \Pkg{fontspec} package.
4057 In addition to `font features' in the original \Pkg{fontspec},
4058 the following `font features' specifications are allowed for
4059 the commands of Japanese version:
4062 \ref{ssec-fontspec}節で述べたように,この追加パッケージは\Pkg{fontspec}
4063 パッケージで定義されているコマンドに対応する和文フォント用のコマンドを提供する.
4064 オリジナルの\Pkg{fontspec}での`font feature'に加えて,和文版のコマンドには
4065 以下の`font feature'を指定することができる:
4069 \begin{list}{}{\def\makelabel{\ttfamily}\def\{{\char`\{}\def\}{\char`\}}\advance\leftmargin1\zw}
4072 \item[JFM-var=<name>] \
4075 These 3 font features correspond to \texttt{cid}, \texttt{jfm} and
4076 \texttt{jfmvar} keys for \verb+\jfont+ primitive, respectively.
4077 \texttt{CID} is effective only when with \texttt{NoEmbed}
4079 See Subsections~\ref{ssec-jfont} and \ref{ssec-psft} for details.
4082 これら3つのキーはそれぞれ \verb+\jfont+ プリミティブに対する
4083 \texttt{cid}, \texttt{jfm}, \texttt{jfmvar}キーとそれぞれ対応する.
4084 \texttt{CID} は下の \texttt{NoEmbed} と合わせて用いられたときのみ有効である.
4085 詳細は\ref{ssec-jfont}節と\ref{ssec-psft}節を参照.
4090 By specifying this font feature, one can use `name-only' Japanese font which
4091 will not be embedded in the output PDF file. See Subsection~\ref{ssec-psft}.
4094 これを指定することで,PDFに埋め込まれない「名前だけ」のフォントを指定することが
4095 できる.\ref{ssec-psft}節を参照.
4099 \subsection{\texttt{luatexja-otf.sty}}
4102 This optional package supports typesetting characters in
4103 Adobe-Japan1. \texttt{luatexja-otf.sty} offers the following 2~low-level
4107 この追加パッケージはAdobe-Japan1の文字の出力をサポートする.
4108 \texttt{luatexja-otf.sty}は以下の2つの低レベルコマンドを提供する:
4110 \begin{list}{}{\def\makelabel{\ttfamily}\def\{{\char`\{}\def\}{\char`\}}\advance\leftmargin1\zw}
4111 \item[\char92CID\{<number>\}]
4113 Typeset a character whose CID number is <number>.
4116 CID番号が<number>の文字を出力する.
4119 \item[\char92UTF\{<hex\_number>\}]
4121 Typeset a character whose character code is <hex\_number> (in hexadecimal).
4122 This command is similar to \verb+\char"+<hex\_number>,\ %"
4123 but please remind remarks below.
4126 文字コードが(16進で)<hex\_number>の文字を出力する.
4127 このコマンドは \verb+\char"+<hex\_number>と似ているが,下の記述に注意すること.%"
4131 %<en>\paragraph{Remarks}
4134 Characters by \verb+\CID+ and \verb+\UTF+ commands are different from
4135 ordinary characters in the following points:
4138 \verb+\CID+ と \verb+\UTF+ コマンドによって出力される文字は
4146 \item Always treated as \textbf{JAchar}s.
4149 \item 常に\textbf{JAchar}として扱われる.
4152 \item Processing codes for supporting OpenType features (\textit{e.g.},
4153 glyph replacement and kerning) by the \Pkg{luaotfload} package
4154 is not performed to these characters.
4157 \item OpenType feature(例えばグリフ置換やカーニング)をサポートするための
4158 \Pkg{luaotfload}パッケージのコードはこれらの文字には働かない.
4163 %<en>\paragraph{Additional Syntax of JFM}
4164 %<ja>\paragraph{JFMへの記法の追加}
4167 \texttt{luatexja-otf.sty} extends the syntax of JFM; the entries of \texttt{
4168 chars} table in JFM now allows a string in the form
4169 \verb+'AJ1-xxx'+, which stands for the character
4170 whose CID number in Adobe-Japan1 is \verb+xxx+.
4173 \texttt{luatexja-otf.sty}はJFMの記法を拡張する.
4174 JFMの\texttt{chars}テーブルのエントリとして \verb+'AJ1-xxx'+ の形の文字列が
4175 使えるようになる.これはAdobe-Japan1におけるCID番号が \verb+xxx+ の文字を表す.
4178 %<en>\part{Implementations}
4181 %<en>\section{Storing Parameters}
4182 %<ja>\section{パラメータの保持}
4184 %<en>\subsection{Used Dimensions, Attributes and whatsit nodes}
4185 %<ja>\subsection{\LuaTeX-jaで用いられる寸法レジスタ,属性レジスタ,whatsitノード}
4188 Here the following is the list of dimensions and attributes which are used in \LuaTeX-ja.
4191 以下は\LuaTeX-jaで用いられる寸法レジスタ(dimension),属性レジスタ(attribute)の
4195 \def\makelabel{\ttfamily}\advance\leftmargin1\zw
4196 \def\dim#1{\item[\char92 #1\ \textrm{(dimension)}]}
4197 \def\attr#1{\item[\char92 #1\ \textrm{(attribute)}]}
4202 \verb+\jQ+ is equal to
4203 $1\,\textrm{Q}=0.25\,\textrm{mm}$, where `Q'~(also called `級') is
4204 a unit used in Japanese phototypesetting. So one should not change the value of this dimension.
4207 \verb+\jQ+ は$1\,\textrm{Q}=0.25\,\textrm{mm}$
4208 と等しい.ここで,`Q'(もしくは「級」)は日本の写植で用いられる単位である.したがって,
4209 この寸法レジスタの値を変更してはならない.
4214 There is also a unit called `歯' which equals to $0.25\,\textrm{mm}$ and
4215 used in Japanese phototypesetting. This
4216 \verb+\jH+ is a synonym of \verb+\jQ+.
4219 同じく写植で用いられていた単位として「歯」があり,これも$0.25\,\textrm{mm}$と
4220 等しい.\verb+\jH+ は \verb+\jQ+ の別名である.
4225 A temporal register for the `full-width' of current Japanese font.
4228 現在の和文フォントの「全角幅」を保持する一時レジスタ.
4233 A temporal register for the `full-height' (usually the sum of height of imaginary body and its depth) of current Japanese font.
4236 現在の和文フォントの「全角高さ」(通常,高さと深さの和)を保持する一時レジスタ.
4241 Current number of Japanese font family for math formulas.
4244 数式用の和文フォントファミリの現在の番号.
4249 The font index of current Japanese font.
4255 \attr{ltj@charclass}
4257 The character class of Japanese \textit{glyph\_node}.
4260 和文文字の\textit{glyph\_node}の文字クラス.
4263 \attr{ltj@yablshift}
4265 The amount of shifting the baseline of alphabetic fonts in scaled point ($2^{-16}\,\textrm{pt}$).
4268 スケールド・ポイント($2^{-16}\,\textrm{pt}$)を単位とした欧文フォントのベースラインの移動量.
4271 \attr{ltj@ykblshift}
4273 The amount of shifting the baseline of Japanese fonts in scaled point ($2^{-16}\,\textrm{pt}$).
4276 スケールド・ポイント($2^{-16}\,\textrm{pt}$)を単位とした和文フォントのベースラインの移動量.
4281 Whether the auto insertion of \Param{kanjiskip} is allowed at the node.
4284 そのノードで\Param{kanjiskip}の自動挿入が許されるかどうか.
4289 Whether the auto insertion of \Param{xkanjiskip} is allowed at the node.
4292 そのノードで\Param{xkanjiskip}の自動挿入が許されるかどうか.
4297 An attribute for distinguishing `kinds' of a node. One of the following value is
4298 assigned to this attribute:
4301 ノードの「種類」を区別するための属性.以下のうちのひとつが値として割り当てられる:
4304 \item[\textit{italic} (1)]
4306 Glues from an italic correction
4307 (\verb+\/+). This distinction of origins of glues
4308 (from explicit \verb+\kern+, or from \verb+\/+)
4309 is needed in the insertion process of \Param{xkanjiskip}.
4312 イタリック補正(\verb+\/+)によるグルー.このグルーの由来の区別(\verb+\kern+ か
4313 \verb+\/+ か)は\Param{xkanjiskip}の挿入過程において必要になる.
4316 \item[\textit{packed} (2)]
4318 \item[\textit{kinsoku} (3)]
4320 Penalties inserted for the word-wrapping process of Japanese characters (\emph{kinsoku}).
4323 和文文字のワードラップ過程において挿入されたペナルティ(\emph{kinsoku}).
4326 \item[\textit{from\_jfm} (4)]
4328 Glues/kerns from JFM.
4334 \item[\textit{line\_end} (5)]
4339 和文文字が行末にきたとき,行末との間に挿入されるカーンである.
4343 \item[\textit{kanji\_skip} (6)]
4345 Glues for \Param{kanjiskip}.
4348 \Param{kanjiskip}のグルー.
4351 \item[\textit{xkanji\_skip} (7)]
4353 Glues for \Param{xkanjiskip}.
4356 \Param{xkanjiskip}のグルー.
4359 \item[\textit{processed} (8)]
4361 Nodes which is already processed by \ldots.
4364 \LuaTeX-ja の内部処理によって既に処理されたノード.
4367 \item[\textit{ic\_processed} (9)]
4369 Glues from an italic correction, but also already processed.
4372 イタリック補正に由来するグルーであるが,まだ処理されていないもの.
4375 \item[\textit{boxbdd} (15)]
4377 Glues/kerns that inserted just the beginning or the ending of an hbox or a paragraph.
4380 ある水平ボックスか段落の最初か最後に挿入されたグルー/カーン.
4386 Where $i$~is a natural number which is less than~7.
4387 These 7~attributes store bit~vectors indicating which character block is regarded as a block of \textbf{JAchar}s.
4391 これら7つの属性レジスタは,どの文字ブロックが\textbf{JAchar}のブロックとして
4392 扱われるかを示すビットベクトルを格納する.
4397 Furthermore, \LuaTeX-ja uses several `user-defined' whatsit nodes for
4398 inrernal processing. All those nodes store a natural number (hence the node's
4399 \texttt{type} is 100). The following \verb+user_id+s are used:
4402 さらに,\LuaTeX-jaはいくつかの「ユーザ定義の」whatsit ノードを内部処理に用いる.
4403 これらの全てのノードは自然数を格納している(したがってノードの\texttt{type}は
4404 100である).次の \verb+user_id+ が使用される:
4409 Nodes for indicating that \verb+\inhibitglue+ is
4410 specified. The \texttt{value} field of these nodes doesn't matter.
4413 \verb+\inhibitglue+ が指定されたことを示すノード.これらのノードの
4414 \texttt{value}フィールドは意味を持たない.
4419 Nodes for \LuaTeX-ja's stack system (see the next
4420 subsection). The \texttt{value} field of these nodes is
4424 \LuaTeX-jaのスタックシステム(次の節を参照)のためのノード.
4425 これらのノードの\texttt{value}フィールドは現在のグループを表す.
4430 Nodes for Japanese Characters which the callback process of
4431 \Pkg{luaotfload} won't be applied, and the character code is
4432 stored in the \texttt{value} field. Each node having this
4433 \verb+user_id+ is converted to a `glyph\_node' \emph{after}
4434 the callback process of luaotfload.
4435 This \verb+user_id+ is only used by the \Pkg{luatexja-otf} package.
4438 \Pkg{luaotfload}のコールバックによる処理が適用されない和文文字のためのノードで,
4439 \texttt{value}フィールドにその文字のコードが格納されている.
4440 この \verb+user_id+ を持つノードはそれぞれが\Pkg{luaotfload}のコールバックの処理の
4441 \textbf{後で}`glyph\_node'に変換される.この \verb+user_id+ は %
4442 \Pkg{luatexja-otf} パッケージでのみ使用される.
4446 Nodes for indicating beginning of a paragraph.
4447 A paragraph which is started by \verb+\item+ in list-like environments has a horizontal box
4448 for its label before the actual contents. So \dots
4451 These whatsits will be removed during the process of inserting \textbf{JAglue}s.
4454 これらのwhatsitノードは\textbf{JAglue}の挿入処理の間に取り除かれる.
4457 %<en>\subsection{Stack System of \LuaTeX-ja}
4458 %<ja>\subsection{\LuaTeX-jaのスタックシステム}
4461 %<en>\paragraph{Background}
4464 \LuaTeX-ja has its own stack system, and most parameters of \LuaTeX-ja
4465 are stored in it. To clarify the reason, imagine the parameter
4466 \Param{kanjiskip} is stored by a skip, and consider the following
4470 \LuaTeX-jaは独自のスタックシステムを持ち,\LuaTeX-jaのほとんどのパラメータは
4471 これを用いて保持されている.その理由を明らかにするために,
4472 \Param{kanjiskip}パラメータがスキップレジスタで保持されているとし,
4476 \ltjsetparameter{kanjiskip=0pt}ふがふが.%
4477 \setbox0=\hbox{\ltjsetparameter{kanjiskip=5pt}ほげほげ}
4482 As described in Subsection~\ref{ssec-param}, the only effective value of
4483 \Param{kanjiskip} in an hbox is the latest value, so the value of
4484 \Param{kanjiskip} which applied in the entire hbox should be 5\,pt.
4485 However, by the implementation method of \LuaTeX, this `5\,pt' cannot be
4486 known from any callbacks. In the \texttt{tex/packaging.w} (which is a
4487 file in the source of \LuaTeX), there are the following codes:
4490 \ref{ssec-param}節で述べたように,ある水平ボックスの中で効力を持つ
4491 \Param{kanjiskip}の値は最後に現れた値のみであり,したがってボックス全体に適用される
4492 \Param{kanjiskip}は5\,ptであるべきである.しかし,\LuaTeX の実装のために,
4493 この`5\,pt'はどのコールバックからも知ることはできない.
4494 \texttt{tex/packaging.w}(これは\LuaTeX のソースファイルである)の中に,
4500 scaled h; /* height of box */
4501 halfword p; /* first node in a box */
4502 scaled d; /* max depth */
4508 if (cur_list.mode_field == -hmode) {
4509 cur_box = filtered_hpack(cur_list.head_field,
4510 cur_list.tail_field, saved_value(1),
4511 saved_level(1), grp, saved_level(2));
4512 subtype(cur_box) = HLIST_SUBTYPE_HBOX;
4515 Notice that \verb+unsave+ is executed \emph{before}
4516 \verb+filtered_hpack+ (this is where \verb+hpack_filter+ callback is
4517 executed): so `5\,pt' in the above source is orphaned at
4518 \verb+unsave+, and hence it can't be accessed from \verb+hpack_filter+
4522 \verb+unsave+ が \verb+filtered_hpack+(これは \verb+hpack_filter+ コールバックが
4523 実行されるところである)の\textbf{前に}実行されていることに注意する.
4524 したがって,上記ソース中で`5\,pt'は \verb+unsave+ のところで捨てられ,
4525 \verb+hpack_filter+ からはアクセスすることができない.
4528 %<en>\paragraph{The method}
4529 %<ja>\paragraph{解決法}
4530 %<zh>\paragraph{解决方法}
4533 The code of stack system is based on that in a post of Dev-luatex mailing list\footnote{%
4534 \texttt{[Dev-luatex] tex.currentgrouplevel}, a post at 2008/8/19 by Jonathan Sauer.}.
4537 スタックシステムのコードはDev-luatexメーリングリストのある投稿\footnote{\texttt{[Dev-luatex] tex.currentgrouplevel}: Jonathan Sauerによる2008/8/19の投稿.}を
4542 These are two \TeX\ count registers for maintaining information:
4543 \verb+\ltj@@stack+ for the stack level, and \verb+\ltj@@group@level+ for
4544 the \TeX's group level when the last assignment was done. Parameters
4545 are stored in one big table named \texttt{charprop\_stack\_table}, where
4546 \texttt{charprop\_stack\_table[$i$]} stores data of stack level~$i$. If
4547 a new stack level is created by \verb+\ltjsetparameter+, all data of the
4548 previous level is copied.
4551 情報を保持するために,2つの\TeX の整数レジスタを用いている:
4552 \verb+\ltj@@stack+ でスタックレベル,\verb+\ltj@@group@level+ で最後の代入が
4553 なされた時点での\TeX のグループレベルを保持している.
4554 パラメータは\texttt{charprop\_stack\_table}という名前のひとつの大きなテーブルに
4555 格納される.ここで,\texttt{charprop\_stack\_table[$i$]}はスタックレベル$i$の
4556 データを格納している.もし新しいスタックレベルが \verb+\ltjsetparameter+ によって
4557 生成されたら,前のレベルの全てのデータがコピーされる.
4561 To resolve the problem mentioned in `Background' above, \LuaTeX-ja uses
4562 another thing: When a new stack level is about to be created, a whatsit
4563 node whose type, subtype and value are 44~(\textit{user\_defined}),
4564 30112, and current group level respectively is appended to the current
4565 list (we refer this node by \textit{stack\_flag}). This enables us to
4566 know whether assignment is done just inside a hbox. Suppose that the
4567 stack level is~$s$ and the \TeX's group level is~$t$ just after the hbox
4571 上の「背景」で述べた問題を解決するために,\LuaTeX-jaではもう一つの手法を導入する:
4572 新しいスタックレベルが生成されようとするとき,type, subtype, valueがそれぞれ
4573 44~(\textit{user\_defined}), 30112,そして現在のグループレベルであるwhatsitノード
4574 を現在のリストに付け加える(このノードを\textit{stack\_flag}とする).
4575 これにより,ある水平ボックスの中で代入がなされたかどうかを知ることが可能
4576 となる.スタックレベルを$s$,その水平ボックスグループの直後の\TeX のグループレベルを
4584 \item If there is no \textit{stack\_flag} node in the list of the hbox, then
4585 no assignment was occurred inside the hbox. Hence values of
4586 parameters at the end of the hbox are stored in the stack
4590 \item もしその水平ボックスのリストの中に\textit{stack\_flag}ノードがなければ,
4591 水平ボックスの中では代入は起こらなかったということになる.
4592 したがって,その水平ボックスの終わりにおけるパラメータの値はスタックレベル$s$に
4597 \item If there is a \textit{stack\_flag} node whose value is~$t+1$, then
4598 an assignment was occurred just inside the hbox group. Hence
4599 values of parameters at the end of the hbox are stored in the
4603 \item もし値が$t+1$の\textit{stack\_flag}ノードがあれば,その
4604 水平ボックスグループの中で代入が起こったことになる.
4605 したがって,水平ボックスの終わりにおけるパラメータの値はスタックレベル$s+1$に
4610 \item If there are \textit{stack\_flag} nodes but all of their values
4611 are more than~$t+1$, then an assignment was occurred in the box,
4612 but it is done is `more internal' group. Hence values of
4613 parameters at the end of the hbox are stored in the stack
4617 \item もし\textit{stack\_flag}ノードがあるがそれらの値が全て$t+1$より大きい
4618 場合,そのボックスの中で代入が起こったが,それは「より内部の」グループで
4619 起こったということになる.したがって,水平ボックスの終わりでのパラメータの
4620 値はスタックレベル$s$に格納されている.
4625 Note that to work this trick correctly, assignments to
4626 \verb+\ltj@@stack+ and \verb+\ltj@@group@level+ have to be local always,
4627 regardless the value of \verb+\globaldefs+.
4628 This problem is resolved by using
4629 \hbox{\verb+\directlua{tex.globaldefs=0}+} (this assignment is local).
4632 このトリックを正しく働かせるためには,\verb+\ltj@@stack+ と \verb+\ltj@@group@level+ への
4633 代入は \verb+\globaldefs+ の値によらず常にローカルでなければならないことに注意する.
4634 この問題は \hbox{\verb+\directlua{tex.globaldefs=0}+}(この代入は常にローカル)を
4638 %<en>\section{Linebreak after Japanese Character}
4639 %<ja>\section{和文文字直後の改行}
4640 %<zh>\section{日文字符后断行}
4642 %<en>\subsection{Reference: Behavior in \pTeX}
4643 %<ja>\subsection{参考:\pTeX の動作}
4644 %<zh>\subsection{参考:\pTeX 行为}
4646 In~\pTeX, a line break after a Japanese character doesn't emit a space,
4647 since words are not separated by spaces in Japanese writings. However,
4648 this feature isn't fully implemented in \LuaTeX-ja due to the
4649 specification of callbacks in~\LuaTeX. To clarify the difference between
4650 \pTeX~and~\LuaTeX, We briefly describe the handling of a line break in~\pTeX, in
4653 \pTeX's input processor can be described in terms of a finite state
4654 automaton, as that of~\TeX\ in~Section~2.5 of~\cite{texbytopic}. The
4655 internal states are as follows:
4657 \item State~$N$: new line
4658 \item State~$S$: skipping spaces
4659 \item State~$M$: middle of line
4660 \item State~$K$: after a Japanese character
4662 The first three states---$N$, $S$~and~$M$---are as same as \TeX's input
4663 processor. State~$K$ is similar to state~$M$, and is entered after
4664 Japanese characters. The diagram of state transitions are indicated in
4665 Figure~\ref{fig-ptexipro}. Note that \pTeX\ doesn't leave state~$K$
4666 after `beginning/ending of a group' characters.
4670 欧文では文章の改行は単語間でしか行わない.そのため,\TeX では,(文字の直後の)改行は
4671 空白文字と同じ扱いとして扱われる.一方,和文ではほとんどどこでも改行が可能なため,
4672 \pTeX では和文文字の直後の改行は単純に無視されるようになっている.
4674 このような動作は,\pTeX が\TeX からエンジンとして拡張されたことによって可能になったことである.
4675 \pTeX の入力処理部は,\TeX におけるそれと同じように,有限オートマトンとして記述することができ,
4679 \item State~$N$: 行の開始.
4680 \item State~$S$: 空白読み飛ばし.
4681 \item State~$M$: 行中.
4682 \item State~$K$: 行中(和文文字の後).
4684 また,状態遷移は,図\ref{fig-ptexipro}のようになっており,図中の数字は
4685 カテゴリーコードを表している.最初の3状態は\TeX の入力処理部と同じであり,
4686 図中から状態$K$と「$j$」と書かれた矢印を取り除けば,\TeX の入力処理部と同
4691 行が和文文字(とグループ境界文字)で終わっていれば,改行は無視される
4698 \def\sp{\texttt{\char32}}
4700 {\text{scan a cs}}\ar@(r,ul)[dr]&\\
4702 *++[o][F-]{N}\ar[ur]^0\ar[dd]_{d,\ g}\ar[u]^{5\ (\texttt{\char92par})}
4703 \ar@{->}@(d,l)[ddrr]_(0.45){j}&&
4704 *++[o][F-]{S}\ar@(l,dr)[ul]^0\ar@(l,ur)[ddll]_{d,\ g}\ar[u]_{5}
4705 \ar@{->}@(r,r)[dd]^{j}\\&\\&
4706 *++[o][F-]{M}\ar[uuur]^0\ar@(r,dl)[uurr]_(0.55){10\ (\sp)}
4707 \ar[d]_{5\ ({\sp})}\ar@{->}@(dr,dl)[rr]_{j}&&
4708 *++[o][F-]{K}\ar@{->}@(ul,d)[uuul]^0\ar@{->}[ll]^{d}
4709 \ar@{->}@(ur,dr)[uu]^{10\ (\sp)}\ar@{->}[d]_5\\
4712 d:=\{3,4,6,7,8,11,12,13\},\quad g:=\{1,2\},\quad j:=(\text{Japanese characters})
4716 \item Numbers represent category codes.
4719 \item 数字はカテゴリーコードを表わしている.
4722 \item Category codes 9~(ignored), 14~(comment)~and~15~(invalid) are omitted in the above diagram.
4725 \item カテゴリーコード9(無視する文字),14(コメント文字),15(無効文字)は上の図では省かれている.
4731 %<en>\caption{State transitions of \pTeX's input processor.}
4732 %<ja>\caption{\pTeX の入力処理部の状態遷移.}
4733 \label{fig-ptexipro}
4737 %<en>\subsection{Behavior in \LuaTeX-ja}
4738 %<ja>\subsection{\LuaTeX-jaの動作}
4739 %<zh>\subsection{\LuaTeX-ja行为}
4741 States in the input processor of \LuaTeX\ is the same as that of \TeX,
4742 and they can't be customized by any callbacks. Hence, we can only use
4743 \verb+process_input_buffer+ and \verb+token_filter+ callbacks for to
4744 suppress a space by a line break which is after Japanese characters.
4746 However, \verb+token_filter+ callback cannot be used either, since a
4747 character in category code 5~(end-of-line) is converted into an space
4748 token \emph{in the input processor}. So we can use only the
4749 \verb+process_input_buffer+ callback. This means that suppressing a
4750 space must be done \emph{just before} an input line is read.
4752 Considering these situations, handling of an end-of-line in \LuaTeX-ja are as follows:
4754 A character U+FFFFF (its category code is set to 14~(comment) by
4755 \LuaTeX-ja) is appended to an input line, \emph{before \LuaTeX\ actually
4756 process it}, if and only if the following three conditions are satisfied:
4758 \item The category code of \verb+\endlinechar+%
4759 \footnote{Usually, it is $\langle${return}$\rangle$
4760 (whose character code is 13).} is 5~(end-of-line).
4761 \item The category code of U+FFFFF itself is 14~(comment).
4762 \item The input line matches the following `regular expression':
4764 (\text{any char})^*(\textbf{JAchar})
4765 \bigl(\{\text{catcode}=1\}\cup\{\text{catcode}=2\}\bigr)^*
4771 The following example shows the major difference from the behavior of \pTeX:
4773 \ltjsetparameter{autoxspacing=false}
4774 \ltjsetparameter{jacharrange={-6}}xあ
4775 y\ltjsetparameter{jacharrange={+6}}zあ
4779 \item There is no space between `x' and `y', since the line~2 ends with a \textbf{JAchar} `あ'
4780 (this `あ' considered as an \textbf{JAchar} at the ending of line~1).
4781 \item There is no space between `あ' (in the line~3) and `u', since the
4782 line~3 ends with an \textbf{ALchar}
4783 (the letter `あ' considered as an \textbf{ALchar} at the ending of line~2).
4788 \LuaTeX の入力処理部は\TeX のそれと全く同じであり,コールバックによりユーザが
4789 カスタマイズすることはできない.このため,改行抑制の目的でユーザが利用で
4790 きそうなコールバックとしては,\verb+process_input_buffer+や
4791 \verb+token_filter+に限られてしまう.しかし,\TeX の入力処理部をよく見る
4792 と,後者も役には経たないことが分かる:改行文字は,入力処理部によってトー
4793 クン化される時に,カテゴリーコード10の32番文字へと置き換えられてしまうた
4794 め,\verb+token_filter+で非標準なトークン読み出しを行おうとしても,空白文
4795 字由来のトークンと,改行文字由来のトークンは区別できないのだ.
4797 すると,我々のとれる道は,\verb+process_input_buffer+を用いて
4798 \LuaTeX の入力処理部に引き渡される前に入力文字列を編集するというものしかない.
4799 以上を踏まえ,\LuaTeX-jaにおける「和文文字直後の改行抑制」の処理は,次のようになっている:
4802 各入力行に対し,\textbf{その入力行が読まれる前の内部状態で}
4803 以下の3条件が満たされている場合,\LuaTeX-jaはU+FFFFF番の文字
4804 \footnote{この文字はコメント文字として扱われるように\LuaTeX-ja内部で設定をしている.}
4805 を末尾に追加する.よって,その場合に改行は空白とは見做されないこととなる.
4807 \item \verb+\endlinechar+の文字\footnote{普通は,改行文字(文字コード13番)である.}
4808 のカテゴリーコードが5~(end-of-line)である.
4809 \item U+FFFFFのカテゴリーコードが14~(comment)である.
4810 \item 入力行は次の「正規表現」にマッチしている:
4812 (\text{any char})^*(\textbf{JAchar})
4813 \bigl(\{\text{catcode}=1\}\cup\{\text{catcode}=2\}\bigr)^*
4818 この仕様は,前節で述べた\pTeX の仕様にできるだけ近づけたものとなっている.最初の条件は,
4819 \texttt{verbatim}系環境などの日本語対応マクロを書かなくてすませるためのものである.
4820 しかしながら,完全に同じ挙動が実現できたわけではない.
4821 差異は,次の例が示すように,和文文字の範囲を変更した行の改行において見られる:
4823 \ltjsetparameter{autoxspacing=false}
4824 \ltjsetparameter{jacharrange={-6}}xあ
4825 y\ltjsetparameter{jacharrange={+6}}zあ
4828 もし\pTeX とまったく同じ挙動を示すならば,出力は
4829 「\hbox{\ltjsetparameter{autoxspacing=false}x yzあu}」となるべきである.しかし,実際には
4832 \item 2行目は「あ」という和文文字で終わる(2行目を処理する前の時点では,
4833 「あ」は和文文字扱いである)ため,直後の改行文字は無視される.
4834 \item 3行目は「あ」という欧文文字で終わる(2行目を処理する前の時点では,
4835 「あ」は欧文文字扱いである)ため,直後の改行文字は空白に置き換わる.
4837 このため,トラブルを避けるために,和文文字の範囲を\verb+\ltjsetparameter+で編集した場合,
4838 その行はそこで改行するようにした方がいいだろう.
4842 %<en>\section{Insertion of JFM glues, \Param{kanjiskip} and \Param{xkanjiskip}}
4843 %<ja>\section{JFMグルーの挿入,\Param{kanjiskip}と\Param{xkanjiskip}}
4844 %<zh>\section{JFM的胶插入,\Param{kanjiskip}和\Param{xkanjiskip}}
4846 %<en>\subsection{Overview}
4847 %<ja>\subsection{概要}
4848 %<zh>\subsection{概要}
4850 \LuaTeX-jaにおける和文処理グルーの挿入方法は,\pTeX のそれとは全く異なる.
4851 \pTeX では次のような仕様であった:
4853 \item JFMグルーの挿入は,和文文字を表すトークンを元に水平リストに(文字を表す)<char\_node>を
4855 \item \Param{xkanjiskip}の挿入は,水平ボックスへのパッケージングや行分割前に行われる.
4856 \item \Param{kanjiskip}はノードとしては挿入されない.パッケージングや行分割の計算時に
4857 「和文文字を表す2つの<char\_node>の間には\Param{kanjiskip}がある」ものとみなされる.
4859 しかし,\LuaTeX-jaでは,水平ボックスへのパッケージングや行分割前に全ての
4860 \textbf{JAglue},即ちJFMグルー・\Param{xkanjiskip}・\Param{kanjiskip}の
4861 3種類を一度に挿入することになっている.これは,\LuaTeX において欧文の合字・
4862 カーニング処理がノードベースになったことに対応する変更である.
4864 \LuaTeX-jaにおける\textbf{JAglue}挿入処理では,次節で定義する
4865 「クラスタ」を単位にして行われる.大雑把にいうと,「クラスタ」は文字とそれに付随す
4866 るノード達(アクセント位置補正用のカーンや,イタリック補正)をまとめたもの
4867 であり,2つのクラスタの間には,ペナルティ,\verb+\vadjust+,whatsitなど,行組版
4871 %<en>\subsection{definition of a `cluster'}
4872 %<ja>\subsection{「クラスタ」の定義}
4873 %<zh>\subsection{“cluster”定义}
4875 \def\OA{$\text{\sf O}_{\text{\sf A}}$}
4876 \def\OB{$\text{\sf O}_{\text{\sf B}}$}
4879 A \emph{cluster} is a list of consecutive nodes in one of the following forms,
4880 with the \textit{id} of it:
4883 \textbf{クラスタ}は以下の形のうちのどれかひとつをとる連続的なノードのリストである:
4887 \item Nodes whose value of\ \verb+\ltj@icflag+ is in $[3,15)$. These
4888 nodes come from a hbox which is already packaged, by unpackaging
4890 The \textit{id} is \textit{id\_pbox}.
4893 \item その \verb+\ltj@icflag+ の値が$[3,15)$に入るノードのリスト.
4894 これらのノードはある既にパッケージングされた水平ボックスから \verb+\unhbox+ で
4896 その\textit{id}は\textit{id\_pbox}である.
4900 \item A inline math formula, including two \textit{math\_node}s at the boundary of it.
4901 The \textit{id} is \textit{id\_math}.
4904 \item インライン数式でその境界に2つの\textit{math\_node}を含むもの.
4905 その\textit{id}は\textit{id\_math}である.
4909 \item A \textit{glyph\_node}~$p$ with nodes which relate with it:
4912 \item \textit{glpyh\_node}~$p$とそれに関係するノード:
4916 \item A kern for the italic correction of~$p$.
4919 \item $p$のイタリック補正のためのカーン.
4923 \item An accent attached to $p$ by \verb+\accent+.
4926 \item \verb+\accent+ による$p$に付随したアクセント.
4931 \Node{kern}{$\mathit{subtype}=2$}\longrightarrow
4932 \left\{\begin{array}{c}
4933 \Node{glyph}{accent}\\\noalign{\medskip}
4934 \Node{hbox}{accent (shifted vert.)}
4935 \end{array}\right\}\longrightarrow
4936 \Node{kern}{$\mathit{subtype}=2$}}^{\text{(a)}}
4938 \Node{glyph}{$p$}\longrightarrow
4940 \Node{kern}{italic corr.}}^{\text{(b)}}
4944 The \textit{id} is \textit{id\_jglyph} or
4945 \textit{id\_glyph}, according to whether the \textit{glyph\_node}
4946 represents a Japanese character or not.
4949 \textit{id}は\textit{glyph\_node}が和文文字を表すかどうかによって
4950 \textit{id\_jglyph},もしくは\textit{id\_glyph}となる.
4954 \item An box-like node, that is, an hbox, a vbox, a rule (\verb+\vrule+) and an \textit{unset\_node}.
4955 The \textit{id} is \textit{id\_hlist} if the node is an
4956 hbox which is not shifted vertically, or \textit{id\_box\_like}
4960 \item ボックス様のノード,つまり水平ボックス,垂直ボックス,罫線 (\verb+\vrule+),
4961 そして\textit{unset\_node}.
4962 その\textit{id}は垂直に移動していない水平ボックスならば\textit{id\_hlist},
4963 そうでなければ\textit{id\_box\_like}となる.
4967 \item A glue, a kern whose subtype is not 2~(\textit{accent}), and a discretionary break.
4968 The \textit{id} is \textit{id\_glue}, \textit{id\_kern}
4969 and \textit{id\_disc}, respectively.
4972 \item グルー,subtypeが 2~(\textit{accent})ではないカーン,そして任意改行.
4973 その\textit{id}はそれぞれ\textit{id\_glue}, \textit{id\_kern},そして
4974 \textit{id\_disc}である.
4978 Let \textit{Np}, \textit{Nq} and \textit{Nr} denote a cluster.
4981 以下では\textit{Np}, \textit{Nq}, \textit{Nr}でクラスタを表す.
4985 \paragraph{\textit{id}の意味}
4986 $\mathit{Np}.\mathit{id}$の意味を述べるとともに,
4987 「先頭の文字」を表す\textit{glyph\_node}~$\mathit{Np}.\mathit{head}$と,
4988 「最後の文字」を表す\textit{glyph\_node}~$\mathit{Np}.\mathit{tail}$を次のように定義する.
4989 直感的に言うと,\textit{Np}は$\mathit{Np}.\mathit{head}$で始まり$\mathit{Np}.\mathit{tail}$で終わるような単語,
4990 と見做すことができる.これら$\mathit{Np}.\mathit{head}$, $\mathit{Np}.\mathit{tail}$は
4991 説明用に準備した概念であって,実際のLuaコード中にそのように書かれているわけではないことに注意.
4994 \item[\textit{id\_jglyph}] 和文文字.\\
4995 $\mathit{Np}.\mathit{head}$, $\mathit{Np}.\mathit{tail}$は,その和文文字を表している
4996 \textit{glyph\_node}そのものである.
4997 \item[\textit{id\_glyph}] 和文文字を表していない\textit{glyph\_node}~$p$.\\
4998 多くの場合,$p$は欧文文字を格納しているが,`ffi'などの合字によって作られた
4999 \textit{glyph\_node}である可能性もある.
5000 前者の場合,$\mathit{Np}.\mathit{head}$,~$\mathit{Np}.\mathit{tail} = p$である.
5003 \item $\mathit{Np}.\mathit{head}$は,
5004 合字の構成要素の先頭→(その\textit{glyph\_node}における)合字の構成要素の先頭→……
5005 と再帰的に検索していってたどり着いた\textit{glyph\_node}である.
5006 \item $\mathit{Np}.\mathit{last}$は,同様に末尾→末尾→と検索してたどり着いた\textit{glyph\_node}である.
5008 \item[\textit{id\_math}] インライン数式.\\
5009 便宜的に,$\mathit{Np}.\mathit{head}$, $\mathit{Np}.\mathit{tail}$ともに
5010 「文字コード$-1$の欧文文字」とおく.
5011 \item[\textit{id\_hlist}] 縦方向にシフトされていない水平ボックス.\\
5012 この場合,$\mathit{Np}.\mathit{head}$, $\mathit{Np}.\mathit{tail}$はそれぞれ$p$の内容を表すリストの,
5015 \item 状況によっては,\TeX ソースで言うと
5017 \hbox{\hbox{abc}...\hbox{\lower1pt\hbox{xyz}}}
5019 のように,$p$の内容が別の水平ボックスで開始・終了している可能性も十分あり得る.そのような場合,
5020 $\mathit{Np}.\mathit{head}$, $\mathit{Np}.\mathit{tail}$の算出は,\textbf{垂直方向にシフトされていない}水平ボックスの
5021 場合だけ内部を再帰的に探索する.例えば上の例では,$\mathit{Np}.\mathit{head}$は文字「a」を表すノードであり,
5022 一方$\mathit{Np}.\mathit{tail}$は垂直方向にシフトされた水平ボックス,\verb+\lower1pt\hbox{xyz}+に対応するノードである.
5023 \item また,先頭にアクセント付きの文字がきたり,末尾にイタリック補正用のカーンが
5024 来ることもあり得る.この場合は,クラスタの定義のところにもあったように,それらは無視して算出を行う.
5025 \item 最初・最後のノードが合字によって作られた\textit{glyph\_node}のときは,それぞれに対して\textit{id\_glyph}%
5026 と同様に再帰的に構成要素をたどっていく.
5028 \item[\textit{id\_pbox}] 「既に処理された」ノードのリストであり,これらのノードが二度処理を受けないために
5029 まとめて1つのクラスタとして取り扱うだけである.
5030 \textit{id\_hlist}と同じ方法で$\mathit{Np}.\mathit{head}$, $\mathit{Np}.\mathit{tail}$を算出する,
5031 \item[\textit{id\_disc}] discretionary break (\verb+\discretionary{pre}{post}{nobreak}+).\\
5032 \textit{id\_hlist}と同じ方法で$\mathit{Np}.\mathit{head}$, $\mathit{Np}.\mathit{tail}$を算出するが,
5033 第3引数の \texttt{nobreak}(行分割が行われない時の内容)を使う.言い換えれば,ここで行分割が発生した時の状況は
5035 \item[\textit{id\_box\_like}] \textit{id\_hlist}とならないboxや,rule.\\
5036 この場合は,$\mathit{Np}.\mathit{head}$, $\mathit{Np}.\mathit{tail}$のデータは利用されないので,2つの算出は無意味である.
5037 敢えて明示するならば,$\mathit{Np}.\mathit{head}$, $\mathit{Np}.\mathit{tail}$は共にnil値である.
5038 \item[他] 以上にない\textit{id}に対しても,$\mathit{Np}.\mathit{head}$, $\mathit{Np}.\mathit{tail}$の算出は無意味.
5041 \paragraph{クラスタの別の分類}
5042 さらに,JFMグルー挿入処理の実際の説明により便利なように,\textit{id}とは別のクラスタの分類を行っておく.
5043 挿入処理では2つの隣り合ったクラスタの間に
5044 空白等の実際の挿入を行うことは前に書いたが,ここでの説明では,問題にしているクラスタ\textit{Np}は「後ろ側」のクラスタである
5045 とする.「前側」のクラスタについては,以下の説明で\textit{head}が\textit{last}に置き換わることに注意すること.
5047 \item[和文A] リスト中に直接出現している和文文字.
5048 \textit{id}が\textit{id\_jglyph}であるか,\\
5049 \textit{id}が\textit{id\_pbox}であって$\mathit{Np}.\mathit{head}$が\textbf{JAchar}であるとき.
5051 \item[和文B] リスト中の水平ボックスの中身の先頭として出現した和文文字.和文Aとの違いは,これの前に
5052 JFMグルーの挿入が行われない(\Param{xkanjiskip},~\Param{kanjiskip}は入り得る)ことである.\\
5053 \textit{id}が\textit{id\_hlist}か\textit{id\_disc}であって$\mathit{Np}.\mathit{head}$が\textbf{JAchar}であるとき.
5055 \item[欧文] リスト中に直接/水平ボックスの中身として出現している欧文文字.次の3つの場合が該当:
5057 \item \textit{id}が\textit{id\_glyph}である.
5058 \item \textit{id}が\textit{id\_math}である.
5059 \item \textit{id}が\textit{id\_pbox}か\textit{id\_hlist}か\textit{id\_disc}であって,$\mathit{Np}.\mathit{head}$が\textbf{ALchar}.
5061 \item[箱] box,またはそれに類似するもの.次の2つが該当:
5063 \item \textit{id}が\textit{id\_pbox}か\textit{id\_hlist}か\textit{id\_disc}であって,$\mathit{Np}.\mathit{head}$が\textit{glyph\_node}でない.
5064 \item \textit{id}が\textit{id\_box\_like}である.
5069 \subsection{段落/水平ボックスの先頭や末尾}
5071 まず,段落/水平ボックスの一番最初にあるクラスタ\textit{Np}を探索する.
5072 水平ボックスの場合は何の問題もないが,段落の場合では以下のノード達を事前に読み飛ばしておく:
5074 \verb+\parindent+由来の水平ボックス ($\mathit{subtype}=3$),及び\textit{subtype}が44~(\textit{user\_defined})でない
5077 これは,\verb+\parindent+由来の水平ボックスがクラスタを構成しないようにするためである.
5079 次に,\textit{Np}の直前に空白$g$を必要なら挿入する:
5081 \item この処理が働くような\textit{Np}は\textsf{和文A}である.
5082 \item 問題のリストが字下げありの段落(\verb+\parindent+由来の水平ボックスあり)の場合は,
5083 この空白$g$は「文字コード\texttt{'parbdd'}の文字」と\textit{Np}の間に入るグルー/カーンである.
5084 \item そうでないとき(\verb+noindent+で開始された段落や水平ボックス)は,
5085 $g$は「文字コード\texttt{'boxbdd'}の文字」と\textit{Np}の間に入るグルー/カーンである.
5087 ただし,もし$g$がglueであった場合,この挿入によって\textit{Np}による行分割が新たに可能になるべきではない.
5088 そこで,以下の場合には,$g$の直前に\verb+\penalty10000+を挿入する:
5090 \item 問題にしているリストが段落であり,かつ
5091 \item \textit{Np}の前には予めペナルティがなく,$g$はglue.
5095 末尾の処理は,問題のリストが段落のものか水平ボックスのものかによって異なる.
5096 後者の場合は容易い:最後のクラスタを\textit{Nq}とおくと,\textit{Nq}と「文字コード\texttt{'boxbdd'}の文字」の間に入るグルー/カーンを,
5097 \textit{Nq}の直後に挿入するのみである.
5099 一方.前者(段落)の場合は,リストの末尾は常に\verb+\penalty10000+と,
5100 \verb+\parfillskip+由来のグルーが存在する.よって,最後のクラスタ\textit{Np}は
5101 この\verb+\parfillskip+由来のグルーとなり,実質的な中身の最後はその1つ前のクラスタ\textit{Nq}となる.
5103 \item まず\textit{Nq}の直後に(後に述べる)\textsf{line-end~[E]}によって定まる空白を挿入する.
5104 \item 次に,段落の最後の「通常の和文文字${}+{}$句点」が独立した行となるのを防ぐために,
5105 \Param{jcharwidowpenalty}の値の分だけ適切な場所のペナルティを増やす.
5107 ペナルティ量を増やす場所は,\textit{head}が\textbf{JAchar}であり,かつその文字の\Param{kcatcode}が偶数であるような
5108 最後のクラスタの直前にあるものたちである\footnote{大雑把に言えば,\Param{kcatcode}が奇数であるような\textbf{JAchar}
5109 を約物として考えていることになる.\Param{kcatcode}の最下位ビットはこの\Param{jcharwidowpenalty}用にのみ利用される.}.
5112 \subsection{概観と典型例:2つの「和文A」の場合}
5113 先に述べたように,2つの隣り合ったクラスタ,\textit{Nq}と\textit{Np}の間には,
5114 ペナルティ,\verb+\vadjust+,whatsitなど,行組版には関係しないものがある.模式的に表すと,
5116 \Node{cluster}{\textit{Nq}}\longrightarrow
5118 \Node{penalty}{$p$}\longrightarrow \cdots\longrightarrow \Node{whatsit}{}}^{(a)}
5119 \longrightarrow \Node{cluster}{\textit{Np}}
5121 のようになっている.間の(a)に相当する部分には,何のノードもない場合ももちろんあり得る.
5122 そうして,JFMグルー挿入後には,この2クラスタ間は次のようになる:
5124 \Node{cluster}{\textit{Nq}}\longrightarrow\Node{kern}{左空白}\longrightarrow
5126 \Node{penalty}{$p+x$}\longrightarrow \cdots\longrightarrow \Node{whatsit}{}}^{(a)}
5127 \longrightarrow \Node{glue or kern}{右空白}\longrightarrow \Node{cluster}{\textit{Np}}
5130 以後,\textbf{典型的な例として,クラスタ\textit{Nq}と\textit{Np}が共に\textsf{\textmd{和文A}}である場合を見ていこう,}
5133 \paragraph{「右空白」の算出}
5134 まず,「右空白」にあたる量を算出する.通常はこれが,隣り合った2つの和文文字間に入る空白量となる.
5136 \item[JFM由来{[M]}] JFMの文字クラス指定によって入る空白を以下によって求める.この段階で空白量が未定義(未指定)だった場合,
5137 デフォルト値\Param{kanjiskip}を採用することとなるので,次へ.
5139 \item もし両クラスタの間で\verb+\inhibitglue+が実行されていた場合(証としてwhatsitノードが自動挿入される),
5140 代わりに\Param{kanjiskip}が挿入されることとなる.次へ.
5141 \item \textit{Nq}と\textit{Np}が同じJFM・同じ\texttt{jfmvar}キー・同じサイズの和文フォントであったならば,
5142 共通に使っているJFM内で挿入される空白(グルーかカーン)が決まっているか調べる.
5143 \item 1.でも2.でもない場合は,\textit{Nq}と\textit{Np}が違うJFM/\texttt{jfmvar}/サイズである.
5146 \vcenter{\halign{\hfil$#:={}$&(\inhibitglue#\inhibitglue)\cr
5147 gb&\textit{Nq}と「文字コードが{\tt'diffmet'}の文字」との間に入るグルー/カーン\cr
5148 ga&「文字コードが{\tt'diffmet'}の文字」と\textit{Np}との間に入るグルー/カーン\cr
5151 として,左側由来・右側由来の空白(グルー/カーン)を(それぞれのJFMから)求める.
5152 $\mathit{ga}$と$\mathit{gb}$のどちらか片方が未定義であるならば,定義されている側の値をそのまま採用する.
5153 もし$\mathit{ga}$と$\mathit{gb}$が両方決まっているならば,両者の値を平均\footnote{\Param{differentjfm}パラメタの
5154 値によって,「大きい方」「小さい方」「合計」に変えることができる.}した値を採用する.
5159 \jfont\foo=psft:Ryumin-Light:jfm=ujis
5160 \jfont\bar=psft:GothicBBB-Medium:jfm=ujis
5161 \jfont\baz=psft:GothicBBB-Medium:jfm=ujis;jfmvar=piyo
5165 \overbrace{\Node{glyph}{{\tt\char92 foo}, `あ'}}^{p}
5166 \longrightarrow \overbrace{\Node{glyph}{{\tt\char92 bar}, `い'}}^{q}
5167 \longrightarrow \overbrace{\Node{glyph}{{\tt\char92 baz}, `う'}}^{r}
5169 という3ノードを考える(それぞれ単独でクラスタをなす).
5170 この場合,$p$と$q$の間は,実フォントが異なるにもかかわらず(2)の状況となる一方で,
5171 $q$と$r$の間は(実フォントが同じなのに)\texttt{jfmvar}キーの内容が異なるので(3)の状況となる.
5172 \item[\Param{kanjiskip}~{[K]}] 上の[M]において空白が定まらなかった場合,
5173 \Param{kanjiskip}の値を以下で定め,それを「右空白」として採用する.
5174 この段階においては,\verb+\inhibitglue+は効力を持たないため,
5175 結果として,2つの和文文字間には常に何らかのグルー/カーンが挿入されることとなる.
5177 \item 両クラスタ(厳密には$\mathit{Nq}.\mathit{tail}$,$\mathit{Np}.\mathit{head}$)の中身の文字コードに対する
5178 \Param{autospacing}パラメタが両方ともfalseだった場合は,長さ0のglueとする.
5179 \item ユーザ側から見た\Param{kanjiskip}パラメタの自然長が${\tt \char92 maxdimen}=(2^{30}-1)\,{\rm sp}$で
5180 なければ,\Param{kanjiskip}パラメタの値を持つglueを採用する.
5181 \item 2.でない場合は,\textit{Nq}, \textit{Np}で使われているJFMに指定されている\Param{kanjiskip}の値を用いる.
5182 どちらか片方のクラスタだけが和文文字(\textsf{和文A}・\textsf{和文B})のときは,そちらのクラスタで使われている
5183 JFM由来の値だけを用いる.もし両者で使われているJFMが異なった場合は,上の[M]~3.と同様の方法を用いて調整する.
5186 \paragraph{「左空白」の算出とそれに伴う補正}
5189 \item[line-end~{[E]}]
5190 \textit{Nq}と\textit{Np}の間で行分割が起きたときに,
5191 \textit{Nq}と行末の間に入る空白である.ぶら下げ組の組版などに用いられることを期待している.
5193 \item 既に算出した「右空白」がカーンである場合は,「左空白」は挿入されない.
5194 \item 「右空白」がglueか未定義(長さ0のglueとみなす)の場合は,「左空白」は
5195 \textit{Nq}と「文字コード\texttt{'lineend'}の文字」との間に入るカーンとして,JFMから決定される.
5196 \item 2.で決まった「左空白」の長さが0でなければ,その分だけ先ほど算出した「右空白」の自然長を引く.
5199 \paragraph{禁則用ペナルティの挿入}
5202 a:=(\text{\textit{Nq}{\footnotemark}の文字に対する\Param{postbreakpenalty}の値})
5203 +(\text{\textit{Np}{\footnotemark}の文字に対する\Param{prebreakpenalty}の値})
5205 とおく\footnotetext{厳密にはそれぞれ$\mathit{Nq}.\mathit{tail}$,$\mathit{Np}.\mathit{head}$.}.
5206 ペナルティは通常$[-10000,10000]$の整数値をとり,また$\pm 10000$は正負の無限大を意味することになっているが,この$a$の
5209 $a$は禁則処理用に\textit{Nq}と\textit{Np}の間に加えられるべきペナルティ量である.
5211 \item[P-normal~{[PN]}]
5212 \textit{Nq}と\textit{Np}の間の(a)部分にペナルティ(\textit{penalty\_node})があれば処理は簡単である:
5213 それらの各ノードにおいて,ペナルティ値を($\pm 10000$を無限大として扱いつつ)$a$だけ増加させればよい.
5214 また,$10000 + (-10000) = 0$としている.
5216 少々困るのは,(a)部分にペナルティが存在していない場合である.
5217 直感的に,補正すべき量$a$が0でないとき,その値をもつ\textit{penalty\_node}を作って
5218 「右空白」の(もし未定義なら\textit{Np}の)直前に挿入……
5219 ということになるが,実際には僅かにこれより複雑である.
5221 \item 「右空白」がカーンであるとき,
5222 それは「\textit{Nq}と\textit{Np}の間で改行は許されない」ことを意図している.そのため,
5223 この場合は$a\neq 0$であってもペナルティの挿入はしない.
5224 \item 「左空白」がカーンとしてきっちり定義されている時(このとき,「右空白」はカーンでない),
5225 この「左空白」の直後での行分割を許容しないといけないので,$a=0$であっても
5226 \textit{penalty\_node}を作って挿入する.
5227 \item 以上のどれでもないときは,$a\neq 0$ならば\textit{penalty\_node}を作って挿入する.
5231 \def\gkf#1#2#3{\sf$\displaystyle\vphantom{\Bigg(}%
5232 \frac{\hbox to 1\zw{#1}\hbox to 4.5\zw{\hss #2}}{\hbox{#3}}$}
5234 %<en>\caption{Summary of JFM glues.}
5235 %<ja>\caption{JFM グルーの概要.}
5236 %<zh>\caption{JFM胶总结。}
5240 \begin{tabular}{>{\sf}c|cccccc}
5242 {\bf\textit{Np}}↓&\sf 和文A&\sf 和文B&\sf 欧文&\sf 箱&\sf glue&\sf kern\\\midrule
5245 \gkf{---}{\OA →K}{PN}&
5246 \gkf{---}{\OA →X}{PN}&
5249 \gkf{---}{\OA}{PS}\\
5255 \gkf{E}{\OB →X}{PA}&
5257 箱&\gkf{E}{\OB}{PA}\\
5258 glue&\gkf{E}{\OB}{PN}\\
5259 kern&\gkf{E}{\OB}{PS}\\
5265 Here {\small\gkf{E}{M→K}{PN}} means that
5268 ここで {\small\gkf{E}{M→K}{PN}} は次の意味である:
5272 \item To determine the `right-space', \LuaTeX-ja first attempts by the method `\textsf{JFM-origin~[M]}'.
5273 If this attempt fails, \LuaTeX-ja use the method `\textsf{\Param{kanjiskip}~[K]}'.
5276 \item 「右空白」を決めるために,\LuaTeX-ja はまず「JFM由来{[M]}」の方法を試みる.
5277 これが失敗したら,\LuaTeX-ja は「\Param{kanjiskip}~{[K]}」の方法を試みる.
5281 \item The `left space' between \textit{Nq}~and~\textit{Np} is determined by the method `\textsf{line-end~[E]}'.
5284 \item \textit{Nq} と \textit{Np} の間の「左空白」は「\textsf{line-end~[E]}」の
5289 \item \LuaTeX-ja adopts the method `\textsf{P-normal~[PN]}' to adjust the penalty between two clusters for \emph{kinsoku shori}.
5292 \item \LuaTeX-jaは2つのクラスタの間の禁則処理用のペナルティを調節するために「\textsf{P-normal~[PN]}」の方法を採用する.
5299 本節の内容は表\ref{tab-jfmglue}にまとめてある.
5301 \paragraph{和文Aと欧文の間}
5302 \textit{Nq}が\textsf{和文A}で,\textit{Np}が\textsf{欧文}の場合,JFMグルー挿入処理は次のようにして行われる.
5304 \item 「右空白」については,まず以下に述べる\textsf{Boundary-B~[\OB]}により空白を決定しようと試みる.
5305 それが失敗した場合は,\textsf{\Param{xkanjiskip}~[X]}によって定める.
5306 \item 「左空白」については,既に述べた\textsf{line-end~[E]}をそのまま採用する.それに伴う「右空白」の補正も同じ.
5307 \item 禁則用ペナルティも,以前述べた\textsf{P-normal~[PN]}と同じである.
5310 \item[Boundary-B~{[\OB]}] 和文文字と「和文でないもの」との間に入る空白を以下によって求め,
5311 未定義でなければそれを「右空白」として採用する.
5312 \textsf{JFM-origin~[M]}の変種と考えて良い.
5313 これによって定まる空白の典型例は,和文の閉じ括弧と欧文文字の間に入る半角アキである.
5315 \item もし両クラスタの間で\verb+\inhibitglue+が実行されていた場合(証としてwhatsitノードが自動挿入される),次へ.
5317 \textit{Nq}と「文字コードが{\tt'jcharbdd'}の文字」との間に入るグルー/カーンとして定まる.
5319 \item[\Param{xkanjiskip}~{[X]}]
5320 この段階では,\textsf{\Param{kanjiskip}~[K]}のときと同じように,
5321 \Param{xkanjiskip}の値を以下で定め,それを「右空白」として採用する.
5322 この段階で\verb+\inhibitglue+は効力を持たないのも同じである.
5324 \item 以下のいずれかの場合は,\Param{xkanjiskip}の挿入は抑止される.しかし,実際には行分割を許容するために,長さ0のglueを採用する:
5326 \item 両クラスタにおいて,それらの中身の文字コードに対する\Param{autoxspacing}パラメタが共にfalseである.
5327 \item \textit{Nq}の中身の文字コードについて,「直後への\Param{xkanjiskip}の挿入」が禁止されている
5328 (つまり,\Param{jaxspmode}~(or \Param{alxspmode})パラメタが2以上).
5329 \item \textit{Np}の中身の文字コードについて,「直前への\Param{xkanjiskip}の挿入」が禁止されている
5330 (つまり,\Param{jaxspmode}~(or \Param{alxspmode})パラメタが偶数).
5332 \item ユーザ側から見た\Param{xkanjiskip}パラメタの自然長が${\tt \char92 maxdimen}=(2^{30}-1)\,{\rm sp}$で
5333 なければ,\Param{xkanjiskip}パラメタの値を持つglueを採用する.
5334 \item 2.でない場合は,\textit{Nq}, \textit{Np}(\textsf{和文A}/\textsf{和文B}なのは片方だけ)
5335 で使われているJFMに指定されている\Param{xkanjiskip}の値を用いる.
5339 \paragraph{欧文と和文Aの間}
5340 \textit{Nq}が\textsf{欧文}で,\textit{Np}が\textsf{和文A}の場合,JFMグルー挿入処理は上の場合とほぼ同じである.
5341 \textsf{和文A}のクラスタが逆になるので,\textsf{Boundary-A~[\OA]}の部分が変わるだけ.
5343 \item 「右空白」については,まず以下に述べる\textsf{Boundary-A~[\OA]}により空白を決定しようと試みる.
5344 それが失敗した場合は,\textsf{\Param{xkanjiskip}~[X]}によって定める.
5345 \item \textit{Nq}が和文でないので,「左空白」は算出されない.
5346 \item 禁則用ペナルティは,以前述べた\textsf{P-normal~[PN]}と同じである.
5349 \item[Boundary-A~{[\OA]}] 「和文でないもの」と和文文字との間に入る空白を以下によって求め,
5350 未定義でなければそれを「右空白」として採用する.
5351 \textsf{JFM-origin~[M]}の変種と考えて良い.
5352 これによって定まる空白の典型例は,欧文文字と和文の開き括弧との間に入る半角アキである.
5354 \item もし両クラスタの間で\verb+\inhibitglue+が実行されていた場合(証としてwhatsitノードが自動挿入される),次へ.
5356 「文字コードが{\tt'jcharbdd'}の文字」と\textit{Np}との間に入るグルー/カーンとして定まる.
5360 \paragraph{和文Aと箱・グルー・カーンの間}
5361 \textit{Nq}が\textsf{和文A}で,\textit{Np}が\textsf{箱}・グルー・カーンのいずれかであった場合,
5362 両者の間に挿入されるJFMグルーについては同じ処理である.しかし,そこでの行分割に対する仕様が異なるので,
5363 ペナルティの挿入処理は若干異なったものとなっている.
5366 \item 「右空白」については,既に述べた\textsf{Boundary-B~[\OB]}により空白を決定しようと試みる.
5367 それが失敗した場合は,「右空白」は挿入されない.
5368 \item 「左空白」については,既に述べた\textsf{line-end~[E]}の算出方法をそのまま採用する.それに伴う「右空白」の補正も同じ.
5369 \item 禁則用ペナルティの処理は,後ろのクラスタ\textit{Np}の種類によって異なる.
5370 なお,$\mathit{Np}.\mathit{head}$は無意味であるから,
5371 「$\mathit{Np}.\mathit{head}$に対する\Param{prebreakpenalty}の値」は0とみなされる.言い換えれば,
5373 a:=(\text{\textit{Nq}{\footnotemark}の文字に対する\Param{postbreakpenalty}の値}).
5376 \item[箱] \textit{Np}が\textsf{箱}であった場合は,両クラスタの間での行分割は
5377 (明示的に両クラスタの間に\verb+\penalty10000+があった場合を除き)いつも許容される.そのため,
5378 ペナルティ処理は,後に述べる\textsf{P-allow~[PA]}が\textsf{P-normal~[PN]}の代わりに用いられる.
5379 \item[グルー] \textit{Np}がグルーの場合,ペナルティ処理は\textsf{P-normal~[PN]}を用いる.
5380 \item[カーン] \textit{Np}がカーンであった場合は,両クラスタの間での行分割は
5381 (明示的に両クラスタの間にペナルティがあった場合を除き)許容されない.
5382 ペナルティ処理は,後に述べる\textsf{P-suppress~[PS]}を使う.
5384 これらの\textsf{P-normal~[PN]},\textsf{P-allow~[PA]},\textsf{P-suppress~[PS]}の違いは,
5385 \textit{Nq}と\textit{Np}の間(以前の図だと(a)の部分)にペナルティが存在しない場合にのみ存在する.
5389 \item[P-allow~{[PA]}]
5390 \textit{Nq}と\textit{Np}の間の(a)部分にペナルティがあれば,\textsf{P-normal~[PN]}と同様に,
5391 それらの各ノードにおいてペナルティ値を$a$だけ増加させる.
5393 (a)部分にペナルティが存在していない場合,
5394 \LuaTeX-ja は\textit{Nq}と\textit{Np}の間の行分割を可能にしようとする.
5395 そのために,以下の場合に$a$をもつ\textit{penalty\_node}を作って
5396 「右空白」の(もし未定義なら\textit{Np}の)直前に挿入する:
5398 \item 「右空白」がグルーでない(カーンか未定義)であるとき.
5399 \item 「左空白」がカーンとしてきっちり定義されている時.
5402 \item[P-suppress~{[PS]}]
5403 \textit{Nq}と\textit{Np}の間の(a)部分にペナルティがあれば,\textsf{P-normal~[PN]}と同様に,
5404 それらの各ノードにおいてペナルティ値を$a$だけ増加させる.
5406 (a)部分にペナルティが存在していない場合,
5407 \textit{Nq}と\textit{Np}の間の行分割は元々不可能のはずだったのであるが,
5408 \LuaTeX-ja はそれをわざわざ行分割可能にはしない.
5409 そのため,「右空白」がglueであれば,その直前に\verb+\penalty10000+を挿入する.
5412 なお,「右空白」はカーン,「左空白」は未定義の
5414 \overbrace{\Node{glyph}{`あ'}}^{\mathit{Nq}}\longrightarrow \overbrace{\Node{glue}{1\,pt}}^{\mathit{Np}}
5417 このとき,$a$,即ち「あ」の\Param{postbreakpenalty}がいかなる値であっても,
5420 \overbrace{\Node{glyph}{`あ'}}^{\mathit{Nq}}\longrightarrow
5421 \Node{kern}{右空白}\longrightarrow \overbrace{\Node{glue}{1\,pt}}^{\mathit{Np}}
5424 となり,$a$分のペナルティは挿入されないことに注意して欲しい.
5425 \Param{postbreakpenalty}は($a$は)殆どの場合が非負の値と考えられ,そのような場合では
5428 \overbrace{\Node{glyph}{`あ'}}^{\mathit{Nq}}\longrightarrow
5429 \Node{penalty}{$a$}\longrightarrow
5430 \Node{kern}{右空白}\longrightarrow \overbrace{\Node{glue}{1\,pt}}^{\mathit{Np}}
5433 \footnote{kern$\rightarrow$glueが1つの行分割可能点(行分割に伴うペナルティは0)
5434 であるため,たとえ$a=10000$であっても,\textit{Nq}と\textit{Np}の間で行分割を禁止することはできない.}.
5436 \paragraph{箱・グルー・カーンと和文Aの間}
5437 \textit{Np}が\textsf{箱}・グルー・カーンのいずれかで,\textit{Np}が\textsf{和文A}であった場合は,
5438 すぐ上の(\textit{Nq}と\textit{Np}の順序が逆になっている)場合とほぼ同じであるが,「左空白」がなくなることにのみ注意.
5440 \item 「右空白」については,既に述べた\textsf{Boundary-A~[\OA]}により空白を決定しようと試みる.
5441 それが失敗した場合は,「右空白」は挿入されない.
5442 \item \textit{Nq}が和文でないので,「左空白」は算出されない.
5443 \item 禁則用ペナルティの処理は,\textit{Nq}の種類によって異なる.
5444 $\mathit{Nq}.\mathit{tail}$は無意味なので,
5446 a:=(\text{\textit{Np}{\footnotemark}の文字に対する\Param{prebreakpenalty}の値}).
5449 \item[箱] \textit{Nq}が\textsf{箱}の場合は,\textsf{P-allow~[PA]}を用いる.
5450 \item[グルー] \textit{Nq}がグルーの場合は,\textsf{P-normal~[PN]}を用いる.
5451 \item[カーン] \textit{Nq}がカーンの場合は,\textsf{P-suppress~[PS]}を用いる.
5455 \paragraph{和文Aと和文Bの違い}
5456 先に述べたように,\textsf{和文B}は水平ボックスの中身の先頭(or 末尾)として出現している
5457 和文文字である.リスト内に直接ノードとして現れている和文文字(\textsf{和文A})との違いは,
5459 \item \textsf{和文B}に対しては,JFMの文字クラス指定から定まる空白
5460 \textsf{JFM-origin~[M]},\textsf{Boundary-A~[\OA]},\textsf{Boundary-B~[\OB]})の挿入は行われない.
5463 \item 片方が\textsf{和文A},もう片方が\textsf{和文B}のクラスタの場合,
5464 \textsf{Boundary-A~[\OA]}または\textsf{Boundary-B~[\OB]}の挿入を試み,それがダメなら
5465 \Param{kanjiskip}~\textsf{[K]}の挿入を行う.
5466 \item \textsf{和文B}の2つのクラスタの間には,\Param{kanjiskip}~\textsf{[K]}が自動的に入る.
5468 \item \textsf{和文B}と箱・グルー・カーンが隣接したとき(どちらが前かは関係ない),間にJFMグルー・ペナルティの挿入は一切しない.
5469 \item \textsf{和文B}と\textsf{和文B},また\textsf{和文B}と\textsf{欧文}とが隣接した時は,禁則用ペナルティ挿入処理は
5470 \textsf{P-suppress~[PS]}が用いられる.
5471 \item \textsf{和文B}の文字に対する\Param{prebreakpenalty},~\Param{postbreakpenalty}の値は使われず,0として計算される.
5482 \item 1行目の\verb+\inhibitglue+は\textsf{Boundary-B~[\OB]}の処理のみを抑止するので,ピリオドと「A」の間には
5483 \Param{xkanjiskip}(四分アキ)が入ることに注意.
5484 \item 2行目のピリオドと「A」の間においては,前者が\textsf{和文B}となる(水平ボックスの中身の末尾として登場しているから)ので,
5485 そもそも\textsf{Boundary-B~[\OB]}の処理は行われない.よって,\Param{xkanjiskip}が入ることとなる.
5486 \item 3行目では,ピリオドの属するクラスタは\textsf{和文A}である.これによって,
5487 ピリオドと「A」の間には\textsf{Boundary-B~[\OB]}由来の半角アキが入ることになる.
5492 \begin{thebibliography}{99}
5493 \addcontentsline{toc}{section}{\refname}
5494 \bibitem{texbytopic}
5495 Victor Eijkhout, \emph{\TeX\ by Topic, A \TeX nician's Reference}, Addison-Wesley, 1992.
5496 \end{thebibliography}
5501 %% config file for showexpl.sty
5503 %% Copyright The LuaTeX-ja project team, 2005
5505 \ProvidesFile{showexpl.cfg}
5506 [2012/05/20 v0.01 Definitions for the showexpl package (luatexja)]