OSDN Git Service

Updated a document; added lltjlisting.sty in doc/
[luatex-ja/luatexja.git] / doc / man-en.tex
1 %#!lualatex
2 \documentclass[a4paper,titlepage]{article}
3 \usepackage{amsmath,amssymb,xcolor,pict2e}
4 \usepackage{booktabs,listings,lltjlisting,showexpl}
5 \usepackage{luatexja}
6 %\usepackage{luatexja-fontspec}
7 \usepackage[margin=20mm]{geometry}
8 \usepackage[unicode=true]{hyperref}
9
10 \title{The Lua\TeX-ja package}
11 \author{The Lua\TeX-ja project team}
12
13
14 \lstset{
15   basicstyle=\ttfamily\small, pos=o, breaklines=true,
16   numbers=none, rframe={}
17 }
18
19 \catcode`\<=13
20 \def<#1>{{\normalfont\itshape$\langle$#1$\rangle$}}
21 \begin{document}
22 \maketitle
23
24 \tableofcontents
25
26 \newpage
27 \part{User's manual}
28 {\Large\bf This documentation is far from complete. It may have many
29 grammatical errors.}
30
31
32 \section{Introduction}
33
34 The Lua\TeX-ja package is a macro package for typesetting high-quality
35 Japanese documents in Lua\TeX.
36
37 \subsection{Backgrounds}
38 Traditionally, ASCII p\TeX, an extension of \TeX, and its derivatives
39 are used to typeset Japanese documents in \TeX. p\TeX is an engine
40 extension of \TeX: so it can produce high-quality Japanese documents
41 without using very complicated macros. But this point is a mixed
42 blessing: p\TeX\ is left behind from other extensions of \TeX,
43 especially $\varepsilon$-\TeX\ and pdf\TeX, and from changes about
44 Japanese processing in computers (\textit{e.g.}, the UTF-8 encoding).
45
46 Recently the extensions of p\TeX, namely up\TeX\ (Unicode-implementation
47 of p\TeX) and $\varepsilon$-p\TeX\ (Merging of p\TeX and
48 $\varepsilon$-\TeX\ extension), have developed to fill those gap to some
49 extent, but gaps are still exist.
50
51 However, the appearance of Lua\TeX\ changed the whole situation. With
52 using Lua `callbacks', users can customize the internal processing of
53 Lua\TeX. So there is no need to modify sources of the \TeX\ engine to
54 support Japanese typesetting: to do this, we only have to write Lua
55 script for appropriate callbacks.
56
57
58 \subsection{Major Changes from p\TeX}
59 The Lua\TeX-ja package is much influenced by p\TeX\ engine. The initial
60 target of development was to implement features of p\TeX. However,
61 \emph{Lua\TeX-ja is not a just porting of p\TeX: Unnatural
62 specifications/behaviors of p\TeX\ were not adopted}.
63
64 The followings are major changes from p\TeX:
65 \begin{itemize}
66 \item Japanese fonts are a tuple of a `real' font, a Japanese font
67       metric (\textbf{JFM}, for short), and an optional string called
68       `variation'.
69
70 \item In p\TeX, a linebreak after Japanese character is ignored (and
71       doesn't yield a space), since Japanese texts can linebreak almost
72       everywhere. However, Lua\TeX-ja doesn't have this function
73       completely, because of a specification of Lua\TeX.
74 \item The insertion process of glues/kerns between two Japanese
75       characters and between a Japanese character and other characters
76       (we refer these glues/kerns as \textbf{JAglue}) is rewritten from
77       scratch.
78
79 \begin{itemize}
80 \item As Lua\TeX's internal character handling is `node-based'
81       (\textit{e.g.}, \verb+of{}fice+ doesn't prevent ligatures), the
82       insertion process of \textbf{JAglue} is now `node-based'.
83 \item Furthermore, nodes between two characters which have no effects in
84       linebreak (\textit{e.g.}, \verb+\special+ node) are ignored in the
85       insertion process.
86 \item In the process, two Japanese fonts which differ in their `real'
87       fonts only are identified.
88 \end{itemize}
89 \item At the present, vertical typesetting (\textit{tategaki}), is not
90       supported in Lua\TeX-ja.
91
92 \end{itemize} 
93 For detailed information, see Part~\ref{part-imp}.
94
95 \subsection{Notations}
96 In this document, the following terms and notations are used:
97 \begin{itemize}
98 \item Characters are divided into two types: 
99 \begin{itemize}
100 \item \textbf{JAchar}: standing for Japanese characters such as
101       Hiragana, Katakana, Kanji and other punctuation marks for
102       Japanese.'
103 \item \textbf{ALchar}: standing for all other characters like alphabets. 
104 \end{itemize}
105 \item A word in sans-serif font (like \textsf{prebreakpenalty})
106       represents an internal parameter for Japanese typesetting, and it
107       is used as a key in \verb+\ltjsetparameter+ command.
108 \item The word ``primitive'' is used not only for primitives in Lua\TeX,
109       but also for control sequences that defined in the core module of
110       Lua\TeX-ja.
111 \end{itemize}
112
113 \subsection{About the project}
114 \paragraph{Project Wiki} \url{http://sourceforge.jp/projects/luatex-ja/wiki/FrontPage%28en%29}
115
116 This project is hosted by SourceForge.JP.
117 \paragraph{Members}
118
119 %h7k
120 %kmaeda
121 %abenori
122 %kuroky
123 %munepi
124 %thonda
125 %zrbabbler
126
127 \newpage
128 \section{Getting Started}
129 \subsection{Installation}
130 To install the Lua\TeX-ja\ package, you will need:
131 \begin{itemize}
132 \item Lua\TeX, version 0.65.0-beta or later.\\
133 If you are using \TeX~Live\ 2011 or W32\TeX, you don't have to worry.
134 \item The source archive of Lua\TeX-ja, of course{\tt:)}
135 \end{itemize}
136
137 The installation methods are as follows:
138 \begin{enumerate}
139 \item Download the source archive.
140
141 At the present, Lua\TeX-ja has no official release, so you have to retrieve
142 the archive from the repository.
143 You can retrieve the Git repository via
144 \begin{verbatim}
145 $ git clone git://git.sourceforge.jp/gitroot/luatex-ja/luatexja.git
146 \end{verbatim} 
147 or download the archive of HEAD in the master branch from
148 \begin{flushleft}
149 \url{http://git.sourceforge.jp/view?p=luatex-ja/luatexja.git;a=snapshot;h=HEAD;sf=tgz}.
150 \end{flushleft}
151 \item Extract the archive. You will see {\tt src/} and several other sub-directories.
152 \item Copy all the contents of {\tt src/} into one of your \texttt{TEXMF} tree.
153 \item If {\tt mktexlsr} is needed to update the filename database, make it so.
154 \end{enumerate}
155
156 \subsection{Cautions}
157 \begin{itemize}
158 \item The encoding of your source file must be UTF-8. 
159 \item conflicts with unicode-math
160 \end{itemize}
161
162 \subsection{Using in plain \TeX}
163 To use Lua\TeX-ja in plain \TeX, simply put the following  at the beginning of the document:
164 \begin{verbatim}
165 \input luatexja.sty
166 \end{verbatim}
167
168 This does the minimal setting (like {\tt ptex.tex}) for typesetting Japanese documents:
169 \begin{itemize}
170 \item The following 6 Japanese fonts are preloaded.
171 \begin{center}
172 \begin{tabular}{ccccc}
173 \toprule
174 \textbf{classification}&\textbf{font name}&\textbf{13.5\,Q}&\textbf{9.5\,Q}&\textbf{7\,Q}\\\midrule
175 \textit{mincho}&Ryumin-Light    &\verb+\tenmin+&\verb+\sevenmin+&\verb+\fivemin+\\
176 \textit{gothic}&GothicBBB-Medium&\verb+\tengt+ &\verb+\sevengt+ &\verb+\fivegt+\\
177 \bottomrule
178 \end{tabular}
179 \end{center}
180 \begin{itemize}
181 \item The `Q' is an unit used in Japanese phototypesetting, and
182       $1\,\textrm{Q}=0.25\,\textrm{mm}$. This length is stored in a
183       dimension \verb+\jQ+.
184
185 \item It is widely accepted that the font `Ryumin-Light' and
186       `GothicBBB-Medium' aren't embedded into PDF files, and the PDF
187       reader substitutes them by some external Japanese font. We adopt
188       this custom to the default setting.
189 \item size
190 \end{itemize}
191 \item A character in Unicode is treated as \textbf{JAchar} if and only
192       if its code-point has more than or equal to U+0100.
193 \item The amount of glue that are inserted between \textbf{JAchar} and
194       \textbf{ALchar} (the parameter \textsf{xkanjiskip}) is set to
195 \[
196  0.25\,\hbox{\verb+\zw+}^{+1\,\text{pt}}_{-1\,\text{pt}} = \frac{27}{32}\,\mathrm{mm}^{+1\,\text{pt}}_{-1\,\text{pt}}.
197 \]
198 Here \verb+\zw+ is a counterpart of \texttt{em} for Japanese fonts, that is, the length of `full-width' in the current Japanese font.
199 \end{itemize}
200
201
202 \subsection{Using in \LaTeX}
203 \paragraph{\LaTeXe}
204 Using in \LaTeXe\ is basically same. To set up the minimal environment
205 for Japanese, you only have to load {\tt luatexja.sty}:
206 \begin{verbatim}
207 \usepackage{luatexja}
208 \end{verbatim}
209 It also does the minimal setting (the counterpart in p\LaTeX\ is  {\tt
210 plfonts.dtx} and {\tt pldefs.ltx}):
211
212 \begin{itemize}
213 \item {\tt JY3} is used as the font encoding for Japanese fonts (in horizontal direction).\\
214 If vertical typesetting is supported by Lua\TeX-ja, {\tt JT3} will be used for vertical fonts.
215 \item Two font families {\tt mc} and {\tt gt} are defined: 
216 \begin{center}
217 \begin{tabular}{ccccc}
218 \toprule
219 \textbf{classification}&\textbf{family}&\verb+\mdseries+&\verb+\bfseries+&\textbf{scale}\\\midrule
220 \textit{mincho}&\tt mc&Ryumin-Light    &GothicBBB-Medium&0.960444\\
221 \textit{gothic}&\tt gt&GothicBBB-Medium&GothicBBB-Medium&0.960444\\
222 \bottomrule
223 \end{tabular}
224 \end{center}
225 \item Japanese characters in math mode are typeset by the font family {\tt mc}.
226 \end{itemize}
227
228 However, the above setting is not sufficient for Japanese-based documents. To do this, 
229 You are better to use class files other than {\tt article.cls}, {\tt book.cls}, ...
230 The better alternatives are:
231 \begin{itemize}
232 \item BXjscls
233 \item ltjarticle, ltjbook?
234 \item ltjsarticle, ltjsbook?
235 \end{itemize}
236
237 \subsection{Changing Fonts}
238 \paragraph{Remark: Japanese Characters in Math Mode}
239 Since p\TeX\ supports Japanese characters in math mode, there are
240 sources like the following:
241
242 \begin{LTXexample}
243 $f_{高温}$~($f_{\text{high temperature}}$).
244 \[ y=(x-1)^2+2\quad{}よって\quad y>0 \]
245 $5\in{}素:=\{\,p\in\mathbb N:\text{$p$ is a prime}\,\}$.
246 \end{LTXexample}
247 We (the project members of Lua\TeX-ja) think that using
248 Japanese characters in math mode are allowed if these are used as identifiers.
249 In this point of view, 
250 \begin{itemize}
251 \item The lines 1~and~2 above are not correct, since `高温' in above is used as a textual label, and
252 `よって' is used as a conjunction. 
253 \item However, the line~3 is correct, since `素' is used as an identifier.
254 \end{itemize}
255
256 Hence, in our opinion, the above input should be corrected as:
257 \begin{LTXexample}
258 $f_{\text{高温}}$~%
259 ($f_{\text{high temperature}}$).
260 \[ y=(x-1)^2+2\quad 
261   \mathrel{\text{よって}}\quad y>0 \]
262 $5\in{}素:=\{\,p\in\mathbb N:\text{$p$ is a prime}\,\}$.
263 \end{LTXexample}
264 %BUG?: \{\}がなければ「素」がでない.上の段落の「よって」もでてない.
265
266
267 どう繋ごうか?
268
269 In this chapter, we don't describe how to change Japanese fonts in
270 math mode. For the method, please see Part~\ref{part-ref}.
271
272
273 \paragraph{plain \TeX}
274 To change Japanese fonts in plain \TeX, you must use the primitive
275 \verb+\jfont+. So please see Part~\ref{part-ref}.
276
277
278 \paragraph{NFSS2}
279 For \LaTeXe, Lua\TeX-ja simply adopted font selection system from that
280 of p\LaTeXe\ (in: {\tt plfont.dtx}).
281 \begin{itemize}
282 \item Two control sequences \verb+\mcdefault+ and \verb+\gtdefault+ are
283       used to specify the default font family for \textit{mincho} and
284       \textit{gothic}, respectively.
285 \item Commands \verb+\fontfamily+, \verb+\fontseries+,
286       \verb+\fontshape+ and \verb+\selectfont+ can be used to change
287       attributes of Japanese fonts. 
288 \begin{center}
289 \begin{tabular}{ccccc}
290 \toprule
291 &\textbf{encoding}&\textbf{family}&\textbf{series}&\textbf{shape}\\\midrule
292 alphabetic fonts
293 &\verb+\romanencoding+&\verb+\romanfamily+&\verb+\romanseries+&\verb+\romanshape+\\
294 Japanese fonts
295 &\verb+\kanjiencoding+&\verb+\kanjifamily+&\verb+\kanjiseries+&\verb+\kanjishape+\\
296 both&---&--&\verb+\fontseries+&\verb+\fontshape+\\
297 auto select&\verb+\fontencoding+&\verb+\fontfamily+&---&---\\
298 \bottomrule
299 \end{tabular}
300 \end{center}
301 \item For defining a Japanese font family, use \verb+\DeclareKanjiFamily+
302       instead of \verb+\DeclareFontFamily+.
303 \end{itemize}
304
305 \paragraph{fontspec}
306 To use with \texttt{fontspec} package, it is needed to load
307 \texttt{luatexja-fontspec} package in the preamble. This additional
308 package automatically loads \texttt{luatexja} and \texttt{fontspec}
309 package, if needed.
310
311 In \texttt{luatexja-fontspec} package, the following 4 commands are defined as
312 counterparts of original commands in \texttt{fontspec}:
313 \begin{center}
314 \begin{tabular}{ccccc}
315 \toprule
316 Japanese fonts
317 &\verb+\jfontspec+&\verb+\setmainjfont+&\verb+\setsansjfont+&\verb+\newjfontfamily+\\
318 alphabetic fonts
319 &\verb+\fontspec+&\verb+\setmainfont+&\verb+\setsansfont+&\verb+\newfontfamily+\\
320 \bottomrule
321 \end{tabular}
322 \end{center}
323
324 Note that there is no command named \verb+\setmonojfont+, since it is
325 popular for Japanese fonts that (nearly) all Japanese glyphs have the same width.
326
327
328 \section{Changing Parameters}
329 There are many parameters in Lua\TeX-ja. And due to the implementation,
330 most of them were not stored as internal register of \TeX, but as an
331 original storage system in Lua\TeX-ja. Hence, to change or recall those
332 parameters, you have to use commands \verb+\ltjsetparameter+ and
333 \verb+\ltjgetparameter+.
334
335 \subsection{Editing the range of \textbf{JAchar}}
336 As noted before, the default setting is:
337 \begin{center}
338 A character in Unicode is treated as \textbf{JAchar} if and only if its
339  code-point has more than or equal to U+0100.
340 \end{center}
341 $\uparrow$ TODO: CHANGE THIS!
342
343
344
345
346
347 \subsection{\textsf{kanjiskip} and \textsf{xkanjiskip}}\label{subs-kskip}
348 \textbf{JAglue} is divided into the following three categories:
349 \begin{itemize}
350 \item Glues/kerns specified in JFM. If \verb+\inhibitglue+ is issued,
351       this glue will be not inserted.
352 \item The default glue which inserted between two \textbf{JAchar}s ({\sf
353       kanjiskip}).
354 \item The default glue which inserted between a \textbf{JAchar} and an
355       \textbf{ALchar} (\textsf{xkanjiskip}).
356 \end{itemize}
357 The value (a skip) of \textsf{kanjiskip} or \textsf{xkanjiskip} can be
358 changed as the following.
359 \begin{verbatim}
360 \ltjsetparameter{kanjiskip={0pt plus 0.4pt minus 0.4pt}, 
361                  xkanjiskip={0.25\zw plus 1pt minus 1pt}}
362 \end{verbatim}
363
364
365 It may occur that JFM contains the data of `ideal width of {\sf
366 kanjiskip}' and/or `ideal width of \textsf{xkanjiskip}'.
367 To use these data from JFM, set the value of \textsf{kanjiskip} or 
368 \textsf{xkanjiskip} to \verb+\maxdimen+.
369
370 \subsection{Insertion Setting of \textsf{xkanjiskip}}
371 It is not desirable that \textsf{xkanjiskip} is inserted between every
372 boundary between \textbf{JAchar} and \textbf{ALchar}. For example,
373 \textsf{xkanjiskip} should not be inserted after opening parenthesis
374 (\textit{e.g.}, compare `(あ' and `(\hskip\ltjgetparameter{xkanjiskip}あ').
375
376 Lua\TeX-ja can control whether \textsf{xkanjiskip} can be inserted
377 before/after a character, by using \textsf{jaxspmode} and
378 \textsf{alxspmode} parameters. 
379 \begin{LTXexample}
380 \ltjsetparameter{jaxspmode={`あ,preonly}, alxspmode={`\!,postonly}} 
381 pあq い!う
382 \end{LTXexample}
383
384 The second argument {\tt preonly} means `the insertion of
385 \textsf{xkanjiskip} is allowed before this character, but not after'.
386 the other possible values are {\tt postonly}, {\tt allow} and {\tt
387 inhibit}.
388
389 If you want to enable/disable all insertion of \textsf{kanjiskip} and
390 \textsf{xkanjiskip}, set \textsf{autospacing} and \textsf{autoxspacing}
391 parameters to {\tt false}, respectively.
392
393
394 \subsection{Shifting Baseline}
395 To make a match between a Japanese font and an alphabetic font, sometimes
396 the shifting of baseline of one of the pair. In p\TeX, this is achieved
397 by setting \verb+\ybaselineshift+ to a non-zero length (the
398 baseline of alphabetic fonts is shifted below). However, for documents
399 whose main language is not Japanese,it is good to shift the baseline of
400 Japanese fonts, but not that of alphabetic fonts.
401 Because of this, Lua\TeX-ja can be independently set the shifting amount
402 of the baseline of alphabetic fonts (\textsf{yalbaselineshift}
403 parameter) and that of Japanese fonts (\textsf{yjabaselineshift}
404 parameter). 
405
406 \begin{LTXexample}
407 \vrule width 150pt height 0.4pt depth 0pt\hskip-120pt
408 \ltjsetparameter{yjabaselineshift=0pt, yalbaselineshift=0pt}abcあいう
409 \ltjsetparameter{yjabaselineshift=5pt, yalbaselineshift=2pt}abcあいう
410 \end{LTXexample}
411
412 Here the horizontal line in above is the baseline of a line.
413
414 There is an interesting side-effect from that the baseline of
415 Japanese fonts can be shifted: characters in different size can be
416 vertically aligned center in a line, by setting two parameters appropriately.
417
418 \begin{LTXexample}
419 xyz漢字 
420 {\scriptsize
421   \ltjsetparameter{yjabaselineshift=-1pt, 
422     yalbaselineshift=-1pt}
423   XYZひらがな
424 }abcかな
425 \end{LTXexample}
426
427
428 \subsection{`tombow'}
429 `tombow' is a mark for indicating 4~corners and horizontal/vertical
430 center of the paper. p\LaTeX and this Lua\TeX-ja support `tombow' by
431 their kernel. The following steps are needed to typeset tombow:
432
433 \begin{enumerate}
434 \item First, define the banner which will be printed at the upper left
435       of the paper. This is done by assigning a token list to
436       \verb+\@bannertoken+.
437
438 For example, the following sets banner as `{\tt filename (2012-01-01 17:01)}':
439 \begin{verbatim}
440 \makeatletter
441
442 \hour\time \divide\hour by 60 \@tempcnta\hour \multiply\@tempcnta 60\relax
443 \minute\time \advance\minute-\@tempcnta
444 \@bannertoken{%
445    \jobname\space(\number\year-\two@digits\month-\two@digits\day
446    \space\two@digits\hour:\two@digits\minute)}%
447 \end{verbatim}
448
449 \item ...
450 \end{enumerate}
451
452
453 \part{Reference}\label{part-ref}
454 \section{Font Metric and Japanese Font}
455 \subsection{\texttt{\char92jfont} primitive}
456 Caution: 10pt
457
458 \subsection{Structure of JFM file}
459 A JFM file is a Lua script which has only one function call:
460 \begin{verbatim}
461 luatexja.jfont.define_jfm { ... }
462 \end{verbatim}
463 Real data are stored in the table which indicated above by
464 \verb+{ ... }+.  So, the rest of subsection are devoted to describe the
465 structure of this table.  Note that all lengths in a JFM file are
466 floating-point numbers in design-size unit.
467
468 \begin{list}{}{\def\makelabel{\ttfamily}\def\{{\char`\{}\def\}{\char`\}}}
469 \item[dir=<direction>] (required)
470
471 The direction of JFM. At the present, only \texttt{'yoko'} is supported.
472
473 \item[zw=<length>] (required)
474
475 The amount of the length of the `full-width.
476
477 \item[zh=<length>] (required)
478
479 \item[kanjiskip=\{<natural>, <stretch>, <shrink>\}] (optional)
480
481 This field specifies the `ideal' amount of \textsf{kanjiskip}. As noted
482              in Subsection~\ref{subs-kskip}, if \textsf{kanjiskip} is
483              \verb+\maxdimen+, the value specified in this field is used
484              (if this field is not specified in JFM, 0\,pt is
485              used). Note that <stretch> and <shrink> fields are in
486              design-size unit too.
487
488
489 \item[xkanjiskip=\{<natural>, <stretch>, <shrink>\}] (optional)
490
491 Like the \texttt{kanjiskip} field, this field specifies the `ideal'
492              amount of \textsf{xkanjiskip}.
493
494 \end{list}
495
496 Besides from above fields, a JFM file have several sub-tables those
497 indices are natural numbers.  The table indexed by~$i\in\omega$ stores
498 informations of `character class'~$i$. At least, the character class~0 is
499 always present, so each JFM file must have a sub-table whose index is
500 \texttt{[0]}.  Each sub-table (its numerical index is denoted by $i$) has
501 the following fields:
502
503 \begin{list}{}{\def\makelabel{\ttfamily}\def\{{\char`\{}\def\}{\char`\}}}
504 \item[chars=\{<character>, ...\}] (required except character class~0)
505
506 This field is a list of \textbf{JAchar}s which are in this character
507              type~$i$. This field is not required if $i=0$, since all
508              \textbf{JAchar} which are not in any character class other
509              than 0 (hence, the character class~0 contains most of
510              \textbf{JAchar}s). In the list, a \textbf{JAchar} can be
511              specified by its code number, or by the character itself
512              (as a string of length~1).
513
514 In addition to those `real' characters, the following `imaginary
515              characters' can be specified in the list:
516
517 \item[width=<length>, height=<length>, depth=<length>, italic=<length>]\ 
518
519 Specify width of characters in character class~$i$, height, depth and
520 the amount of italic correction.  These fields are required.
521
522
523 \item[left=<length>, down=<length>, align=<align>]\ 
524
525 These are for adjusting the position of the `real' glyph. Legal
526              values of \texttt{align} field are \texttt{'left'},
527              \texttt{'middle'} and \texttt{'right'}. If one of these
528              3~fields are omitted, \texttt{left} and \texttt{down} are
529              treated as~0, and \texttt{align} field is treated as
530              \texttt{'left'}.
531 The effects of these 3~fields are indicated in Figure~\ref{fig-pos}.
532
533 In most cases, \texttt{left} and \texttt{down} fields are~0, while
534 it is not uncommon that the \texttt{align} field is \texttt{'middle'} or \texttt{'right'}.
535 For example, setting the \texttt{align} field to \texttt{'right'} is practically needed 
536 when the current character class is the class for opening delimiters'. 
537 \begin{figure}[htb]
538 \begin{minipage}{0.4\textwidth}%
539 \begin{center}\unitlength=10pt\small
540 \begin{picture}(15,12)(-1,-4)
541 \color{black!10!white}% real glyph :step1
542 \put(0,0){\vrule width 12\unitlength height 8\unitlength depth 3\unitlength}
543
544 \color{red!20!white}% real glyph :step1
545 \put(-1,-1.5){\vrule width 6\unitlength height 7\unitlength depth 2.5\unitlength}
546
547 \color{red}% real glyph
548 \thicklines
549 \put(-1,-1.5){\vector(0,1){7}\vector(0,-1){2.5}\vector(1,0){6}}
550 \put(5,-1.5){\line(0,1){7}\line(0,-1){2.5}}
551 \put(-1,5.5){\line(1,0){6}}
552 \put(-1,-4){\line(1,0){6}}
553
554 \color{green!20!white}% real glyph :step1
555 \put(3,0){\vrule width 6\unitlength height 7\unitlength depth 2.5\unitlength}
556
557 \color{black}% real glyph :step1
558 \thicklines
559 \put(0,0){\vector(0,1){8}\line(0,-1){3}\vector(1,0){12}}
560 \put(12,0){\line(0,1){8}\vector(0,-1){3}}
561 \put(0,8){\line(1,0){12}}
562 \put(0,-3){\line(1,0){12}}
563 \put(0.2,4){\makebox(0,0)[l]{\texttt{height}}}
564 \put(12.2,-1.5){\makebox(0,0)[l]{\texttt{depth}}}
565 \put(6,0.2){\makebox(0,0)[b]{\texttt{width}}}
566
567 \color{green!50!black}% real glyph :step1
568 \thicklines
569 \put(3,0){\vector(0,1){7}\vector(0,-1){2.5}\vector(1,0){6}}
570 \put(9,0){\line(0,1){7}\line(0,-1){2.5}}
571 \put(3,7){\line(1,0){6}}
572 \put(3,-2.5){\line(1,0){6}}
573 \newsavebox{\eqdist}
574 \savebox{\eqdist}(0,0)[b]{%
575   \thinlines
576   \put(-0.08,0.2){\line(0,-1){0.4}}%
577   \put(0.08,0.2){\line(0,-1){0.4}}}
578 \put(1.5,0){\usebox{\eqdist}}
579 \put(10.5,0){\usebox{\eqdist}}
580
581 \color{blue}% shifted
582 \thicklines
583 \put(3,-1.5){\vector(-1,0){4}}
584 \put(1,-1.7){\makebox(0,0)[t]{\texttt{left}}}
585 \put(3,0){\vector(0,-1){1.5}}
586 \put(3.2,-0.75){\makebox(0,0)[l]{\texttt{down}}}
587 \end{picture} 
588 \end{center}
589 \end{minipage}%
590 \begin{minipage}{0.6\textwidth}%
591 Consider a node containing Japanese character whose value of the \texttt{align} 
592 field is \texttt{'middle'}.
593 \begin{itemize}
594 \item The black rectangle is a frame of the node.
595 Its width, height and depth are specified by JFM.
596 \item Since the \texttt{align} field is \texttt{'middle'}, 
597 the `real' glyph is centered horizontally (the green rectangle).
598 \item Furthermore, the glyph is shifted according to values of fields \texttt{left} and \texttt{down}. The ultimate position of the real glyph is the red rectangle.
599 \end{itemize}
600 \end{minipage}
601 \caption{The position of the `real' glyph}
602 \label{fig-pos}
603 \end{figure}
604
605
606 \item[kern=\{\}]
607 \item[glue=\{\}]
608 \end{list}
609
610 \subsection{Math Font Family}
611
612 \section{Parameters}
613 \subsection{{\tt\char92 ltjsetparameter} primitive}
614
615 \subsection{List of Parameters}
616 \begin{list}{}{\def\makelabel{\ttfamily}\def\{{\char`\{}\def\}{\char`\}}}
617 \item[\textsf{kcatcode}\,=\{<chr\_code>,<value>\}]
618 \item[\textsf{prebreakpenalty}\,=\{<chr\_code>,<penalty>\}]
619 \item[\textsf{postbreakpenalty}\,=\{<chr\_code>,<penalty>\}]
620 \item[\textsf{jatextfont}\,=\{<jfam>,<jfont\_cs>\}]
621 \item[\textsf{jascriptfont}\,=\{<jfam>,<jfont\_cs>\}]
622 \item[\textsf{jascriptscriptfont}\,=\{<jfam>,<jfont\_cs>\}]
623 \item[\textsf{yjabaselineshift}\,=<dimen>]
624 \item[\textsf{yalbaselineshift}\,=<dimen>]
625 \item[\textsf{jaxspmode}\,=\{<chr\_code>,<mode>\}]
626 \item[\textsf{alxspmode}\,=\{<chr\_code>,<mode>\}]
627 \item[\textsf{autospacing}\,=<bool>]
628 \item[\textsf{autoxspacing}\,=<bool>]
629 \item[\textsf{kanjiskip}\,=<skip>]
630 \item[\textsf{xkanjiskip}\,=<skip>]
631 \item[\textsf{jcharwidowpenalty}\,=<penalty>]
632 \item[\textsf{differentjfm}\,=<mode>]
633 \item[\textsf{jacharrange}\,=<ranges>]
634 \end{list}
635 \section{Other Primitives}
636 \section{Control Sequences for \LaTeXe}
637 \part{Implementations}\label{part-imp}
638 \end{document}