X-Git-Url: http://git.osdn.jp/view?a=blobdiff_plain;f=doc%2Fmanual.dtx;h=b0493d4017508a4f38cd85b9fff095f1799c0b45;hb=d014630fb1548d2b8e364b47574566b30d6cc07d;hp=d304caea130e9d21e97ba6155a5b2c9b154669d0;hpb=727de954cde9b792141adb1bae7280ef2be7e189;p=luatex-ja%2Fluatexja.git
diff --git a/doc/manual.dtx b/doc/manual.dtx
index d304cae..b0493d4 100644
--- a/doc/manual.dtx
+++ b/doc/manual.dtx
@@ -1,351 +1,980 @@
-%#! lualatex -shell-escape manual.ins && lualatex man-en && lualatex man-ja
-
-%<*Eng>
-\documentclass[a4paper,titlepage]{article}
-\usepackage[margin=20mm]{geometry}
-%
-%<*Jpn>
-\documentclass[a4paper,titlepage]{bxjsarticle}
-\setpagelayout*{margin=20mm}
-\def\headfont{\normalfont\bfseries}
-% \def\headfont{\sffamily\gtfamily} is needed in ordinal documents
-%
-
-\usepackage{amsmath,amssymb,xcolor,pict2e}
-\usepackage{booktabs,listings,lltjlisting,showexpl}
-\usepackage{luatexja}
-\usepackage[unicode=true]{hyperref}
+%#! lualatex -shell-escape manual.ins
+
+%\documentclass[a4paper,titlepage]{article}
+%\documentclass[a4paper,titlepage]{ltjsarticle}
+\usepackage[margin=20mm,footskip=5mm]{geometry}
+
+\usepackage{amsmath,amssymb,xcolor,pict2e,multienum,amsthm,float}
+\usepackage{booktabs,listings,showexpl,multicol}
+\usepackage{luatexja-otf}
+\usepackage{luatexja-fontspec}
+\usepackage[unicode]{hyperref}
+\usepackage[all]{xy}
+\SelectTips{cm}{}
+
+\DeclareRobustCommand\eTeX{\ensuremath{\varepsilon}-\kern-.125em\TeX}
+\DeclareRobustCommand\LuaTeX{Lua\TeX}
+\DeclareRobustCommand\pdfTeX{pdf\TeX}
+\DeclareRobustCommand\pTeX{p\kern-.05em\TeX}
+\DeclareRobustCommand\upTeX{up\kern-.05em\TeX}
+\DeclareRobustCommand\pLaTeX{p\kern-.05em\LaTeX}
+\DeclareRobustCommand\pLaTeXe{p\kern-.05em\LaTeXe}
+\DeclareRobustCommand\epTeX{\ensuremath{\varepsilon}-\kern-.125em\pTeX}
+
+\ltjsetparameter{jacharrange={-3}}
+\ltjdefcharrange{6}{`â }
+\theoremstyle{definition}
+%\newtheorem{defn}{Definition}
+%\newtheorem{defn}{å®ç¾©}
+
+\newenvironment{cslist}{%
+ \leftskip2em\parindent=0pt\def\makelabel##1{{\tt\char92##1}}
+ \def\{{\char`\{}\def\}{\char`\}}
+ \let\origitem=\item
+ \def\item[##1]{\par\smallskip\par\hskip-\leftskip\makelabel{##1}\par}
+}{}
-%<*Eng>
-\title{The Lua\TeX-ja package}
-\author{The Lua\TeX-ja project team}
-%
-%<*Jpn>
-\title{Lua\TeX-jaããã±ã¼ã¸}
-\author{Lua\TeX-jaããã¸ã§ã¯ããã¼ã }
-%
+\makeatletter
+\long\def\@makecaption#1#2{%
+ \vskip\abovecaptionskip
+ \sbox\@tempboxa{{\small #1. #2}}%
+ \ifdim \wd\@tempboxa >\hsize
+ {\small #1. #2}\par
+ \else
+ \global \@minipagefalse
+ \hb@xt@\hsize{\hfil\box\@tempboxa\hfil}%
+ \fi
+ \vskip\belowcaptionskip}
+% Suppress output from showexpl to stdout.
+\let\SX@Info\relax
+\makeatother
+
+\def\Node#1#2{\,\vcenter{\hbox{\fboxsep=1pt\fbox{\vbox{\small\halign{\hfil##\hfil\cr
+ #1\mathstrut\cr\noalign{\hrule height.4pt}\strut#2\cr}}}}\,}}
+
+%<*en>
+\title{The \LuaTeX-ja package}
+\author{The \LuaTeX-ja project team}
+%
+%<*ja>
+\title{\LuaTeX-jaããã±ã¼ã¸}
+\author{\LuaTeX-jaããã¸ã§ã¯ããã¼ã }
+%
\lstset{
basicstyle=\ttfamily\small, pos=o, breaklines=true,
- numbers=none, rframe={}
+ numbers=none, rframe={}, basewidth=0.5em
}
-\catcode`\<=13
-\def<#1>{{\normalfont\itshape$\langle$#1$\rangle$}}
\parskip=\smallskipamount
+\protected\def\Param#1{\textsf{#1}} % parameter name
+\protected\def\Pkg#1{\underline{\smash{\texttt{#1}}}} % packages/classes
+
\begin{document}
+\catcode`\<=13
+\def<#1>{{\normalfont\rm\itshape$\langle$#1$\rangle$}}
\maketitle
\tableofcontents
\bigskip
-%<*Eng>
-{\Large\bf This documentation is far from complete. It may have many
+%<*en>
+\textbf{This documentation is far from complete. It may have many
grammatical (and contextual) errors.}
-%
-%<*Jpn>
-\textbf{\large æ¬ããã¥ã¡ã³ãã¯ã¾ã ã¾ã æªå®æã§ãï¼
-ã¾ãï¼è±èªçã¨æ¥æ¬èªçãdocstripããã°ã©ã ãç¨ãããã¨ã§ä¸ç·ã«çæãã¦ããé½åä¸ï¼
-è¦åºããè±èªã®ã¾ã¾ã«ãªã£ã¦ãã¾ãï¼}
-%
-
-\newpage
-\part{User's manual}
-
-\section{Introduction}
-
-%<*Eng>
-The Lua\TeX-ja package is a macro package for typesetting high-quality
-Japanese documents in Lua\TeX.
-%
-%<*Jpn>
-Lua\TeX-jaããã±ã¼ã¸ã¯ï¼æ¬¡ä¸ä»£æ¨æº\TeX ã§ããLua\TeX ã®ä¸ã§ï¼p\TeX ã¨åç
+%
+%<*ja>
+\textbf{\large æ¬ããã¥ã¡ã³ãã¯ã¾ã ã¾ã æªå®æã§ãï¼}
+%
+
+\clearpage
+%\part{User's manual}
+%\part{ã¦ã¼ã¶ã¼ãºããã¥ã¢ã«}
+
+%\section{Introduction}
+%\section{ã¯ããã«}
+
+%<*en>
+The \LuaTeX-ja package is a macro package for typesetting high-quality
+Japanese documents when using \LuaTeX.
+%
+%<*ja>
+\LuaTeX-jaããã±ã¼ã¸ã¯ï¼æ¬¡ä¸ä»£æ¨æº\TeX ã§ãã\LuaTeX ã®ä¸ã§ï¼\pTeX ã¨åç
/ãã以ä¸ã®å質ã®æ¥æ¬èªçµçãå®ç¾ããããã¨ãããã¯ãããã±ã¼ã¸ã§ããï¼
-%
+%
-\subsection{Backgrounds}
-Traditionally, ASCII p\TeX, an extension of \TeX, and its derivatives
-are used to typeset Japanese documents in \TeX. p\TeX\ is an engine
+%\subsection{Backgrounds}
+%\subsection{èæ¯}
+
+%<*en>
+Traditionally, ASCII \pTeX, an extension of \TeX, and its derivatives
+are used to typeset Japanese documents in \TeX. \pTeX\ is an engine
extension of \TeX: so it can produce high-quality Japanese documents
without using very complicated macros. But this point is a mixed
-blessing: p\TeX\ is left behind from other extensions of \TeX,
-especially $\varepsilon$-\TeX\ and pdf\TeX, and from changes about
+blessing: \pTeX\ is left behind from other extensions of \TeX,
+especially \eTeX\ and \pdfTeX, and from changes about
Japanese processing in computers (\textit{e.g.}, the UTF-8 encoding).
-
-Recently extensions of p\TeX, namely up\TeX\ (Unicode-implementation
-of p\TeX) and $\varepsilon$-p\TeX\ (merging of p\TeX and
-$\varepsilon$-\TeX\ extension), have developed to fill those gaps to some
-extent, but gaps are still exist.
-
-However, the appearance of Lua\TeX\ changed the whole situation. With
+%
+%<*ja>
+å¾æ¥ï¼ã\TeX ãç¨ãã¦æ¥æ¬èªçµçãè¡ããã¨ãã£ãã¨ãï¼ã¨ã³ã¸ã³ã¨ãã¦ã¯
+ASCII \pTeX ãããã®æ¡å¼µç©ãç¨ãããããã¨ãä¸è¬çã§ãã£ãï¼\pTeX ã¯\TeX
+ã®ã¨ã³ã¸ã³æ¡å¼µã§ããï¼ï¼å°ã
ä»æ§ä¸ä¸ä¾¿ãªç¹ã¯ãããã®ã®ï¼åæ¥å°å·ã®åéã«
+ãç¨ããããã»ã©ã®é«å質ãªæ¥æ¬èªçµçãå¯è½ã¨ãã¦ããï¼ã ãï¼ããã¯å¼±ç¹ã«
+ããªã£ã¦ãã¾ã£ãï¼\pTeX ã¨ããï¼çµççã«ï¼æºè¶³ãªãã®ããã£ãããï¼æµ·å¤ã§
+è¡ããã¦ããæ°ã
ã®\TeX ã®æ¡å¼µââä¾ãã°\eTeX ã\pdfTeX ââãï¼TrueType,
+OpenType, Unicodeã¨ãã£ãè¨ç®æ©ã§æ¥æ¬èªãæ±ãéã®ç¶æ³ã®å¤åã«è¿½å¾ãããã¨
+ãæ ã£ã¦ãã¾ã£ãã®ã ï¼
+%
+
+%<*en>
+Recently extensions of \pTeX, namely \upTeX\ (Unicode-implementation
+of \pTeX) and \epTeX\ (merging of \pTeX\ and
+\eTeX\ extension), have developed to fill those gaps to some
+extent, but gaps still exist.
+%
+%<*ja>
+ããæ°å¹´ï¼è¥å¹²ç¶æ³ã¯æ¹åããã¦ããï¼ç¾å¨æã«å
¥ã大åã®\pTeX ãã¤ããªã§ã¯
+å¤é¨UTF-8å
¥åãå©ç¨å¯è½ã¨ãªãï¼ããã«Unicodeåãæ¨é²ãï¼\pTeX ã®å
é¨å¦ç
+ã¾ã§Unicodeåãã\upTeX ãéçºããã¦ããï¼ã¾ãï¼\pTeX ã«\eTeX æ¡å¼µããã¼
+ã¸ãã\epTeX ãç»å ´ãï¼\TeX\ Live\ 2011ã§ã¯\pLaTeX ã\epTeX ã®ä¸ã§åä½ã
+ãããã«ãªã£ãï¼ã ãï¼\pdfTeX æ¡å¼µï¼PDF ç´æ¥åºåãmicro-typesettingï¼ã
+\pTeX ã«å¯¾å¿ããããã¨ããåãã¯ãªãï¼æµ·å¤ã¨ã®gapã¯æªã ã«ããã®ãç¾ç¶ã§ã
+ãï¼
+%
+
+%<*en>
+However, the appearance of \LuaTeX\ changed the whole situation. With
using Lua `callbacks', users can customize the internal processing of
-Lua\TeX. So there is no need to modify sources of engines to
+\LuaTeX. So there is no need to modify sources of engines to
support Japanese typesetting: to do this, we only have to write Lua
scripts for appropriate callbacks.
+%
+%<*ja>
+ãããï¼\LuaTeX ã®ç»å ´ã§ï¼ç¶æ³ã¯å¤§ããå¤ãããã¨ã«ãªã£ãï¼Luaã³ã¼ãã§
+`callback'ãæ¸ããã¨ã«ããï¼\LuaTeX ã®å
é¨å¦çã«å²ãè¾¼ã¿ãããããã¨ãå¯
+è½ã¨ãªã£ãï¼ããã¯ï¼ã¨ã³ã¸ã³æ¡å¼µã¨ããçä¼¼ãããªãã¦ãï¼Luaã³ã¼ãã¨ããã«
+é¢ãã\TeX ãã¯ããæ¸ãã°ï¼ã¨ã³ã¸ã³æ¡å¼µã¨ã»ã¼åç¨åº¦ã®ãã¨ãã§ããããã«ãªã£
+ãã¨ãããã¨ãæå³ããï¼\LuaTeX-jaã¯ï¼ãã®ã¢ããã¼ãã«ãã£ã¦Luaã³ã¼ãã»
+\TeX ãã¯ãã«ãã£ã¦æ¥æ¬èªçµçã\LuaTeX ã®ä¸ã§å®ç¾ããããã¨ããç®çã§éçº
+ãå§ã¾ã£ãããã±ã¼ã¸ã§ããï¼
+%
+
+%\subsection{Major Changes from \pTeX}
+%\subsection{\pTeX ããã®ä¸»ãªå¤æ´ç¹}
+
+%<*en>
+The \LuaTeX-ja package is under much influence of \pTeX\ engine. The initial
+target of development was to implement features of \pTeX. However,
+\emph{\LuaTeX-ja is not a just porting of \pTeX; unnatural
+specifications/behaviors of \pTeX\ were not adopted}.
+%
+%<*ja>
+\LuaTeX-jaã¯ï¼\pTeX ã«å¤å¤§ãªå½±é¿ãåãã¦ããï¼åæã®éçºç®æ¨ã¯ï¼\pTeX ã®æ©
+è½ãLuaã³ã¼ãã«ããå®è£
ãããã¨ã§ãã£ãï¼ãããï¼éçºãé²ãã«ã¤ãï¼\pTeX
+ã®å®å
¨ãªç§»æ¤ã¯ä¸å¯è½ã§ããï¼ã¾ã\pTeX ã«ãããå®è£
ãããããä¸å¯è§£ã«ãªã£
+ã¦ãããããªç¶æ³ãçºè¦ãããï¼ãã®ããï¼\textbf{\LuaTeX-ja ã¯ï¼ãã¯ã
+\pTeX ã®å®å
¨ãªç§»æ¤ã¯ç®æ¨ã¨ã¯ããªãï¼\pTeX ã«ãããä¸èªç¶ãªä»æ§ã»æåãã
+ãã°ï¼ããã¯ç©æ¥µçã«æ¹ããï¼}
+%
+
+%<*en>
+The followings are major changes from \pTeX:
+%
+%<*ja>
+以ä¸ã¯ \pTeX ããã®ä¸»ãªå¤æ´ç¹ã§ããï¼
+%
-
-\subsection{Major Changes from p\TeX}
-The Lua\TeX-ja package is under much influence of p\TeX\ engine. The initial
-target of development was to implement features of p\TeX. However,
-\emph{Lua\TeX-ja is not a just porting of p\TeX; unnatural
-specifications/behaviors of p\TeX\ were not adopted}.
-
-The followings are major changes from p\TeX:
\begin{itemize}
+%<*en>
\item A Japanese font is a tuple of a `real' font, a Japanese font
metric (\textbf{JFM}, for short), and an optional string called
`variation'.
-
-\item In p\TeX, a linebreak after Japanese character is ignored (and
- doesn't yield a space), since linebreaks (in source files) are
- permitted almost everywhere in Japanese texts. However, Lua\TeX-ja
+%
+%<*ja>
+\item åæãã©ã³ãã¯ãå®éã®ããã©ã³ãï¼åæãã©ã³ãã¡ããªãã¯ï¼JFM ã¨å¼ã¶ï¼ï¼ã
+ ã㦠`variation' ã¨å¼ã°ããæååã®çµã§ããï¼
+%
+
+%<*en>
+\item In \pTeX, a line break after Japanese character is ignored (and
+ doesn't yield a space), since line breaks (in source files) are
+ permitted almost everywhere in Japanese texts. However, \LuaTeX-ja
doesn't have this function completely, because of a specification
- of Lua\TeX.
+ of \LuaTeX.
+%
+%<*ja>
+\item æ¥æ¬èªã®ææ¸ä¸ã§ã¯æ¹è¡ã¯ã»ã¨ãã©ã©ãã§ã許ãããã®ã§ï¼\pTeX ã§ã¯åææå
+ ç´å¾ã®æ¹è¡ã¯ç¡è¦ãããï¼ã¹ãã¼ã¹ãå
¥ããªãï¼ããã«ãªã£ã¦ããï¼ãããï¼
+ \LuaTeX-ja ã§ã¯ \LuaTeX ã®ä»æ§ã®ããã«ãã®æ©è½ã¯å®å
¨ã«ã¯å®è£
ããã¦ããªãï¼
+%
+
+%<*en>
\item The insertion process of glues/kerns between two Japanese
characters and between a Japanese character and other characters
(we refer these glues/kerns as \textbf{JAglue}) is rewritten from
scratch.
+%
+%<*ja>
+\item 2ã¤ã®åææåã®éï¼åææåã¨æ¬§ææåã®éã«å
¥ãã°ã«ã¼ï¼ã«ã¼ã³
+ ï¼\textbf{JAglue} ã¨å¼ã¶ï¼ã®æ¿å
¥å¦çã0ããæ¸ãç´ããã¦ããï¼
+%
\begin{itemize}
-\item As Lua\TeX's internal character handling is `node-based'
+%<*en>
+\item As \LuaTeX's internal character handling is `node-based'
(\textit{e.g.}, \verb+of{}fice+ doesn't prevent ligatures), the
insertion process of \textbf{JAglue} is now `node-based'.
+%
+%<*ja>
+\item \LuaTeX ã®å
é¨ã§ã®æåã®æ±ããããã¼ããã¼ã¹ãã«ãªã£ã¦ããããã«ï¼ä¾ãã°ï¼
+ \verb+of{}fice+ ã§ååã¯æå¶ãããªãï¼ï¼\textbf{JAglue} ã®æ¿å
¥å¦çã
+ ããã¼ããã¼ã¹ãã§ããï¼
+%
+
+%<*en>
\item Furthermore, nodes between two characters which have no effects in
- linebreak (\textit{e.g.}, \verb+\special+ node) are ignored in the
- insertion process.
-\item In the process, two Japanese fonts which differ in their `real'
- fonts only are identified.
+ line break (\textit{e.g.}, \verb+\special+ node) and kerns from
+ italic correction are ignored in the insertion process.
+%
+%<*ja>
+\item ããã«ï¼2ã¤ã®æåã®éã«ããè¡æ«ã§ã¯å¹æãæããªããã¼ãï¼ä¾ãã°
+ \verb+\special+ ãã¼ãï¼ãï¼ã¤ã¿ãªãã¯è£æ£ã«ä¼´ãæ¿å
¥ãããã«ã¼ã³ã¯
+ æ¿å
¥å¦çä¸ã§ã¯ç¡è¦ãããï¼
+%
+
+%<*en>
+\item \emph{Caution: due to above two points, many methods which did the
+ dividing the process of the insertion of \textbf{JAglue} in \pTeX\ are not
+ effective anymore.} In concrete terms, the following two methods are not effective anymore:
+%
+%<*ja>
+\item \textbf{注æï¼ä¸ã®2ã¤ã®å¤æ´ã«ããï¼å¾æ¥ \textbf{JAglue} ã®æ¿å
¥å¦çãåæããã®ã«
+ 使ããã¦ããããã¤ãã®æ¹æ³ã¯ç¨ãããã¨ãã§ããªãï¼å
·ä½çã«ã¯ï¼æ¬¡ã®æ¹æ³ã¯ãã¯ãç¡å¹ã§ããï¼}
+%
+\begin{verbatim}
+ããã¡ã{}ã£ã¨ããã¡ã\/ã£ã¨
+\end{verbatim}
+%<*en>
+ If you want to do so, please put an empty hbox between it instead:
+%
+%<*ja>
+ ããåããã¨ããããããã°ï¼ç©ºã®hboxãéã«æãã°ããï¼
+%
+\begin{verbatim}
+ããã¡ã\hbox{}ã£ã¨
+\end{verbatim}
+
+
+%<*en>
+\item In the process, two Japanese fonts which only differ in their `real'
+ fonts are identified.
+%
+%<*ja>
+\item å¦çä¸ã§ã¯ï¼2ã¤ã®åæãã©ã³ãã¯ï¼ãå®éã®ããã©ã³ãã®ã¿ãç°ãªãå ´åã«åä¸è¦
+ ãããï¼
+%
\end{itemize}
+
+%<*en>
\item At the present, vertical typesetting (\emph{tategaki}), is not
- supported in Lua\TeX-ja.
+ supported in \LuaTeX-ja.
+%
+%<*ja>
+\item ç¾æç¹ã§ã¯ï¼ç¸¦æ¸ã㯠\LuaTeX-ja ã§ã¯ãµãã¼ãããã¦ããªãï¼
+%
-\end{itemize}
+\end{itemize}
+
+%<*en>
For detailed information, see Part~\ref{part-imp}.
+%
+%<*ja>
+詳細ã«ã¤ãã¦ã¯ç¬¬ \ref{part-imp} é¨ãè¦ãï¼
+%
+
+%\subsection{Notations}
+%\subsection{ç¨èªã¨è¨æ³}
-\subsection{Notations}
+%<*en>
In this document, the following terms and notations are used:
+%
+%<*ja>
+æ¬ããã¥ã¡ã³ãã§ã¯ï¼ä»¥ä¸ã®ç¨èªã¨è¨æ³ãç¨ããï¼
+%
+
\begin{itemize}
-\item Characters are divided into two types:
+%<*en>
+\item Characters are divided into two types:
+%
+%<*ja>
+\item æåã¯2種é¡ã«åããããï¼
+%
\begin{itemize}
+%<*en>
\item \textbf{JAchar}: standing for Japanese characters such as
Hiragana, Katakana, Kanji and other punctuation marks for
- Japanese.'
-\item \textbf{ALchar}: standing for all other characters like alphabets.
+ Japanese.
+%
+%<*ja>
+\item \textbf{JAchar}: ã²ãããªï¼ã«ã¿ã«ãï¼æ¼¢åï¼åæç¨ã®ç´ç©ã¨ãã£ãåææåã®
+ ãã¨ãæãï¼
+%
+
+%<*en>
+\item \textbf{ALchar}: standing for all other characters like alphabets.
+%
+%<*ja>
+\item \textbf{ALchar}: ã¢ã«ãã¡ããããå§ãã¨ããï¼ãã®ä»å
¨ã¦ã®æåãæãï¼
+%
\end{itemize}
-We say `alphabetic fonts' for fonts used in \textbf{ALchar}, and `Japanese fonts' for fonts used in \textbf{JAchar}.
-\item A word in a sans-serif font (like \textsf{prebreakpenalty})
- represents an internal parameter for Japanese typesetting, and it
+%<*en>
+We say `alphabetic fonts' for fonts used in \textbf{ALchar}, and `Japanese fonts' for fonts used in \textbf{JAchar}.
+%
+%<*ja>
+ããã¦ï¼\textbf{ALchar} ã®åºåã«ç¨ãããããã©ã³ããã欧æãã©ã³ããã¨å¼ã³ï¼
+\textbf{JAchar} ã®åºåã«ç¨ãããããã©ã³ãããåæãã©ã³ããã¨å¼ã¶ï¼
+%
+
+%<*en>
+\item A word in a sans-serif font (like \Param{prebreakpenalty})
+ means an internal parameter for Japanese typesetting, and it
is used as a key in \verb+\ltjsetparameter+ command.
-\item The word `primitive' is used not only for primitives in Lua\TeX,
+%
+%<*ja>
+\item ãµã³ã»ãªãä½ã§æ¸ãããèªï¼ä¾ï¼\Param{prebreakpenalty}ï¼ã¯æ¥æ¬èªçµçç¨ã®
+ ãã©ã¡ã¼ã¿ã表ãï¼ããã㯠\verb+\ltjsetparameter+ ã³ãã³ãã®ãã¼ã¨ãã¦
+ ç¨ããããï¼
+%
+
+%<*en>
+\item A word in typewriter font with underline (like \Pkg{fontspec})
+ means a package or a class of \LaTeX.
+%
+%<*ja>
+\item ä¸ç·ä»ãã®ã¿ã¤ãã©ã¤ã¿ä½ã§æ¸ãããèªï¼ä¾ï¼\Pkg{fontspec}ï¼ã¯ \LaTeX ã®
+ ããã±ã¼ã¸ãã¯ã©ã¹ã表ãï¼
+%
+
+%<*en>
+\item The word `primitive' is used not only for primitives in \LuaTeX,
but also for control sequences that defined in the core module of
- Lua\TeX-ja.
+ \LuaTeX-ja.
+%
+%<*ja>
+\item ãããªããã£ããã¨ããèªãï¼\LuaTeX ã®ããªããã£ãã ãã§ã¯ãªã \LuaTeX-ja
+ ã®ã³ã¢ã¢ã¸ã¥ã¼ã«ã§å®ç¾©ãããã³ã³ããã¼ã«ã·ã¼ã±ã³ã¹ã«å¯¾ãã¦ãç¨ããï¼
+%
+
+%<*en>
\item In this document, natural numbers start from~0.
+%
+%<*ja>
+\item æ¬ããã¥ã¡ã³ãã§ã¯ï¼èªç¶æ°ã¯0ããå§ã¾ãï¼
+%
\end{itemize}
-\subsection{About the project}
-\paragraph{Project Wiki} \url{http://sourceforge.jp/projects/luatex-ja/wiki/FrontPage%28en%29}
+%\subsection{About the project}
+%\subsection{ããã¸ã§ã¯ãã«ã¤ãã¦}
-This project is hosted by SourceForge.JP.
-\paragraph{Members}
+%<*en>
+\paragraph{Project Wiki} Project Wiki is under construction.
+%
+%<*ja>
+\paragraph{ããã¸ã§ã¯ã Wiki} ããã¸ã§ã¯ã Wiki ã¯æ§ç¯ä¸ã§ããï¼
+%
-%h7k
-%kmaeda
-%abenori
-%kuroky
-%munepi
-%thonda
-%zrbabbler
+%<*en>
+\begin{itemize}
+\item \url{http://sourceforge.jp/projects/luatex-ja/wiki/FrontPage%28en%29} (English)
+\item \url{http://sourceforge.jp/projects/luatex-ja/wiki/FrontPage} (Japanese)
+\end{itemize}
+%
+%<*ja>
+\begin{itemize}
+\item \url{http://sourceforge.jp/projects/luatex-ja/wiki/FrontPage}ï¼æ¥æ¬èªï¼
+\item \url{http://sourceforge.jp/projects/luatex-ja/wiki/FrontPage%28en%29}ï¼è±èªï¼
+\end{itemize}
+%
-\newpage
-\section{Getting Started}
-\subsection{Installation}
-To install the Lua\TeX-ja\ package, you will need:
+%<*en>
+This project is hosted by SourceForge.JP.
+%
+%<*ja>
+æ¬ããã¸ã§ã¯ã㯠SourceForge.JP ã®ãµã¼ãã¹ãç¨ãã¦éå¶ããã¦ããï¼
+%
+
+%\paragraph{Members}\
+%\paragraph{éçºã¡ã³ãã¼}\
+%<*en>
+\begin{multienumerate}
+\def\labelenumi{$\bullet$}
+\mitemxxx{Hironori KITAGAWA}{Kazuki MAEDA}{Takayuki YATO}
+\mitemxxx{Yusuke KUROKI}{Noriyuki ABE}{Munehiro YAMAMOTO}
+\mitemxxo{Tomoaki HONDA}{Shuzaburo SAITO}
+\end{multienumerate}
+%
+%<*ja>
+\begin{multienumerate}
+\def\labelenumi{$\bullet$}
+\mitemxxx{åå· å¼å
¸}{åç° ä¸è²´}{å
«ç» å´ä¹}
+\mitemxxx{é»æ¨ è£ä»}{é¿é¨ ç´è¡}{å±±æ¬ å®å®}
+\mitemxxo{æ¬ç° ç¥äº®}{é½è¤ ä¿®ä¸é}
+\end{multienumerate}
+%
+
+
+% \paragraph{Acknowledgments} -- æ¿å
¥ãããªããã
+
+\clearpage
+%\section{Getting Started}
+%\section{使ãæ¹}
+%\subsection{Installation}
+%\subsection{ã¤ã³ã¹ãã¼ã«}
+
+%<*en>
+To install the \LuaTeX-ja\ package, you will need:
+%
+%<*ja>
+\LuaTeX-ja ããã±ã¼ã¸ã®ã¤ã³ã¹ãã¼ã«ã«ã¯ï¼æ¬¡ã®ãã®ãå¿
è¦ã§ããï¼
+%
\begin{itemize}
-\item Lua\TeX\ (version 0.65.0-beta or later) and its supporting packages.\\
-If you are using \TeX~Live\ 2011 or W32\TeX, you don't have to worry.
-\item The source archive of Lua\TeX-ja, of course{\tt:)}
+%<*en>
+\item \LuaTeX\ (version 0.65.0-beta or later) and its supporting packages.\\
+If you are using \TeX~Live~2011 or current W32\TeX, you don't have to worry.
+%
+%<*ja>
+\item \LuaTeXï¼ãã¼ã¸ã§ã³ 0.65.0-beta 以éï¼ã¨ãã®æ¯æ´ããã±ã¼ã¸ï¼
+ \TeX~Live~2011 ã W32\TeX ã®ææ°çãªãã°åé¡ãªãï¼
+%
+%<*en>
+\item The source archive of \LuaTeX-ja, of course\texttt{:)}
+%
+%<*ja>
+\item \LuaTeX-ja ã®ã½ã¼ã¹ã¢ã¼ã«ã¤ãï¼ãã¡ãã \texttt{:)}ï¼ï¼
+%
\end{itemize}
+%<*en>
The installation methods are as follows:
+%
+%<*ja>
+ã¤ã³ã¹ãã¼ã«æ¹æ³ã¯ä»¥ä¸ã®ããã«ãªãï¼
+%
\begin{enumerate}
+%<*en>
\item Download the source archive.
-At the present, Lua\TeX-ja has no official release, so you have to retrieve
-the archive from the repository.
-You can retrieve the Git repository via
+ At the present, \LuaTeX-ja has no official release, so you have to retrieve
+ the archive from the repository.
+ You can retrieve the Git repository via
+%
+%<*ja>
+\item ã½ã¼ã¹ã¢ã¼ã«ã¤ãããã¦ã³ãã¼ãããï¼
+
+ ç¾æç¹ã§ã¯ï¼\LuaTeX-ja ã®å
¬å¼ãªãªã¼ã¹ã¯ãªãã®ã§ï¼ã¬ãã¸ããªããã¢ã¼ã«ã¤ãã
+ åå¾ããªããã°ãªããªãï¼
+ 次ã®ããã«ãããã¨ã§ï¼Git ã¬ãã¸ããªãåå¾ãããã¨ãã§ããï¼
+%
\begin{verbatim}
$ git clone git://git.sourceforge.jp/gitroot/luatex-ja/luatexja.git
\end{verbatim}
-or download the archive of HEAD in \texttt{master} branch from
+%<*en>
+ or download the archive of HEAD in \texttt{master} branch from
+%
+%<*ja>
+ ãããã¯ï¼\texttt{master} ãã©ã³ãã® HEAD ã¢ã¼ã«ã¤ãã以ä¸ãããã¦ã³ãã¼ããããã¨ãã§ããï¼
+%
\begin{flushleft}
\url{http://git.sourceforge.jp/view?p=luatex-ja/luatexja.git;a=snapshot;h=HEAD;sf=tgz}.
\end{flushleft}
-\item Extract the archive. You will see {\tt src/} and several other sub-directories.
-\item Copy all the contents of {\tt src/} into one of your \texttt{TEXMF} tree.
-\item If {\tt mktexlsr} is needed to update the filename database, make it so.
+
+%<*en>
+Note that the forefront of development may not be in \texttt{master} branch.
+%
+%<*ja>
+éçºä¸ã®ææ°ã®ææ㯠\texttt{master} ãã©ã³ãã«ã¯å«ã¾ãã¦ããªããããããªããã¨ã«æ³¨æï¼
+%
+
+%<*en>
+\item Extract the archive. You will see \texttt{src/} and several other sub-directories.
+%
+%<*ja>
+\item ã¢ã¼ã«ã¤ããå±éããï¼\texttt{src/} ãã¯ããã¨ããããã¤ãã®ãã£ã¬ã¯ããªãã§ããï¼
+%
+
+%<*en>
+\item Copy all the contents of \texttt{src/} into one of your \texttt{TEXMF} tree.
+%
+%<*ja>
+\item \texttt{src/} ã®ä¸èº«å
¨ã¦ãèªåã® \texttt{TEXMF} ããªã¼ã«ã³ãã¼ããï¼
+%
+
+%<*en>
+\item If \texttt{mktexlsr} is needed to update the file name database, make it so.
+%
+%<*ja>
+\item å¿
è¦ãããã°ï¼\texttt{mktexlsr} ãå®è¡ããï¼
+%
\end{enumerate}
-\subsection{Cautions}
+%\subsection{Cautions}
+%\subsection{注æç¹}
+
\begin{itemize}
-\item The encoding of your source file must be UTF-8.
-\item Not well-tested. In particular, the default setting of the range
- of \textbf{JAchar} in the present version does not coexist with
- other packages which use Unicode fonts.
+%<*en>
+\item The encoding of your source file must be UTF-8. No other
+ encodings, such as EUC-JP or Shift-JIS, are not supported.
+%
+%<*ja>
+\item å稿ã®ã½ã¼ã¹ãã¡ã¤ã«ã®æåã³ã¼ã㯠UTF-8 ã§ãªããã°ãªããªãï¼
+ å¾æ¥æ¥æ¬èªã®æåã³ã¼ãã¨ãã¦ç¨ãããã¦ãã EUC-JP ã Shift-JIS ã¯ä½¿ç¨ã§ãã¾ããï¼
+%
+
+%<*en>
+\item May be conflict with other packages.
+
+ For example, the default setting of \textbf{JAchar} in the present
+ version does not coexist with the \Pkg{unicode-math}
+ package. Putting the following line in preamble makes that
+ mathematical symbols will be typeset correctly, but several
+ Japanese characters will be treated as an \textbf{ALchar} as
+ side-effect:
+%
+%<*ja>
+\item ããã¤ãã®ããã±ã¼ã¸ã¨è¡çªããï¼
+
+ ä¾ãã°ï¼\textbf{JAchar} ã®ç¯å²ã®è¨å®ãããã©ã«ãã®ã¾ã¾ã ã¨ï¼ç¾è¡ã®
+ ãã¼ã¸ã§ã³ã§ã¯ \Pkg{unicode-math} ããã±ã¼ã¸ã¨å
±åã§ããªãï¼
+ 以ä¸ã®è¡ãããªã¢ã³ãã«ã«è¿½å ãããã¨ã§æ°å¦è¨å·ãæ£ããåºãããã«
+ ãªããï¼å¯ä½ç¨ã¨ãã¦ããã¤ãã®åææåã \textbf{ALchar} ã¨ãã¦
+ æ±ãããããã«ãªã£ã¦ãã¾ãï¼
+%
+\begin{verbatim}
+\ltjsetparameter{jacharrange={-3, -8}}
+\end{verbatim}
\end{itemize}
-\subsection{Using in plain \TeX}\label{ssec-plain}
-To use Lua\TeX-ja in plain \TeX, simply put the following at the beginning of the document:
+%\subsection{Using in plain \TeX}
+%\subsection{plain \TeX ã§ä½¿ã}
+\label{ssec-plain}
+
+%<*en>
+To use \LuaTeX-ja in plain \TeX, simply put the following at the beginning of the document:
+%
+%<*ja>
+\LuaTeX-ja ã plain \TeX ã§ä½¿ãããã«ã¯ï¼åã«æ¬¡ã®è¡ãã½ã¼ã¹ãã¡ã¤ã«ã®åé ã«è¿½å ããã°ããï¼
+%
\begin{verbatim}
\input luatexja.sty
\end{verbatim}
+%<*en>
+This does minimal settings (like \texttt{ptex.tex}) for typesetting Japanese documents:
+%
+%<*ja>
+ããã§ï¼\texttt{ptex.tex} ã®ããã«ï¼æ¥æ¬èªçµçã®ããã®æä½éã®è¨å®ããªãããï¼
+%
-This does minimal settings (like {\tt ptex.tex}) for typesetting Japanese documents:
\begin{itemize}
+%<*en>
\item The following 6~Japanese fonts are preloaded:
\begin{center}
\begin{tabular}{ccccc}
\toprule
-\textbf{classification}&\textbf{font name}&\textbf{13.5\,Q}&\textbf{9.5\,Q}&\textbf{7\,Q}\\\midrule
+\textbf{classification}&\textbf{font name}&\bf `10\,pt'&\bf`7\,pt'&\bf`5\,pt'\\\midrule
\emph{mincho}&Ryumin-Light &\verb+\tenmin+&\verb+\sevenmin+&\verb+\fivemin+\\
\emph{gothic}&GothicBBB-Medium&\verb+\tengt+ &\verb+\sevengt+ &\verb+\fivegt+\\
\bottomrule
\end{tabular}
\end{center}
+%
+%<*ja>
+\item 以ä¸ã®6ã¤ã®åæãã©ã³ããå®ç¾©ãããï¼
+\begin{center}
+\begin{tabular}{ccccc}
+\toprule
+\textbf{åä½}&\textbf{ãã©ã³ãå}&\bf `10\,pt'&\bf`7\,pt'&\bf`5\,pt'\\\midrule
+ææä½&Ryumin-Light &\verb+\tenmin+&\verb+\sevenmin+&\verb+\fivemin+\\
+ã´ã·ãã¯ä½&GothicBBB-Medium&\verb+\tengt+ &\verb+\sevengt+ &\verb+\fivegt+\\
+\bottomrule
+\end{tabular}
+\end{center}
+%
\begin{itemize}
-\item The `Q' is a unit used in Japanese phototypesetting, and
+%<*en>
+\item The `Qï¼ç´ï¼' is a unit used in Japanese phototypesetting, and
$1\,\textrm{Q}=0.25\,\textrm{mm}$. This length is stored in a
dimension \verb+\jQ+.
+%
+%<*ja>
+\item `Qï¼ç´ï¼' ã¯æ¥æ¬ã®åæ¤ã§ç¨ããããåä½ã§ï¼$1\,\textrm{Q}=0.25\,\textrm{mm}$
+ ã§ããï¼ãã®é·ã㯠\verb+\jQ+ ã«ä¿æããã¦ããï¼
+%
+%<*en>
\item It is widely accepted that the font `Ryumin-Light' and
`GothicBBB-Medium' aren't embedded into PDF files, and PDF reader
substitute them by some external Japanese fonts (\textit{e.g.},
- Kozuka Mincho is used in Adobe Reader). We adopt this custom to
+ Kozuka Mincho is used for Ryumin-Light in Adobe Reader). We adopt this custom to
the default setting.
-\item You may notice that size of above fonts is slightly smaller than
- their alphabetic counterparts: for example, the size
- \verb+\texmin+ is $13.5\,\textrm{Q}\simeq 9.60444\,\textrm{pt}$. This is intensional: ...
+%
+%<*ja>
+\item `Ryumin-Light' 㨠`GothicBBB-Medium' 㯠PDF ãã¡ã¤ã«ã«åãè¾¼ã¾ãã«
+ åååç
§ã®ã¿ã§ç¨ãããã¨ãåºãåãå
¥ãããã¦ããï¼ãã®å ´å PDF ãªã¼ãã¼ã
+ é©åãªå¤é¨ãã©ã³ãã§ä»£ç¨ããï¼ä¾ãã°ï¼Adobe Reader ã§ã¯ Ryumin-Light ã¯
+ å°å¡ææã§ä»£æ¿ãããï¼ï¼ããã§ï¼ããããããã©ã«ãã®ãã©ã³ãã¨
+ ãã¦æ¡ç¨ããï¼
+%
+
+%<*en>
+\item A character in an alphabetic font is generally smaller than a
+ Japanese font in the same size. So actual size specification of
+ these Japanese fonts is in fact smaller than that of alphabetic
+ fonts, namely scaled by 0.962216.
+%
+%<*ja>
+\item 欧æãã©ã³ãã®æåã¯åæãã©ã³ãã®æåãããï¼åãæåãµã¤ãºã§ã
+ ä¸è¬ã«å°ããï¼ããã§ï¼ãããã®åæãã©ã³ãã®å®éã®ãµã¤ãºã¯æå®ãããå¤ããã
+ å°ãããªãããã«è¨å®ããã¦ããï¼å
·ä½çã«ã¯æå®ã® 0.962216 åã«ã¹ã±ã¼ã«ãããï¼
+%
\end{itemize}
-\item A character in Unicode is treated as \textbf{JAchar} if and only
- if its code-point has more than or equal to U+0100.
+
+%<*en>
\item The amount of glue that are inserted between a \textbf{JAchar} and
- an \textbf{ALchar} (the parameter \textsf{xkanjiskip}) is set to
+ an \textbf{ALchar} (the parameter \Param{xkanjiskip}) is set to
+%
+%<*ja>
+\item \textbf{JAchar} 㨠\textbf{ALchar} ã®éã«å
¥ãã°ã«ã¼ (\Param{xkanjiskip}) ã®
+ éã¯æ¬¡ã®ããã«è¨å®ããã¦ããï¼
+%
\[
- 0.25\,\hbox{\verb+\zw+}^{+1\,\text{pt}}_{-1\,\text{pt}} = \frac{27}{32}\,\mathrm{mm}^{+1\,\text{pt}}_{-1\,\text{pt}}.
+ (0.25\cdot 0.962216\cdot 10\,\mathrm{pt})^{+1\,\text{pt}}_{-1\,\text{pt}}
+ = 2.40554\,\mathrm{pt}^{+1\,\text{pt}}_{-1\,\text{pt}}.
\]
-Here \verb+\zw+ is the counterpart of \texttt{em} for Japanese fonts, that is, the length of `full-width' in current Japanese font.
\end{itemize}
-\subsection{Using in \LaTeX}
+%\subsection{Using in \LaTeX}
+%\subsection{\LaTeX ã§ä½¿ã}
+\label{ssec-ltx}
+
\paragraph{\LaTeXe}
+
+%<*en>
Using in \LaTeXe\ is basically same. To set up the minimal environment
-for Japanese, you only have to load {\tt luatexja.sty}:
+for Japanese, you only have to load \texttt{luatexja.sty}:
+%
+%<*ja>
+\LaTeXe ãç¨ããå ´åãåºæ¬çã«ã¯åãã§ããï¼æ¥æ¬èªçµçã®ããã®æä½éã®ç°å¢ã
+è¨å®ããããã«ã¯ï¼\texttt{luatexja.sty} ãèªã¿è¾¼ãã ãã§ããï¼
+%
\begin{verbatim}
\usepackage{luatexja}
\end{verbatim}
-It also does minimal settings (counterparts in p\LaTeX\ are {\tt
-plfonts.dtx} and {\tt pldefs.ltx}):
+%<*en>
+It also does minimal settings (counterparts in \pLaTeX\ are \texttt{
+plfonts.dtx} and \texttt{pldefs.ltx}):
+%
+%<*ja>
+ãã㧠\pLaTeX ã® \texttt{plfonts.dtx} 㨠\texttt{pldefs.ltx} ã«ç¸å½ããæä½éã®è¨å®ã
+ãªãããï¼
+%
\begin{itemize}
-\item {\tt JY3} is the font encoding for Japanese fonts (in horizontal direction).\\
-When vertical typesetting is supported by Lua\TeX-ja in the future, {\tt JT3} will be used for vertical fonts.
-\item Two font families {\tt mc} and {\tt gt} are defined:
+%<*en>
+\item \texttt{JY3} is the font encoding for Japanese fonts (in horizontal direction).\\
+When vertical typesetting is supported by \LuaTeX-ja in the future, \texttt{JT3} will be used for vertical fonts.
+%
+%<*ja>
+\item \texttt{JY3} ã¯åæãã©ã³ãç¨ã®ãã©ã³ãã¨ã³ã³ã¼ãã£ã³ã°ã§ããï¼æ¨ªæ¸ãç¨ï¼ï¼\\
+å°æ¥çã«ï¼\LuaTeX-ja ã§ç¸¦æ¸ãããµãã¼ããããéã«ã¯ï¼\texttt{JT3} ã縦æ¸ãç¨ã¨ãã¦
+ç¨ããäºå®ã§ããï¼
+%
+
+%<*en>
+\item Two font families \texttt{mc} and \texttt{gt} are defined:
\begin{center}
\begin{tabular}{ccccc}
\toprule
\textbf{classification}&\textbf{family}&\verb+\mdseries+&\verb+\bfseries+&\textbf{scale}\\\midrule
-\emph{mincho}&\tt mc&Ryumin-Light &GothicBBB-Medium&0.960444\\
-\emph{gothic}&\tt gt&GothicBBB-Medium&GothicBBB-Medium&0.960444\\
+\emph{mincho}&\tt mc&Ryumin-Light &GothicBBB-Medium&0.962216\\
+\emph{gothic}&\tt gt&GothicBBB-Medium&GothicBBB-Medium&0.962216\\
\bottomrule
\end{tabular}
\end{center}
-\textbf{Note on fonts in bold series}
-
-\item Japanese characters in math mode are typeset by the font family {\tt mc}.
+Remark that the bold series in both family are same as the medium series of \emph{gothic} family.
+This is a convention in \pLaTeX. This is a trace that there were only 2~fonts (these are Ryumin-Light
+and GothicBBB-Medium) in early years of DTP.
+%
+%<*ja>
+\item 2ã¤ã®ãã©ã³ããã¡ã㪠\texttt{mc} 㨠\texttt{gt} ãå®ç¾©ããã¦ããï¼
+\begin{center}
+\begin{tabular}{ccccc}
+\toprule
+\textbf{åä½}&\textbf{ãã¡ããª}&\verb+\mdseries+&\verb+\bfseries+&\textbf{ã¹ã±ã¼ã«}\\\midrule
+ææä½&\tt mc&Ryumin-Light &GothicBBB-Medium&0.962216\\
+ã´ã·ãã¯ä½&\tt gt&GothicBBB-Medium&GothicBBB-Medium&0.962216\\
+\bottomrule
+\end{tabular}
+\end{center}
+ã©ã¡ãã®ãã¡ããªã«ããã¦ãï¼ãã® bold ã·ãªã¼ãºã¯ã´ã·ãã¯ä½ã® medium ã·ãªã¼ãºã§
+ãããã¨ã«æ³¨æï¼ããã¯åæã® DTP ã«ããã¦åæãã©ã³ãã2ã¤ï¼ãããã¡ããã©\
+Ryumin-Light, GothicBBB-Medium ã ã£ãï¼ããå©ç¨ã§ããªãã£ãæã®åæ®ã§ããï¼\pLaTeX{}
+ã§ã®æ¨æºè¨å®ã¨ãåãã§ããï¼
+%
+
+%<*en>
+\item Japanese characters in math mode are typeset by the font family \texttt{mc}.
+%
+%<*ja>
+\item æ°å¼ã¢ã¼ãä¸ã®åææå㯠\texttt{mc} ãã¡ããªã§åºåãããï¼
+%
\end{itemize}
+%<*en>
However, above settings are not sufficient for Japanese-based
-documents. To typeset Japanese-based documents, You are better to use
-class files other than {\tt article.cls}, {\tt book.cls}, ... At the
-present, BXjscls (\texttt{bxjsarticle.cls} and \texttt{bxjsbook.cls}, by
-Takayuki Yato) are better alternative. It is not determined whether
-Lua\TeX-ja will develop and contain counterparts of major classes used
-in p\TeX\ (including jsclasses by Haruhiko Okumura).
-
-\subsection{Changing Fonts}
+documents. To typeset Japanese-based documents, you are better to use
+class files other than \texttt{article.cls}, \texttt{book.cls}, and so on. At
+the present, we have the counterparts of \Pkg{jclasses} (standard
+classes in \pLaTeX) and \Pkg{jsclasses} (classes by Haruhiko
+Okumura), namely, \Pkg{ltjclasses} and \Pkg{ltjsclasses}.
+%
+%<*ja>
+ããããªããï¼ä¸è¨ã®è¨å®ã¯æ¥æ¬èªã®ææ¸ã«ã¨ã£ã¦ååã¨ã¯è¨ããªãï¼
+æ¥æ¬èªææ¸ãçµçããããã«ã¯ï¼\texttt{article.cls}, \texttt{book.cls} ã¨ãã£ã
+欧æç¨ã®ã¯ã©ã¹ãã¡ã¤ã«ã§ã¯ãªãï¼åæç¨ã®ã¯ã©ã¹ãã¡ã¤ã«ãç¨ããæ¹ãããï¼
+ç¾æç¹ã§ã¯ï¼\Pkg{jclasses} ï¼\pLaTeX ã®æ¨æºã¯ã©ã¹ï¼ã¨ \Pkg{jsclasses}
+ï¼å¥¥ææ´å½¦æ°ã«ããã¯ã©ã¹ãã¡ã¤ã«ï¼ã«å¯¾å¿ãããã®ã¨ãã¦ï¼\Pkg{ltjclasses}ï¼
+\Pkg{ltjsclasses} ãããããç¨æããã¦ããï¼
+%
+
+%<*en>
+\paragraph{\texttt{\char92 CID, \texttt{\char92 UTF}} and macros in OTF package}
+Under \pLaTeX, \Pkg{otf} package (developed by Shuzaburo Saito) is
+used for typesetting characters which is in Adobe-Japan1-6 CID but not
+in JIS~X~0208. Since this package is widely used, \LuaTeX-ja
+supports some of functions in \Pkg{otf} package.
+If you want to use these functions, load \Pkg{luatexja-otf} package.
+%
+%<*ja>
+\paragraph{\texttt{\char92 CID, \texttt{\char92 UTF}} 㨠OTF ããã±ã¼ã¸ã®ãã¯ã}
+\pLaTeX ã§ã¯ï¼JIS~X~0208 ã«ãªã Adobe-Japan1-6 ã®æåãåºåããããã«ï¼
+é½è¤ä¿®ä¸éæ°ã«ãã \Pkg{otf} ããã±ã¼ã¸ãç¨ãããã¦ããï¼ãã®ããã±ã¼ã¸ã¯
+åºãç¨ãããã¦ããããï¼\LuaTeX-ja ã«ããã¦ã \Pkg{otf} ããã±ã¼ã¸ã®æ©è½ã®
+ä¸é¨ããµãã¼ããã¦ããï¼ãããã®æ©è½ãç¨ããããã«ã¯ \Pkg{luatexja-otf} ããã±ã¼ã¸
+ãèªã¿è¾¼ãã°ããï¼
+%
+
+\begin{LTXexample}
+森\UTF{9DD7}å¤ã¨å
ç°ç¾\UTF{9592}ã¨ã\UTF{9AD9}島å±ã«è¡ãã
+
+\CID{7652}飾åºã®\CID{13706}é家ï¼
+è飾åºã®åé家
+\end{LTXexample}
+%lltjp-listings.styè¦ä¿®æ£ï¼ï¼âã森ãã®ç´å¾ã§æ¹è¡ï¼
+
+
+%\subsection{Changing Fonts}
+%\subsection{ãã©ã³ãã®å¤æ´}
+\label{ssub-chgfnt}
+
+%<*en>
\paragraph{Remark: Japanese Characters in Math Mode}
-Since p\TeX\ supports Japanese characters in math mode, there are
+Since \pTeX\ supports Japanese characters in math mode, there are
sources like the following:
-
+%
+%<*ja>
+\paragraph{æè¦ï¼æ°å¼ã¢ã¼ãä¸ã®åææå}
+\pTeX ã§ã¯ï¼ä½ãããªãã§ãæ°å¼ä¸ã«åææåãè¨è¿°ãããã¨ãã§ããï¼ãã®ããï¼
+以ä¸ã®ãããªã½ã¼ã¹ãè¦ãããï¼
+%
\begin{LTXexample}
$f_{é«æ¸©}$~($f_{\text{high temperature}}$).
\[ y=(x-1)^2+2\quad{}ãã£ã¦\quad y>0 \]
$5\in{}ç´ :=\{\,p\in\mathbb N:\text{$p$ is a prime}\,\}$.
\end{LTXexample}
-
-We (the project members of Lua\TeX-ja) think that using
+%<*en>
+We (the project members of \LuaTeX-ja) think that using
Japanese characters in math mode are allowed if and only if these are used as identifiers.
-In this point of view,
+In this point of view,
+%
+%<*ja>
+\LuaTeX-ja ããã¸ã§ã¯ãã§ã¯ï¼æ°å¼ã¢ã¼ãä¸ã§ã®åææåã¯ããããèå¥åã¨ãã¦ç¨ãããã
+ã¨ãã®ã¿è¨±ãããã¨èãã¦ããï¼
+ãã®è¦³ç¹ããï¼
+%
\begin{itemize}
+%<*en>
\item The lines 1~and~2 above are not correct, since `é«æ¸©' in above is used as a textual label, and
-`ãã£ã¦' is used as a conjunction.
+`ãã£ã¦' is used as a conjunction.
+%
+%<*ja>
+\item ä¸è¨æ°å¼ã®ãã¡ 1, 2 è¡ç®ã¯æ£ãããªãï¼ãªããªãã° `é«æ¸©' ãæå³ã®ããã©ãã«ã¨
+ ãã¦ï¼`ãã£ã¦' ãæ¥ç¶è©ã¨ãã¦ç¨ãããã¦ããããã§ããï¼
+%
+%<*en>
\item However, the line~3 is correct, since `ç´ ' is used as an identifier.
+%
+%<*ja>
+\item ããããªããï¼3è¡ç®ã¯ `ç´ ' ãèå¥åã¨ãã¦ç¨ãããã¦ããã®ã§æ£ããï¼
+%
\end{itemize}
+%<*en>
Hence, in our opinion, the above input should be corrected as:
+%
+%<*ja>
+ãããã£ã¦ï¼\LuaTeX-ja ããã¸ã§ã¯ãã®æè¦ã¨ãã¦ã¯ï¼ä¸è¨ã®å
¥åã¯æ¬¡ã®ããã«ç´ãããã¹ã
+ã§ããï¼
+%
\begin{LTXexample}
$f_{\text{é«æ¸©}}$~%
($f_{\text{high temperature}}$).
-\[ y=(x-1)^2+2\quad
+\[ y=(x-1)^2+2\quad
\mathrel{\text{ãã£ã¦}}\quad y>0 \]
$5\in{}ç´ :=\{\,p\in\mathbb N:\text{$p$ is a prime}\,\}$.
\end{LTXexample}
%BUG?: \{\}ããªããã°ãç´ ããã§ãªãï¼ä¸ã®æ®µè½ã®ããã£ã¦ããã§ã¦ãªãï¼
+%<*en>
We also believe that using Japanese characters as identifiers is rare,
hence we don't describe how to change Japanese fonts in math mode in
this chapter. For the method, please see Part~\ref{part-ref}.
-
-
+%
+%<*ja>
+ã¾ã \LuaTeX-ja ããã¸ã§ã¯ãã§ã¯ï¼åææåãèå¥åã¨ãã¦ç¨ãããããã¨ã¯ã»ã¨ãã©ãªã
+ã¨èãã¦ããï¼ãããã£ã¦ãã®ç¯ã§ã¯æ°å¼ã¢ã¼ãä¸ã®åæãã©ã³ããå¤æ´ããæ¹æ³ã«ã¤ãã¦ã¯
+è¨è¿°ããªãï¼ãã®æ¹æ³ã«ã¤ãã¦ã¯ç¬¬ \ref{part-ref} é¨ãåç
§ã®ãã¨ï¼
+%
+
+%<*en>
\paragraph{plain \TeX}
To change Japanese fonts in plain \TeX, you must use the primitive
\verb+\jfont+. So please see Part~\ref{part-ref}.
+%
+%<*ja>
+\paragraph{plain \TeX}
+plain \TeX ã§åæãã©ã³ããå¤æ´ããããã«ã¯ï¼\verb+\jfont+ ããªããã£ããç¨ããªãã
+ã°ãªããªãï¼ç¬¬ \ref{part-ref} é¨ãåç
§ããï¼
+%
-
+%<*en>
\paragraph{NFSS2}
-For \LaTeXe, Lua\TeX-ja simply adopted the font selection system from that
-of p\LaTeXe\ (in {\tt plfonts.dtx}).
+For \LaTeXe, \LuaTeX-ja simply adopted the font selection system from that
+of \pLaTeXe\ (in \texttt{plfonts.dtx}).
+%
+%<*ja>
+\paragraph{NFSS2}
+\LaTeXe ã«ã¤ãã¦ã¯ï¼\LuaTeX-ja ã§ã¯åã«ãã©ã³ãé¸æã·ã¹ãã ã \pLaTeXe\ (\texttt{plfonts.dtx})
+ããæ¡ç¨ãã¦ããï¼
+%
\begin{itemize}
+%<*en>
\item Two control sequences \verb+\mcdefault+ and \verb+\gtdefault+ are
used to specify the default font families for \emph{mincho} and
\emph{gothic}, respectively. Default values: \texttt{mc} for
\verb+\mcdefault+ and \texttt{gt} for \verb+\gtdefault+.
+%
+%<*ja>
+\item 2ã¤ã®ã³ã³ããã¼ã«ã·ã¼ã±ã³ã¹ \verb+\mcdefault+ 㨠\verb+\gtdefault+ ãããã
+ ãææä½ã¨ã´ã·ãã¯ä½ã®ããã©ã«ãã®ãã©ã³ããã¡ããªãæå®ããããã«ç¨ããããï¼
+ åæå¤ï¼\verb+\mcdefault+ 㯠\texttt{mc}ï¼\verb+\gtdefault+ 㯠\texttt{gt}ï¼
+%
+%<*en>
\item Commands \verb+\fontfamily+, \verb+\fontseries+,
\verb+\fontshape+ and \verb+\selectfont+ can be used to change
- attributes of Japanese fonts.
+ attributes of Japanese fonts.
+%
+%<*ja>
+\item \verb+\fontfamily+, \verb+\fontseries+, \verb+\fontshape+, ããã¦
+ \verb+\selectfont+ ãåæãã©ã³ãã®å±æ§ãå¤æ´ããããã«ä½¿ç¨ã§ããï¼
+%
+
+%<*en>
\begin{center}
-\begin{tabular}{ccccc}
+\begin{tabular}{cccccc}
\toprule
-&\textbf{encoding}&\textbf{family}&\textbf{series}&\textbf{shape}\\\midrule
+&\textbf{encoding}&\textbf{family}&\textbf{series}&\textbf{shape}&\textbf{selection}\\\midrule
alphabetic fonts
-&\verb+\romanencoding+&\verb+\romanfamily+&\verb+\romanseries+&\verb+\romanshape+\\
+&\verb+\romanencoding+&\verb+\romanfamily+&\verb+\romanseries+&\verb+\romanshape+
+&\verb+\useroman+\\
Japanese fonts
-&\verb+\kanjiencoding+&\verb+\kanjifamily+&\verb+\kanjiseries+&\verb+\kanjishape+\\
-both&---&--&\verb+\fontseries+&\verb+\fontshape+\\
-auto select&\verb+\fontencoding+&\verb+\fontfamily+&---&---\\
+&\verb+\kanjiencoding+&\verb+\kanjifamily+&\verb+\kanjiseries+&\verb+\kanjishape+
+&\verb+\usekanji+\\
+both&---&--&\verb+\fontseries+&\verb+\fontshape+&---\\
+auto select&\verb+\fontencoding+&\verb+\fontfamily+&---&---&\verb+\usefont+\\
\bottomrule
\end{tabular}
\end{center}
-\item For defining a Japanese font family, use \verb+\DeclareKanjiFamily+
- instead of \verb+\DeclareFontFamily+.
+%
+%<*ja>
+\begin{center}
+\begin{tabular}{cccccc}
+\toprule
+&\textbf{ã¨ã³ã³ã¼ãã£ã³ã°}&\textbf{ãã¡ããª}&\textbf{ã·ãªã¼ãº}&\textbf{ã·ã§ã¼ã}&\textbf{é¸æ}\\\midrule
+欧æãã©ã³ã
+&\verb+\romanencoding+&\verb+\romanfamily+&\verb+\romanseries+&\verb+\romanshape+
+&\verb+\useroman+\\
+åæãã©ã³ã
+&\verb+\kanjiencoding+&\verb+\kanjifamily+&\verb+\kanjiseries+&\verb+\kanjishape+
+&\verb+\usekanji+\\
+両æ¹&---&--&\verb+\fontseries+&\verb+\fontshape+&---\\
+èªåé¸æ&\verb+\fontencoding+&\verb+\fontfamily+&---&---&\verb+\usefont+\\
+\bottomrule
+\end{tabular}
+\end{center}
+%
+
+%<*en>
+ \verb+\fontencoding{}+ changes the encoding of alphabetic fonts
+ or Japanese fonts depending on the argument. For example,
+ \verb+\fontencoding{JY3}+ changes the encoding of Japanese fonts to
+ \texttt{JY3} and \verb+\fontencoding{T1}+ changes the encoding of
+ alphabetic fonts to \texttt{T1}.
+ \verb+\fontfamily+ also changes the family of Japanese fonts, alphabetic
+ fonts, \emph{or both}. For detail, see Subsection~\ref{ssub-nfsspat}.
+%
+%<*ja>
+ ããã§ï¼\verb+\fontencoding{}+ã¯ï¼å¼æ°ã«ããåæå´ã欧æ
+ å´ãã®ã©ã¡ããã®ã¨ã³ã³ã¼ãã£ã³ã°ãå¤æ´ããï¼ä¾ãã°ï¼
+ \verb+\fontencoding{JY3}+ã¯åæãã©ã³ãã®ã¨ã³ã³ã¼ãã£ã³ã°ã
+ \texttt{JY3}ã«å¤æ´ãï¼\verb+\fontencoding{T1}+ ã¯æ¬§æãã©ã³ãå´ã
+ \texttt{T1}ã¸ã¨å¤æ´ããï¼\verb+\fontfamily+ãå¼æ°ã«ããåæå´ï¼æ¬§æ
+ å´ï¼\textbf{ãããã¯ä¸¡æ¹}ã®ãã©ã³ããã¡ããªãå¤æ´ããï¼è©³ç´°ã¯
+ \ref{ssub-nfsspat}ç¯ãåç
§ãããã¨ï¼
+%
+
+%<*en>
+\item For defining a Japanese font family, use
+ \verb+\DeclareKanjiFamily+ instead of
+ \verb+\DeclareFontFamily+. However, in the present implementation,
+ using \verb+\DeclareFontFamily+ doesn't cause any problem.
+%
+%<*ja>
+\item åæãã©ã³ããã¡ããªã®å®ç¾©ã«ã¯ \verb+\DeclareFontFamily+ ã®ä»£ããã«
+ \verb+\DeclareKanjiFamily+ ãç¨ããï¼ãããï¼ç¾å¨ã®å®è£
ã§ã¯
+ \verb+\DeclareFontFamily+ ãç¨ãã¦ãåé¡ã¯çããªãï¼
+%
\end{itemize}
-\paragraph{fontspec}
-To coexist with \texttt{fontspec} package, it is needed to load
-\texttt{luatexja-fontspec} package in the preamble. This additional
-package automatically loads \texttt{luatexja} and \texttt{fontspec}
+\subsection{fontspec}
+%<*en>
+To coexist with the \Pkg{fontspec} package, it is needed to load
+\Pkg{luatexja-fontspec} package in the preamble. This additional
+package automatically loads \Pkg{luatexja} and \Pkg{fontspec}
package, if needed.
-
-In \texttt{luatexja-fontspec} package, the following 7~commands are defined as
-counterparts of original commands in \texttt{fontspec}:
+%
+%<*ja>
+\Pkg{fontspec} ããã±ã¼ã¸ã¨åæ§ã®æ©è½ãåæãã©ã³ãã«å¯¾ãã¦ãç¨ããããã«ã¯ï¼
+\Pkg{luatexja-fontspec} ããã±ã¼ã¸ãããªã¢ã³ãã«ã§èªã¿è¾¼ãå¿
è¦ãããï¼ãã®ããã±ã¼ã¸
+ã¯å¿
è¦ãªãã°èªå㧠\Pkg{luatexja} ããã±ã¼ã¸ã¨ \Pkg{fontspec} ããã±ã¼ã¸ãèªã¿è¾¼ãï¼
+%
+
+%<*en>
+In \Pkg{luatexja-fontspec} package, the following 7~commands are defined as
+counterparts of original commands in the \Pkg{fontspec} package:
+%
+%<*ja>
+\Pkg{luatexja-fontspec} ããã±ã¼ã¸ã§ã¯ï¼ä»¥ä¸ã®7ã¤ã®ã³ãã³ãã \Pkg{fontspec}
+ããã±ã¼ã¸ã®å
ã®ã³ãã³ãã«å¯¾å¿ãããã®ã¨ãã¦å®ç¾©ãã¦ããï¼
+%
+%<*en>
\begin{center}
\begin{tabular}{ccccc}
\toprule
@@ -361,126 +990,701 @@ alphabetic fonts
\bottomrule
\end{tabular}
\end{center}
-使ç¨ä¾
+%
+%<*ja>
+\begin{center}
+\begin{tabular}{ccccc}
+\toprule
+åæãã©ã³ã
+&\verb+\jfontspec+&\verb+\setmainjfont+&\verb+\setsansjfont+&\verb+\newjfontfamily+\\
+欧æãã©ã³ã
+&\verb+\fontspec+&\verb+\setmainfont+&\verb+\setsansfont+&\verb+\newfontfamily+\\
+\midrule
+åæãã©ã³ã
+&\verb+\newjfontface+&\verb+\defaultjfontfeatures+&\verb+\addjfontfeatures+\\
+欧æãã©ã³ã
+&\verb+\newfontface+&\verb+\defaultfontfeatures+&\verb+\addfontfeatures+\\
+\bottomrule
+\end{tabular}
+\end{center}
+%
+\begin{LTXexample}
+\fontspec[Numbers=OldStyle]{TeX Gyre Termes}
+\jfontspec{IPAexMincho}
+JIS~X~0213:2004âè¾»
+\addjfontfeatures{CJKShape=JIS1990}
+JIS~X~0208:1990âè¾»
+\end{LTXexample}
+
+%<*en>
Note that there is no command named \verb+\setmonojfont+, since it is
-popular for Japanese fonts that nearly all Japanese glyphs have same widths.
+popular for Japanese fonts that nearly all Japanese glyphs have same
+widths. Also note that the kerning feature is set off by default in
+these 7~commands, since this feature and \textbf{JAglue} will clash (see
+\ref{para-kern}).
+%
+%<*ja>
+åæãã©ã³ãã«ã¤ãã¦ã¯å
¨ã¦ã®åææåã®ã°ãªããã»ã¼çå¹
ã§ããã®ãæ®éã§ããããï¼
+\verb+\setmonojfont+ ã³ãã³ãã¯åå¨ããªããã¨ã«æ³¨æï¼ã¾ãï¼ãããã®åæç¨ã®7ã¤ã®ã³ã
+ã³ãã§ã¯ Kerning feature ã¯ããã©ã«ãã§ã¯ off ã¨ãªã£ã¦ããï¼ããã¯ãã®
+feature ã \textbf{JAglue} ã¨è¡çªããããã§ããï¼\ref{para-kern} ç¯ãåç
§ï¼ï¼
+%
+
+%<*en>
+\paragraph{Caution}
+\Pkg{xunicode} package will be reloaded during the loading of \Pkg{luatexja-fontspec} package.
+However, this reloading won't work for the current version (2011/09/09,~v0.981) of
+\Pkg{xunicode} package. Hence we have to patch it, using the following patch, for example:
+%
+%<*ja>
+\paragraph{注æ}
+\Pkg{luatexja-fontspec}ããã±ã¼ã¸ã§ã¯ï¼å
é¨ã§ \Pkg{xunicode} ããã±ã¼ã¸ã®åèªã¿è¾¼ã¿ã
+è¡ã£ã¦ãããï¼ \textbf{\TeX\ Live\ 2011 ä»ã«å«ã¾ãã¦ãã \Pkg{xunicode} ããã±ã¼ã¸
+(2011/09/09,~v0.981) ã§ã¯ãã®åèªã¿è¾¼ã¿ããã¾ãåä½ãã}ï¼ä¾ãã°
+以ä¸ã®ãããªããããå½ã¦ãå¿
è¦ãããï¼
+%
+\begin{lstlisting}
+--- xunicode.sty.orig 2011-09-12 08:31:47.000000000 +0900
++++ xunicode.sty 2011-11-16 22:06:17.061413113 +0900
+@@ -1475,7 +1475,11 @@
+
+ \newtoks\tipasavetokens
+ \newtoks\tipachecktokens
++
++\fi
+ \newif\iftipaonetoken
++\expandafter\ifx\csname ReloadXunicode\endcsname\relax
++
+ \def\tipalasttoken{!@! do nothing with this !@!}
+ \def\tipacatchonechar#1{\begingroup
+ \def\textipa##1{##1}% prevent recursion
+\end{lstlisting}
-\section{Changing Parameters}
-There are many parameters in Lua\TeX-ja. And due to the behavior of Lua\TeX,
+%\section{Changing Parameters}
+%\section{ãã©ã¡ã¼ã¿ã®å¤æ´}
+
+%<*en>
+There are many parameters in \LuaTeX-ja. And due to the behavior of \LuaTeX,
most of them are not stored as internal register of \TeX, but as an
-original storage system in Lua\TeX-ja. Hence, to assign or acquire those
+original storage system in \LuaTeX-ja. Hence, to assign or acquire those
parameters, you have to use commands \verb+\ltjsetparameter+ and
\verb+\ltjgetparameter+.
+%
+%<*ja>
+\LuaTeX-ja ã«ã¯å¤ãã®ãã©ã¡ã¼ã¿ãåå¨ããï¼ãã㦠\LuaTeX ã®æ¯ãèãã®ããã«ï¼
+ãã®å¤ã㯠\TeX ã®ã¬ã¸ã¹ã¿ã«ã§ã¯ãªãï¼\LuaTeX-ja ç¬èªã®æ¹æ³ã§ä¿æããã¦ããï¼
+ãã®ããï¼ãããã®ãã©ã¡ã¼ã¿ãè¨å®ã»åå¾ããããã«ã¯ \verb+\ltjsetparameter+ ã¨
+\verb+\ltjgetparameter+ ãç¨ããªããã°ãªããªãï¼
+%
+
+%\subsection{Editing the range of \textbf{JAchar}s}
+%\subsection{\textbf{JAchar} ã®ç¯å²ã®è¨å®}
+
+%<*en>
+To edit the range of \textbf{JAchar}s, you have to assign a non-zero
+natural number which is less than 217 to the character range first. This
+can be done by using \verb+\ltjdefcharrange+ primitive. For example, the
+next line assigns whole characters in Supplementary Multilingual Plane
+and the character `æ¼¢' to the range number~100.
+%
+%<*ja>
+\textbf{JAchar} ã®ç¯å²ãè¨å®ããããã«ã¯ï¼ã¾ãæåç¯å²ã«0ãã大ãã217ããå°ãã
+èªç¶æ°ãå²ãå½ã¦ãå¿
è¦ãããï¼ããã«ã¯ \verb+\ltjdefcharrange+ ããªããã£ããç¨ããï¼
+ä¾ãã°ï¼æ¬¡ã®ããã«æ¸ããã¨ã§è¿½å å¤è¨èªé¢ (SMP) ã«ããå
¨ã¦ã®æå㨠`æ¼¢' ã®ç¯å²çªå·ã
+100ã«è¨å®ãããï¼
+%
+\begin{lstlisting}
+\ltjdefcharrange{100}{"10000-"1FFFF,`æ¼¢}
+\end{lstlisting}
+%<*en>
+This assignment of numbers to ranges are always global, so you should
+not do this in the middle of a document.
+%
+%<*ja>
+ãã®æåç¯å²ã¸ã®çªå·ã®å²ãå½ã¦ã¯ãã¤ãã°ãã¼ãã«ã§ããï¼ãããã£ã¦ææ¸ã®éä¸ã§
+ãã®æä½ãããã¹ãã§ã¯ãªãï¼
+%
+
+%<*en>
+If some character has been belonged to some non-zero numbered range,
+this will be overwritten by the new setting. For example, whole SMP
+belong to the range~4 in the default setting of \LuaTeX-ja, and if you
+specify the above line, then SMP will belong to the range~100 and be
+removed from the range~4.
+%
+%<*ja>
+ããæå®ãããããæåãããéé¶çªå·ã®ç¯å²ã«å±ãã¦ãããªãã°ï¼ããã¯æ°ããè¨å®ã§
+ä¸æ¸ããããï¼ä¾ãã°ï¼SMP ã¯å
¨ã¦ \LuaTeX-ja ã®ããã©ã«ãã§ã¯4çªã®æåç¯å²ã«
+å±ãã¦ãããï¼ä¸è¨ã®æå®ãè¡ãã° SMP ã¯100çªã«å±ãããã«ãªãï¼4çªããã¯é¤ãããï¼
+%
+
+%<*en>
+After assigning numbers to ranges, the \textsf{jacharrange} parameter can
+be used to customize which character range will be treated as ranges of
+\textbf{JAchar}s, as the following line (this is just the default
+setting of \LuaTeX-ja):
+%
+%<*ja>
+æåç¯å²ã«çªå·ãå²ãå½ã¦ãå¾ã¯ï¼\textsf{jacharrange} ãã©ã¡ã¼ã¿ã \textbf{JAchar} ã¨
+ãã¦æ±ãããæåã®ç¯å²ãè¨å®ããããã«ç¨ããããï¼ä¾ãã°ï¼ä»¥ä¸ã¯ \LuaTeX-ja ã®
+åæè¨å®ã§ããï¼
+%
+\begin{verbatim}
+\ltjsetparameter{jacharrange={-1, +2, +3, -4, -5, +6, +7, +8}}
+\end{verbatim}
+%<*en>
+The argument to \textsf{jacharrange} parameter is a list of integer.
+Negative integer $-n$ in the list means that `the characters that belong to
+range~$n$ are treated as \textbf{ALchar}', and positive integer $+n$ means
+that `the characters that belong to range~$n$ are treated as \textbf{JAchar}'.
+%
+%<*ja>
+\textsf{jacharrange} ãã©ã¡ã¼ã¿ã«ã¯æ´æ°ã®ãªã¹ããä¸ããï¼
+ãªã¹ãä¸ã®è² ã®æ´æ° $-n$ ã¯ãæåç¯å² $n$ ã«å±ããæå㯠\textbf{ALchar} ã¨ãã¦
+æ±ãããããã¨ãæå³ãï¼æ£ã®æ´æ° $+n$ 㯠\textbf{JAchar} ã¨ãã¦æ±ããã¨ãæå³ããï¼
+%
+
+%<*en>
+\paragraph{Default Setting}
+\LuaTeX-ja predefines eight character ranges for convenience. They are
+determined from the following data:
+%
+%<*ja>
+\paragraph{åæè¨å®}
+\LuaTeX-ja ã§ã¯8ã¤ã®æåç¯å²ãè¨å®ãã¦ããï¼ãããã¯ä»¥ä¸ã®ãã¼ã¿ã«åºã¥ãã¦æ±ºå®ãã¦
+ããï¼
+%
+\begin{itemize}
+%<*en>
+\item Blocks in Unicode~6.0.
+%
+%<*ja>
+\item Unicode~6.0 ã®ãããã¯ï¼
+%
+%<*en>
+\item The \texttt{Adobe-Japan1-UCS2} mapping between a CID Adobe-Japan1-6 and Unicode.
+%
+%<*ja>
+\item \texttt{Adobe-Japan1-UCS2} ã«ãã Adobe-Japan1-6 ã® CID 㨠Unicode ã®éã®
+ ãããã³ã°ï¼
+%
+%<*en>
+\item The \texttt{PXbase} bundle for \upTeX\ by Takayuki Yato.
+%
+%<*ja>
+\item å
«ç»å´ä¹æ°ã«ãã \upTeX ç¨ã® \texttt{PXbase} ãã³ãã«ï¼
+%
+\end{itemize}
-\subsection{Editing the range of \textbf{JAchar}}
-As noted before, the default setting is:
-\begin{center}
-A character in Unicode is treated as \textbf{JAchar},\\
- if and only if its
- code-point has more than or equal to U+0100.
+%<*en>
+Now we describe these eight ranges. The alphabet `J' or `A' after the
+number shows whether characters in the range is treated as
+\textbf{JAchar}s or not by default. These settings are similar to the
+\texttt{prefercjk} settings defined in \texttt{PXbase} bundle.
+%
+%<*ja>
+以ä¸ã§ã¯ããã8ã¤ã®æåç¯å²ã«ã¤ãã¦è¨è¿°ããï¼çªå·ã®ãã¨ã®ã¢ã«ãã¡ããã `J' 㨠`A'
+ã¯ããã©ã«ã㧠\textbf{JAchar} ã¨ãã¦æ±ããããã©ããã示ãï¼ãããã®è¨å®ã¯
+\texttt{PXbase} ãã³ãã«ã§å®ç¾©ããã¦ãã \texttt{prefercjk} ã¨é¡ä¼¼ã®ãã®ã§ããï¼
+%
+\begin{description}
+%<*en>
+\item[Range~8${}^{\text{J}}$] Symbols in the intersection of the upper half of ISO~8859-1
+ (Latin-1 Supplement) and JIS~X~0208 (a basic character set for Japanese). This character range
+ consists of the following characters:
+%
+%<*ja>
+\item[ç¯å² 8${}^{\text{J}}$] ISO~8859-1 ã®ä¸ä½é åï¼ã©ãã³1è£å©ï¼ã¨
+ JIS~X~0208 ã®å
±éé¨åã«ããè¨å·ï¼ãã®æåç¯å²ã¯
+ 以ä¸ã®æåã§æ§æãããï¼
+%
+\begin{multicols}{2}
+\begin{itemize}
+\def\ch#1#2{\item \char"#1\ (\texttt{U+00#1}, #2)}%"
+%<*en>
+\ch{A7}{Section Sign}
+\ch{A8}{Diaeresis}
+\ch{B0}{Degree sign}
+\ch{B1}{Plus-minus sign}
+\ch{B4}{Spacing acute}
+\ch{B6}{Paragraph sign}
+\ch{D7}{Multiplication sign}
+\ch{F7}{Division Sign}
+%
+%<*ja>
+\ch{A7}{ç¯è¨å·}
+\ch{A8}{ãã¬ã}
+\ch{B0}{度}
+\ch{B1}{æ£åã¯è² 符å·}
+\ch{B4}{ã¢ãã¥ã¼ãã»ã¢ã¯ã»ã³ã}
+\ch{B6}{段è½è¨å·}
+\ch{D7}{ä¹ç®è¨å·}
+\ch{F7}{é¤ç®è¨å·}
+%
+\end{itemize}
+\end{multicols}
+
+%<*en>
+\item[Range~1${}^{\text{A}}$] Latin characters that some of them are included in Adobe-Japan1-6.
+This range consist of the following Unicode ranges, \emph{except characters in the range~8 above}:
+%
+%<*ja>
+\item[ç¯å² 1${}^{\text{A}}$] ã©ãã³æåï¼ä¸é¨ã¯Adobe-Japan1-6 ã«ãå«ã¾ãã¦ããï¼
+ ãã®ç¯å²ã¯ä»¥ä¸ã® Unicode ã®ãããã¯ããæ§æããã¦ããï¼
+ \textbf{ãã ãï¼ç¯å² 8 ã¯é¤ãï¼}
+%
+\begin{multicols}{2}
+\begin{itemize}
+%<*en>
+\item \texttt{U+0080}--\texttt{U+00FF}: Latin-1 Supplement
+\item \texttt{U+0100}--\texttt{U+017F}: Latin Extended-A
+\item \texttt{U+0180}--\texttt{U+024F}: Latin Extended-B
+\item \texttt{U+0250}--\texttt{U+02AF}: IPA Extensions
+\item \texttt{U+02B0}--\texttt{U+02FF}: Spacing Modifier Letters
+\item \texttt{U+0300}--\texttt{U+036F}: Combining Diacritical Marks
+\item \texttt{U+1E00}--\texttt{U+1EFF}: Latin Extended Additional
+%
+%<*ja>
+\item \texttt{U+0080}--\texttt{U+00FF}: ã©ãã³1è£å©
+\item \texttt{U+0100}--\texttt{U+017F}: ã©ãã³æåæ¡å¼µA
+\item \texttt{U+0180}--\texttt{U+024F}: ã©ãã³æåæ¡å¼µB
+\item \texttt{U+0250}--\texttt{U+02AF}: IPAæ¡å¼µï¼å½éé³å£°è¨å·ï¼
+\item \texttt{U+02B0}--\texttt{U+02FF}: åé²ãä¼´ã修飾æå
+\item \texttt{U+0300}--\texttt{U+036F}: ãã¤ã¢ã¯ãªãã£ã«ã«ãã¼ã¯ï¼åæå¯è½ï¼
+\item \texttt{U+1E00}--\texttt{U+1EFF}: ã©ãã³æåæ¡å¼µè¿½å
+%
+\par\
+\end{itemize}
+\end{multicols}
+%<*en>
+\item[Range~2${}^{\text{J}}$] Greek and Cyrillic letters. JIS~X~0208 (hence most of Japanese
+ fonts) has some of these characters.
+%
+%<*ja>
+\item[ç¯å² 2${}^{\text{J}}$] ã®ãªã·ã£æåã¨ããªã«æåï¼JIS~X~0208ï¼ãããã£ã¦å¤ãã®
+ åæãã©ã³ãï¼ã¯ãããã®æåãæã¤ï¼
+%
+\begin{multicols}{2}
+\begin{itemize}
+%<*en>
+\item \texttt{U+0370}--\texttt{U+03FF}: Greek and Coptic
+\item \texttt{U+0400}--\texttt{U+04FF}: Cyrillic
+\item \texttt{U+1F00}--\texttt{U+1FFF}: Greek Extended
+%
+%<*ja>
+\item \texttt{U+0370}--\texttt{U+03FF}: ã®ãªã·ã¢æååã³ã³ããæå
+\item \texttt{U+0400}--\texttt{U+04FF}: ããªã«æå
+\item \texttt{U+1F00}--\texttt{U+1FFF}: ããªã«æåè£å©
+%
+\\\
+\end{itemize}
+\end{multicols}
+%<*en>
+\item[Range~3${}^{\text{J}}$] Punctuations and Miscellaneous symbols. The block list is
+ indicated in Table~\ref{table-rng3}.
+%
+%<*ja>
+\item[ç¯å² 3${}^{\text{J}}$] å¥èªç¹ã¨è¨å·é¡ï¼ãããã¯ã®ãªã¹ãã¯è¡¨~\ref{table-rng3}
+ ã«ç¤ºãã¦ããï¼
+%
+\begin{table}[!tb]
+%<*en>
+\caption{Unicode blocks in predefined character range~3.}
+%
+%<*ja>
+\caption{æåç¯å² 3 ã«æå®ããã¦ãã Unicode ãããã¯ï¼}
+%
+\label{table-rng3}
+\catcode`\"=13\def"#1#2#3#4{\texttt{U+#1#2#3#4}}%"
+\begin{center}\small
+\begin{tabular}{llll}
+%<*en>
+"2000--"206F&General Punctuation&
+"2070--"209F&Superscripts and Subscripts\\
+"20A0--"20CF&Currency Symbols&
+"20D0--"20FF&Comb.\ Diacritical Marks for Symbols\\
+"2100--"214F&Letterlike Symbols&
+"2150--"218F&Number Forms\\
+"2190--"21FF&Arrows&
+"2200--"22FF&Mathematical Operators\\
+"2300--"23FF&Miscellaneous Technical&
+"2400--"243F&Control Pictures\\
+"2500--"257F&Box Drawing&
+"2580--"259F&Block Elements\\
+"25A0--"25FF&Geometric Shapes&
+"2600--"26FF&Miscellaneous Symbols\\
+"2700--"27BF&Dingbats&
+"2900--"297F&Supplemental Arrows-B\\
+"2980--"29FF&Misc.\ Mathematical Symbols-B&
+"2B00--"2BFF&Miscellaneous Symbols and Arrows\\
+"E000--"F8FF&Private Use Area&
+%
+%<*ja>
+"2000--"206F&ä¸è¬å¥èªç¹&
+"2070--"209F&ä¸ä»ãã»ä¸ä»ã\\
+"20A0--"20CF&é貨è¨å·&
+"20D0--"20FF&è¨å·ç¨ãã¤ã¢ã¯ãªãã£ã«ã«ãã¼ã¯ï¼åæå¯è½ï¼\\
+"2100--"214F&æåæ§è¨å·&
+"2150--"218F&æ°åã«æºãããã®\\
+"2190--"21FF&ç¢å°&
+"2200--"22FF&æ°å¦è¨å·ï¼æ¼ç®åï¼\\
+"2300--"23FF&ãã®ä»ã®æè¡ç¨è¨å·&
+"2400--"243F&å¶å¾¡æ©è½ç¨è¨å·\\
+"2500--"257F&罫ç·ç´ ç&
+"2580--"259F&ãããã¯è¦ç´ \\
+"25A0--"25FF&å¹¾ä½å¦æ¨¡æ§&
+"2600--"26FF&ãã®ä»ã®è¨å·\\
+"2700--"27BF&è£
飾è¨å·&
+"2900--"297F&è£å©ç¢å°B\\
+"2980--"29FF&ãã®ä»ã®æ°å¦è¨å·B&
+"2B00--"2BFF&ãã®ä»ã®è¨å·åã³ç¢å°\\
+"E000--"F8FF&ç§ç¨é åï¼å¤åé åï¼&
+%
+\end{tabular}
\end{center}
-$\uparrow$ TODO: CHANGE THIS!
-
-
+\end{table}
+%<*en>
+\item[Range~4${}^{\text{A}}$] Characters usually not in Japanese fonts. This range consists
+ of almost all Unicode blocks which are not in other
+ predefined ranges. Hence, instead of showing the block list,
+ we put the definition of this range itself:
+%
+%<*ja>
+\item[ç¯å² 4${}^{\text{A}}$] é常åæãã©ã³ãã«ã¯å«ã¾ãã¦ããªãæåï¼
+ ãã®ç¯å²ã¯ä»ã®ç¯å²ã«ãªãã»ã¨ãã©å
¨ã¦ã® Unicode ãããã¯
+ ã§æ§æããã¦ããï¼ãããã£ã¦ï¼ãããã¯ã®ãªã¹ãã示ã
+ 代ããã«ï¼ç¯å²ã®å®ç¾©ãã®ãã®ã示ãï¼
+%
+\begin{lstlisting}
+\ltjdefcharrange{4}{%
+ "500-"10FF, "1200-"1DFF, "2440-"245F, "27C0-"28FF, "2A00-"2AFF,
+ "2C00-"2E7F, "4DC0-"4DFF, "A4D0-"A82F, "A840-"ABFF, "FB50-"FE0F,
+ "FE20-"FE2F, "FE70-"FEFF, "FB00-"FB4F, "10000-"1FFFF} % non-Japanese
+\end{lstlisting}
+%<*en>
+\item[Range~5${}^{\text{A}}$] Surrogates and Supplementary Private Use Areas.
+%
+%<*ja>
+\item[ç¯å² 5${}^{\text{A}}$] 代ç¨ç¬¦å·ã¨è£å©ç§ç¨é åï¼
+%
+%<*en>
+\item[Range~6${}^{\text{J}}$] Characters used in Japanese. The block list is indicated in Table~\ref{table-rng6}.
+%
+%<*ja>
+\item[ç¯å² 6${}^{\text{J}}$] æ¥æ¬èªã§ç¨ããããæåï¼ãããã¯ã®ãªã¹ãã¯
+ 表~\ref{table-rng6} ã«ç¤ºãï¼
+%
+\begin{table}[!tb]
+%<*en>
+\caption{Unicode blocks in predefined character range~6.}
+%
+%<*ja>
+\caption{æåç¯å² 6 ã«æå®ããã¦ãã Unicode ãããã¯ï¼}
+%
+\label{table-rng6}
+\catcode`\"=13\def"#1#2#3#4{\texttt{U+#1#2#3#4}}%"
+\begin{center}\small
+\begin{tabular}{llll}
+%<*en>
+"2460--"24FF&Enclosed Alphanumerics&
+"2E80--"2EFF&CJK Radicals Supplement\\
+"3000--"303F&CJK Symbols and Punctuation&
+"3040--"309F&Hiragana\\
+"30A0--"30FF&Katakana&
+"3190--"319F&Kanbun\\
+"31F0--"31FF&Katakana Phonetic Extensions&
+"3200--"32FF&Enclosed CJK Letters and Months\\
+"3300--"33FF&CJK Compatibility&
+"3400--"4DBF&CJK Unified Ideographs Extension A\\
+"4E00--"9FFF&CJK Unified Ideographs&
+"F900--"FAFF&CJK Compatibility Ideographs\\
+"FE10--"FE1F&Vertical Forms&
+"FE30--"FE4F&CJK Compatibility Forms\\
+"FE50--"FE6F&Small Form Variants&
+"{20}000--"{2F}FFF&(Supplementary Ideographic Plane)
+%
+%<*ja>
+"2460--"24FF&å²ã¿è±æ°å&
+"2E80--"2EFF&CJKé¨é¦è£å©\\
+"3000--"303F&CJKã®è¨å·åã³å¥èªç¹&
+"3040--"309F&平仮å\\
+"30A0--"30FF&çä»®å&
+"3190--"319F&æ¼¢æç¨è¨å·ï¼è¿ãç¹ï¼\\
+"31F0--"31FF&çä»®åæ¡å¼µ&
+"3200--"32FF&å²ã¿CJKæåã»æ\\
+"3300--"33FF&CJKäºæç¨æå&
+"3400--"4DBF&CJKçµ±åæ¼¢åæ¡å¼µA\\
+"4E00--"9FFF&CJKçµ±åæ¼¢å&
+"F900--"FAFF&CJKäºææ¼¢å\\
+"FE10--"FE1F&縦æ¸ãå½¢&
+"FE30--"FE4F&CJKäºæå½¢\\
+"FE50--"FE6F&å°åå½¢&
+"{20}000--"{2F}FFF&ï¼è¿½å å¤è¨èªé¢ï¼
+%
+\end{tabular}
+\end{center}
+\end{table}
+%<*en>
+\item[Range~7${}^{\text{J}}$] Characters used in CJK languages, but not included in Adobe-Japan1-6.
+The block list is indicated in Table~\ref{table-rng7}.
+%
+%<*ja>
+\item[ç¯å² 7${}^{\text{J}}$] CJK è¨èªã§ç¨ããããæåã®ãã¡ï¼Adobe-Japan1-6 ã«
+ å«ã¾ãã¦ããªããã®ï¼
+ ãããã¯ã®ãªã¹ãã¯è¡¨~\ref{table-rng7} ã«ç¤ºãï¼
+%
+\begin{table}[!tb]
+%<*en>
+\caption{Unicode blocks in predefined character range~7.}
+%
+%<*ja>
+\caption{æåç¯å² 7 ã«æå®ããã¦ãã Unicode ãããã¯ï¼}
+%
+\label{table-rng7}
+\catcode`\"=13\def"#1#2#3#4{\texttt{U+#1#2#3#4}}%"
+\begin{center}\small
+\begin{tabular}{llll}
+%<*en>
+"1100--"11FF&Hangul Jamo&
+"2F00--"2FDF&Kangxi Radicals\\
+"2FF0--"2FFF&Ideographic Description Characters&
+"3100--"312F&Bopomofo\\
+"3130--"318F&Hangul Compatibility Jamo&
+"31A0--"31BF&Bopomofo Extended\\
+"31C0--"31EF&CJK Strokes&
+"A000--"A48F&Yi Syllables\\
+"A490--"A4CF&Yi Radicals&
+"A830--"A83F&Common Indic Number Forms\\
+"AC00--"D7AF&Hangul Syllables&
+"D7B0--"D7FF&Hangul Jamo Extended-B
+%
+%<*ja>
+"1100--"11FF&ãã³ã°ã«åæ¯&
+"2F00--"2FDF&康çé¨é¦\\
+"2FF0--"2FFF&æ¼¢åæ§æè¨è¿°æå&
+"3100--"312F&注é³åæ¯ ï¼æ³¨é³ç¬¦å·ï¼\\
+"3130--"318F&ãã³ã°ã«äºæåæ¯&
+"31A0--"31BF&注é³åæ¯æ¡å¼µ\\
+"31C0--"31EF&CJKã®çç»&
+"A000--"A48F&ã¤æå\\
+"A490--"A4CF&ã¤æåé¨é¦&
+"A830--"A83F&å
±éã¤ã³ãæ°åã«æºãããã®\\
+"AC00--"D7AF&ãã³ã°ã«é³ç¯æå&
+"D7B0--"D7FF&ãã³ã°ã«åæ¯æ¡å¼µB
+%
+\end{tabular}
+\end{center}
+\end{table}
+\end{description}
+%\subsection{\Param{kanjiskip} and \Param{xkanjiskip}}
+%\subsection{\Param{kanjiskip} 㨠\Param{xkanjiskip}}
+\label{subs-kskip}
-\subsection{\textsf{kanjiskip} and \textsf{xkanjiskip}}\label{subs-kskip}
+%<*en>
\textbf{JAglue} is divided into the following three categories:
+%
+%<*ja>
+\textbf{JAglue} ã¯ä»¥ä¸ã®3ã¤ã®ã«ãã´ãªã«åé¡ãããï¼
+%
\begin{itemize}
-\item Glues/kerns specified in JFM. If \verb+\inhibitglue+ is issued around a Japanese character,
- this glue will be not inserted at the place.
-\item The default glue which inserted between two \textbf{JAchar}s ({\sf
+%<*en>
+\item Glues/kerns specified in JFM. If \verb+\inhibitglue+ is issued
+ around a Japanese character, this glue will be not inserted at the
+ place.
+%
+%<*ja>
+\item JFM ã§æå®ãããã°ã«ã¼ï¼ã«ã¼ã³ï¼ãã \verb+\inhibitglue+ ãåææåã®å¨ãã§
+ çºè¡ããã¦ããã°ï¼ãã®ã°ã«ã¼ã¯æ¿å
¥ãããªãï¼
+%
+%<*en>
+\item The default glue which inserted between two \textbf{JAchar}s (\Param{
kanjiskip}).
+%
+%<*ja>
+\item ããã©ã«ãã§2ã¤ã® \textbf{JAchar} ã®éã«æ¿å
¥ãããã°ã«ã¼ï¼\Param{kanjiskip}ï¼ï¼
+%
+%<*en>
\item The default glue which inserted between a \textbf{JAchar} and an
- \textbf{ALchar} (\textsf{xkanjiskip}).
+ \textbf{ALchar} (\Param{xkanjiskip}).
+%
+%<*ja>
+\item ããã©ã«ã㧠\textbf{JAchar} 㨠\textbf{ALchar} ã®éã«æ¿å
¥ãããã°ã«ã¼ï¼\Param{xkanjiskip}ï¼ï¼
+%
\end{itemize}
-The value (a skip) of \textsf{kanjiskip} or \textsf{xkanjiskip} can be
+%<*en>
+The value (a skip) of \Param{kanjiskip} or \Param{xkanjiskip} can be
changed as the following.
-\begin{verbatim}
-\ltjsetparameter{kanjiskip={0pt plus 0.4pt minus 0.4pt},
+%
+%<*ja>
+\Param{kanjiskip} ã \Param{xkanjiskip} ã®å¤ã¯ä»¥ä¸ã®ããã«ãã¦å¤æ´å¯è½ã§ãã.
+%
+\begin{lstlisting}
+\ltjsetparameter{kanjiskip={0pt plus 0.4pt minus 0.4pt},
xkanjiskip={0.25\zw plus 1pt minus 1pt}}
-\end{verbatim}
-
-
-It may occur that JFM contains the data of `ideal width of {\sf
-kanjiskip}' and/or `ideal width of \textsf{xkanjiskip}'.
-To use these data from JFM, set the value of \textsf{kanjiskip} or
-\textsf{xkanjiskip} to \verb+\maxdimen+.
+\end{lstlisting}
-\subsection{Insertion Setting of \textsf{xkanjiskip}}
-It is not desirable that \textsf{xkanjiskip} is inserted between every
+%<*en>
+It may occur that JFM contains the data of `ideal width of \Param{kanjiskip}'
+and/or `ideal width of \Param{xkanjiskip}'.
+To use these data from JFM, set the value of \Param{kanjiskip} or
+\Param{xkanjiskip} to \verb+\maxdimen+.
+%
+%<*ja>
+JFM ã¯ãæã¾ãã \Param{kanjiskip} ã®å¤ãããæã¾ãã \Param{xkanjiskip} ã®å¤ãã
+æã£ã¦ãããã¨ãããï¼
+ãããã®ãã¼ã¿ã使ãããã«ã¯ï¼\Param{kanjiskip} ã \Param{xkanjiskip} ã®å¤ã
+\verb+\maxdimen+ ã®å¤ã«è¨å®ããã°ããï¼
+%
+
+%\subsection{Insertion Setting of \Param{xkanjiskip}}
+%\subsection{\Param{xkanjiskip} ã®è¨å®ã®æ¿å
¥}
+
+%<*en>
+It is not desirable that \Param{xkanjiskip} is inserted into every
boundary between \textbf{JAchar}s and \textbf{ALchar}s. For example,
-\textsf{xkanjiskip} should not be inserted after opening parenthesis
+\Param{xkanjiskip} should not be inserted after opening parenthesis
(\textit{e.g.}, compare `(ã' and `(\hskip\ltjgetparameter{xkanjiskip}ã').
-
-Lua\TeX-ja can control whether \textsf{xkanjiskip} can be inserted
-before/after a character, by changing \textsf{jaxspmode} for \textbf{JAchar}s and
-\textsf{alxspmode} parameters \textbf{ALchar}s respectively.
+\LuaTeX-ja can control whether \Param{xkanjiskip} can be inserted
+before/after a character, by changing \Param{jaxspmode} for \textbf{JAchar}s and
+\Param{alxspmode} parameters \textbf{ALchar}s respectively.
+%
+%<*ja>
+\Param{xkanjiskip} ããã¹ã¦ã® \textbf{JAchar} 㨠\textbf{ALchar} ã®å¢çã«
+æ¿å
¥ãããã®ã¯æã¾ãããã¨ã§ã¯ãªãï¼ä¾ãã°ï¼\Param{xkanjiskip} ã¯éãæ¬å¼§ã®
+å¾ã«ã¯æ¿å
¥ãããã¹ãã§ã¯ãªãï¼`(ã' 㨠`(\hskip\ltjgetparameter{xkanjiskip}ã' ã
+æ¯ã¹ã¦ã¿ãï¼ï¼
+\LuaTeX-ja ã§ã¯ \Param{xkanjiskip} ãããæåã®åï¼å¾ã«æ¿å
¥ãããã©ãããï¼
+\textbf{JAchar} ã«å¯¾ãã¦ã¯ \Param{jaxspmode} ãï¼\textbf{ALchar} ã«å¯¾ãã¦ã¯
+\Param{alxspmode} ãããããå¤ãããã¨ã§å¶å¾¡ãããã¨ãã§ããï¼
+%
\begin{LTXexample}
-\ltjsetparameter{jaxspmode={`ã,preonly}, alxspmode={`\!,postonly}}
+\ltjsetparameter{jaxspmode={`ã,preonly}, alxspmode={`\!,postonly}}
pãq ã!ã
\end{LTXexample}
-The second argument {\tt preonly} means `the insertion of
-\textsf{xkanjiskip} is allowed before this character, but not after'.
-the other possible values are {\tt postonly}, {\tt allow} and {\tt
-inhibit}. For the compatibility with p\TeX, natural numbers between
-0~and~3 are also allowed as the second argument\footnote{But we don't
-recommend this: since numbers 1~and~2 have opposite meanings in
-\textsf{jaxspmode} and \textsf{alxspmode}.}.
-
-If you want to enable/disable all insertions of \textsf{kanjiskip} and
-\textsf{xkanjiskip}, set \textsf{autospacing} and \textsf{autoxspacing}
-parameters to {\tt false}, respectively.
-
-
-\subsection{Shifting Baseline}
+%<*en>
+The second argument \texttt{preonly} means `the insertion of
+\Param{xkanjiskip} is allowed before this character, but not after'.
+the other possible values are \texttt{postonly}, \texttt{allow} and \texttt{
+inhibit}. ...
+%
+%<*ja>
+2ã¤ç®ã®å¼æ°ã® \texttt{preonly} ã¯ã\Param{xkanjiskip} ã®æ¿å
¥ã¯ãã®æåã®
+åã§ã®ã¿è¨±ããï¼å¾ã§ã¯è¨±ããªãããã¨ãæå³ããï¼ä»ã«æå®å¯è½ãªå¤ã¯
+\texttt{postonly}, \texttt{allow}, \texttt{inhibit} ã§ããï¼
+
+ãªãï¼ç¾è¡ã®
+ä»æ§ã§ã¯ï¼\Param{jaxspmode}, \Param{alxspmode} ã¯ãã¼ãã«ãå
±æãã¦ããï¼
+ä¸ã®ã½ã¼ã¹ã®1è¡ç®ã次ã®ããã«å¤ãã¦ãåããã¨ã«ãªãï¼
+\begin{verbatim}
+\ltjsetparameter{alxspmode={`ã,preonly}, jaxspmode={`\!,postonly}}
+\end{verbatim}
+ã¾ãï¼ããã2ãã©ã¡ã¼ã¿ã«ã¯æ°å¤ã§å¤ãæå®ãããã¨ãã§ããï¼ç¬¬\ref{part-ref}é¨ãåç
§ï¼ï¼
+%
+
+%<*en>
+If you want to enable/disable all insertions of \Param{kanjiskip} and
+\Param{xkanjiskip}, set \Param{autospacing} and \Param{autoxspacing}
+parameters to \texttt{true}/\texttt{false}, respectively.
+%
+%<*ja>
+ããå
¨ã¦ã® \Param{kanjiskip} 㨠\Param{xkanjiskip} ã®æ¿å
¥ãæå¹åï¼ç¡å¹å
+ããããã°ï¼ãããã \Param{autospacing} 㨠\Param{autoxspacing} ã
+\texttt{true}/\texttt{false} ã«è¨å®ããã°ããï¼
+%
+
+%\subsection{Shifting Baseline}
+%\subsection{ãã¼ã¹ã©ã¤ã³ã®ç§»å}
+
+%<*en>
To make a match between a Japanese font and an alphabetic font, sometimes
-shifting of the baseline of one of the pair is needed. In p\TeX, this is achieved
+shifting of the baseline of one of the pair is needed. In \pTeX, this is achieved
by setting \verb+\ybaselineshift+ to a non-zero length (the
baseline of alphabetic fonts is shifted below). However, for documents
whose main language is not Japanese, it is good to shift the baseline of
Japanese fonts, but not that of alphabetic fonts.
-Because of this, Lua\TeX-ja can independently set the shifting amount
-of the baseline of alphabetic fonts (\textsf{yalbaselineshift}
-parameter) and that of Japanese fonts (\textsf{yjabaselineshift}
-parameter).
+Because of this, \LuaTeX-ja can independently set the shifting amount
+of the baseline of alphabetic fonts (\Param{yalbaselineshift}
+parameter) and that of Japanese fonts (\Param{yjabaselineshift}
+parameter).
+%
+%<*ja>
+åæãã©ã³ãã¨æ¬§æãã©ã³ããåãããããã«ã¯ï¼æã
ã©ã¡ããã®ãã¼ã¹ã©ã¤ã³ã®ç§»åã
+å¿
è¦ã«ãªãï¼\pTeX ã§ã¯ãã㯠\verb+\ybaselineshift+ ãéé¶ã®é·ãã«è¨å®ãããã¨ã§
+ãªããã¦ããï¼æ¬§æãã©ã³ãã®ãã¼ã¹ã©ã¤ã³ãä¸ããï¼ï¼ãããï¼æ¥æ¬èªã主ã§ã¯ãªã
+ææ¸ã«å¯¾ãã¦ã¯ï¼æ¬§æãã©ã³ãã§ã¯ãªãåæãã©ã³ãã®ãã¼ã¹ã©ã¤ã³ã移åããæ¹ãããï¼
+ãã®ããï¼\LuaTeX-ja ã§ã¯æ¬§æãã©ã³ãã®ãã¼ã¹ã©ã¤ã³ã®ã·ããé
+ï¼\Param{yalbaselineshift} ãã©ã¡ã¼ã¿ï¼ã¨åæãã©ã³ãã®ãã¼ã¹ã©ã¤ã³ã®ã·ããé
+ï¼\Param{yjabaselineshift}ãã©ã¡ã¼ã¿ï¼ãç¬ç«ã«è¨å®ã§ããããã«ãªã£ã¦ããï¼
+%
\begin{LTXexample}
\vrule width 150pt height 0.4pt depth 0pt\hskip-120pt
\ltjsetparameter{yjabaselineshift=0pt, yalbaselineshift=0pt}abcããã
\ltjsetparameter{yjabaselineshift=5pt, yalbaselineshift=2pt}abcããã
\end{LTXexample}
+%<*en>
Here the horizontal line in above is the baseline of a line.
+%
+%<*ja>
+ä¸ã®ä¾ã«ããã¦å¼ããã¦ããæ°´å¹³ç·ããã¼ã¹ã©ã¤ã³ã§ããï¼
+%
+%<*en>
There is an interesting side-effect: characters in different size can be
vertically aligned center in a line, by setting two parameters appropriately.
The following is an example (beware the value is not well tuned):
+%
+%<*ja>
+ãã®æ©è½ã«ã¯é¢ç½ã使ãæ¹ãããï¼2ã¤ã®ãã©ã¡ã¼ã¿ãé©åã«è¨å®ãããã¨ã§ï¼ãµã¤ãºã®
+ç°ãªãæåãä¸å¿ç·ã«æãããã¨ãã§ããã®ã ï¼
+以ä¸ã¯ä¸ã¤ã®ä¾ã§ããï¼å¤ã¯ãã¾ã調æ´ããã¦ããªããã¨ã«æ³¨æï¼ï¼
+%
\begin{LTXexample}
-xyzæ¼¢å
+xyzæ¼¢å
{\scriptsize
- \ltjsetparameter{yjabaselineshift=-1pt,
+ \ltjsetparameter{yjabaselineshift=-1pt,
yalbaselineshift=-1pt}
XYZã²ãããª
}abcããª
\end{LTXexample}
-\subsection{`tombow'}
-`tombow' is a mark for indicating 4~corners and horizontal/vertical
-center of the paper. p\LaTeX and this Lua\TeX-ja support `tombow' by
-their kernel. The following steps are needed to typeset tombow:
+%\subsection{Cropmark}
+%\subsection{ãã³ã}
+
+%<*en>
+Cropmark is a mark for indicating 4~corners and horizontal/vertical
+center of the paper. In Japanese, we call cropmark as tombo(w).
+\pLaTeX\ and this \LuaTeX-ja support `tombow' by their kernel.
+The following steps are needed to typeset cropmark:
+%
+%<*ja>
+ãã³ãã¯ç¨ç´ã®åã¤è§ã¨æ°´å¹³ï¼åç´æ¹åã®ä¸å¿ã表ãå°ã§ããï¼
+\pLaTeX 㨠\LuaTeX-ja ã§ã¯ãã³ãã®åºåããµãã¼ããã¦ããï¼
+ãã³ããåºåããããã«ã¯ä»¥ä¸ã®æé ãå¿
è¦ã§ããï¼
+%
\begin{enumerate}
+%<*en>
\item First, define the banner which will be printed at the upper left
of the paper. This is done by assigning a token list to
\verb+\@bannertoken+.
-For example, the following sets banner as `{\tt filename (2012-01-01 17:01)}':
+For example, the following sets banner as `\texttt{filename (YYYY-MM-DD hh:mm)}':
+%
+%<*ja>
+\item ã¾ãï¼ç¨ç´ã®å·¦ä¸ã«å°å·ãããããã¼ãå®ç¾©ããï¼ãã㯠\verb+\@bannertoken+
+ ã«ãã¼ã¯ã³ãªã¹ããä¸ãããã¨ã§ãªãããï¼
+
+ä¾ãã°ï¼ä»¥ä¸ã¯ããã¼ã¨ã㦠`\texttt{filename (YYYY-MM-DD hh:mm)}' ãè¨å®ãã:
+%
+
\begin{verbatim}
\makeatletter
@@ -495,41 +1699,225 @@ For example, the following sets banner as `{\tt filename (2012-01-01 17:01)}':
\end{enumerate}
-\part{Reference}\label{part-ref}
-\section{Font Metric and Japanese Font}
-\subsection{\texttt{\char92jfont} primitive}
+%\part{Reference}
+%\part{ãªãã¡ã¬ã³ã¹}
+\label{part-ref}
+%\section{Font Metric and Japanese Font}
+%\section{ãã©ã³ãã¡ããªãã¯ã¨åæãã©ã³ã}
+%\subsection{\texttt{\char92jfont} primitive}
+%\subsection{\texttt{\char92jfont} ããªããã£ã}
+
+%<*en>
To load a font as a Japanese font, you must use the
\verb+\jfont+ primitive instead of~\verb+\font+, while
-\verb+\jfont+ admits the same syntax used in~\verb+\font+.
-Lua\TeX-ja automatically loads \texttt{luaotfload} package,
+\verb+\jfont+ admits the same syntax used in~\verb+\font+.
+\LuaTeX-ja automatically loads \Pkg{luaotfload} package,
so TrueType/OpenType fonts with features can be used for Japanese fonts:
+%
+%<*ja>
+ãã©ã³ããåæãã©ã³ãã¨ãã¦èªã¿è¾¼ãããã«ã¯ï¼\verb+\jfont+ ããªããã£ãã
+\verb+\font+ ããªããã£ãã®ä»£ããã«ç¨ããï¼
+\verb+\jfont+ ããªããã£ãã®ææ³ã¯ \verb+\font+ ã¨åãã§ããï¼
+\LuaTeX-ja 㯠\Pkg{luaotfload} ããã±ã¼ã¸ãèªåçã«èªã¿è¾¼ãã®ã§ï¼
+TrueType/OpenType ãã©ã³ãã« feature ãæå®ãããã®ãåæãã©ã³ãã¨ãã¦ç¨ãã
+ãã¨ãã§ããï¼
+%
\begin{LTXexample}
\jfont\tradgt={file:ipaexg.ttf:script=latn;%
- +trad;jfm=ujis} at 14pt
+ +trad;-kern;jfm=ujis} at 14pt
\tradgt{}å½ï¼ä½ï¼å»ï¼åº
\end{LTXexample}
+%<*en>
Note that the defined control sequence
(\verb+\tradgt+ in the example above) using \verb+\jfont+ is not a
-\textit{font\_def} token, hence the input like
-\verb+\fontname\tradgt+ causes a error. We denote control sequences which are defined in \verb+\jfont+
-by .
+\textit{font\_def} token, hence the input like \verb+\fontname\tradgt+
+causes a error. We denote control sequences which are defined in
+\verb+\jfont+ by .
+%
+%<*ja>
+ãªãï¼\verb+\jfont+ ã§å®ç¾©ãããã³ã³ããã¼ã«ã·ã¼ã±ã³ã¹ï¼ä¸ã®ä¾ã 㨠\verb+\tradgt+ï¼
+㯠\textit{font\_def} ãã¼ã¯ã³ã§ã¯ãªãã®ã§ï¼\verb+\fontname\tradgt+ ã®ãããª
+å
¥åã¯ã¨ã©ã¼ã¨ãªããã¨ã«æ³¨æããï¼ä»¥ä¸ã§ã¯ \verb+\jfont+ ã§å®ç¾©ããã
+ã³ã³ããã¼ã«ã·ã¼ã±ã³ã¹ã ã§è¡¨ãï¼
+%
+
+%\paragraph{Prefix \texttt{psft}}
+%\paragraph{\texttt{psft} ãã¬ãã£ãã¯ã¹}
+%<*en>
+Besides \texttt{file:}\ and \texttt{name:}\ prefixes, \texttt{psft:}\
+can be used a prefix in \verb+\jfont+ (and~\verb+\font+) primitive.
+Using this prefix, you can specify a `name-only' Japanese font which
+will be not embedded to PDF. Typical use of this prefix is to specify
+the `standard' Japanese fonts, namely, `Ryumin-Light' and
+`GothicBBB-Medium'. For kerning or other information, that of Kozuka
+Mincho Pr6N Regular (this is a font by Adobe Inc., and included in
+Japanese Font Packs for Adore Reader) will be used.
+%
+%<*ja>
+\texttt{file:} 㨠\texttt{name:} ã®ãã¬ãã£ãã¯ã¹ã«å ãã¦ï¼
+\verb+\jfont+ ããªããã£ãï¼ã¨ \verb+\font+ ããªããã£ãï¼ã§ã¯
+\texttt{psft:} ãã¬ãã£ãã¯ã¹ç¨ãããã¨ãã§ããï¼
+ãã®ãã¬ãã£ãã¯ã¹ãç¨ãããã¨ã§ï¼PDF ã«ã¯åãè¾¼ã¾ããªããååã ãã®ã
+åæãã©ã³ããæå®ãããã¨ãã§ããï¼å
¸åçãªä½¿ãæ¹ã¯ãæ¨æºçãªãåæãã©ã³ãï¼
+ã¤ã¾ã `Ryumin-Light' 㨠`GothicBBB-Medium' ãæå®ãããã¨ã§ããï¼
+ãã®å ´åï¼ã«ã¼ãã³ã°ä»ã®æ
å ±ã¯å°å¡ææ Pr6N Regular
+ï¼Adobe 社ã«ãããã©ã³ãã§ï¼Adobe Reader ã®æ¥æ¬èªãã©ã³ãããã¯ã«å«ã¾ãã¦ããï¼
+ãç¨ããããï¼
+%
+
+\paragraph{JFM}
+%<*en>
+As noted in Introduction, a JFM has measurements of characters and
+glues/kerns that are automatically inserted for Japanese
+typesetting. The structure of JFM will be described in the next
+subsection. At the calling of \verb+\jfont+ primitive, you must specify
+which JFM will be used for this font by the following keys:
+%
+%<*ja>
+ãã¯ããã«ãã®ç¯ã§è¿°ã¹ãããã«ï¼JFM ã¯æåã¨åæçµçã§èªåçã«æ¿å
¥ããã
+ã°ã«ã¼ï¼ã«ã¼ã³ã®å¯¸æ³æ
å ±ãæã£ã¦ããï¼JFM ã®æ§é ã¯æ¬¡ã®å°ç¯ã§è¿°ã¹ãï¼
+\verb+\jfont+ ããªããã£ãã®å¼ã³åºãã®éã«ã¯ï¼ã©ã® JFM ãç¨ããã®ãã以ä¸ã®ãã¼ã§
+æå®ããå¿
è¦ãããï¼
+%
-\paragraph{Prefix}
-Besides \texttt{file:}\ and \texttt{name:}\ prefixes, \texttt{psft:}\ can
-be used a prefix in \verb+\jfont+ (and~\verb+\font+) primitive. Using
-this prefix, you can specify a font that has its name only and is not
-related to any real font.
+\begin{list}{}{\def\makelabel{\ttfamily}\def\{{\char`\{}\def\}{\char`\}}}
+\item[jfm=]
+%<*en>
+Specify the name of JFM. If specified JFM has not been loaded, \LuaTeX-ja search and load
+a file named \texttt{jfm-.lua}.
+
+The following JFMs are shipped with \LuaTeX-ja:
+%
+%<*ja>
+JFM ã®ååãæå®ããï¼ãã以åã«æå®ãããJFMãèªã¿è¾¼ã¾ãã¦ããªããã°ï¼
+\texttt{jfm-.lua} ãèªã¿è¾¼ãï¼
+
+以ä¸ã® JFM ã \LuaTeX-ja ã«ã¯å梱ããã¦ããï¼
+%
+\begin{description}
+%<*en>
+\item[\tt jfm-ujis.lua] A standard JFM in \LuaTeX-ja. This JFM is
+ based on \verb+upnmlminr-h.tfm+, a metric for UTF/OTF package that
+ is used in \upTeX. When you use the \Pkg{luatexja-otf} package, you should use this JFM.
+%
+%<*ja>
+\item[\tt jfm-ujis.lua] \LuaTeX-ja ã®æ¨æº JFM ã§ããï¼ãã® JFM 㯠\upTeX ã§
+ ç¨ãããã UTF/OTF ããã±ã¼ã¸ç¨ã®ã¡ããªãã¯ã§ãã \verb+upnmlminr-h.tfm+ ã
+ å
ã«ãã¦ããï¼\Pkg{luatexja-otf} ããã±ã¼ã¸ã使ãã¨ãã¯ãã® JFM ãæå®ããã¹ãã§ããï¼
+%
+%<*en>
+\item[\tt jfm-jis.lua] A counterpart for \verb+jis.tfm+, `JIS font
+ metric' which is widely used in \pTeX. A major difference of
+ \texttt{jfm-ujis.lua} and this \texttt{jfm-jis.lua} is that
+ most characters under \texttt{jfm-ujis.lua} are square-shaped,
+ while that under \texttt{jfm-jis.lua} are horizontal
+ rectangles.
+%
+%<*ja>
+\item[\tt jfm-jis.lua] \pTeX ã§åºãç¨ãããã¦ãããJIS ãã©ã³ãã¡ããªãã¯ã
+ \verb+jis.tfm+ ã«ç¸å½ãã JFM ã§ããï¼\texttt{jfm-ujis.lua} ã¨ãã®
+ \texttt{jfm-jis.lua} ã®ä¸»ãªéãã¯ï¼\texttt{jfm-ujis.lua} ã§ã¯ã»ã¨ãã©ã®æåã
+ æ£æ¹å½¢ç¶ã§ããã®ã«å¯¾ãï¼\texttt{jfm-jis.lua} ã§ã¯æ¨ªé·ã®é·æ¹å½¢ç¶ã§ããï¼
+%
+%<*en>
+\item[\tt jfm-min.lua] A counterpart for \verb+min10.tfm+, which is one
+ of the default Japanese font metric shipped with \pTeX. There
+ are notable difference between this JFM and other 2~JFMs, as
+ shown in Table~\ref{tab-difjfm}.
+%
+%<*ja>
+\item[\tt jfm-min.lua] \pTeX ã«å梱ããã¦ããããã©ã«ãã®åæãã©ã³ãã¡ããªãã¯
+ ã§ãã \verb+min10.tfm+ ã«ç¸å½ãã JFM ã§ããï¼ãã® JFM ã¨ä»ã®2ã¤ã® JFM ã®éã«ã¯
+ 表 \ref{tab-difjfm} ã«ç¤ºããããªç¹çãã¹ãéããããï¼
+%
+\end{description}
-Mainly, use of this \texttt{psft:}\ prefix is for using non-embedding `standard' Japanese fonts (Ryumin-Light and GothicBBB-Medium).
-æ´å²
+\item[jfmvar=] Sometimes there is a need that ...
+\end{list}
-\paragraph{Features}
-jfm, jfmvar
+\begin{table}[t]
+%\caption{Differences between JFMs shipped with \LuaTeX-ja}
+%\caption{\LuaTeX-ja ã«å梱ããã¦ãã JFM ã®éã}
+\label{tab-difjfm}
+\ltjsetparameter{jacharrange={+3}}
+\begin{center}
+\def\r#1{{\jfont\g=psft:Ryumin-Light:jfm=#1 at 14.43324pt \g
+\setbox0=\vtop{\hsize=7\zw\noindent âââââââ
+ããæ¥ã¢ã¢ã¡ãããã使ãã§è¿·åã«ãªã£ã¦æ³£ãã¾ããï¼}\copy0
+\vrule height 0pt depth \dp0}}
+\def\s#1{{\jfont\g=psft:Ryumin-Light:jfm=#1 at 14.43324pt \g
+\setbox0=\vtop{\hsize=7\zw\noindent ã¡ãã£ã¨ï¼ä½}\copy0}}
+\def\t#1{{\jfont\g=psft:Ryumin-Light:jfm=#1 at 19.24432pt \g
+\setbox0=\hbox{æ¼¢}%
+\vrule width 0.4pt height\ht0 depth\dp0\kern-.2pt\copy0
+\kern-\wd0\vrule width\wd0height .2pt depth .2pt
+\kern-\wd0\raise\ht0\hbox{\vrule width\wd0height .2pt depth .2pt}%
+\kern-\wd0\lower\dp0\hbox{\vrule width\wd0height .2pt depth .2pt}%
+\kern-.2pt\vrule width 0.4pt height\ht0 depth \dp0}}
+\begin{tabular}{rccc}
+\toprule
+&\tt jfm-ujis.lua&\tt jfm-jis.lua&\tt jfm-min.lua\\
+\midrule
+%Example~1\footnotemark
+%ä¾1\footnotemark
+&\r{ujis}&\r{jis}&\r{min}\\
+%Example~2
+%ä¾2
+&\s{ujis}&\s{jis}&\s{min}\\
+Bounding Box&\t{ujis}&\t{jis}&\t{min}\\
+\bottomrule
+\end{tabular}
+\end{center}
+\ltjsetparameter{jacharrange={-3}}
+\end{table}
+\footnotetext{from: ä¹é¨å³å·±, min10ãã©ã³ãã«ã¤ãã¦.
+\texttt{http://argent.shinshu-u.ac.jp/\~{\ }otobe/tex/files/min10.pdf}.}
+
+%\paragraph{Note: kern feature}
+%\paragraph{注æï¼kern feature}
+\label{para-kern}
+%<*en>
+Some fonts have information for inter-glyph spacing. However, this
+information is not well-compatible with \LuaTeX-ja. More concretely,
+this kerning space from this information are inserted \emph{before} the
+insertion process of \textbf{JAglue}, and this causes incorrect spacing
+between two characters when both a glue/kern from the data in the font
+and it from JFM are present.
+%
+%<*ja>
+ããã¤ãã®ãã©ã³ãã¯ã°ãªãéã®ã¹ãã¼ã¹ã«ã¤ãã¦ã®æ
å ±ãæã£ã¦ããï¼ãããï¼
+ãã®æ
å ±ã¯ \LuaTeX-ja ã¨ã¯ãã¾ãç¸æ§ããããªãï¼å
·ä½çã«ã¯ï¼ãã®æ
å ±ã«åºã¥ãã¦æ¿å
¥
+ãããã«ã¼ãã³ã°ã¹ãã¼ã¹ã¯ \textbf{JAglue} ã®æ¿å
¥éç¨ã®\textbf{åã«}æ¿å
¥ããï¼
+JFM ã«åºã¥ãã°ã«ã¼ï¼ã«ã¼ã³ãæ¿å
¥ãããå ´åã«ã¯2æåéã®æå³ããªãã¹ãã¼ã¹ã®åå ã¨
+ãªãï¼
+%
+\begin{itemize}
+%<*en>
+\item You should specify \texttt{-kern} in
+ \verb+jfont+ primitive, when you want to use other font features,
+ such as \texttt{script=...}\,.
+%
+%<*ja>
+\item \texttt{script=...} ã¨ãã£ã feature ã使ãããå ´åã«ã¯ï¼\verb+\jfont+
+ ããªããã£ãã« \texttt{-kern} ãæå®ããã¹ãã§ããï¼
+%
+%<*en>
+\item If you want to use Japanese fonts in proportional width, and use
+ information from this font, use \texttt{jfm-prop.lua} for its JFM, and ...
+%
+%<*ja>
+\item ãããããã¼ã·ã§ãã«å¹
ã®åæãã©ã³ãããã®ãã©ã³ãã®æ
å ±ã«åºã¥ãã¦ä½¿ããã
+ ãªãã°ï¼\texttt{jfm-prop.lua} ã JFM ã¨ãã¦æå®ãï¼â¦â¦
+%
+
+TODO: kanjiskip?
+\end{itemize}
-\subsection{Structure of JFM file}
+%\subsection{Structure of JFM file}
+%\subsection{JFM ãã¡ã¤ã«ã®æ§é }
A JFM file is a Lua script which has only one function call:
\begin{verbatim}
luatexja.jfont.define_jfm { ... }
@@ -552,9 +1940,9 @@ The amount of the length of the `full-width'.
\item[kanjiskip=\{, , \}] (optional)
-This field specifies the `ideal' amount of \textsf{kanjiskip}. As noted
+This field specifies the `ideal' amount of \Param{kanjiskip}. As noted
in Subsection~\ref{subs-kskip}, if the parameter
- \textsf{kanjiskip} is \verb+\maxdimen+, the value specified
+ \Param{kanjiskip} is \verb+\maxdimen+, the value specified
in this field is actually used (if this field is not specified in
JFM, it is regarded as 0\,pt). Note that and
fields are in design-size unit too.
@@ -562,14 +1950,14 @@ This field specifies the `ideal' amount of \textsf{kanjiskip}. As noted
\item[xkanjiskip=\{, , \}] (optional)
-Like the \texttt{kanjiskip} field, this field specifies the `ideal'
- amount of \textsf{xkanjiskip}.
+Like the \Param{kanjiskip} field, this field specifies the `ideal'
+ amount of \Param{xkanjiskip}.
\end{list}
Besides from above fields, a JFM file have several sub-tables those
indices are natural numbers. The table indexed by~$i\in\omega$ stores
-informations of `character class'~$i$. At least, the character class~0 is
+information of `character class'~$i$. At least, the character class~0 is
always present, so each JFM file must have a sub-table whose index is
\texttt{[0]}. Each sub-table (its numerical index is denoted by $i$) has
the following fields:
@@ -583,19 +1971,17 @@ This field is a list of characters which are in this character
than 0 (hence, the character class~0 contains most of
\textbf{JAchar}s). In the list, a character can be
specified by its code number, or by the character itself
- (as a string of length~1).
-
-In addition to those `real' characters, the following `imaginary
- characters' can be specified in the list:
+ (as a string of length~1). Moreover, there are `imaginary
+ characters' which specified in the list. We will describe these later.
\item[width=, height=, depth=, italic=]\ (required)
Specify width of characters in character class~$i$, height, depth and
the amount of italic correction. All characters in character class~$i$ are regarded that its width, height and depth are
-as values of these fields.
-But there is one exception: if \texttt{'prop'} is specified in \texttt{width} field, width of a character becomes that of its `real' glyph
+as values of these fields.
+But there is one exception: if \texttt{'prop'} is specified in \texttt{width} field, width of a character becomes that of its `real' glyph
-\item[left=, down=, align=]\
+\item[left=, down=, align=]\
These fields are for adjusting the position of the `real' glyph. Legal
values of \texttt{align} field are \texttt{'left'},
@@ -607,9 +1993,9 @@ The effects of these 3~fields are indicated in Figure~\ref{fig-pos}.
In most cases, \texttt{left} and \texttt{down} fields are~0, while
it is not uncommon that the \texttt{align} field is \texttt{'middle'} or \texttt{'right'}.
-For example, setting the \texttt{align} field to \texttt{'right'} is practically needed
-when the current character class is the class for opening delimiters'.
-\begin{figure}[tb]
+For example, setting the \texttt{align} field to \texttt{'right'} is practically needed
+when the current character class is the class for opening delimiters'.
+\begin{figure}[!tb]
\begin{minipage}{0.4\textwidth}%
\begin{center}\unitlength=10pt\small
\begin{picture}(15,12)(-1,-4)
@@ -659,23 +2045,23 @@ when the current character class is the class for opening delimiters'.
\put(1,-1.7){\makebox(0,0)[t]{\texttt{left}}}
\put(3,0){\vector(0,-1){1.5}}
\put(3.2,-0.75){\makebox(0,0)[l]{\texttt{down}}}
-\end{picture}
+\end{picture}
\end{center}
\end{minipage}%
\begin{minipage}{0.6\textwidth}%
-Consider a node containing Japanese character whose value of the \texttt{align}
+Consider a node containing Japanese character whose value of the \texttt{align}
field is \texttt{'middle'}.
\begin{itemize}
\item The black rectangle is a frame of the node.
Its width, height and depth are specified by JFM.
-\item Since the \texttt{align} field is \texttt{'middle'},
+\item Since the \texttt{align} field is \texttt{'middle'},
the `real' glyph is centered horizontally (the green rectangle).
\item Furthermore, the glyph is shifted according to values of fields
\texttt{left} and \texttt{down}. The ultimate position of the real
glyph is indicated by the red rectangle.
\end{itemize}
\end{minipage}
-\caption{The position of the `real' glyph}
+\caption{The position of the `real' glyph.}
\label{fig-pos}
\end{figure}
@@ -685,39 +2071,238 @@ the `real' glyph is centered horizontally (the green rectangle).
\item[glue={\{[$j$]=\{, , \}, ...\}}]
\end{list}
-\subsection{Math Font Family}
+%<*en>
+\begin{list}{}{\def\makelabel{\ttfamily}\def\{{\char`\{}\def\}{\char`\}}}
+\item['lineend'] An ending of a line.
+\item['diffmet'] Used at a boundary between two \textbf{JAchar}s whose JFM or size is different.
+\item['boxbdd'] The beginning/ending of a horizontal box, and the beginning of a noindented paragraph.
+\item['parbdd'] The beginning of an (indented) paragraph.
+\item['jcharbdd'] A boundary between \textbf{JAchar} and anything else
+ (such as \textbf{ALchar}, kern, glue, ...).
+\item[$-1$] The left/right boundary of an inline math formula.
+\end{list}
+%
+%<*ja>
+ä¸ã§èª¬æããéãï¼\texttt{chars}ãã£ã¼ã«ãä¸ã«ã¯ããã¤ãã®ãç¹æ®æåãã
+æå®å¯è½ã§ããï¼ãããã¯ï¼å¤§åã\pTeX ã®JFMã°ã«ã¼ã®æ¿å
¥å¦çã§ã¯ã¿ãªãæå
+ã¯ã©ã¹0ã®æåãã¨ãã¦æ±ããã¦ããæåã§ããï¼ãã®çµæã¨ãã¦\pTeX ããç´°ã
+ãçµç調æ´ãã§ããããã«ãªã£ã¦ããï¼ä»¥ä¸ã§ãã®ä¸è¦§ãè¿°ã¹ãï¼
+\begin{list}{}{\def\makelabel{\ttfamily}\def\{{\char`\{}\def\}{\char`\}}}
+\item['lineend'] è¡ã®çµç«¯ã表ãï¼
+\item['diffmet']
+
+\item['boxbdd'] hboxã®å
é ã¨æ«å°¾ï¼åã³ã¤ã³ãã³ãããã¦ããªã
+ ï¼\verb+\noindent+ã§éå§ãããï¼æ®µè½ã®å
é ã表ãï¼
+\item['parbdd'] é常ã®ï¼\verb+\noindent+ã§éå§ããã¦ããªãï¼æ®µè½ã®å
é ï¼
+\item['jcharbdd'] åææåã¨ããã®ä»ã®ãã®ãï¼æ¬§ææåï¼glueï¼kernçï¼ã¨ã®å¢çï¼
+\item[$-1$] è¡ä¸æ°å¼ã¨å°ã®æã¨ã®å¢çï¼
+\end{list}
+
+\paragraph{\pTeX ç¨åæãã©ã³ãã¡ããªãã¯ã®ç§»æ¤}
+以ä¸ã«ï¼\pTeX ç¨åæãã©ã³ãã¡ããªãã¯ã\LuaTeX-jaç¨ã«ç§»æ¤ããå ´åã®æ³¨æç¹ãæãã¦ããï¼
+\begin{itemize}
+\item å®éã«åºåãããåæãã©ã³ãã®ãµã¤ãºãdesign sizeã¨ãªãï¼
+ãã®ããï¼ä¾ãã°$1\,\textrm{zw}$ãdesign sizeã®0.962216åã§ããJISãã©ã³
+ ãã¡ããªãã¯çã移æ¤ããå ´åã¯ï¼
+\begin{itemize}
+\item JFMä¸ã®å
¨ã¦ã®æ°å¤ã$1/0.962216$åãã¦ããï¼
+\item \TeX ã½ã¼ã¹ä¸ã§ä½¿ç¨ããã¨ããã§ï¼ãµã¤ãºæå®ã0.962216åã«ããï¼
+ \LaTeX ã§ã®ãã©ã³ã宣è¨ãªãï¼ä¾ãã°æ¬¡ã®ããã«ï¼
+\begin{verbatim}
+\DeclareFontShape{JY3}{mc}{m}{n}{<-> s*[0.962216] psft:Ryumin-Light:jfm=jis}{}
+\end{verbatim}
+\end{itemize}
+\item ä¸ã«è¿°ã¹ãç¹æ®æåã¯ï¼\texttt{'boxbdd'}ãé¤ãæåã¯ã©ã¹ãå
¨é¨0ã¨ãã
+ ï¼JFMä¸ã«åã«æ¸ããªããã°ããï¼ï¼
+\item \texttt{'boxbdd'}ã«ã¤ãã¦ã¯ï¼ããã®ã¿ã§ä¸ã¤ã®æåã¯ã©ã¹ãå½¢æãï¼ãã®
+ æåã¯ã©ã¹ã«é¢ãã¦ã¯glue/kernã®è¨å®ã¯ããªãï¼
+
+ããã¯ï¼\pTeX ã§ã¯ï¼
+ hboxã®å
é ã»æ«å°¾ã¨ã¤ã³ãã³ãããã¦ããªãï¼\verb+\noindent+ã§éå§ã
+ ããï¼æ®µè½ã®å
é ã«ã¯JFMã°ã«ã¼ã¯å
¥ããªãã¨ããä»æ§ãå®ç¾ãããããã§ããï¼
+\item \pTeX ã®çµçãåç¾ããããã¨ããã®ãç®çã§ããã°ä»¥ä¸ã®æ³¨æãå®ãã°ååã§ããï¼
+
+ã¨ããã§ï¼\pTeX ã§ã¯é常ã®æ®µè½ã®å
é ã«JFMã°ã«ã¼ãæ®ãã¨ããä»æ§ãããã®ã§ï¼
+ 段è½å
é ã®éãæ¬å¼§ã¯å
¨è§äºåä¸ããã«ãªãï¼å
¨è§ä¸ãããå®ç¾ãããã«
+ ã¯ï¼æ®µè½ã®æåã«æåã§\verb+\inhibitglue+ã追å ãããï¼ãããã¯
+ \verb+\everypar+ã®hackãè¡ãï¼ãããèªååããããããªãã£ãï¼
+
+ä¸æ¹ï¼\LuaTeX-jaã§ã¯ï¼\texttt{'parbdd'}ã«ãã£ã¦ï¼ãããJFMå´ã§èª¿æ´ã§ããã
+ãã«ãªã£ãï¼ä¾ãã°ï¼\LuaTeX-jaå梱ã®JFMã®ããã«ï¼\texttt{'boxbdd'}ã¨åãæåã¯ã©ã¹ã«
+\texttt{'parbdd'}ãå
¥ããã°å
¨è§ä¸ããã¨ãªãï¼
+
+\ltjsetparameter{jacharrange={+3}}
+\begin{LTXexample}
+\jfont\g=psft:Ryumin-Light:jfm=test \g
+\parindent1\zw\noindent{}âââââ
+\par{}ãâââäºåä¸ãã
+\par{}ãâââå
¨è§ä¸ãã
+\par{}ãâââå
¨è§äºåä¸ãã
+\end{LTXexample}
+\end{itemize}
+\ltjsetparameter{jacharrange={-3}}
+%
+
+%\subsection{Math Font Family}
+%\subsection{æ°å¼ãã©ã³ããã¡ããª}
+\TeX\ handles fonts in math formulas by 16~font families\footnote{Omega,
+Aleph, \LuaTeX~and $\varepsilon$-\kern-.125em(u)\pTeX can handles 256~families, but
+an external package is needed to support this in plain \TeX\ and
+\LaTeX.}, and each family has three fonts:
+\verb+\textfont+, \verb+\scriptfont+ and \verb+\scriptscriptfont+.
+
+\LuaTeX-ja's handling of Japanese fonts in math formulas is similar;
+Table~\ref{tab-math} shows counterparts to \TeX's primitives for math
+font families. There is no relation between the value of
+\verb+\fam+ and that of \verb+\jfam+; with appropriate settings,
+you can set both \verb+\fam+ and \verb+\jfam+ to~the same value.
+
+\begin{table}[!tb]
+\caption{Primitives for Japanese math fonts.}
+\label{tab-math}
\begin{center}\def\{{\char`\{}\def\}{\char`\}}
\begin{tabular}{lll}
\toprule
&Japanese fonts&alphabetic fonts\\
-font family&\verb+\jfam+&\verb+\fam+\\
-text size&\tt\textsf{jatextfont}\,=\{,\}&\tt\verb+\textfont+=\\
-script size&\tt\textsf{jascriptfont}\,=\{,\}&\tt\verb+\scriptfont+=\\
-scriptscript size&\tt\textsf{jascriptscriptfont}\,=\{,\}&\tt\verb+\scriptscriptfont+=\\
+\midrule
+font family&\verb+\jfam+${}\in [0,256)$&\verb+\fam+\\
+text size&\tt\Param{jatextfont}\,=\{,\}&\tt\verb+\textfont+=\\
+script size&\tt\Param{jascriptfont}\,=\{,\}&\tt\verb+\scriptfont+=\\
+scriptscript size&\tt\Param{jascriptscriptfont}\,=\{,\}&\tt\verb+\scriptscriptfont+=\\
\bottomrule
\end{tabular}
\end{center}
+\end{table}
+
+%\subsection{Callbacks}
+%\subsection{ã³ã¼ã«ããã¯}
+Like \LuaTeX\ itself, \LuaTeX-ja also has callbacks. These callbacks can
+be accessed via \verb+luatexbase.add_to_callback+ function and so on, as other callbacks
+\begin{list}{}%
+{\def\makelabel#1{\bfseries#1}}
+\item[\texttt{luatexja.load\_jfm} callback]
+With this callback you can overwrite JFMs.
+This callback is called when a new JFM is loaded.
+
+\begin{verbatim}
+function ( jfm_info, jfm_name)
+ return new_jfm_info
+end
+\end{verbatim}
+
+The argument \verb+jfm_info+ contains a table similar to the table in a JFM file, except
+this argument has \texttt{chars} field which contains character codes
+ whose character class is not~0.
+
+An example of this callback is the \texttt{ltjarticle} class, with
+ forcefully assigning character class~0 to \texttt{'parbdd'}
+ in the JFM \texttt{jfm-min.lua}. This callback doesn't
+ replace any code of \LuaTeX-ja.
+
+\item[\texttt{luatexja.define\_font} callback]
+This callback and the next callback form a pair, and you can assign letters which don't have
+ fixed code points in Unicode to non-zero character classes.
+This \texttt{luatexja.define\_font} callback is called just when new Japanese font is loaded.
+\begin{verbatim}
+function ( jfont_info, font_number)
+ return new_jfont_info
+end
+\end{verbatim}
+
+You may assume that \verb+jfont_info+ has the following fields:
+\begin{description}
+\item[\tt jfm] The index number of JFM.
+\item[\tt size] Font size in a scaled point (${}=2^{-16}\,\textrm{pt}$).
+\item[\tt var] The value specified in \texttt{jfmvar=...} at a call of \verb+\jfont+.
+\end{description}
+
+The returned table \verb+new_jfont_info+ also should include these three fields.
+The \verb+font_number+ is a font number.
+
+A good example of this and the next callbacks is the \Pkg{luatexja-otf}
+ package, supporting \verb+"AJ1-xxx"+ form for Adobe-Japan1
+ CID characters in a JFM. This callback doesn't replace any
+ code of \LuaTeX-ja.
+
+
+\item[\texttt{luatexja.find\_char\_class} callback]
+This callback is called just when \LuaTeX-ja inready to determine which
+ character class a character \verb+chr_code+ belongs.
+A function used in this callback should be in the following form:
+\begin{lstlisting}[numbers=left]
+function ( char_class, jfont_info, chr_code)
+ if char_class~=0 then return char_class
+ else
+ ....
+ return ( new_char_class or 0)
+ end
+end
+\end{lstlisting}
+
+The argument \verb+char_class+ is the result of \LuaTeX-ja's default
+ routine or previous function calls in this callback, hence
+ this argument may not be 0. Moreover, the returned
+ \verb+new_char_class+ should be as same as \verb+char_class+ when \verb+char_class+
+ is not~0, otherwise you will overwrite the \LuaTeX-ja's
+ default routine.
+
+This callback doesn't replace any code of \LuaTeX-ja.
+
+\item[\texttt{luatexja.set\_width} callback]
+This callback is called when \LuaTeX-ja is trying to encapsule a
+ \textbf{JAchar} \textit{glyph\_node}, to adjust its
+ dimension and position.
+\begin{lstlisting}[numbers=left]
+function ( shift_info, jfont_info, char_class)
+ return new_shift_info
+end
+\end{lstlisting}
+
+The argument \verb+shift_info+ and the returned \verb+new_shift_info+ have
+\texttt{down} and \texttt{left} fields, which are the amount of shifting
+ down/left the character in a scaled-point.
+
+%<*ja>
+è¯ãä¾ã\Pkg{test/valign.lua}ã§ããï¼ãã®ãã¡ã¤ã«ãèªã¿è¾¼ã¾ããç¶æ
ã§ã¯ï¼
+ JFMå
ã§è¦å®ãããæåã¯ã©ã¹0ã®æåã«ããã$(\hbox{é«
+ ã}):(\hbox{æ·±ã})$ã®æ¯ã«ãªãããã«ï¼å®éã®ãã©ã³ãã®åºåä¸
+ ä¸ä½ç½®ãèªå調æ´ãããï¼ä¾ãã°ï¼
+\begin{itemize}
+\item JFMå´ã®è¨å®ï¼$(\hbox{é«ã})=88x$, $(\hbox{æ·±ã})=12x$%
+ï¼åæOpenTypeãã©ã³ãã®æ¨æºå¤ï¼
+\item å®ãã©ã³ãå´ã®æ°å¤ï¼$(\hbox{é«ã})=28y$, $(\hbox{æ·±ã})=5y$ï¼åæTrueTypeãã©ã³ãã®æ¨æºå¤ï¼
+\end{itemize}
+ã¨ãªã£ã¦ããã¨ããï¼ããã¨ï¼å®éã®æåã®åºåä½ç½®ã¯ï¼
+\[
+ \frac{88x}{88x+12x} (28y+5y) - 28y = \frac{26}{825}y= 0.03\dot1\dot5y
+\]
+ã ãä¸ã«ããããããã¨ã«ãªãï¼
+%
+\end{list}
+
-\section{Parameters}
-\subsection{{\tt\char92 ltjsetparameter} primitive}
+%\section{Parameters}
+%\section{ãã©ã¡ã¼ã¿}
+%\subsection{\texttt{\char92 ltjsetparameter} primitive}
+%\subsection{\texttt{\char92 ltjsetparameter} ããªããã£ã}
As noted before, \verb+\ltjsetparameter+ and \verb+\ltjgetparameter+ are
-primitives for accessing most parameters of Lua\TeX-ja. One of the main
-reason that Lua\TeX-ja didn't adopted the syntax similar to that of p\TeX\
-(\textit{e.g.},~\verb+\prebreakpenalty`ï¼=10000+)
+primitives for accessing most parameters of \LuaTeX-ja. One of the main
+reason that \LuaTeX-ja didn't adopted the syntax similar to that of \pTeX\
+(\textit{e.g.},~\verb+\prebreakpenalty`ï¼=10000+)
is the position of \verb+hpack_filter+ callback in the source
-of Lua\TeX, see Section~\ref{sec-para}.
+of \LuaTeX, see Section~\ref{sec-para}.
\verb+\ltjsetparameter+ and \verb+\ltjglobalsetparameter+ are primitives
for assigning parameters. These take one argument which is a
\texttt{=} list. Allowed keys are described in the next
-subsection.
+subsection.
The difference between
\verb+\ltjsetparameter+ and \verb+\ltjglobalsetparameter+ is only the
scope of assignment;
-\verb+\ltjsetparameter+ does a local assignment and
-\verb+\ltjglobalsetparameter+ does a global one.
+\verb+\ltjsetparameter+ does a local assignment and
+\verb+\ltjglobalsetparameter+ does a global one.
They also obey the value of \verb+\globaldefs+,
like other assignment.
@@ -725,83 +2310,138 @@ like other assignment.
always takes a parameter name as first argument, and also takes the
additional argument---a character code, for example---in some cases.
\begin{LTXexample}
-\ltjgetparameter{differentjfm},
+\ltjgetparameter{differentjfm},
\ltjgetparameter{autospacing},
\ltjgetparameter{prebreakpenalty}{`ï¼}.
\end{LTXexample}
\emph{The return value of\/ {\normalfont\tt\char92ltjgetparameter} is
always a string}. This is outputted by \texttt{tex.write()}, so any
-character other than space~` '~(U+0020) has the category code
+character other than space~`\texttt{\char32}'~(U+0020) has the category code
12~(other), while the space has 10~(space).
-\subsection{List of Parameters}
-In the following list of parameters, [\verb+\cs+] indicates the counterpart in p\TeX, and each symbol has the following meaning:
+%\subsection{List of Parameters}
+%\subsection{ãã©ã¡ã¼ã¿ä¸è¦§}
+The following is the list of parameters which can be specified by the
+\verb+\ltjsetparameter+ command. [\verb+\cs+] indicates the counterpart
+in \pTeX, and symbols beside each parameter has the following meaning:
\begin{itemize}
-\item `\ast' : local
-\item `\dagger' always global
-\item No mark: the last of paragraph
+\item No mark: values at the end of the paragraph or the hbox are
+ adopted in the whole paragraph/hbox.
+\item `\ast' : local parameters, which can change everywhere inside a paragraph/hbox.
+\item `\dagger': assignments are always global.
\end{itemize}
\begin{list}{}{\def\makelabel{\ttfamily}\def\{{\char`\{}\def\}{\char`\}}}
-\item[\textsf{jcharwidowpenalty}\,=] [\verb+\jcharwidowpenalty+]
+\item[\Param{jcharwidowpenalty}\,=] [\verb+\jcharwidowpenalty+]
-Penalty value for supressing orphans. This penalty is inserted just
+Penalty value for suppressing orphans. This penalty is inserted just
after the last \textbf{JAchar} which is not regarded as a
(Japanese) punctuation mark.
-\item[\textsf{kcatcode}\,=\{,\}]\
+\item[\Param{kcatcode}\,=\{,\}]\
-An additional attributes having each character whose character code is .
+An additional attributes having each character whose character code is .
At the present version, the lowermost bit of indicates
whether the character is considered as a punctuation mark
- (see the description of \textsf{jcharwidowpenalty} above).
+ (see the description of \Param{jcharwidowpenalty} above).
+
+
+\item[\Param{prebreakpenalty}\,=\{,\}] [\verb+\prebreakpenalty+]\
+%<*ja>
+æåã³ã¼ãã®\textbf{JAchar}ãè¡é ã«ãããã¨ãææ¢ããããã«ï¼
+ ãã®æåã®åã«æ¿å
¥/追å ãããããã«ãã£ã®éãæå®ããï¼
+
+ä¾ãã°éãæ¬å¼§ãããã¯çµ¶å¯¾ã«è¡é ã«ãã¦ã¯ãªããªãã®ã§ï¼æ¨æºã§èªã¿è¾¼ã¾ãã
+ \texttt{luatexja-kinsoku.tex}ã«ããã¦
+\begin{verbatim}
+\ltjsetparameter{prebreakpenalty={`ã,10000}}
+\end{verbatim}
+ã¨ï¼æ大å¤ã®10000ãæå®ããã¦ããï¼ä»ã«ãï¼å°æ¸ãã®ã«ããªã©ï¼çµ¶å¯¾ç¦æ¢ã¨ã
+ ãããã§ã¯ãªããã§ããã°è¡é ã«ã¯ãã¦æ¬²ãããªãå ´åã«ï¼0ã¨
+ 10000ã®éã®å¤ãæå®ããã®ãæç¨ã§ããã.
+\begin{verbatim}
+\ltjsetparameter{prebreakpenalty={`ã,150}}
+\end{verbatim}
+%
+\item[\Param{postbreakpenalty}\,=\{,\}] [\verb+\postbreakpenalty+]
+%<*ja>
+æåã³ã¼ãã®\textbf{JAchar}ãè¡æ«ã«ãããã¨ãææ¢ããããã«ï¼
+ ãã®æåã®å¾ã«æ¿å
¥/追å ãããããã«ãã£ã®éãæå®ããï¼
-\item[\textsf{prebreakpenalty}\,=\{,\}] [\verb+\prebreakpenalty+]
-\item[\textsf{postbreakpenalty}\,=\{,\}] [\verb+\postbreakpenalty+]
-\item[\textsf{jatextfont}\,=\{,\}] [\verb+\textfont+ in \TeX]
-\item[\textsf{jascriptfont}\,=\{,\}] [\verb+\scriptfont+ in \TeX]
-\item[\textsf{jascriptscriptfont}\,=\{,\}] [\verb+\scriptscriptfont+ in \TeX]
-\item[\textsf{yjabaselineshift}\,=$^\ast$]\
-\item[\textsf{yalbaselineshift}\,=$^\ast$] [\verb+\ybaselineshift+]
+\pTeX ã§ã¯ï¼\verb+\prebreakpenalty+, \verb+\postbreakpenalty+ã«ããã¦ï¼
+\begin{itemize}
+\item ä¸ã¤ã®æåã«å¯¾ãã¦ï¼pre, postã©ã¡ããä¸ã¤ããæå®ãããã¨ãã§ããªãã£
+ ãï¼å¾ããæå®ããæ¹ã§ä¸æ¸ããããï¼ï¼
+\item pre, poståããã¦256æååã®æ
å ±ãæ ¼ç´ãããã¨ããã§ããªãã£ãï¼
+\end{itemize}
+ã¨ããå¶éããã£ããï¼\LuaTeX-ja ã§ã¯ãããã®å¶éã¯è§£æ¶ããã¦ããï¼
+%
-\item[\textsf{jaxspmode}\,=\{,\}] [\verb+\inhibitxspcode+]
+\item[\Param{jatextfont}\,=\{,\}] [\verb+\textfont+ in \TeX]
+\item[\Param{jascriptfont}\,=\{,\}] [\verb+\scriptfont+ in \TeX]
+\item[\Param{jascriptscriptfont}\,=\{,\}] [\verb+\scriptscriptfont+ in \TeX]
+\item[\Param{yjabaselineshift}\,=$^\ast$]\
+\item[\Param{yalbaselineshift}\,=$^\ast$] [\verb+\ybaselineshift+]
-Setting whether inserting \textsf{xkanjiskip} is allowed before/after a \textbf{JAchar} whose character code is .
+\item[\Param{jaxspmode}\,=\{,\}]
+
+Setting whether inserting \Param{xkanjiskip} is allowed before/after a \textbf{JAchar} whose character code is .
The followings are allowed for :
\begin{description}
-\item[0, \texttt{inhibit}] Insertion of \textsf{xkanjiskip} is inhibited before the charater, nor after the charater.
-\item[2, \texttt{preonly}] Insertion of \textsf{xkanjiskip} is allowed before the charater, but not after.
-\item[1, \texttt{postonly}] Insertion of \textsf{xkanjiskip} is allowed after the charater, but not before.
-\item[3, \texttt{allow}] Insertion of \textsf{xkanjiskip} is allowed before the charater and after the charater.
+\item[0, \texttt{inhibit}] Insertion of \Param{xkanjiskip} is inhibited before the character, nor after the character.
+\item[1, \texttt{preonly}] Insertion of \Param{xkanjiskip} is allowed before the character, but not after.
+\item[2, \texttt{postonly}] Insertion of \Param{xkanjiskip} is allowed after the character, but not before.
+\item[3, \texttt{allow}] Insertion of \Param{xkanjiskip} is allowed before the character and after the character.
This is the default value.
\end{description}
+This parameter is similar to the \verb+\inhibitxspcode+ primitive of \pTeX, but not compatible with \verb+\inhibitxspcode+.
+
-\item[\textsf{alxspmode}\,=\{,\}] [\verb+\xspcode+]
+\item[\Param{alxspmode}\,=\{,\}] [\verb+\xspcode+]
-Setting whether inserting \textsf{xkanjiskip} is allowed before/after a \textbf{ALchar} whose character code is .
+Setting whether inserting \Param{xkanjiskip} is allowed before/after a
+ \textbf{ALchar} whose character code is .
The followings are allowed for :
\begin{description}
-\item[0, \texttt{inhibit}] Insertion of \textsf{xkanjiskip} is inhibited before the charater, nor after the charater.
-\item[1 \texttt{preonly}] Insertion of \textsf{xkanjiskip} is allowed before the charater, but not after.
-\item[2 \texttt{postonly}] Insertion of \textsf{xkanjiskip} is allowed after the charater, but not before.
-\item[3, \texttt{allow}] Insertion of \textsf{xkanjiskip} is allowed before the charater and after the charater.
+\item[0, \texttt{inhibit}] Insertion of \Param{xkanjiskip} is inhibited
+ before the character, nor after the character.
+\item[1, \texttt{preonly}] Insertion of \Param{xkanjiskip} is allowed
+ before the character, but not after.
+\item[2, \texttt{postonly}] Insertion of \Param{xkanjiskip} is allowed
+ after the character, but not before.
+\item[3, \texttt{allow}] Insertion of \Param{xkanjiskip} is allowed both
+ before the character and after the character.
This is the default value.
\end{description}
-Note that parameters \textsf{jaxspmode} and \textsf{alxspmode} use a common table.
-
-\item[\textsf{autospacing}\,=$^\ast$] [\verb+\autospacing+]
-\item[\textsf{autoxspacing}\,=$^\ast$] [\verb+\autoxspacing+]
-\item[\textsf{kanjiskip}\,=] [\verb+\kanjiskip+]
-\item[\textsf{xkanjiskip}\,=] [\verb+\xkanjiskip+]
-\item[\textsf{differentjfm}\,=$^\dagger$]
-\item[\textsf{jacharrange}\,=$^\ast$]
-\item[\textsf{kansujichar}\,=\{, \}] [\verb+\kansujichar+]
+Note that parameters \Param{jaxspmode} and \Param{alxspmode} use a common table, hence these two parameters are synonyms of each other.
+
+\item[\Param{autospacing}\,=$^\ast$] [\verb+\autospacing+]
+\item[\Param{autoxspacing}\,=$^\ast$] [\verb+\autoxspacing+]
+\item[\Param{kanjiskip}\,=] [\verb+\kanjiskip+]
+\item[\Param{xkanjiskip}\,=] [\verb+\xkanjiskip+]
+
+\item[\Param{differentjfm}\,=$^\dagger$]
+
+Specify how glues/kerns between two \textbf{JAchar}s whose JFM (or size) are different.
+The allowed arguments are the followings:
+\begin{description}
+\item[\texttt{average}]
+\item[\texttt{both}]
+\item[\texttt{large}]
+\item[\texttt{small}]
+\end{description}
+
+\item[\Param{jacharrange}\,=$^\ast$]
+\item[\Param{kansujichar}\,=\{, \}] [\verb+\kansujichar+]
\end{list}
-\section{Other Primitives}
-\subsection{Compatibility with p\TeX}
+%\section{Other Primitives}
+%\section{ãã®ä»ã®ããªããã£ã}
+%\subsection{Primitives for Compatibility}
+%\subsection{äºæããªããã£ã}
+The following primitives are implemented for compatibility with \pTeX:
\begin{list}{}{\def\makelabel{\ttfamily\char92 }}
\item[kuten]
\item[jis]
@@ -810,11 +2450,172 @@ Note that parameters \textsf{jaxspmode} and \textsf{alxspmode} use a common tabl
\item[ucs]
\item[kansuji]
\end{list}
-\section{Control Sequences for \LaTeXe}
-\part{Implementations}\label{part-imp}
-\section{Storing Parameters}\label{sec-para}
-\subsection{Used Dimensions and Attributes}
-Here the following is the list of dimension and attributes which are used in Lua\TeX-ja.
+%\subsection{\texttt{\char92 inhibitglue} primitive}
+%\subsection{\texttt{\char92 inhibitglue} ããªããã£ã}
+The primitive \verb+\inhibitglue+ suppresses the insertion of \textbf{JAglue}.
+The following is an example, using a special JFM that there will be a glue between
+the beginning of a box and `ã', and also between `ã' and `ã¦'.
+
+\begin{LTXexample}
+\jfont\g=psft:Ryumin-Light:jfm=test \g
+ãã¦ã\inhibitglue{}ã¦\inhibitglue\par
+ã\par\inhibitglue{}ã
+\par\inhibitglue\hrule{}ãoff\inhibitglue ice
+\end{LTXexample}
+
+With the help of this example, we remark the specification of \verb+\inhibitglue+:
+\begin{itemize}
+\item The call of \verb+\inhibitglue+ in the (internal) vertical mode is
+ effective at the beginning of the next paragraph. This is realized
+ by hacking \verb+\everypar+.
+\item The call of \verb+\inhibitglue+ in the (restricted) horizontal
+ mode is only effective on the spot; does not get over boundary of
+ paragraphs. Moreover, \verb+\inhibitglue+ cancels ligatures and
+ kernings, as shown in line~4 of above example.
+\item The call of \verb+\inhibitglue+ in math mode is just ignored.
+\end{itemize}
+
+%\section{Control Sequences for \LaTeXe}
+%\section{\LaTeXe ç¨ã®ã³ã³ããã¼ã«ã·ã¼ã±ã³ã¹}
+%\subsection{Patch for NFSS2}
+%\subsection{NFSS2 ã¸ã®ããã}
+\label{ssub-nfsspat}
+As described in Subsection~\ref{ssec-ltx}, \LuaTeX-ja simply adopted
+\texttt{plfonts.dtx} in \pLaTeXe\ for the Japanese patch for NFSS2.
+For an convenience, we will describe
+commands which are not described in Subsection~\ref{ssub-chgfnt}.
+
+\begin{cslist}%
+\item[DeclareYokoKanjiEncoding\{\}\{\}\{\}]
+In NFSS2 under \LuaTeX-ja, distinction between alphabetic font families
+ and Japanese font families is only made by its
+ encoding. For example, encodings OT1 and T1 are for
+ alphabetic font families, and a Japanese font family cannot
+ have these encodings. This command defines a new encoding
+ scheme for Japanese font family (in horizontal direction).
+
+\item[DeclareKanjiEncodingDefaults\{\}\{\}]
+\item[DeclareKanjiSubstitution\{\}\{\}\{\}\{\}]
+\item[DeclareErrorKanjiFont\{\}\{\}\{\}\{\}\{\}]
+
+The above 3~commands are just the counterparts for \verb+DeclareFontEncodingDefaults+ and~others.
+
+\item[reDeclareMathAlphabet\{\}\{\}\{\}]
+åæã»æ¬§æã®æ°å¼ç¨ãã©ã³ããã¡ããªãä¸åº¦ã«å¤æ´ããå½ä»¤ãä½æããï¼
+å
·ä½çã«ã¯ï¼æ¬§ææ°å¼ç¨ãã©ã³ããã¡ããªå¤æ´ã®å½ä»¤ã¨ï¼åææ°å¼ç¨ãã©
+ ã³ããã¡ããªå¤æ´ã®å½ä»¤ã®2ã¤ãåæã«è¡ãå½ä»¤ã¨ãã¦
+ ãï¼åï¼å®ç¾©ããï¼å®éã®ä½¿ç¨ã§ã¯ã¨
+ ã«åããã®ãæå®ããï¼ããªãã¡ï¼ã«åæå´ãå¤
+ æ´ãããããã«ããã®ãä¸è¬çã¨æãããï¼
+
+æ¬ã³ãã³ãã®ä½¿ç¨ã«ã¤ãã¦ã¯ï¼\pLaTeX é
å¸ä¸ã®\texttt{plfonts.dtx}ã«è©³ãã
+ 注æç¹ãè¿°ã¹ããã¦ããã®ã§ï¼ãã¡ããåç
§ããããï¼
+
+\item[DeclareRelationFont\{\}\{\}\{\}\{\}\\
+ \hfill\{\}\{\}\{\}\{\}]
+%<*en>
+This command sets the `accompanied' alphabetic font family (given by the latter 4~arguments)
+with respect to a Japanese font family given by the former 4~arguments.
+%
+%<*ja>
+ãããããå¾å±æ¬§æããè¨å®ããããã®å½ä»¤ã§ããï¼ååã®4å¼æ°ã§è¡¨ãããåæãã©ã³ããã¡ããªã«å¯¾ãã¦ï¼
+ãã®ãã©ã³ãã«å¯¾å¿ãããå¾å±æ¬§æããã©ã³ããã¡ããªãå¾åã®4å¼æ°ã«ããä¸ããï¼
+%
+\item[SetRelationFont]
+This command is almost same as \verb+\DeclareRelationFont+, except that this command does a local
+assignment, where \verb+\DeclareRelationFont+ does a global assignment.
+\item[userelfont]
+Change current alphabetic font encoding/family/\dots\ to the `accompanied' alphabetic
+ font family with respect to current Japanese font family,
+ which was set by
+ \verb+\DeclareRelationFont+ or \verb+SetRelationFont+.
+Like \verb+\fontfamily+, \verb+\selectfont+ is required to take an effect.
+
+\item[adjustbaseline]
+...
+
+\item[fontfamily\{\}]
+{\let\item\origitem
+As in \LaTeXe, this command changes current font family (alphabetic, Japanese,~\emph{or both})
+to . Which family will be changed is determined as follows:
+\begin{itemize}
+\item Let current encoding scheme for Japanese fonts be
+ . Current Japanese font family will be changed to
+ , if one of the following two conditions is met:
+\begin{itemize}
+\item The family under the encoding is already defined by
+ \verb+\DeclareKanijFamily+.
+\item A font definition named \texttt{.fd} (the file name is
+ all lowercase) exists.
+\end{itemize}
+\item Let current encoding scheme for Japanese fonts be
+ . For alphabetic font family, the criterion as above is used.
+\item There is a case which none of the above applies, that is, the font
+ family named doesn't seem to be defined neither under the
+ encoding , nor under .
+
+In this case, the default family for font substitution is used for
+ alphabetic and Japanese fonts. Note that current encoding will not
+ be set to , unlike the original implementation in \LaTeX.
+\end{itemize}
+}
+\end{cslist}
+
+As closing this subsection, we shall introduce an example of
+\verb+SetRelationFont+ and \verb+\userelfont+:
+\begin{LTXexample}
+\gtfamily{}ãããabc
+\SetRelationFont{JY3}{gt}{m}{n}{OT1}{pag}{m}{n}
+\userelfont\selectfont{}ãããabc
+\end{LTXexample}
+
+
+%\subsection{Cropmark/`tombow'}
+%\subsection{ãã³ã}
+
+%\section{Extensions}
+%\section{æ¡å¼µ}
+\subsection{\texttt{luatexja-fontspec.sty}}
+
+\subsection{\texttt{luatexja-otf.sty}}
+This optional package supports typesetting characters in
+Adobe-Japan1. \texttt{luatexja-otf.sty} offers the following 2~low-level
+commands:
+\begin{list}{}{\def\makelabel{\ttfamily}\def\{{\char`\{}\def\}{\char`\}}}
+\item[\char92CID\{\}]
+Typeset a character whose CID number is .
+\item[\char92UTF\{\}]
+Typeset a character whose character code is (in hexadecimal).
+This command is similar to \verb+\char"+,\ %"
+but please remind remarks below.
+\end{list}
+
+\paragraph{Remarks}
+Characters by \verb+\CID+ and \verb+\UTF+ commands are different from
+ordinary characters in the following points:
+\begin{itemize}
+\item Always treated as \textbf{JAchar}s.
+\item Processing codes for supporting OpenType features (\textit{e.g.},
+ glyph replacement and kerning) by the \Pkg{luaotfload} package
+ is not performed to these characters.
+\end{itemize}
+
+
+\paragraph{Additionally Syntax of JFM}
+\texttt{luatexja-otf.sty} extends the syntax of JFM; the entries of \texttt{
+chars} table in JFM now allows a string in the form
+\verb+'AJ1-xxx'+, which stands for the character
+whose CID number in Adobe-Japan1 is \verb+xxx+.
+
+%\part{Implementations}
+%\part{å®è£
}
+\label{part-imp}
+%\section{Storing Parameters}
+%\section{ãã©ã¡ã¼ã¿ã®ä¿æ}
+\label{sec-para}
+%\subsection{Used Dimensions, Attributes and whatsit nodes}
+%\subsection{ç¨ãããã寸æ³ã¬ã¸ã¹ã¿ï¼å±æ§ã¬ã¸ã¹ã¿ï¼whatsit ãã¼ã}
+Here the following is the list of dimensions and attributes which are used in \LuaTeX-ja.
\begin{list}{}{%
\def\makelabel{\ttfamily}
\def\dim#1{\item[\char92 #1\ \textrm{(dimension)}]}
@@ -824,48 +2625,67 @@ Here the following is the list of dimension and attributes which are used in Lua
\dim{jQ}
As explained in Subsection~\ref{ssec-plain}, \verb+\jQ+ is equal to
$1\,\textrm{Q}=0.25\,\textrm{mm}$, where `Q'~(also called `ç´') is
- a unit used in Japanese phototypesetting. So one should not change the value of this dimension.
+ a unit used in Japanese phototypesetting. So one should not change the value of this dimension.
\dim{jH}
There is also a unit called `æ¯' which equals to $0.25\,\textrm{mm}$ and
- used in Japanese phototypesetting. The dimension
- \verb+\jH+ stores this length, similar to \verb+\jQ+.
+ used in Japanese phototypesetting. This
+ \verb+\jH+ is a synonym of \verb+\jQ+.
\dim{ltj@zw} A temporal register for the `full-width' of current Japanese font.
\dim{ltj@zh} A temporal register for the `full-height' (usually the sum of height of imaginary body and its depth) of current Japanese font.
-\attr{jfam}
+\attr{jfam} Current number of Japanese font family for math formulas.
\attr{ltj@curjfnt} The font index of current Japanese font.
\attr{ltj@charclass} The character class of Japanese \textit{glyph\_node}.
\attr{ltj@yablshift} The amount of shifting the baseline of alphabetic
fonts in scaled point ($2^{-16}\,\textrm{pt}$).
\attr{ltj@ykblshift} The amount of shifting the baseline of Japanese
fonts in scaled point ($2^{-16}\,\textrm{pt}$).
-\attr{ltj@autospc} Whether the auto insertion of \textsf{kanjiskip} is allowed at the node.
-\attr{ltj@autoxspc} Whether the auto insertion of \textsf{xkanjiskip} is allowed at the node.
-\attr{ltj@icflag} For distinguishing `kinds' of the node. To this
- attribute, one of the following value is
- assigned:
+\attr{ltj@autospc} Whether the auto insertion of \Param{kanjiskip} is allowed at the node.
+\attr{ltj@autoxspc} Whether the auto insertion of \Param{xkanjiskip} is allowed at the node.
+\attr{ltj@icflag} An attribute for distinguishing `kinds' of a node. One of the following value is
+ assigned to this attribute:
\begin{description}
-\item[ITALIC (1)] Glues from an itaric correction
- (\verb+\/+). This distinction of origins of glues (from explicit \verb+\kern+, or from \verb+\/+)
- is needed in the insertion process of \textsf{xkanjiskip}.
-\item[PACKED (2)]
-\item[KINSOKU (3)] Penalties inserted for the word-wrapping process of Japanese characters (\emph{kinsoku}).
-\item[FROM\_JFM (4)] Glues/kerns from JFM.
-\item[LINE\_END (5)] Kerns
-\item[KANJI\_SKIP (6)] Glues for \textsf{kanjiskip}.
-\item[XKANJI\_SKIP (7)] Glues for \textsf{xkanjiskip}.
-\item[PROCESSED (8)] Nodes which is already processed by ...
-\item[IC\_PROCESSED (9)] Glues from an itaric correction
-\item[BOXBDD (15)] Glues/kerns that inserted just the beginning or the ending of an hbox or a paragraph.
+\item[\textit{italic} (1)] Glues from an italic correction
+ (\verb+\/+). This distinction of origins of glues
+ (from explicit \verb+\kern+, or from \verb+\/+)
+ is needed in the insertion process of \Param{xkanjiskip}.
+\item[\textit{packed} (2)]
+\item[\textit{kinsoku} (3)] Penalties inserted for the word-wrapping process of Japanese characters (\emph{kinsoku}).
+\item[\textit{from\_jfm} (4)] Glues/kerns from JFM.
+\item[\textit{line\_end} (5)] Kerns for ...
+\item[\textit{kanji\_skip} (6)] Glues for \Param{kanjiskip}.
+\item[\textit{xkanji\_skip} (7)] Glues for \Param{xkanjiskip}.
+\item[\textit{processed} (8)] Nodes which is already processed by ...
+\item[\textit{ic\_processed} (9)] Glues from an italic correction, but also already processed.
+\item[\textit{boxbdd} (15)] Glues/kerns that inserted just the beginning or the ending of an hbox or a paragraph.
\end{description}
\attr{ltj@kcat$i$} Where $i$~is a natural number which is less than~7.
These 7~attributes store bit~vectors indicating which character block is regarded as a block of \textbf{JAchar}s.
\end{list}
-\subsection{Stack System of Lua\TeX-ja}
+Furthermore, \LuaTeX-ja uses several `user-defined' whatsit nodes for
+typesetting. All those nodes store a natural number (hence the node's
+\texttt{type} is 100).
+\begin{description}
+\item[30111] Nodes for indicating that \verb+\inhibitglue+ is
+ specified. The \texttt{value} field of these nodes doesn't matter.
+\item[30112] Nodes for \LuaTeX-ja's stack system (see the next
+ subsection). The \texttt{value} field of these nodes is
+ current group.
+\item[30113] Nodes for Japanese Characters which the callback process of
+ luaotfload won't be applied, and the character code is
+ stored in the \texttt{value} field. Each node having this
+ \verb+user_id+ is converted to a `glyph\_node' \emph{after}
+ the callback process of luaotfload.
+\end{description}
+These whatsits will be removed during the process of inserting \textbf{JAglue}s.
+
+%\subsection{Stack System of \LuaTeX-ja}
+%\subsection{\LuaTeX-ja ã®ã¹ã¿ãã¯ã·ã¹ãã }
+\label{ssec-stack}
\paragraph{Background}
-Lua\TeX-ja has its own stack system, and most parameters of Lua\TeX-ja
+\LuaTeX-ja has its own stack system, and most parameters of \LuaTeX-ja
are stored in it. To clarify the reason, imagine the parameter
-\textsf{kanjiskip} is stored by a skip, and consider the following
+\Param{kanjiskip} is stored by a skip, and consider the following
source:
\begin{LTXexample}
\ltjsetparameter{kanjiskip=0pt}ãµããµã.%
@@ -874,11 +2694,11 @@ source:
\end{LTXexample}
As described in Part~\ref{part-ref}, the only effective value of
-\textsf{kanjiskip} in an hbox is the latest value, so the value of
-\textsf{kanjiskip} which applied in the entire hbox should be 5\,pt.
-However, by the implementation method of Lua\TeX, this `5\,pt' cannot be
+\Param{kanjiskip} in an hbox is the latest value, so the value of
+\Param{kanjiskip} which applied in the entire hbox should be 5\,pt.
+However, by the implementation method of \LuaTeX, this `5\,pt' cannot be
known from any callbacks. In the \texttt{tex/packaging.w} (which is a
-file in the source of Lua\TeX), there are the following codes:
+file in the source of \LuaTeX), there are the following codes:
\begin{lstlisting}
void package(int c)
{
@@ -906,7 +2726,7 @@ callback.
The code of stack system is based on that in a post of Dev-luatex mailing list\footnote{%
\texttt{[Dev-luatex] tex.currentgrouplevel}, a post at 2008/8/19 by Jonathan Sauer.}.
-These are two \TeX\ count registers for maintaining informations:
+These are two \TeX\ count registers for maintaining information:
\verb+\ltj@@stack+ for the stack level, and \verb+\ltj@@group@level+ for
the \TeX's group level when the last assignment was done. Parameters
are stored in one big table named \texttt{charprop\_stack\_table}, where
@@ -914,7 +2734,7 @@ are stored in one big table named \texttt{charprop\_stack\_table}, where
a new stack level is created by \verb+\ltjsetparameter+, all data of the
previous level is copied.
-To resolve the problem mentioned in `Background' above, Lua\TeX-ja uses
+To resolve the problem mentioned in `Background' above, \LuaTeX-ja uses
another thing: When a new stack level is about to be created, a whatsit
node whose type, subtype and value are 44~(\textit{user\_defined}),
30112, and current group level respectively is appended to the current
@@ -939,8 +2759,282 @@ group, then:
\end{itemize}
Note that to work this trick correctly, assignments to
-\verb+\ltj@@stack+ and \verb+\ltj@@group@level+ have to be local always,
+\verb+\ltj@@stack+ and \verb+\ltj@@group@level+ have to be local always,
regardless the value of \verb+\globaldefs+.
This problem is resolved by using
\hbox{\verb+\directlua{tex.globaldefs=0}+} (this assignment is local).
-\end{document}
\ No newline at end of file
+
+
+%\section{Linebreak after Japanese Character}
+%\section{åææåç´å¾ã®æ¹è¡}
+\label{sec-lbreak}
+%\subsection{Reference: Behavior in \pTeX}
+%\subsection{åè: \pTeX ã®æå}
+%<*en>
+In~\pTeX, a line break after a Japanese character doesn't emit a space,
+since words are not separated by spaces in Japanese writings. However,
+this feature isn't fully implemented in \LuaTeX-ja due to the
+specification of callbacks in~\LuaTeX. To clarify the difference between
+\pTeX~and~\LuaTeX, We briefly describe the handling of a line break in~\pTeX, in
+this subsection.
+
+\pTeX's input processor can be described in terms of a finite state
+automaton, as that of~\TeX\ in~Section~2.5 of~\cite{texbytopic}. The
+internal states are as follows:
+\begin{itemize}
+\item State~$N$: new line
+\item State~$S$: skipping spaces
+\item State~$M$: middle of line
+\item State~$K$: after a Japanese character
+\end{itemize}
+The first three states---$N$, $S$~and~$M$---are as same as \TeX's input
+processor. State~$K$ is similar to state~$M$, and is entered after
+Japanese characters. The diagram of state transitions are indicated in
+Figure~\ref{fig-ptexipro}. Note that \pTeX\ doesn't leave state~$K$
+after `beginning/ending of a group' characters.
+%
+
+%<*ja>
+欧æã§ã¯æç« ã®æ¹è¡ã¯åèªéã§ããè¡ããªãï¼ãã®ããï¼\TeX ã§ã¯ï¼ï¼æåã®ç´å¾ã®ï¼æ¹è¡ã¯
+空ç½æåã¨åãæ±ãã¨ãã¦æ±ãããï¼ä¸æ¹ï¼åæã§ã¯ã»ã¨ãã©ã©ãã§ãæ¹è¡ãå¯è½ãªããï¼
+\pTeX ã§ã¯åææåã®ç´å¾ã®æ¹è¡ã¯åç´ã«ç¡è¦ãããããã«ãªã£ã¦ããï¼
+
+ãã®ãããªåä½ã¯ï¼\pTeX ã\TeX ããã¨ã³ã¸ã³ã¨ãã¦æ¡å¼µããããã¨ã«ãã£ã¦å¯è½ã«ãªã£ããã¨ã§ããï¼
+\pTeX ã®å
¥åå¦çé¨ã¯ï¼\TeX ã«ãããããã¨åãããã«ï¼æéãªã¼ãããã³ã¨ãã¦è¨è¿°ãããã¨ãã§ãï¼
+以ä¸ã«è¿°ã¹ããããª4ç¶æ
ãæã£ã¦ããï¼
+
+\begin{itemize}
+\item State~$N$: è¡ã®éå§ï¼
+\item State~$S$: 空ç½èªã¿é£ã°ãï¼
+\item State~$M$: è¡ä¸ï¼
+\item State~$K$: è¡ä¸ï¼åææåã®å¾ï¼ï¼
+\end{itemize}
+ã¾ãï¼ç¶æ
é·ç§»ã¯ï¼å³~\ref{fig-ptexipro} ã®ããã«ãªã£ã¦ããï¼å³ä¸ã®æ°åã¯
+ã«ãã´ãªã¼ã³ã¼ãã表ãã¦ããï¼æåã®3ç¶æ
ã¯\TeX ã®å
¥åå¦çé¨ã¨åãã§ããï¼
+å³ä¸ããç¶æ
$K$ã¨ã$j$ãã¨æ¸ãããç¢å°ãåãé¤ãã°ï¼\TeX ã®å
¥åå¦çé¨ã¨å
+ããã®ã«ãªãï¼
+
+ãã®å³ããåãããã¨ã¯ï¼
+\begin{quote}
+è¡ãåææåï¼ã¨ã°ã«ã¼ãå¢çæåï¼ã§çµãã£ã¦ããã°ï¼æ¹è¡ã¯ç¡è¦ããã
+\end{quote}
+ã¨ãããã¨ã§ããï¼
+%
+
+\begin{figure}[!tb]
+\begin{gather*}
+ \def\sp{\texttt{\char32}}
+ \xymatrix{&&
+ {\text{scan a cs}}\ar@(r,ul)[dr]&\\
+\ar[r]&
+ *++[o][F-]{N}\ar[ur]^0\ar[dd]_{d,\ g}\ar[u]^{5\ (\texttt{\char92par})}
+ \ar@{->}@(d,l)[ddrr]_(0.45){j}&&
+ *++[o][F-]{S}\ar@(l,dr)[ul]^0\ar@(l,ur)[ddll]_{d,\ g}\ar[u]_{5}
+ \ar@{->}@(r,r)[dd]^{j}\\&\\&
+ *++[o][F-]{M}\ar[uuur]^0\ar@(r,dl)[uurr]_(0.55){10\ (\sp)}
+ \ar[d]_{5\ ({\sp})}\ar@{->}@(dr,dl)[rr]_{j}&&
+ *++[o][F-]{K}\ar@{->}@(ul,d)[uuul]^0\ar@{->}[ll]^{d}
+ \ar@{->}@(ur,dr)[uu]^{10\ (\sp)}\ar@{->}[d]_5\\
+ &&&
+ }\\
+ d:=\{3,4,6,7,8,11,12,13\},\quad g:=\{1,2\},\quad j:=(\text{Japanese characters})
+\end{gather*}
+\begin{itemize}
+\item Numbers represent category codes.
+\item Category codes 9~(ignored), 14~(comment)~and~15~(invalid) are omitted in above diagram.
+\end{itemize}
+\caption{State transitions of \pTeX's input processor.}
+\label{fig-ptexipro}
+\end{figure}
+
+
+%\subsection{Behavior in \LuaTeX-ja}
+%\subsection{\LuaTeX-ja ã®æå}
+%<*en>
+States in the input processor of \LuaTeX\ is the same as that of \TeX,
+and they can't be customized by any callbacks. Hence, we can only use
+\verb+process_input_buffer+ and \verb+token_filter+ callbacks for to
+suppress a space by a line break which is after Japanese characters.
+
+However, \verb+token_filter+ callback cannot be used either, since a
+character in category code 5~(end-of-line) is converted into an space
+token \emph{in the input processor}. So we can use only the
+\verb+process_input_buffer+ callback. This means that suppressing a
+space must be done \emph{just before} an input line is read.
+
+Considering these situations, handling of an end-of-line in \LuaTeX-ja are as follows:
+\begin{quote}
+A character U+FFFFF (its category code is set to 14~(comment) by
+\LuaTeX-ja) is appended to an input line, \emph{before \LuaTeX\ actually
+process it}, if and only if the following two conditions are satisfied:
+\begin{enumerate}
+\item The category code of the character $\langle${return}$\rangle$
+ (whose character code is 13) is 5~(end-of-line).
+\item The input line matches the following `regular expression':
+\[
+ (\text{any char})^*(\textbf{JAchar})
+ \bigl(\{\text{catcode}=1\}\cup\{\text{catcode}=2\}\bigr)^*
+\]
+\end{enumerate}
+\end{quote}
+
+\paragraph{Remark}
+The following example shows the major difference from the behavior of \pTeX:
+\begin{LTXexample}
+\ltjsetparameter{autoxspacing=false}
+\ltjsetparameter{jacharrange={-6}}xã
+y\ltjsetparameter{jacharrange={+6}}zã
+u
+\end{LTXexample}
+\begin{itemize}
+\item There is no space between `x' and `y', since the line~2 ends with a \textbf{JAchar} `ã'
+(this `ã' considered as an \textbf{JAchar} at the ending of line~1).
+\item There is no space between `ã' (in the line~3) and `u', since the
+ line~3 ends with an \textbf{ALchar}
+(the letter `ã' considered as an \textbf{ALchar} at the ending of line~2).
+\end{itemize}
+%
+
+%<*ja>
+\LuaTeX ã®å
¥åå¦çé¨ã¯\TeX ã®ããã¨å
¨ãåãã§ããï¼callbackã«ããã¦ã¼ã¶ã
+ã«ã¹ã¿ãã¤ãºãããã¨ã¯ã§ããªãï¼ãã®ããï¼æ¹è¡æå¶ã®ç®çã§ã¦ã¼ã¶ãå©ç¨ã§
+ããããªcallbackã¨ãã¦ã¯ï¼\verb+process_input_buffer+ã
+\verb+token_filter+ã«éããã¦ãã¾ãï¼ãããï¼\TeX ã®å
¥åå¦çé¨ãããè¦ã
+ã¨ï¼å¾è
ãå½¹ã«ã¯çµããªããã¨ãåããï¼æ¹è¡æåã¯ï¼å
¥åå¦çé¨ã«ãã£ã¦ãã¼
+ã¯ã³åãããæã«ï¼ã«ãã´ãªã¼ã³ã¼ã10ã®32çªæåã¸ã¨ç½®ãæãããã¦ãã¾ãã
+ãï¼\verb+token_filter+ã§éæ¨æºãªãã¼ã¯ã³èªã¿åºããè¡ããã¨ãã¦ãï¼ç©ºç½æ
+åç±æ¥ã®ãã¼ã¯ã³ã¨ï¼æ¹è¡æåç±æ¥ã®ãã¼ã¯ã³ã¯åºå¥ã§ããªãã®ã ï¼
+
+ããã¨ï¼æã
ã®ã¨ããéã¯ï¼\verb+process_input_buffer+ãç¨ãã¦
+\LuaTeX ã®å
¥åå¦çé¨ã«å¼ã渡ãããåã«å
¥åæååãç·¨éããã¨ãããã®ãããªãï¼
+以ä¸ãè¸ã¾ãï¼\LuaTeX-jaã«ããããåææåç´å¾ã®æ¹è¡æå¶ãã®å¦çã¯ï¼æ¬¡ã®ããã«ãªã£ã¦ããï¼
+
+\begin{quote}
+åå
¥åè¡ã«å¯¾ãï¼\textbf{ãã®å
¥åè¡ãèªã¾ããåã®å
é¨ç¶æ
ã§}
+以ä¸ã®2æ¡ä»¶ãæºãããã¦ããå ´åï¼\LuaTeX-jaã¯U+FFFFFçªã®æå
+\footnote{ãã®æåã¯ã³ã¡ã³ãæåã¨ãã¦æ±ãããããã«\LuaTeX-jaå
é¨ã§è¨å®ããã¦ããï¼}
+ãæ«å°¾ã«è¿½å ããï¼ãã£ã¦ï¼ãã®å ´åã«æ¹è¡ã¯ç©ºç½ã¨ã¯è¦åãããªããã¨ã¨ãªãï¼
+\begin{enumerate}
+\item æ¹è¡æåï¼æåã³ã¼ã13çªï¼ã®ã«ãã´ãªã¼ã³ã¼ãã5~(end-of-line)ã§ããï¼
+\item å
¥åè¡ã¯æ¬¡ã®ãæ£è¦è¡¨ç¾ãã«ããããã¦ããï¼
+\[
+ (\text{any char})^*(\textbf{JAchar})
+ \bigl(\{\text{catcode}=1\}\cup\{\text{catcode}=2\}\bigr)^*
+\]
+\end{enumerate}
+\end{quote}
+
+ãã®ä»æ§ã¯ï¼åç¯ã§è¿°ã¹ã\pTeX ã®ä»æ§ã«ã§ããã ãè¿ã¥ãããã®ã¨ãªã£ã¦ããï¼æåã®æ¡ä»¶ã¯ï¼
+\texttt{verbatim}ç³»ç°å¢ãªã©ã®æ¥æ¬èªå¯¾å¿ãã¯ããæ¸ããªãã¦ãã¾ããããã®ãã®ã§ããï¼
+ããããªããï¼å®å
¨ã«åãæåãå®ç¾ã§ããããã§ã¯ãªãï¼
+å·®ç°ã¯ï¼æ¬¡ã®ä¾ã示ãããã«ï¼åææåã®ç¯å²ãå¤æ´ããè¡ã®æ¹è¡ã«ããã¦è¦ãããï¼
+\begin{LTXexample}
+\ltjsetparameter{autoxspacing=false}
+\ltjsetparameter{jacharrange={-6}}xã
+y\ltjsetparameter{jacharrange={+6}}zã
+u
+\end{LTXexample}
+ãã\pTeX ã¨ã¾ã£ããåãæåã示ããªãã°ï¼åºåã¯
+ã\hbox{\ltjsetparameter{autoxspacing=false}x yzãu}ãã¨ãªãã¹ãã§ããï¼ãããï¼å®éã«ã¯
+ä¸ã®ããã«ç°ãªãæåã¨ãªã£ã¦ããï¼
+\begin{itemize}
+\item 2è¡ç®ã¯ãããã¨ããåææåã§çµããï¼2è¡ç®ãå¦çããåã®æç¹ã§ã¯ï¼
+ ãããã¯åææåæ±ãã§ããï¼ããï¼ç´å¾ã®æ¹è¡æåã¯ç¡è¦ãããï¼
+\item 3è¡ç®ã¯ãããã¨ãã欧ææåã§çµããï¼2è¡ç®ãå¦çããåã®æç¹ã§ã¯ï¼
+ ãããã¯æ¬§ææåæ±ãã§ããï¼ããï¼ç´å¾ã®æ¹è¡æåã¯ç©ºç½ã«ç½®ãæããï¼
+\end{itemize}
+ãã®ããï¼ãã©ãã«ãé¿ããããã«ï¼åææåã®ç¯å²ã\verb+\ltjsetparameter+ã§ç·¨éããå ´åï¼
+ãã®è¡ã¯ããã§æ¹è¡ããããã«ããæ¹ãããã ããï¼
+%
+
+
+%\section{Insertion of JFM glues, \Param{kanjiskip} and \Param{xkanjiskip}}
+%\section{JFM ã°ã«ã¼ã®æ¿å
¥ï¼\Param{kanjiskip} 㨠\Param{xkanjiskip}}
+%\subsection{Overview}
+%\subsection{æ¦è¦}
+
+
+\LuaTeX-ja ã«ãããåæå¦çã°ã«ã¼ã®æ¿å
¥æ¹æ³ã¯ï¼\pTeX ã®ããã¨ã¯å
¨ãç°ãªãï¼
+\pTeX ã§ã¯æ¬¡ã®ãããªä»æ§ã§ãã£ãï¼
+\begin{itemize}
+\item JFMã°ã«ã¼ã®æ¿å
¥ã¯ï¼åææåã表ããã¼ã¯ã³ãå
ã«æ°´å¹³ãªã¹ãã«ï¼æåã表ãï¼ã
+追å ããéç¨ã§è¡ãããï¼
+\item \Param{xkanjiskip}ã®æ¿å
¥ã¯ï¼hboxã¸ã®ããã±ã¼ã¸ã³ã°ãè¡åå²åã«è¡ãããï¼
+\item \Param{kanjiskip}ã¯ãã¼ãã¨ãã¦ã¯æ¿å
¥ãããªãï¼ããã±ã¼ã¸ã³ã°ãè¡åå²ã®è¨ç®æã«
+ãåææåã表ã2ã¤ã®ã®éã«ã¯\Param{kanjiskip}ãããããã®ã¨ã¿ãªãããï¼
+\end{itemize}
+ãããï¼\LuaTeX-jaã§ã¯ï¼hboxã¸ã®ããã±ã¼ã¸ã³ã°ãè¡åå²åã«å
¨ã¦ã®
+\textbf{JAglue}ï¼å³ã¡JFMã°ã«ã¼ã»\Param{xkanjiskip}ã»\Param{kanjiskip}ã®
+3種é¡ãä¸åº¦ã«æ¿å
¥ãããã¨ã«ãªã£ã¦ããï¼ããã¯ï¼\LuaTeX ã«ããã¦æ¬§æã®ååã»
+ã«ã¼ãã³ã°å¦çããã¼ããã¼ã¹ã«ãªã£ããã¨ã«å¯¾å¿ããå¤æ´ã§ããï¼
+
+\LuaTeX-jaã«ããã\textbf{JAglue}æ¿å
¥å¦çã§ã¯ï¼æ¬¡ç¯ã§å®ç¾©ãã
+ãã¯ã©ã¹ã¿ããåä½ã«ãã¦è¡ãããï¼å¤§éæã«ããã¨ï¼ãã¯ã©ã¹ã¿ãã¯æåã¨ããã«ä»éã
+ããã¼ãéï¼ã¢ã¯ã»ã³ãä½ç½®è£æ£ç¨ã®kernãï¼ã¤ã¿ãªãã¯è£æ£ï¼ãã¾ã¨ãããã®
+ã§ããï¼2ã¤ã®ã¯ã©ã¹ã¿ã®éã«ã¯ï¼ããã«ãã£ï¼\verb+\vadjust+ï¼whatsitãªã©ï¼è¡çµç
+ã«ã¯é¢ä¿ããªããã®ãããï¼
+
+
+%\subsection{Step 0: definition of a `cluster'}
+%\subsection{Step 0: ãã¯ã©ã¹ã¿ãã®å®ç¾©}
+
+\begin{defn}
+A \emph{cluster} is a list of consecutive nodes in one of the following forms,
+with the \textit{id} of it:
+\begin{enumerate}
+\item Nodes whose value of\ \verb+\ltj@icflag+ is in $[3,15)$. These
+ nodes come from a hbox which is already packaged, by unpackaging
+ (\verb+\unhbox+).
+ The \textit{id} is \textit{id\_pbox}.
+\item A inline math formula, including two \textit{math\_node}s at the boundary of it:
+HOGE
+ The \textit{id} is \textit{id\_math}.
+\item A \textit{glyph\_node}~$p$ with nodes which relate with it:
+\begin{enumerate}
+\item A kern for the italic correction of~$p$.
+\item An accent attached to $p$ by \verb+\accent+.
+\end{enumerate}
+\[
+\overbrace{%
+ \Node{kern}{$\mathit{subtype}=2$}\longrightarrow
+\left\{\begin{array}{c}
+\Node{glyph}{accent}\\\noalign{\medskip}
+\Node{hbox}{accent (shifted vert.)}
+\end{array}\right\}\longrightarrow
+\Node{kern}{$\mathit{subtype}=2$}}^{\text{(a)}}
+\longrightarrow
+\Node{glyph}{$p$}\longrightarrow
+\overbrace{%
+\Node{kern}{italic corr.}}^{\text{(b)}}
+\]
+
+The \textit{id} is \textit{id\_jglyph} or
+\textit{id\_glyph}, according to whether the \textit{glyph\_node}
+represents a Japanese character or not.
+\item An box-like node, that is, an hbox, an vbox and an rule (\verb+\vrule+).
+The \textit{id} is \textit{id\_hlist} if the node is an
+ hbox which is not shifted vertically, or \textit{id\_box\_like}
+ otherwise.
+\item A glue, a kern whose subtype is not 2~(\textit{accent}), and a discretionary break.
+The \textit{id} is \textit{id\_glue}, \textit{id\_kern}
+ and \textit{id\_disc}, respectively.
+\end{enumerate}
+We denote a cluster by \textit{Np}, \textit{Nq} and \textit{Nr}.
+\end{defn}
+
+以éã¯æ¥æ¬èªï¼
+
+ä¸é¨ã®ã¯ã©ã¹ã¿ã®\textit{id}ã®æå³ã¯æ¬¡ã®éãï¼
+\begin{description}
+\item[\textit{id\_glyph}] 欧ææåï¼`ffi' ã®ãããªãªã¬ãã£ç±æ¥ã®å¯è½æ§ããï¼ï¼
+\item[\textit{id\_jglyph}] åææåï¼
+\item[\textit{id\_math}] ã¤ã³ã©ã¤ã³æ°å¼ï¼ãæåã³ã¼ã$-1$ã®æ¬§ææåãã¨ãã¦å
é¨ã§ã¯æ±ãããï¼
+\item[\textit{id\_hlist}] 縦æ¹åã«ã·ããããã¦ããªã hboxï¼
+\item[\textit{id\_pbox}] ãæ¢ã«å¦çãããããã¼ãã®ãªã¹ãï¼
+\item[\textit{id\_box\_like}] \textit{id\_hlist}ã¨ãªããªãbox
+ï¼ç¸¦æ¹åã«ã·ãããããhboxãï¼vboxï¼ãï¼ruleï¼
+\item[\textit{id\_disc}] discretionary break (\verb+\discretionary{pre}{post}{nobreak}+).
+\end{description}
+
+
+\end{document}