OSDN Git Service

Merge branch 'kitagawa_jfm-after' into tc11-docs
authorHironori Kitagawa <h_kitagawa2001@yahoo.co.jp>
Sat, 19 Nov 2011 00:22:27 +0000 (09:22 +0900)
committerHironori Kitagawa <h_kitagawa2001@yahoo.co.jp>
Sat, 19 Nov 2011 00:22:27 +0000 (09:22 +0900)
doc/ajt-devel-ltja.tex [new file with mode: 0644]
doc/ajt.cls [new file with mode: 0644]
doc/tc11-abst.pdf [new file with mode: 0644]
doc/tc11-abst.tex [new file with mode: 0755]
doc/tc11-slide.pdf [new file with mode: 0644]
doc/tc11-slide.tex [new file with mode: 0644]

diff --git a/doc/ajt-devel-ltja.tex b/doc/ajt-devel-ltja.tex
new file mode 100644 (file)
index 0000000..15be69d
--- /dev/null
@@ -0,0 +1,1085 @@
+%#!lualatex ajt-devel-ltja
+\documentclass{ajt}
+
+%%% Packages used in this paper
+%%% LuaTeX-ja
+
+\usepackage{luatexja}
+\DeclareFontShape{JY3}{mc}{m}{n}{<-> s*[0.92489] file:ipam.ttf:jfm=ujis}{}
+\DeclareFontShape{JY3}{gt}{m}{n}{<-> s*[0.92489] file:ipag.ttf:jfm=ujis}{}
+% quick hack: monospaced Japanese font by \ttfamily
+\DeclareKanjiFamily{JY3}{\ttdefault}{}{}
+\DeclareFontShape{JY3}{\ttdefault}{m}{n}{<-> s*[0.92489] file:ipag.ttf:jfm=mono}{}
+
+%%% for LTXexample environment
+\usepackage{showexpl,lltjlisting}
+\lstset{basicstyle=\ttfamily\small, width=0.3\textwidth, basewidth=.5em}
+
+\usepackage{mflogo,booktabs}
+\definecolor{grayx}{gray}{0.85}
+
+%%% Verbatim environment
+\usepackage{fancyvrb}
+\CustomVerbatimEnvironment{code}{Verbatim}%
+{numbers=left,xleftmargin=1.5em,baselinestretch=1.069,fontsize=\small}
+\CustomVerbatimEnvironment{codewithoutnum}{Verbatim}%
+{xleftmargin=1.5em,baselinestretch=1.069,fontsize=\small}
+\CustomVerbatimEnvironment{codewithoutnumsmall}{Verbatim}%
+{xleftmargin=1.5em,baselinestretch=1.0,fontsize=\footnotesize}
+\DefineShortVerb{\|}
+
+%%% Mandatory article metadata %%%
+\title{Development of the \LuaTeX-ja package}
+\author{Hironori Kitagawa {\normalsize 北川 弘典}}
+\address{The \LuaTeX-ja project team}
+\email{h\_kitagawa2001@yahoo.co.jp}
+
+\keywords{\TeX, p\TeX, \LuaTeX, \LuaTeX-ja, Japanese}
+\abstract{%
+The \LuaTeX-ja package is a macro package for typesetting Japanese
+documents under \LuaTeX.  This packages has more flexibility of
+typesetting than p\TeX, and corrected some unwanted features of p\TeX.
+In this paper, we describe specifications, the current status and some
+internal processing methods of \LuaTeX-ja.
+}
+
+\newcommand{\parname}[1]{\textsf{#1}}
+\newcommand{\jstrut}{\vrule width0pt height\cht depth\cdp}
+\newcommand{\imagfm}[1]{\ifvmode\leavevmode\fi%
+  \hbox{\fboxsep=0pt\fbox{\setbox0=\hbox{#1}\copy0\kern-\wd0
+  \smash{\vrule width \wd0 height 0.4pt depth0.4pt}}}}
+\begin{document}
+
+%%% Do not forget to start with \maketitle!
+\maketitle
+
+\section{Introduction}
+\subsection{History}
+To typeset Japanese documents with \TeX, ASCII p\TeX~\cite{ptex} has
+been widely used in Japan.  There are other methods---for example, using
+Omega and OTP~\cite{omega}, or with the CJK package---to do so, however,
+these alternative methods did not become a majority.  The author thinks
+that this is because p\TeX\ enables us to produce high-quality documents
+(e.g.,~supporting vertical typesetting), and the appearance of p\TeX\ is
+earlier than alternatives described above.
+
+However, p\TeX\ has been left behind from the extensions of \TeX\
+such as \eTeX\ and \pdfTeX, and the diffusion of UTF-8 encoding.  In
+recent years, the situation become better, because of developments
+of |ptexenc|~\cite{ptexenc} by Nobuyuki Tsuchimura (\hbox{土村展之}),
+$\varepsilon$-p\TeX~\cite{eptex} by the author,~and up\TeX~\cite{uptex}
+by Takuji Tanaka (田中琢爾). However, continuing this approach, namely, to develop
+an engine extension localized for Japanese, is not wise. This approach
+needs lots of work for \emph{each} engine, and since \LuaTeX\ has an ability
+to hook \TeX's internal process by using Lua callbacks, the necessity of
+an engine extension is getting smaller.
+
+
+There were several experimental attempts to typeset
+Japanese documents with \LuaTeX\ before. Here we cite three examples:
+\begin{itemize}
+\item |luaums.sty|~\cite{luaums} developed by the author. This
+      experimental package is for creating a certain Japanese-based presentation
+      with \LuaTeX.
+\item the \emph{luajalayout} package~\cite{luajalayout}, formerly known as the
+      \emph{jafontspec} package, by Kazuki Maeda (前田一貴). This package is based on
+      \LaTeXe\ and \emph{fontspec} package.
+\item the \emph{luajp-test} package~\cite{luajp-test}, a test package made by
+      Atsuhito Kohda (香田温人), based on articles on the web page~\cite{joylua}.
+\end{itemize}
+However, these packages are based on \LaTeXe, and do not have much
+ability to control the typesetting rule. And it is inefficient that more
+than one people separately develop similar packages.  Development of the
+\LuaTeX-ja package is started initially by the author and Kazuki Maeda, because of
+these situations.
+
+\subsection{Development Policy of \LuaTeX-ja}
+\label{ssec-pol} 
+The first aim of the \LuaTeX-ja project is to implement features (from the
+'primitive' level) of p\TeX\ as macros under \LuaTeX, so \LuaTeX-ja is
+much affected by p\TeX.  However, as development proceeds, some
+technical/conceptual difficulties are arisen. Hence we changed the aim
+of the project as follows:
+\begin{itemize}
+\item\emph{\LuaTeX-ja offers at least the same flexibility of
+     typesetting that p\TeX\ has.}
+
+     We think that the ability of producing outputs conformed to
+     JIS~X~4051~\cite{jisx4051}, the Japanese Industrial Standard for
+     typesetting, or to a technical note~\cite{w3c} by W3C is not enough;
+     if one wants to produce very incoherent outputs for some reason, it
+     should be possible.
+In this point, previous attempts of Japanese typesetting with \LuaTeX\
+     which we cited in the previous subsection are inadequate.
+
+p\TeX\ has some flexibility of typesetting, by changing internal
+     parameters such as |\kanjiskip| or |\prebreakpenalty|, and by using
+     custom JFM (Japanese TFM). Therefore we decided to include these
+     functionality to \LuaTeX-ja.
+
+\item\emph{\LuaTeX-ja isn't mere re-implementation or porting of p\TeX;
+     some (technically and/or conceptually) inconvenient features of
+     p\TeX\ are modified.} 
+
+     We describe this point in more detail at the next section.
+\end{itemize}
+
+
+\subsection{Contents of this Paper}
+Here we describe the contents of the rest of this paper briefly.  In
+Section~2, we describe major differences between p\TeX\ and \LuaTeX-ja.
+In Section~3, we show the current status of the \LuaTeX-ja package. In
+Section~4, we describe some internal routines of \LuaTeX-ja.  We hope
+that the materials in this section have good applications.
+
+\subsection*{About the Project}
+This \LuaTeX-ja project is hosted by SourceForge.jp. The official wiki
+is located on
+\url{http://sourceforge.jp/projects/luatex-ja/wiki/FrontPage}.  There is
+no stable version at Oct.\ 15, 2011, however the development source can be
+obtained from the git repository.  Members of the project are as follows
+(in random order): Hironori Kitagawa, Kazuki Maeda, Takayuki Yato,
+Yusuke Kuroki, Noriyuki Abe, Munehiro Yamamoto, Tomoaki Honda,
+and~Shuzaburo Saito.
+
+
+\section{Major differences with \pTeX}
+In this section, we look at several major differences between p\TeX\
+and our \LuaTeX-ja.  For general information of Japanese typesetting and the
+overview of p\TeX, please see Okumura~\cite{ptexjp}.
+
+
+\subsection{Names of Control Sequences}
+\label{ssec-csname} Since p\TeX\ is an engine modification of Knuth's
+original \TeX82 engine, some primitives added by it take a form that is
+very difficult to be simulated by a macro.  For example, an additional
+primitive |\prebreakpenalty|$\langle\hbox{\it
+char\_code}\rangle$|[=]|$\langle\hbox{\it penalty}\rangle$ in p\TeX\
+sets the amount of penalty inserted before a character whose code is
+$\langle\hbox{\it char\_code}\rangle$ to $\langle\hbox{\it
+penalty}\rangle$, and this form |\prebreakpenalty|$\langle\hbox{\it
+char\_code}\rangle$ can be also used for retrieving the value.
+
+Moreover, there are some parameters which values of them at the end of a
+horizontal box or that of a paragraph are effective in whole box or
+paragraph.  These parameters were implemented as additional internal
+parameters in \pTeX. However, the implementation of these parameters in
+\LuaTeX-ja is not so easy; we will discuss on it in
+Subsection~\ref{ssec-stack}.
+
+From above 2~problems we discussed above, the assignment and retrieval
+of most parameters in \LuaTeX-ja are summarized into the following
+3~control sequences:
+\begin{itemize}
+\item |\ltjsetparameter{|$\langle\hbox{\it
+      name}\rangle$|=|$\langle\hbox{\it value}\rangle$|,...}|: for local
+      assignment.
+\item |\ltjglobalsetparameter|: for global assignment. These two control
+      sequences obey the value of |\globaldefs| primitive.
+\item |\ltjgetparameter{|$\langle\hbox{\it
+      name}\rangle$|}[{|$\langle\hbox{\it optional
+      argument}\rangle$|}]|: for retrieval. The returned value is always
+      a string.
+\end{itemize}
+
+\subsection{Line-break after a Japanese Character}
+\label{ssec-line} 
+
+Japanese texts can break lines almost everywhere, in contrast with
+alphabetic texts can break lines only between words (or use
+hyphenation). Hence, p\TeX's input processor is modified so that a
+line-break after a Japanese character doesn't emit a space. However,
+there is no way to customize the input processor of \LuaTeX, other than
+to hack its CWEB-source. All a macro package can do is to modify an input line before
+when \LuaTeX\ begin to process it, inside the |process_input_buffer|
+callback.
+
+Hence, in \LuaTeX-ja, a comment letter (we reserve U+FFFFF for this
+purpose) will be appended to an input line, if this line ends with a Japanese
+character\footnote{Strictly speaking, it also requires that the catcode
+of the end-line character is 5~(\emph{end-of-line}). This condition is
+useful under the verbatim environment.}. One might jump to a conclusion
+that the treatment of a line break by p\TeX\ and that of \LuaTeX-ja are
+totally same, however they are different in the respect that \LuaTeX-ja's
+judgement whether a comment letter will be appended the line is done
+\emph{before} the line is actually processed by \LuaTeX.
+
+Figure~\ref{fig-linebreak} shows an example of this situation; the
+command at the first line marks most of Japanese characters as
+`non-Japanese characters'. In other words, from that command onward, the
+letter `あ' will be treated as an alphabetic character by
+\LuaTeX-ja. Then, it is natural to have a space between `あ' and `y' in
+the output, where the actual output in the figure does not so.  This is
+because `あ' is considered a Japanese character by \LuaTeX-ja,
+when \LuaTeX-ja does a decision whether U+FFFFF will be added to the
+input line~2.
+
+\begin{figure}
+\begin{LTXexample}
+\font\x=IPAMincho \x
+\ltjsetparameter{jacharrange={-6}}xあ
+y
+\end{LTXexample}
+\caption{A notable sample showing the treatment of a line break after a
+Japanese character.}\label{fig-linebreak}
+\end{figure}
+
+\subsection{Separation between `real' fonts and Metrics}
+\label{ssec-sepmet}
+
+Traditionally, most Japanese fonts used in typesetting are not
+proportional, that is, most glyphs have same size (in most cases,
+square-shaped). Hence, it is not rare that the contents of different
+JFMs are essentially same, and only differ in their names. For example,
+|min10.tfm| and |goth10.tfm|, which are JFMs shipped with p\TeX\ for
+seriffed \emph{mincho} family and sans-seriffed \emph{gothic} family,
+differ their |FAMILY| and |FACE| only. Moreover, |jis.tfm| and
+|jisg.tfm|, which consists a parts of \emph{jis} font metric, which is
+used in \emph{jsclasses}~\cite{jsclasses} by Haruhiko Okumura (奥村晴彦),
+are totally same as binary files.  Considering this situation, we
+decided to separate `real' fonts and metrics used for them in
+\LuaTeX-ja. Typical declarations of Japanese fonts in the style of plain
+\TeX\ are shown in Figure~\ref{fig-jfdef}. We would like to add several
+remarks:
+\begin{itemize}
+\item A control sequence |\jfont| must be used for Japanese fonts, instead of |\font|.
+\item \LuaTeX-ja automatically loads the \emph{luaotfload} package, so
+      |file:| and |name:| prefixes, and various font features can be
+      used as the line~1 in Figure~\ref{fig-jfdef}.
+\item The |jfm| key specifies the metric for the font. In
+      Figure~\ref{fig-jfdef}, both fonts will use a metric stored in a
+      Lua script named |jfm-ujis.lua|. This metric is the standard
+      metric in \LuaTeX-ja, and is based on JFMs used in the \emph{otf}
+      package~\cite{otf}.
+\item The |psft:| prefix can be used to specify name-only, non-embedded
+      fonts. When one display a pdf with these fonts, actual fonts which
+      will be used for them depend on a pdf reader. 
+\end{itemize}
+The specification of a metric for \LuaTeX-ja is similar to that of a JFM
+(see \cite{ptexjp}); characters are grouped into several classes, the
+size information of characters are specified for each class, and
+glue/kern insertions are specified for each pair of classes. Although
+the author have not tried, it may be possible to develop a program that
+`converts' a JFM to a metric for \LuaTeX-ja.  \LuaTeX-ja offers three
+metrics by default; |jfm-ujis.lua|, |jfm-jis.lua| based on the
+\emph{jis} font metric, and |jfm-min.lua| based on old |min10.tfm|.
+
+ Note that |-kern| in features
+is important, since  kerning information from real font itself will
+clash with glue/kern informations from the metric.
+
+\begin{figure}
+\begin{verbatim}
+\jfont\foo=file:ipam.ttf:jfm=ujis;script=latn;-kern;+jp04 at 12pt
+\jfont\bar=psft:Ryumin-Light:jfm=ujis at 10pt
+\end{verbatim}
+\caption{Typical declarations of Japanese fonts.}
+\label{fig-jfdef}
+\end{figure}
+
+\subsection{Insertion of Kerns and/or Glues for Japanese Typesetting: the Timing}
+\label{ssec-jglue}
+
+As described in \cite{luatexref}, \LuaTeX's kerning and ligaturing
+processes are totally different from those of \TeX82.  \TeX82's process is
+done just when a (sequence of) character is appended to the current
+list. Thus we can interrupt this process by writing as
+|f{}irm|. However, \LuaTeX's process is \emph{node-based}, that is, the
+process will be done when a horizontal box or a paragraph is ended, so
+|f{}irm| and |firm| yield  same outputs under \LuaTeX.
+
+The situation for Japanese characters is more complicated.
+Glues (and kerns) which are needed for Japanese
+typesetting will be divided into the following three categories:
+\begin{itemize}
+\item Glue (or kern) from the metric of Japanese fonts (\emph{JFM glue},
+      for short). 
+
+\item Default glue between a Japanese character and an alphabetic
+      character (\emph{xkanjiskip}, for short), usually 1/4 of
+      full-width (\emph{shibuaki}) with some stretch and shrink for
+      justifying each line.
+\item Default glue between two consecutive Japanese characters
+      (\emph{kanjiskip}, for short). The main reason of this glue is to
+      enable breaking lines almost everywhere in Japanese texts. In most
+      cases, its natural width is zero, and some stretch/shrink for
+      justifying each line.
+\end{itemize}
+In p\TeX, these three kinds of glues are treated differently. A JFM glue
+is inserted when a (sequence of) Japanese character is appended to the
+current list, same as the case of alphabetic characters in \TeX82. This
+means that one can interrupt the insertion process by saying |{}|.  A
+\emph{xkanjiskip} is inserted just before `hpack' or line-breaking of a
+paragraph; this timing is somewhat similar to that of \LuaTeX's kerning
+process. Finally, A \emph{kanjiskip} is not appeared as a node anywhere;
+only appears implicitly in calculation of the width of a horizontal box,
+that of breaking lines, and the actual output process to a DVI
+file. These specifications made p\TeX's behavior very hard to
+understand.
+
+\LuaTeX-ja inserts glues in all three categories simultaneously inside
+|hpack_filter| and |pre_linebreak_filter| callbacks.  The reasons of
+this specification are to behave like alphabetic characters in \LuaTeX\
+(as described in the first paragraph), and to clarify the specification
+for \LuaTeX-ja's process.
+
+\subsection{Insertion of Kerns and/or Glues for Japanese Typesetting: the Spec}
+\begin{table}
+\caption{Examples of differences between  p\TeX\ and \LuaTeX-ja,}
+\label{tab-jfmglue}
+\begin{center}
+\begin{tabular}{llllllll}
+\toprule
+&\multicolumn{1}{c}{(1)}&\multicolumn{1}{c}{(2)}&\multicolumn{1}{c}{(3)}&\multicolumn{1}{c}{(4)}\\
+Input      &|あ】{}【〙\/〘|        &|い』\/a| &|う)\hbox{}(| &|え]\special{}[|\\\midrule
+p\TeX      &あ】\hbox{}【〙\hbox{}〘&い』\/a   &う)\hbox{}(   &え]\hbox{}[\\
+\LuaTeX-ja &あ】{}【〙\/〘          &い』\/a   &う)\hbox{}(   &え]\special{}[\\
+\bottomrule
+\end{tabular}
+\end{center}
+\end{table}
+
+\begin{figure}
+\begin{center}
+\fontsize{40}{40}\selectfont
+\imagfm{\jstrut あ}%
+\imagfm{\jstrut 】\inhibitglue}%
+\imagfm{\jstrut\kern.5\zw}%
+\imagfm{\jstrut\kern.5\zw}%
+\imagfm{\jstrut\inhibitglue【}%
+\imagfm{\jstrut 〙\inhibitglue}%
+\imagfm{\jstrut\kern.5\zw}%
+\imagfm{\jstrut\kern.5\zw}%
+\imagfm{\jstrut\inhibitglue〘}%
+\end{center}
+\caption{Detail of (1) in Table~\ref{tab-jfmglue}.}
+\label{fig-ptexjfm}
+\end{figure}
+
+Now we will take a look inside the insertion process itself, and describe 4~points.
+
+\begin{description}
+\item[Ignored Nodes]
+As noted in the previous subsection, the insertion process in p\TeX\ can
+          be interrupted by saying |{}| or anything else\footnote{This
+          is why some tricks like \texttt{ちょ\char`\{\char`\}っと} for
+          \texttt{min10.tfm} and other `old' JFMs work.}. This leads
+          the second row in Table~\ref{tab-jfmglue}, or
+          Figure~\ref{fig-ptexjfm}. `The process is interrupted' means
+          that p\TeX\ does not think the letter `】\inhibitglue' is
+          followed by `\inhibitglue【', hence two half-width glues are
+          inserted between between `】\inhibitglue' and `\inhibitglue【',
+          where one is from `】\inhibitglue' and another is from
+          `\inhibitglue【'.
+
+          On the other hand, in \LuaTeX-ja, the process is done inside
+          |hpack_filter| and |pre_linebreak_filter| callbacks. Hence,
+          \emph{anything that does not make any node will be
+          ignored}\ in \LuaTeX-ja, as shown in (1) in
+          Table~\ref{tab-jfmglue}. \LuaTeX-ja also ignores any nodes
+          which does not make any contribution to current horizontal
+          list---\emph{ins\_node}, \emph{adjust\_node},
+          \emph{mark\_node}, \emph{whatsit\_node} and
+          \emph{penalty\_node}---, as shown in (4).
+
+
+By the way, around a \emph{glyph\_node} $p$ there may be some nld odes
+          attached to $p$. These are an accent and kerns for
+          positioning it, and a kern from the italic
+          correction\footnote{\TeX82 (and \LuaTeX) does not distinguish
+          between explicit kern and a kern for italic correction. To
+          distinguish them, an additional subtype for kern is introduced
+          in p\TeX. On the other hand, \LuaTeX-ja uses an additional attribute and
+          redefines \texttt{\char`\\/}.} for $p$. It is natural that
+          these attachments should be ignored inside the process. Hence
+          \LuaTeX-ja takes this approach, as the latest version of
+          p\TeX\ (p3.2). This explains (2) in the figure.
+
+Summerizing above, one should put an empty horizontal box |\hbox{}| to
+          where he wants to interrupt the insertion process in
+          \LuaTeX-ja as (3) in the figure.
+
+\item[Fonts with the Same Metric]
+Recall that \LuaTeX-ja separated `real' fonts and metrics, as in Subsection~\ref{ssec-sepmet}. 
+Consider the following input, where all Japanese fonts use same metric
+          (in \LuaTeX-ja), and |\gt| selects \emph{gothic} family for
+          the current Japanese font family:
+\begin{quote}
+\begin{verbatim}
+明朝)\gt (ゴシック
+\end{verbatim}
+\end{quote}
+If the above input is processed by p\TeX, since the insertion process is
+          interrupt by |\gt|, the result looks like
+\begin{quote}
+\mc 明朝)\hbox{}\gt (ゴシック
+\end{quote}
+However this seems to be unnatural, since two Japanese fonts in the
+          output use the same metric, i.e.,~the same
+          typesetting rule.  Hence, we decided that Japanese fonts with
+          the same metric are treated as one font in the insertion
+          process of \LuaTeX-ja. Thus, the output from the above input
+          in \LuaTeX-ja looks like:
+\begin{quote}
+\mc 明朝)\gt (ゴシック
+\end{quote}
+One might have the situation that this default behavior is not
+          suitable. \LuaTeX-ja offers a way to cope with this case, but
+          we leave it to the manual~\cite{man}.
+
+\item[Fonts with Different Metrics] 
+In the case where two consecutive Japanese characters use different metrics and/or
+          different size is similar. Consider the following input where
+          the \emph{mincho} family and the \emph{gothic} family use
+          different metrics:
+\begin{quote}
+\begin{verbatim}
+漢)\gt (漢)\large (大
+\end{verbatim}
+\end{quote}
+As the previous paragraph, this input yields the following, by p\TeX:
+\begin{quote}
+\mc 漢)\hbox{}\gt (漢)\hbox{}\large (大
+\end{quote}
+We thought that amounts of spaces between parentheses in above output
+          are too much. So we changed the default behavior of
+          \LuaTeX-ja so that the amount of a glue between two Japanese
+          characters with different metrics is the average of a glue
+          from the left character and that from the right
+          character. For example, Figure~\ref{fig-diffmet} shows the
+          output from above input. The width of glue indicated `(1)' is
+          $(a/2 + a/2)/2 = 0.5a$, and the width of glue indicated `(2)'
+          is $(a/2 + 1.2a/2)/2 = 0.55a$. This default behavior can be
+          changed by \textsf{diffrentmet} parameter of \LuaTeX-ja.
+
+\begin{figure}
+\begin{center}
+\fontsize{40}{40}\selectfont
+\imagfm{\jstrut\smash{%
+  \vtop{\lineskiplimit=\maxdimen\lineskip2pt\halign{#\cr漢\cr
+    \small\vrule height .5ex depth .5ex\hrulefill\ \lower.5ex\hbox{$a$}\ 
+    \hrulefill\vrule height .5ex depth .5ex\cr}}}}%
+\imagfm{\jstrut )\inhibitglue}%
+\hbox to .5\zw{\hss\normalsize (1)\hss}%
+\imagfm{\jstrut\inhibitglue\gt (}%
+\imagfm{\jstrut\gt 漢}%
+\imagfm{\jstrut\gt )\inhibitglue}%
+\hbox to .55\zw{\hss\normalsize (2)\hss}%
+\imagfm{\fontsize{48}{48}\selectfont\jstrut\gt\inhibitglue (}%
+\imagfm{\fontsize{48}{48}\selectfont\jstrut\smash{%
+  \vtop{\lineskiplimit=\maxdimen\lineskip2pt\halign{#\cr\gt 大\cr
+    \small\vrule height .5ex depth .5ex\hrulefill\ \lower.5ex\hbox{$1.2a$}\ 
+    \hrulefill\vrule height .5ex depth .5ex\cr}}}}
+\end{center}
+\caption{Fonts with different metrics.}
+\label{fig-diffmet}
+\end{figure}
+
+\item[\emph{kanjiskip} and \emph{xkanjiskip}]
+In p\TeX, the value of \emph{xkanjiskip} is controlled by a skip named
+          |\xkanjiskip|. A defect of this implementation is that the
+          value of \emph{xkanjiskip} is not connected with the size of
+          the currnt Japanese font. It seems that |EXTRASPACE|,
+          |EXTRASTRETCH|, |EXTRASHRINK| parameters in a JFM are
+          reserved for specifying the default value of
+          \emph{xkanjiskip} in a unit of the design size, but p\TeX\
+          did not use these parameters. 
+
+Considering this situation of p\TeX, \LuaTeX-ja can use the value of
+          \emph{xkanjiskip} that specified in a metric. If the value of
+          \emph{xkanjiskip} on user side (this is the
+          \textsf{xkanjiskip} parameter in |\ltjsetparameter|) is
+          |\maxdimen|, then the \LuaTeX-ja use the specification from
+          the current used metric as the actual value of
+          \emph{xkanjiskip}.
+This description also applies for \emph{kanjiskip}.
+\end{description}
+
+
+\section{Current Status of Development}
+At the moment, \LuaTeX-ja can be used under plain \TeX, and under
+\LaTeXe. Generally speaking, one only has to read |luatexja.sty|, by |\input|
+command or |\usepackage| (in~\LaTeXe), if you merely want to typeset
+Japanese characters.  We look more detail by parts.
+
+\subsection{`Engine Extension'}
+The lowest part of \LuaTeX-ja corresponds the p\TeX\ extension as
+\emph{an engine extension of \TeX}. We, the project menbers, think that
+this part is almost done. Other features of \LuaTeX-ja which we have not
+described are the followings:
+\begin{description}
+\item[Setting the Range of `Japanese characters'] This feature is
+          inspired by up\TeX. up\TeX\ has an additional primitive named
+          |\kcatcode| for setting how a character is treated among an
+          alphabetic character, \emph{kana}, \emph{kanji},
+          \emph{Hangul}, or~\emph{an other CJK character}. and the
+          assignment of |\kcatcode| can be done by a Unicode
+          block\footnote{There are some exceptions. For example,
+          U+FF00--FFEF (Halfwidth and Fullwidth Forms) are divided into
+          three blocks in recent up\TeX.}.
+
+\LuaTeX-ja uses a slightly different approach. Because there are many
+          Unicode blocks already in Basic Multilingual Plane which are
+          not included in most Japanese fonts, so it would be
+          inefficient to toggle by a Unicode block.  Furthermore, the
+          basic Japanese character set JIS~X~0208 are not just union of
+          Unicode blocks; for example, the intersection of JIS~X~0208
+          and Latin-1 Supplement is shown in Table~\ref{tab-inter}.
+          Considering these two points, to customize the range of
+          Japanese characters in \LuaTeX-ja, one has to define
+          character ranges in his source in advance.
+
+\item[Shifting Baseline]
+In order to make a match between Japanese fonts and alphabetic fonts,
+          sometimes shifting the baseline of alphabetic characters may
+          be needed. p\TeX\ has a dimension |\ybaselineshift|, which
+          corresponds the amount of shifting down the baseline of alphabetic
+          characters. This is useful for Japanese-based documents, but
+          not for documents mainly in languages with alphabetic
+          characters.
+
+Hence, \LuaTeX-ja extends p\TeX's |\ybaselineshift| to Japanese
+          characters. Namely, \LuaTeX-ja offers two parameters,
+          \textsf{yjabaselineshift} and \textsf{yalbaselineshift}, for the
+          amount of shifting the baseline of Japanese characters and
+          that of alphabetic characters, respectively. 
+
+\begin{figure}
+\begin{center}
+\fontsize{40}{40}\selectfont\fboxsep0mm
+\vrule width 0.9\textwidth height0.4pt depth0.4pt\kern-0.9\textwidth
+\hbox to 0.9\linewidth{%
+\hfil
+\raise-10pt\imagfm{\jstrut 漢}%
+\raise-10pt\imagfm{\jstrut 字}\hskip.25\zw%
+\imagfm{p}%
+\imagfm{h}%
+\hfil\hfil
+\imagfm{\jstrut 漢}%
+\imagfm{\jstrut 字}\hskip.25\zw%
+\raise-10pt\imagfm{p}%
+\raise-10pt\imagfm{h}%
+\hfil
+}
+\end{center}
+
+\caption{First example of shifting baseline.}
+\label{fig-bls}
+\end{figure}
+
+\begin{figure}
+\begin{center}
+\fontsize{30}{30}\selectfont\fboxsep0mm
+\vrule width 0.9\textwidth height0.4pt depth0.4pt\kern-0.9\textwidth
+\hbox to 0.9\linewidth{%
+\hfil
+\imagfm{a}%
+\imagfm{b}\hskip.25\zw%
+\imagfm{\jstrut 本}%
+\imagfm{\jstrut 文}\hskip.33333\zw%
+\raise3.514582pt\imagfm{\fontsize{20}{20}\selectfont\jstrut\inhibitglue (}%
+\raise3.514582pt\imagfm{\fontsize{20}{20}\selectfont\jstrut 注}%
+\raise3.514582pt\imagfm{\fontsize{20}{20}\selectfont\jstrut 釈}\hskip.1666667\zw%
+\raise3.514582pt\imagfm{\fontsize{20}{20}\selectfont c}%
+\raise3.514582pt\imagfm{\fontsize{20}{20}\selectfont o}%
+\raise3.514582pt\imagfm{\fontsize{20}{20}\selectfont m}%
+\raise3.514582pt\imagfm{\fontsize{20}{20}\selectfont m}%
+\raise3.514582pt\imagfm{\fontsize{20}{20}\selectfont e}%
+\raise3.514582pt\imagfm{\fontsize{20}{20}\selectfont n}%
+\raise3.514582pt\imagfm{\fontsize{20}{20}\selectfont t}%
+\raise3.514582pt\imagfm{\fontsize{20}{20}\selectfont\jstrut )\inhibitglue}%
+\hskip.33333\zw%
+\imagfm{\jstrut 本}%
+\imagfm{\jstrut 文}%
+\hfil
+}
+\end{center}
+
+\caption{Second example of shifting baseline.}
+\label{fig-small}
+\end{figure}
+
+An example output is shown in Figure~\ref{fig-bls}. The left half is the
+          output when \textsf{yjabaselineshift} is positive, hence the
+          baseline of Japanese characters is shifted down. On the other
+          hand, the right half is the output when
+          \textsf{yalbaselineshift} is positive, hence the baseline of
+          alphabetic characters is shifted. Figure~\ref{fig-small}
+          shows an intresting use of these parameters.
+
+\end{description}
+Note that \LuaTeX-ja doesn't support for vertical typesetting, \emph{tategaki}, for now. 
+
+\begin{table}
+\caption{Intersection of JIS~X~0208 and Latin-1 Supplement.}
+\label{tab-inter}
+\begin{center}
+\begin{tabular}{llll}
+\char"A7 (U+00A7),&
+\char"A8 (U+00A8),&
+\char"B0 (U+00B0),&
+\char"B1 (U+00B1),\\
+\char"B4 (U+00B4),&
+\char"B6 (U+00B6),&
+\char"D7 (U+00B7),&
+\char"F7 (U+00D7)
+\end{tabular}
+\end{center}
+\end{table}
+
+\subsection{Patches for plain \TeX\ and \LaTeXe}
+p\TeX\ has a patch for plain \TeX, namely |ptex.tex|, that for \LaTeXe\
+macro (this patch and \LaTeXe\ consist \emph{p\LaTeXe}), and
+|kinsoku.tex| which includes the default setting of \emph{kinsoku
+shori}, the Japanese hyphenation.  We ported them to \LuaTeX-ja, except
+the codes related to vertical typesetting, since \LuaTeX-ja doesn't
+support vertical typesetting yet. We remark two points related to the
+porting:
+\begin{description}
+\item[Default Range of Japanese Characters] 
+As described in the previos subsection, \LuaTeX-ja can customize the
+range of Japanese characters.  \LuaTeX-ja predefines 8~character ranges,
+as shown in Table~\ref{tab-chrrng}.  Almost of these ranges are just the
+union of Unicode blocks, and determined from the Adobe-Japan1-6 character
+collection~\cite{aj16}, and JIS~X~0208.  And, among these 8~ranges, the
+          ranges~2, 3, 6, 7, and~8 are considered ranges of Japanese
+          characters, and others are considered ranges of alphabetic
+          characters.
+
+This default setting is suitable for Japanese-based documents, however it
+          causes that other packages which use Unicode fonts do not work
+          correctly. For example, |\times| provided by the
+          |unicode-math| package is the character U+00D7, which belongs
+          to the range~8, and |\textendash| provided by the |EU2|
+          encoding used in the \emph{fontspec} package is the
+          character U+2013, which belongs to the range~3. hence, these
+          character cannot be typeset correctly with the default range setting.
+
+\begin{table}
+\caption{Predefined ranges in \LuaTeX-ja}
+\label{tab-chrrng}
+\begin{center}
+\begin{tabular}{@{\bf}rl}
+1&(Additional) Latin characters which is not belonged in the range~8.\\
+2&Greek and Cyrillic letters.\\
+3&Punctuations and miscellaneous symbols.\\
+4&Unicode blocks which does not intersect with Adobe-Japan1-6.\\
+5&Surrogates and supplementary private use Areas.\\
+6&Characters used in Japanese typesetting.\\
+7&Characters possibly used in CJK typesetting, but not in Japanese.\\
+8&Characters in Table~\ref{tab-inter}.
+\end{tabular}
+\end{center}
+\end{table}
+
+
+\item[Behavior of\/ {\tt\char92fontfamily\/}]
+The control sequence |\fontfamily| in p\LaTeXe\ changes the current alphabetic
+          font family and/or the current Japanese font family,
+          depending the argument. More concretely,
+          |\fontfamily{|$\langle\hbox{\it arg\/}\rangle$|}| changes the
+          current alphabetic font family to $\langle\hbox{\it
+          arg\/}\rangle$, if and only if one of the following
+          conditions are satisfied:
+\begin{itemize}
+\item An alphabetic font family named $\langle\hbox{\it arg\/}\rangle$ in
+      \emph{some} alphabetic encoding already defined in the document.
+\item There exists an alphabetic encoding $\langle\hbox{\it
+      enc\/}\rangle$ already defined in the document such that a font
+      definition file $\langle\hbox{\it enc\/}\rangle\langle\hbox{\it
+      arg\/}\rangle$|.fd| exists.
+\end{itemize}
+The same criterion is used for changing Japanese font family.
+
+To work this behavior well, a list of all (alphabetic) encodings defined
+          already in the document is needed. However, since \LuaTeX-ja
+          is loaded as a package, \LuaTeX-ja cannot have this list.
+          Hence \LuaTeX-ja adopted a different approach, namely
+          |\fontfamily{|$\langle\hbox{\it arg\/}\rangle$|}| changes the
+          current alphabetic font family to $\langle\hbox{\it
+          arg\/}\rangle$, if and only if:
+\begin{itemize}
+\item An alphabetic font family named $\langle\hbox{\it arg\/}\rangle$ in
+      the current alphabetic encoding $\langle\hbox{\it enc\/}\rangle$.
+\item A  font definition file $\langle\hbox{\it enc\/}\rangle\langle\hbox{\it
+      arg\/}\rangle$|.fd| exists.
+\end{itemize}
+
+
+\end{description}
+
+
+
+\subsection{Classes for Japanese Documents}
+To produce `high-quality' Japanese documents, we need not only that
+Japanese characters are correctly placed, but also class files for
+Japanese documents. In p\TeX, there are two major families of classes:
+\emph{jclasses} which is distributed with the official p\LaTeXe\ macros,
+and \emph{jsclasses}.  At the present, \LuaTeX-ja
+simply contains their counterparts: \emph{ltjclasses} and
+\emph{ltjsclasses}. However, the policy on classess is not determined
+now, and we hope to have another family of classes which are useful in
+commercial printing.  In the author's opinion, \emph{ltjclasses} is
+better to stay as an example of porting of class files for \pTeX\ to
+\LuaTeX-ja.
+
+\subsection{Patches for Packages}
+Apart from patches for the \LaTeXe~kernel and classes for Japanese
+documents, we need to make patches for several packages. At the present,
+we considered the following packages, and made patches or porting for
+the former two packages.
+
+\begin{description}
+\item[The \emph{fontspec} package] The \emph{fontspec} package is built
+          on NFSS2, hence control sequences offered by the
+          \emph{fontspec} package, such as |\setmainfont|, are only
+          effective for alphabetic fonts if \LuaTeX-ja is loaded. The
+          optional package \texttt{luatexja-\penalty0fontspec.sty}
+          offers these counterparts for Japanese fonts, with additional
+          `j' in the name of control sequences, such as
+          |\setmainjfont|.
+
+\item[The \emph{otf} package]
+This package is widely used in p\TeX\ for characters which is
+not in JIS~X~0208, and for using more than one weight in \emph{mincho}
+and \emph{gothic} font families. Therefore \LuaTeX-ja supports features
+in the \emph{otf} package, by loading \texttt{luatexja-\penalty0otf.sty}
+          manually. Note that characters by |\UTF{xxxx}| and
+          |\CID{xxxx}| are not appended to the current list as a
+          \emph{glyph\_node}, so they are not affected by callbacks by
+          the \emph{luaotfload} package. We have another remark; |\CID|
+          does not work with TrueType fonts.
+
+\item[The \emph{listings} package]
+It is well-known that there is a patch |jlisting.sty| of the
+          \emph{listings} package for p\LaTeXe. Generally speaking, it
+          also can be used in \LuaTeX-ja. However, it seems to be that
+          a Japanese character after a space does not recieve any
+          process of the \emph{listings} package; this is inconvinient
+          when we use the \emph{showexpl} package.
+\end{description}
+
+
+
+\section{Implementation}
+\subsection{Handling of Japanese Fonts}
+In p\TeX, there are three slots for maintaining current fonts, namely
+|\font| for alphabetic fonts, |\jfont| for Japanese font (in horizontal
+direction) and |\tfont| for Japanese font (in vertical direction). With
+these slots, we can manage the current font for alphabetic characters
+and that for Japanese characters separately in p\TeX.  However, \LuaTeX\
+has only one slot for maintaining the current font, as \TeX82.  This
+situation leads a problem: how can we maintain the `current Japanese
+font'?
+
+There are three approaches for this problem. One approach is to make a
+mapping table from alphabetic fonts to corresponding Japanese fonts
+(here we don't assume that NFSS2 is available).  Another approach is
+that we always use composite fonts with alphabetic fonts and Japanese
+fonts. The third approach is that the information of the current
+Japanese font is stored in an attribute. We adopted the third approach,
+since \LuaTeX-ja is much affected by p\TeX\ as we noted in
+Subsection~\ref{ssec-pol}.
+
+As in Figure~\ref{fig-jfdef}, \LuaTeX-ja uses |\jfont| for defining
+Japanese font, as p\TeX.  However, since the information of the current
+Japanese font is stored into an attribute, control sequences defined by
+|\jfont| (e.g.,~|\foo| and |\bar| in Figure~\ref{fig-jfdef}) is
+not representing a font by the means of \TeX82. In other words, each of
+these control sequences is just an assignment to an attribute, therefore
+they cannot be an argument of |\the|, |\fontname|, or |\textfont|.
+
+\subsection{Overview of the Processes}
+Now we describe an outline of the \LuaTeX-ja's process briefly.
+\begin{description}
+\item[Treatment of Line-breaks after a Japanese Character] This part is
+          described already in Subsection~\ref{ssec-line}. Done in the
+          |process_input_buffer| callback.
+\item[Font Replacement] In the |hyphenate| callback, \LuaTeX-ja looks
+          into for each \textit{glyph\_node}~$p$ in the list. If the
+          character represented by $p$ is considered as a Japanese
+          character, the font used in $p$ is replaced by the value of
+          |\ltj@curjfnt|, `the current Japanese font' at~$p$. Also the
+          character class of the character is looked up at this time.
+
+Furthermore the subtype of $p$ is subtracted by 1 to suppress
+          hyphenation around it by \LuaTeX, since later processes of
+          \LuaTeX-ja take care of all things about Japanese characters.
+\end{description}
+%
+Following processes are all executed in |pre_linebreak_filter| and
+|hpack_filter| callback. These processes are main routines of \LuaTeX-ja.
+
+\begin{description}
+\item[Examination of Stack Level] The horizontal list which
+          is the content of a horizontal box is traversed, 
+to determine what is the level of \LuaTeX-ja's internal stack at the end
+          of the list. This is needed because of the place of
+          the |hpack_filter| callback in the source of \LuaTeX. We will discuss more
+          detail in Subsection~\ref{ssec-stack}.
+
+\item[Insertion of Glues/Kerns for Japanese Typesetting]
+This part is already described at Subsection~\ref{ssec-jglue}. 
+
+\item[Adjustument of the Position of (Japanese) Characters]
+We will discuss the detail about this in Subsection~\ref{ssec-width}.
+\end{description}
+
+The callbacks by the \emph{luaotfload} package, e.g.,~replacement of
+glyphs according to font features, are executed just after `Examination
+of Stack Level' above. 
+
+\subsection{Stack Management}
+\label{ssec-stack}
+
+As we noted in Subsection~\ref{ssec-csname}, parameters that the values
+at the end of a horizontal box or that of a paragraph are effective in
+whole box or paragraph, such as \emph{kanjiskip}, cannot be implemented
+by internal integers or registers of other types in \TeX. We explain it
+in this section.
+
+\begin{figure}
+\begin{lstlisting}
+void package(int c)
+{
+    ...
+    d = box_max_depth;
+    unsave();
+    save_ptr -= 4;
+    if (cur_list.mode_field == -hmode) {
+        cur_box = filtered_hpack(cur_list.head_field,
+                                 cur_list.tail_field, saved_value(1),
+                                 saved_level(1), grp, saved_level(2));
+        subtype(cur_box) = HLIST_SUBTYPE_HBOX;
+    } else {
+\end{lstlisting}
+\caption{An extract of a CWEB-source \texttt{tex/packaging.w} of \LuaTeX}
+\label{fig-ltsrc}
+\end{figure}
+
+Figure~\ref{fig-ltsrc} is an extract of a CWEB-source
+\texttt{tex/packaging.w} of \LuaTeX\ (SVN revision 4358). This function
+is called just when an explicit |\hbox{...}| or |\vbox{...}| is ended, and
+the function |filtered_hpack()| is where the |hpack_filter| and then the
+actual `hpack' process are performed. Notice that the |unsave()|
+function is called before |filtered_hpack()|. This is the problem;
+because of |unsave()|, we can retrive only the values of registers
+\emph{outside} the box, even in the |hpack_filter| callback.
+
+To cope with this problem, \LuaTeX-ja has its own stack system, based on
+Lua codes in \cite{stack-mail}. Furthermore, \emph{whatsit} nodes whose
+\emph{user\_id} is 30112 (\emph{stack\_node}, for short) will be
+appended to the current horizontal list each time the current stack
+level is incremented, and their values are the values of
+|\currentgrouplevel| at that time. In the beginning of the |hpack_filter|
+callback, the list in question is traversed to determine whether the
+stack level at the end of the list and that outside the box coincides.
+
+Let $x$ be the value of |\currentgrouplevel|, and $y$ be the current
+stack level, both inside the |hpack_filter| callback, i.e.,~outside a
+horizontal box. Consider a list which represents the content of the box,
+then we have:
+\begin{itemize}
+\item A \emph{stack\_node} whose value is $x+1$ (since all materials in
+      the box are included in a group |\hbox{...}|, the value is at
+      least $x+1$) in the list represents an assignment related to the
+      stack system in just top-level of the list, like
+\begin{quote}
+\begin{verbatim}
+\hbox{...(assignment)...}
+\end{verbatim}
+\end{quote}
+In this case, the current stack level is incremented to $y+1$ after the assignment.
+\item A \emph{stack\_node} whose value is more than  $x+1$ in the list represents
+an assignment inside another group contained in the box. For example,
+      the following input creates
+a \emph{stack\_node} whose value is $x+3=(x+1)+2$:
+\begin{quote}
+\begin{verbatim}
+\hbox{...{...{...(assignment)}...}...}
+\end{verbatim}
+\end{quote}
+\end{itemize}
+Thus, we can conclude that the stack level at the end of the list is
+$y+1$, if and only if there is a \emph{stack\_node} whose value is
+$x+1$. Otherwise, the stack level is just $y$.
+
+\subsection{Adjustment of the Position of Japanese Characters}
+\label{ssec-width}
+
+The size of a glyph specified in a metric and that of the real font
+usually differ. For example, the letter `\inhibitglue【' is half-width
+in |jfm-ujis.lua| or |jis.tfm|, while this letter is full-width like `【'
+in most TrueType fonts used in Japanese typesetting, such as
+IPA~Mincho. Hence the adjustment of position of such glyphs is
+needed. In the context of p\TeX, this process was performed using virtual fonts.
+
+On the other hand, Lua\TeX-ja does the adjustment by encapsuling a glyph
+into a horizontal box. There are two main reasons why we adopted this
+method; one is that we feared Lua codes for coexisting with callback by
+|luaotfload| package would be large if we use virtual fonts, and the
+other is to cope with the shifting of the baseline of characters at the
+same time. 
+
+\begin{figure}
+\begin{center}\unitlength=9pt\small
+\begin{picture}(15,12)(-1,-3)
+
+\color{grayx}% real glyph
+\put(-1,-1.5){\vrule width 6\unitlength height 7\unitlength depth 2.5\unitlength}
+
+\color{black}% real glyph :step1
+\thicklines
+\put(-1,-1.5){\line(0,1){7}\line(0,-1){2.5}}
+\put(5,-1.5){\line(0,1){7}\line(0,-1){2.5}}
+\put(-1,5.5){\line(1,0){6}}
+\put(-1,-4){\line(1,0){6}}
+\put(-1,0){\makebox(0,0)[r]{\strut$R$\,}}
+
+\thicklines
+\put(0,0){\vector(0,1){9}\line(0,-1){3}\vector(1,0){12}}
+\put(12,9){\makebox(0,0)[rt]{\strut$M$\,}}
+\put(12,0){\line(0,1){9}\vector(0,-1){3}}
+\put(0,9){\line(1,0){12}}
+\put(0,-3){\line(1,0){12}}
+\put(0.2,4.5){\makebox(0,0)[l]{\texttt{height}}}
+\put(12.2,-1.5){\makebox(0,0)[l]{\texttt{depth}}}
+\put(6,0.2){\makebox(0,0)[b]{\texttt{width}}}
+
+\thicklines
+\put(3,0){\line(0,1){7}\line(0,-1){2.5}\line(1,0){6}}
+\put(9,0){\line(0,1){7}\line(0,-1){2.5}}
+\put(3,7){\line(1,0){6}}
+\put(3,-2.5){\line(1,0){6}}
+\newsavebox{\eqdist}
+\savebox{\eqdist}(0,0)[c]{%
+  \thinlines
+  \put(-0.08,0.2){\line(0,-1){0.4}}%
+  \put(0.08,0.2){\line(0,-1){0.4}}}
+\put(1.5,0){\usebox{\eqdist}}
+\put(10.5,0){\usebox{\eqdist}}
+
+\thicklines
+\put(3,-1.5){\vector(-1,0){4}}
+\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{center}
+\caption{The position of the `real' glyph.}
+\label{fig-pos}
+\end{figure}
+
+Figure~\ref{fig-pos} shows the adjustment process. A large square $M$ is
+the imaginary body which is specified in the metric, and a vertical
+rectangle is the imaginary body of a real glyph. First, the real glyph
+is aligned with respect to the width of $M$. In the figure, the real
+glyph is aligned `middle'; this setting is useful for the full-width
+middle dot `・'. We have other settings, namely, `left' and `right'.
+After that, it is shifted according to the value of |left| and |down|,
+which are specified in the metric. The final position of the real glyph
+is shown by the gray rectangle~$R$. If the amount of shifting the baseline is
+not zero, $M$ (and hence the real glyph) is shifted by that amount.
+
+We would like to remark briefly about the vertical position of a glyph.
+A JFM (or the metric used in \LuaTeX-ja) and the real font used for it
+may have different height or depth.  In that case, it may look better if
+the real glyph is shifted vertically to match the height-depth ratio
+specified in the metric. This situation is carefully studied by
+Otobe~\cite{min10}. Here the policy on this problem is not determined
+now, however we want to offer several solutions by \LuaTeX-ja.
+
+\section{Conclusion}
+We have discussed about our \LuaTeX-ja package, which is much affected
+by p\TeX. For now, it can be used for experimental use, however there
+are much refinements which are needed for regular use. The author hopes
+that this paper and this project contribute the typesetting Japanese,
+and possibly other Asian languages, under \LuaTeX.
+
+
+%%% The style of the bibiliogrphy is `amsplain'.
+\providecommand{\bysame}{\leavevmode\hbox to3em{\hrulefill}\thinspace}
+\providecommand{\href}[2]{#2}
+\begin{thebibliography}{99}
+
+\bibitem{aj16}
+Adobe Systems Incorporated, \emph{Adobe-Japan1-6 Character Collection
+       for CID-Keyed Fonts}, Technical Note~\#5078, 2004.
+\url{http://partners.adobe.com/public/developer/en/font/5078.Adobe-Japan1-6.pdf}
+
+\bibitem{ptex}
+ASCII MEDIA WORKS,アスキー日本語\TeX\ (p\TeX).\url{http://ascii.asciimw.jp/pb/ptex/}
+
+\bibitem{omega}
+Jin-Hwan~Cho and Haruhiko Okumura, \emph{Typesetting CJK Languages with Omega},
+\TeX, XML, and Digital Typography, Lecture Notes in Computer Science, vol.~3130,
+Springer, 2004, 139--148.
+
+\bibitem{joylua}
+Yannis Haralambous. \emph{The Joy of \LuaTeX}. \url{http://luatex.bluwiki.com/}
+
+\bibitem{jisx4051}
+Japanese Industrial Standards Committee. \emph{JIS~X~4051: Formatting
+       rules for Japanese documents}, 1993, 1995, 2004.
+
+\bibitem{eptex}
+北川弘典,$\varepsilon$-p\TeX についてのwiki.
+\url{http://sourceforge.jp/projects/eptex/wiki/FrontPage}
+
+\bibitem{luaums}
+北川弘典,\LuaTeX で日本語.
+\url{http://oku.edu.mie-u.ac.jp/tex/mod/forum/discuss.php?d=378}
+
+\bibitem{luatexref}
+\LuaTeX\ development team, \emph{The \LuaTeX\ reference}. 
+\url{http://www.luatex.org/svn/trunk/manual/luatexref-t.pdf} (snapshot of SVN trunk)
+
+\bibitem{man}
+The \LuaTeX-ja project team, \emph{The \LuaTeX-ja package}. 
+Not completed for now. Available at |doc/man-en.pdf| (in English) or
+       |doc/man-ja.pdf| (in Japanese)
+in the Git repository.
+
+\bibitem{luajp-test}
+香田温人,\LuaTeX と日本語.
+\url{http://www1.pm.tokushima-u.ac.jp/~kohda/tex/luatex-old.html}
+
+\bibitem{luajalayout}
+前田一貴,luajalayout パッケージ---Lua\LaTeX によ
+       る日本語組版---.
+\url{http://www-is.amp.i.kyoto-u.ac.jp/lab/kmaeda/lualatex/luajalayout/}
+
+\bibitem{jsclasses}
+奥村晴彦,p\LaTeXe 新ドキュメントクラス.
+\url{http://oku.edu.mie-u.ac.jp/~okumura/jsclasses/}
+
+\bibitem{ptexjp}
+Haruhiko Okumura, \emph{p\TeX\ and Japanese Typesetting},
+       The Asian Journal of \TeX\ \textbf{2}~(2008), 43--51.
+
+\bibitem{min10}
+乙部厳己,min10フォントについて.
+\url{http://argent.shinshu-u.ac.jp/~otobe/tex/files/min10.pdf}
+
+\bibitem{otf}
+齋藤修三郎,Open Type Font用VF.
+\url{http://psitau.kitunebi.com/otf.html}
+
+\bibitem{stack-mail}
+Jonathan Sauer, \emph{[Dev-luatex] tex.currentgrouplevel}. 
+\url{http://www.ntg.nl/pipermail/dev-luatex/2008-August/001765.html}
+
+\bibitem{uptex}
+Takuji Tanaka, \emph{up\TeX, up\LaTeX---unicode version of p\TeX, p\LaTeX}.
+\url{http://homepage3.nifty.com/ttk/comp/tex/uptex_en.html}
+
+\bibitem{ptexenc}
+Nobuyuki Tsuchimura, \emph{Development of a Japanese \TeX\ Distribution~`ptetex3'},
+Computer Software\ \textbf{24} (2007), no.~4, 40--50, (in Japanese).
+
+\bibitem{w3c}
+W3C Working Group, \emph{Requirements for Japanese Text Layout}. 
+\url{http://www.w3.org/TR/jlreq/}
+\end{thebibliography}
+
+\end{document}
diff --git a/doc/ajt.cls b/doc/ajt.cls
new file mode 100644 (file)
index 0000000..7f18501
--- /dev/null
@@ -0,0 +1,872 @@
+%% 
+%% Copyright (C) 2010 The Korean TeX Society.
+%% 
+%%     This program is free software; you can redistribute it and/or modify
+%%     it under the terms of the GNU General Public License as published by
+%%     the Free Software Foundation; either version 2 of the License, or
+%%     (at your option) any later version.
+%% 
+%%     This program is distributed in the hope that it will be useful,
+%%     but WITHOUT ANY WARRANTY; without even the implied warranty of
+%%     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+%%     GNU General Public License for more details.
+%% 
+%%     You should have received a copy of the GNU General Public License
+%%     along with this program; if not, write to the Free Software
+%%     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+%% 
+\NeedsTeXFormat{LaTeX2e}[1999/12/01]
+\ProvidesClass{ajt}
+    [2010/12/31 v0.73 The Asian Journal of TeX Class]
+\let\ExecuteOptions@ltx\ExecuteOptions
+\def\ExecuteOptions#1{%
+ \ExecuteOptions@ltx{a4paper,10pt,twoside,onecolumn,final}%
+}%
+\LoadClassWithOptions{article}
+\let\ExecuteOptions\ExecuteOptions@ltx
+\def\normal@body@spread{1.069}
+\def\normal@info@spread{1.0}
+\def\normalbodyspread{\linespread{\normal@body@spread}\selectfont}
+\linespread{\normal@body@spread}
+%%%
+%%% korean option: use ko.TeX for Korean typesetting (default: english)
+%%% ptexjs option: use pTeX (jsclasses appearance) for Japanese typesetting (default: english)
+%%% dvips option: use dvips instead of dvipdfmx, xetex or pdftex
+%%% print option: final version (default: preprint)
+%%% reprint option: print option without crop (default: preprint)
+%%% koreanabstract option: abstract is korean not english (default: english)
+%%% ptexjsabstract option: abstract is japanese (jsclasses appearance) not english (default: english)
+%%%
+\newif\if@korean\@koreanfalse
+\newif\if@ptexjs\@ptexjsfalse
+\newif\if@print\@printfalse
+\newif\if@reprint\@reprintfalse
+\newif\if@korabstract\@korabstractfalse
+\newif\if@ptexjsabstract\@ptexjsabstractfalse
+\def\tpd@driver{pdftex}
+\def\dps@driver{dvips}
+\def\dpx@driver{dvipdfmx}
+\def\xtx@driver{xetex}
+%%%
+\RequirePackage{ifpdf}
+\ifpdf
+  \let\@dvi@driver\tpd@driver
+\else
+  \expandafter\ifx\csname XeTeXrevision\endcsname\relax
+    \let\@dvi@driver\dpx@driver
+  \else
+    \let\@dvi@driver\xtx@driver
+  \fi
+\fi
+%%%
+\DeclareOption{korean}{\@koreantrue\@ptexjsfalse}
+\DeclareOption{ptexjs}{\@ptexjstrue\@koreanfalse}
+\DeclareOption{dvips}{\let\@dvi@driver\dps@driver}
+\DeclareOption{print}{\@printtrue\@reprintfalse}
+\DeclareOption{reprint}{\@printtrue\@reprinttrue}
+\DeclareOption{koreanabstract}{\@korabstracttrue\@ptexjsabstractfalse}
+\DeclareOption{ptexjsabstract}{\@ptexjsabstracttrue\@korabstractfalse}
+\ProcessOptions
+%%%
+\setlength\paperwidth{170mm}
+\setlength\paperheight{254mm}
+\setlength\textwidth{132mm}
+\setlength\oddsidemargin{-6.4mm}
+\setlength\evensidemargin\oddsidemargin
+\if@print\if@reprint\else% for final printing only
+  \addtolength\oddsidemargin{1.5mm}
+  \addtolength\evensidemargin{-1.5mm}
+\fi\fi
+\setlength\textheight{210mm}
+\setlength\headheight{12pt}
+\setlength\headsep{14pt}
+\setlength\topmargin{-10mm}
+\setlength\footskip{24pt}
+%%%
+%%% AJT use CM math fonts, not mathpazo.sty
+%%%
+\ifx\@dvi@driver\xtx@driver % XeTeX
+  \if@print
+    \RequirePackage{fontspec,xunicode}
+    \RequirePackage[no-sscript]{xltxtra}
+    \setmainfont[Mapping=tex-text]{Palatino LT Std}
+    \setsansfont[Mapping=tex-text]{Optima LT Std}
+  \else
+    \RequirePackage{fontspec,xunicode,xltxtra}
+  \fi
+\else % pdfTeX, DVIPDFMx, DVIPS
+  \renewcommand\rmdefault{ppl} % URW Palatino
+  \if@print
+    \renewcommand\sfdefault{pop} % Adobe Optima
+    %\renewcommand\sfdefault{uop} % URW Classico (Optima clone)
+  \fi
+  \if@korean
+    \renewcommand\bfdefault{b}
+  \fi
+\fi
+%%%
+\ifx\@dvi@driver\dpx@driver
+  \RequirePackage[dvipdfmx]{color,graphicx}
+  \RequirePackage[unicode,dvipdfmx]{hyperref}
+\else
+  \RequirePackage{color,graphicx}
+  \ifx\@dvi@driver\xtx@driver
+    \RequirePackage{hyperref}
+  \else
+    \RequirePackage[unicode]{hyperref}
+  \fi
+\fi
+\if@print\setkeys{Hyp}{nolinks=true}\fi
+%%%
+\RequirePackage{calc}
+\RequirePackage{amsmath}
+\RequirePackage{textcomp}
+%%%
+\if@print\if@reprint\else
+  \IfFileExists{crop.sty}
+    {\ifx\@dvi@driver\tpd@driver% pdftex
+       \RequirePackage[a4,center,cam,pdftex!]{crop}%
+     \else% dvips or dvipdfmx or xetex
+       \RequirePackage[a4,center,cam,dvips!]{crop}%
+     \fi
+    }{}
+\fi\fi
+\if@korean
+  \ifx\@dvi@driver\xtx@driver % XeTeX
+    \RequirePackage{xetexko}
+    \if@print
+      \setmainhangulfont[
+        BoldFont={YoonMyungjo Medium},
+        Mapping=tex-text, Renderer=ICU,
+        preperiodkern={-.3ex}, precommakern={-.3ex}
+      ]{YoonMyungjo Light}
+      \setsanshangulfont[
+        BoldFont={YoonGothic Medium},
+        Mapping=tex-text, Renderer=ICU,
+        preperiodkern={-.1ex}, precommakern={-.1ex}
+      ]{YoonGothic Light}
+      \setmonohangulfont[
+        BoldFont={YoonGothic Medium},
+        Mapping=tex-text, Renderer=ICU
+      ]{YoonGothic Light}
+    \fi
+    \linespread{\normal@body@spread}
+    \hangulquotes
+  \else
+    \RequirePackage[utf,finemath]{kotex}
+    \RequirePackage[default]{dhucs-interword}
+    \if@print
+      \RequirePackage[gremphhangul=yngt,gremphhanja=yngt]{dhucs-gremph}
+      \usehangulfontspec{yn}
+      \SetHangulFonts{ynmj}{yngt}{yngt}
+      \SetHanjaFonts{ynmj}{yngt}{yngt}
+      \DeclareFontFamily{LUC}{grem}{\hyphenchar \font\m@ne}
+      \DeclareFontShape{LUC}{grem}{m}{n}{<-> LUC * o\GrEmphFont l}{}
+      \DeclareFontShape{LUC}{grem}{m}{it}{<-> LUC * o\GrEmphFont l}{}
+      \DeclareFontShape{LUC}{grem}{m}{sl}{<-> LUC * o\GrEmphFont l}{}
+      \DeclareFontFamily{LUC}{gremhj}{\hyphenchar \font\m@ne}
+      \DeclareFontShape{LUC}{gremhj}{m}{n}{<-> LUC * o\GrEmphHanjaFont l}{}
+      \DeclareFontShape{LUC}{gremhj}{m}{it}{<-> LUC * o\GrEmphHanjaFont l}{}
+      \DeclareFontShape{LUC}{gremhj}{m}{sl}{<-> LUC * o\GrEmphHanjaFont l}{}
+    \else
+      \RequirePackage{dhucs-gremph}
+      \usehangulfontspec{ut}
+      \SetHangulFonts{utmj}{utgt}{utgt}
+      \SetHanjaFonts{utmj}{utgt}{utgt}
+    \fi
+  \fi
+  \def\korean@body@spread{1.35}
+  \def\korean@info@spread{1.15}
+  \def\koreanbodyspread{\linespread{\korean@body@spread}\selectfont}
+  \def\koreaninfospread{\linespread{\korean@info@spread}\selectfont}
+  \renewcommand{\figurename}{그림}
+  \renewcommand{\tablename}{표}
+  \newcommand\hcntdot{\nobreak\mbox{$\cdot$}}
+  \newcommand\cntrdot{\kern.2em\hcntdot\nobreak\hskip.2em}
+  \newcommand\cntrdots{\kern.2em\hcntdot\nobreak\hskip.2em\hcntdot\nobreak\hskip.2em\hcntdot\nobreak\hskip.4em}
+  \ifx\@dvi@driver\xtx@driver % XeTeX
+    \newcommand\cnm[1]{〈#1〉}
+    \newcommand\ccnm[1]{《#1》}
+    \newcommand\snm[1]{「#1」}
+    \newcommand\bnm[1]{『#1』}
+  \else
+    \newcommand\cnm[1]{\kern-.10em〈#1〉\kern-.10em}
+    \newcommand\ccnm[1]{\kern-.198em《#1》\kern-.198em}
+    \newcommand\snm[1]{\kern-.10em「#1」\kern-.10em}
+    \newcommand\bnm[1]{\kern-.20em『#1』\kern-.20em}
+  \fi
+\else\if@ptexjs
+  \DeclareFontShape{JY1}{mc}{m}{n}{<-> s * [0.961] jis}{}
+  \DeclareFontShape{JY1}{gt}{m}{n}{<-> s * [0.961] jisg}{}
+  \DeclareFontShape{JT1}{mc}{m}{n}{<-> s * [0.961] tmin10}{}
+  \DeclareFontShape{JT1}{gt}{m}{n}{<-> s * [0.961] tgoth10}{}
+  %
+  \DeclareFontShape{JY1}{mc}{m}{it}{<->ssub*mc/m/n}{}
+  \DeclareFontShape{JY1}{mc}{m}{sl}{<->ssub*mc/m/n}{}
+  \DeclareFontShape{JY1}{mc}{m}{sc}{<->ssub*mc/m/n}{}
+  \DeclareFontShape{JY1}{gt}{m}{it}{<->ssub*gt/m/n}{}
+  \DeclareFontShape{JY1}{gt}{m}{sl}{<->ssub*gt/m/n}{}
+  \DeclareFontShape{JY1}{mc}{bx}{it}{<->ssub*gt/m/n}{}
+  \DeclareFontShape{JY1}{mc}{bx}{sl}{<->ssub*gt/m/n}{}
+  \DeclareFontShape{JT1}{mc}{m}{it}{<->ssub*mc/m/n}{}
+  \DeclareFontShape{JT1}{mc}{m}{sl}{<->ssub*mc/m/n}{}
+  \DeclareFontShape{JT1}{mc}{m}{sc}{<->ssub*mc/m/n}{}
+  \DeclareFontShape{JT1}{gt}{m}{it}{<->ssub*gt/m/n}{}
+  \DeclareFontShape{JT1}{gt}{m}{sl}{<->ssub*gt/m/n}{}
+  \DeclareFontShape{JT1}{mc}{bx}{it}{<->ssub*gt/m/n}{}
+  \DeclareFontShape{JT1}{mc}{bx}{sl}{<->ssub*gt/m/n}{}
+  \DeclareRobustCommand\rmfamily
+          {\not@math@alphabet\rmfamily\mathrm
+           \romanfamily\rmdefault\kanjifamily\mcdefault\selectfont}
+  \DeclareRobustCommand\sffamily
+          {\not@math@alphabet\sffamily\mathsf
+           \romanfamily\sfdefault\kanjifamily\gtdefault\selectfont}
+  \DeclareRobustCommand\ttfamily
+          {\not@math@alphabet\ttfamily\mathtt
+           \romanfamily\ttdefault\kanjifamily\gtdefault\selectfont}
+  \def\textmc#1{\relax\ifmmode\hbox\fi{\mcfamily #1}}
+  \def\textgt#1{\relax\ifmmode\hbox\fi{\gtfamily #1}}
+  \def\ptexjs@body@spread{1.333}
+  \def\ptexjs@info@spread{1.15}
+  \def\ptexjsbodyspread{\linespread{\ptexjs@body@spread}\selectfont}
+  \def\ptexjsinfospread{\linespread{\ptexjs@info@spread}\selectfont}
+  \renewcommand{\figurename}{図}
+  \renewcommand{\tablename}{表}
+  \renewcommand{\appendixname}{付録}
+  \prebreakpenalty\jis"2147=10000      % 5000   ’
+  \postbreakpenalty\jis"2148=10000     % 5000   “
+  \prebreakpenalty\jis"2149=10000      % 5000   ”
+  \inhibitxspcode`〒=2
+  \xspcode`+=3
+  \xspcode`\%=3
+  \xspcode`^^80=3
+  \xspcode`^^81=3
+  \xspcode`^^82=3
+  \xspcode`^^83=3
+  \xspcode`^^84=3
+  \xspcode`^^85=3
+  \xspcode`^^86=3
+  \xspcode`^^87=3
+  \xspcode`^^88=3
+  \xspcode`^^89=3
+  \xspcode`^^8a=3
+  \xspcode`^^8b=3
+  \xspcode`^^8c=3
+  \xspcode`^^8d=3
+  \xspcode`^^8e=3
+  \xspcode`^^8f=3
+  \xspcode`^^90=3
+  \xspcode`^^91=3
+  \xspcode`^^92=3
+  \xspcode`^^93=3
+  \xspcode`^^94=3
+  \xspcode`^^95=3
+  \xspcode`^^96=3
+  \xspcode`^^97=3
+  \xspcode`^^98=3
+  \xspcode`^^99=3
+  \xspcode`^^9a=3
+  \xspcode`^^9b=3
+  \xspcode`^^9c=3
+  \xspcode`^^9d=3
+  \xspcode`^^9e=3
+  \xspcode`^^9f=3
+  \xspcode`^^a0=3
+  \xspcode`^^a1=3
+  \xspcode`^^a2=3
+  \xspcode`^^a3=3
+  \xspcode`^^a4=3
+  \xspcode`^^a5=3
+  \xspcode`^^a6=3
+  \xspcode`^^a7=3
+  \xspcode`^^a8=3
+  \xspcode`^^a9=3
+  \xspcode`^^aa=3
+  \xspcode`^^ab=3
+  \xspcode`^^ac=3
+  \xspcode`^^ad=3
+  \xspcode`^^ae=3
+  \xspcode`^^af=3
+  \xspcode`^^b0=3
+  \xspcode`^^b1=3
+  \xspcode`^^b2=3
+  \xspcode`^^b3=3
+  \xspcode`^^b4=3
+  \xspcode`^^b5=3
+  \xspcode`^^b6=3
+  \xspcode`^^b7=3
+  \xspcode`^^b8=3
+  \xspcode`^^b9=3
+  \xspcode`^^ba=3
+  \xspcode`^^bb=3
+  \xspcode`^^bc=3
+  \xspcode`^^bd=3
+  \xspcode`^^be=3
+  \xspcode`^^bf=3
+  \xspcode`^^c0=3
+  \xspcode`^^c1=3
+  \xspcode`^^c2=3
+  \xspcode`^^c3=3
+  \xspcode`^^c4=3
+  \xspcode`^^c5=3
+  \xspcode`^^c6=3
+  \xspcode`^^c7=3
+  \xspcode`^^c8=3
+  \xspcode`^^c9=3
+  \xspcode`^^ca=3
+  \xspcode`^^cb=3
+  \xspcode`^^cc=3
+  \xspcode`^^cd=3
+  \xspcode`^^ce=3
+  \xspcode`^^cf=3
+  \xspcode`^^d0=3
+  \xspcode`^^d1=3
+  \xspcode`^^d2=3
+  \xspcode`^^d3=3
+  \xspcode`^^d4=3
+  \xspcode`^^d5=3
+  \xspcode`^^d6=3
+  \xspcode`^^d7=3
+  \xspcode`^^d8=3
+  \xspcode`^^d9=3
+  \xspcode`^^da=3
+  \xspcode`^^db=3
+  \xspcode`^^dc=3
+  \xspcode`^^dd=3
+  \xspcode`^^de=3
+  \xspcode`^^df=3
+  \xspcode`^^e0=3
+  \xspcode`^^e1=3
+  \xspcode`^^e2=3
+  \xspcode`^^e3=3
+  \xspcode`^^e4=3
+  \xspcode`^^e5=3
+  \xspcode`^^e6=3
+  \xspcode`^^e7=3
+  \xspcode`^^e8=3
+  \xspcode`^^e9=3
+  \xspcode`^^ea=3
+  \xspcode`^^eb=3
+  \xspcode`^^ec=3
+  \xspcode`^^ed=3
+  \xspcode`^^ee=3
+  \xspcode`^^ef=3
+  \xspcode`^^f0=3
+  \xspcode`^^f1=3
+  \xspcode`^^f2=3
+  \xspcode`^^f3=3
+  \xspcode`^^f4=3
+  \xspcode`^^f5=3
+  \xspcode`^^f6=3
+  \xspcode`^^f7=3
+  \xspcode`^^f8=3
+  \xspcode`^^f9=3
+  \xspcode`^^fa=3
+  \xspcode`^^fb=3
+  \xspcode`^^fc=3
+  \xspcode`^^fd=3
+  \xspcode`^^fe=3
+  \xspcode`^^ff=3
+  \def\@{\spacefactor3000\space}
+  \let\footnotes@ve=\footnote
+  \def\footnote{\inhibitglue\footnotes@ve}
+  \let\footnotemarks@ve=\footnotemark
+  \def\footnotemark{\inhibitglue\footnotemarks@ve}
+  \def\@inhibitglue{%
+    \futurelet\@let@token\@@inhibitglue}
+  \def\@@inhibitglue{%
+    \ifx\@let@token「
+      \inhibitglue
+    \else
+      \ifx\@let@token(
+        \inhibitglue
+      \else
+        \ifx\@let@token『
+          \inhibitglue
+        \else
+          \ifx\@let@token[
+            \inhibitglue
+          \fi
+        \fi
+      \fi
+    \fi}
+  \let\everyparhook=\@inhibitglue
+  \setlength\parskip{0\p@}
+  \setlength\parindent{1zw}
+  \let\@startsection@orig\@startsection
+  \def\@startsection{\@afterindenttrue\@startsection@orig}
+  \AtBeginDocument{\everypar{\everyparhook}}
+\else
+  \IfFileExists{microtype.sty}{\RequirePackage[protrusion=true,expansion=false]{microtype}}{}
+\fi\fi
+%%%
+\definecolor{linkcolour}{rgb}{0,0.2,0.6}
+\hypersetup{colorlinks,breaklinks,
+            linkcolor=linkcolour,citecolor=linkcolour,
+            filecolor=linkcolour, urlcolor=linkcolour}
+\IfFileExists{switcheml.sty}
+             {\RequirePackage{switcheml}
+              \AtBeginDocument{\@ifx@undefined{\typesetemail}{\obfuscateemail}{}}}
+             {\AtBeginDocument{\@ifx@undefined{\typesetemail}{\hyperlinkemail}{}}}
+\renewcommand\maketitle{\par
+  \ifajt@noabstract\else
+    \@ifx@undefined{\ajt@info@Abstract}
+      {\ClassError{ajt}
+        {Please specify an \string\abstract\space before \string\maketitle}
+        {It is a Asian Journal of TeX requirement to include an abstract.   \MessageBreak
+                                                                       \MessageBreak
+         If you have exceptional reasons for not having one in this    \MessageBreak
+         article, write \string\noabstract\space somewhere before \string\maketitle.}}{}
+  \fi
+  \begingroup
+    \renewcommand\thefootnote{\@fnsymbol\c@footnote}%
+    \def\@makefnmark{\rlap{\@textsuperscript{\normalfont\@thefnmark}}}%
+    \long\def\@makefntext##1{\parindent 1em\noindent
+            \hb@xt@1.8em{%
+                \hss\@textsuperscript{\normalfont\@thefnmark}}##1}%
+    \newpage
+    \global\@topnum\z@   % Prevents figures from going at top of page.
+    \@maketitle
+    \thispagestyle{titlepage}\@thanks
+  \endgroup
+  \setcounter{footnote}{0}%
+  \global\let\thanks\relax
+  \global\let\maketitle\relax
+  \global\let\@maketitle\relax
+  \global\let\title\relax
+  \global\let\author\relax
+  \global\let\date\relax
+  \global\let\and\relax
+  \if@korean\koreanbodyspread\fi
+  \if@ptexjs\ptexjsbodyspread\fi
+}%
+\def\@maketitle{%
+  \newpage
+  \null
+  \write@ID@aux\read@issue
+  \begin{flushleft}
+    \let\footnote\thanks
+    \begingroup
+      \LARGE\@title
+      \ifx\@empty\@etitle\else
+        \settowidth\@tempdima{\@title}%
+        \settowidth\@tempdimb{\@etitle}%
+        \advance\@tempdima\@tempdimb
+        \ifdim\@tempdima>\textwidth\\[-0.1\baselineskip]\noindent\thinspace
+          \vtop{%
+            \setlength\hsize{\textwidth-2em}%
+            \normalbodyspread\large\@etitle}
+        \else\enspace
+          {\normalbodyspread\large\@etitle}
+        \fi
+      \fi\par
+    \endgroup
+    \vspace{24pt}%
+    \@tempcnta\z@\loop\ifnum\@tempcnta<\value{num@author}\@makeauthors\repeat
+  \end{flushleft}
+  \ajt@optional@author@info
+  \vspace{12pt}
+  \ajt@info@container{Keywords}
+  \ifajt@noabstract\else
+    \vspace{12pt}%
+    \ajt@info@container{Abstract}
+  \fi
+  \vspace{24pt}}
+\def\@makeauthors{%
+  \advance\@tempcnta\@ne
+  \def\@author{{\large\csname @author\the\@tempcnta\endcsname}}%
+  \def\@eauthor{{\normalsize\csname @eauthor\the\@tempcnta\endcsname}}%
+  \def\@address{\csname @address\the\@tempcnta\endcsname}%
+  \def\@email{\csname @email\the\@tempcnta\endcsname}%
+  \begin{minipage}[t]{\ifnum\value{num@author}>1 0.5\fi\textwidth}
+    \small
+    \@author
+    \ifx\@empty\@eauthor\else\enspace\@eauthor\fi
+    \\[0.3\baselineskip]
+    \ifx\@empty\@address\else
+      \settowidth\@tempdima{\@address}%
+      \@address
+      \ifdim\@tempdima>0.5\textwidth\\\else\enspace\fi
+    \fi
+    \ifx\@empty\@email\else\typesetemail\@email\fi
+  \end{minipage}\hfill
+  \ifodd\@tempcnta\else\par\vspace{\baselineskip}\fi
+}
+\newcounter{num@author}\setcounter{num@author}{0}
+\renewcommand*{\title}[2][]{\gdef\@etitle{#1}\gdef\@title{#2}}
+\renewcommand*{\author}[2][]{%
+  \stepcounter{num@author}%
+  \expandafter\gdef\csname @eauthor\thenum@author\endcsname{#1}%
+  \expandafter\gdef\csname @author\thenum@author\endcsname{#2}%
+}
+\newcommand*{\address}[1]{%
+  \expandafter\gdef\csname @address\thenum@author\endcsname{#1}%
+}
+\newcommand*{\email}[1]{%
+  \expandafter\gdef\csname @email\thenum@author\endcsname{#1}%
+}
+\if@ptexjs
+\renewcommand\section{\@startsection {section}{1}{\z@}%
+                                     {3.5ex \@plus 1ex \@minus .2ex}%
+                                     {2.5ex \@plus.2ex}%
+                                     {\normalfont\sffamily\bfseries\large\raggedright}}
+\renewcommand\subsection{\@startsection{subsection}{2}{\z@}%
+                                     {2.5ex \@plus 1ex \@minus .2ex}%
+                                     {1.5ex \@plus .2ex}%
+                                     {\normalfont\sffamily\bfseries\raggedright}}
+\renewcommand\subsubsection{\@startsection{subsubsection}{3}{\z@}%
+                                     {2ex \@plus .5ex \@minus .2ex}%
+                                     {1ex \@plus .2ex}%
+                                     {\normalfont\normalsize\raggedright}}
+\renewcommand\paragraph{\@startsection{paragraph}{4}{\z@}%
+                                     {2.5ex \@plus1ex \@minus.2ex}%
+                                     {-1em}%
+                                     {\normalfont\normalsize\sffamily\itshape}}
+\renewcommand\subparagraph{\@startsection{subparagraph}{5}{\z@}%
+                                     {2.5ex \@plus1ex \@minus .2ex}%
+                                     {-1em}%
+                                     {\normalfont\normalsize\sffamily\itshape}}
+\else
+\renewcommand\section{\@startsection {section}{1}{\z@}%
+                                     {-3.5ex \@plus -1ex \@minus -.2ex}%
+                                     {2.5ex \@plus.2ex}%
+                                     {\normalfont\bfseries\large\raggedright}}
+\renewcommand\subsection{\@startsection{subsection}{2}{\z@}%
+                                     {-2.5ex\@plus -1ex \@minus -.2ex}%
+                                     {1.5ex \@plus .2ex}%
+                                     {\normalfont\bfseries\raggedright}}
+\renewcommand\subsubsection{\@startsection{subsubsection}{3}{\z@}%
+                                     {-2ex\@plus -.5ex \@minus -.2ex}%
+                                     {1ex \@plus .2ex}%
+                                     {\normalfont\normalsize\raggedright}}
+\renewcommand\paragraph{\@startsection{paragraph}{4}{\z@}%
+                                     {2.5ex \@plus1ex \@minus.2ex}%
+                                     {-1em}%
+                                     {\normalfont\normalsize\itshape}}
+\renewcommand\subparagraph{\@startsection{subparagraph}{5}{\parindent}%
+                                     {2.5ex \@plus1ex \@minus .2ex}%
+                                     {-1em}%
+                                     {\normalfont\normalsize\itshape}}
+\fi
+\let\ajt@itemize\itemize
+\let\ajt@enditemize\enditemize
+\let\ajt@enum\enumerate
+\let\ajt@endenum\endenumerate
+\let\ajt@desc\description
+\let\ajt@enddesc\enddescription
+\renewenvironment{itemize}
+  {\ajt@itemize\parskip0pt}{\ajt@enditemize}
+\renewenvironment{enumerate}
+  {\ajt@enum\parskip0pt}{\ajt@endenum}
+\renewenvironment{description}
+  {\ajt@desc\parskip0pt\parindent1.8em}{\ajt@enddesc}
+\let\itemise\itemize
+\let\enditemise\enditemize
+\renewcommand\labelitemi{\normalfont\bfseries\textendash}
+\renewcommand\labelitemii{\normalfont\bfseries\textperiodcentered}
+\if@ptexjs
+  \renewcommand*\descriptionlabel[1]{\hspace\labelsep\normalfont\gtfamily\itshape #1}
+\else
+  \renewcommand*\descriptionlabel[1]{\hspace\labelsep\normalfont\itshape #1}
+\fi
+\newlength\captionindent
+\if@ptexjs
+  \setlength\captionindent{1pc}
+  \setlength\abovecaptionskip{5\p@}
+  \setlength\belowcaptionskip{5\p@}
+  \newcommand*\@captionheadfont{\ptexjsinfospread\small\scshape}
+  \newcommand*\@captionfont{\ptexjsinfospread\normalfont\small}
+\else
+  \setlength\captionindent{3pc}
+  \setlength\abovecaptionskip{10\p@}
+  \setlength\belowcaptionskip{0\p@}
+  \newcommand*\@captionheadfont{\scshape}
+  \newcommand*\@captionfont{\normalfont}
+\fi
+\long\def\@makecaption#1#2{%
+  \setbox\@tempboxa\vbox{\color@setgroup
+    \advance\hsize-2\captionindent\noindent
+    \@captionfont\@captionheadfont#1\@xp\@ifnotempty\@xp
+        {\@cdr#2\@nil}{.\@captionfont\upshape\enspace#2}%
+    \unskip\kern-2\captionindent\par
+    \global\setbox\@ne\lastbox\color@endgroup}%
+  \ifhbox\@ne % the normal case
+    \setbox\@ne\hbox{\unhbox\@ne\unskip\unskip\unpenalty\unkern}%
+  \fi
+  \ifdim\wd\@tempboxa=\z@ % this means caption will fit on one line
+    \setbox\@ne\hbox to\columnwidth{\hss\kern-2\captionindent\box\@ne\hss}%
+  \else % tempboxa contained more than one line
+    \setbox\@ne\vbox{\unvbox\@tempboxa\parskip\z@skip
+        \noindent\unhbox\@ne\advance\hsize-2\captionindent\par}%
+  \fi
+  \ifnum\@tempcnta<64 % if the float IS a figure...
+    \addvspace\abovecaptionskip
+    \hbox to\hsize{\kern\captionindent\box\@ne\hss}%
+  \else % if the float IS NOT a figure...
+    \hbox to\hsize{\kern\captionindent\box\@ne\hss}%
+    \nobreak
+    \vskip\belowcaptionskip
+  \fi
+\relax
+}
+\renewcommand\@footnotetext[1]{\insert\footins{%
+    \if@korean\linespread{\korean@info@spread}\fi%
+    \if@ptexjs\linespread{\ptexjs@info@spread}\fi%
+    \reset@font\footnotesize
+    \interlinepenalty\interfootnotelinepenalty
+    \splittopskip\footnotesep
+    \splitmaxdepth \dp\strutbox \floatingpenalty \@MM
+    \hsize\columnwidth \@parboxrestore
+    \protected@edef\@currentlabel{%
+       \csname p@footnote\endcsname\@thefnmark
+    }%
+    \color@begingroup
+      \@makefntext{%
+        \rule\z@\footnotesep\ignorespaces#1\@finalstrut\strutbox}%
+    \color@endgroup}}%
+\renewcommand\@makefntext[1]{%
+  \parindent 1.8em%
+  \noindent
+  \hb@xt@1.8em{\hbox{\strut\normalfont\footnotesize\@thefnmark.}\hss}#1}
+\def\@ifx@empty#1{% Implicit #2#3
+  \ifx#1\@empty
+    \expandafter\@firstoftwo
+  \else
+    \expandafter\@secondoftwo
+  \fi}%
+\def\@ifx@undefined#1{% Implicit #2#3
+  \ifx#1\@undefined
+    \expandafter\@firstoftwo
+  \else
+    \expandafter\@secondoftwo
+  \fi}%
+\def\@ifeof#1{% Implicit #2#3
+ \ifeof#1
+   \expandafter\@firstoftwo
+ \else
+   \expandafter\@secondoftwo
+ \fi}%
+\def\boolean@true#1{\let#1\@firstoftwo}%
+\def\boolean@false#1{\let#1\@secondoftwo}%
+\def\ps@titlepage{%
+  \def\@oddhead{\titlepage@head\hfil}%
+  \let\@evenhead\@oddhead
+  \def\@oddfoot{\hfil\titlepage@foot}%
+  \let\@evenfoot\@oddfoot}%
+\def\titlepage@head{\footnotesize
+  \parbox{\linewidth}{%
+    \normalbodyspread
+    \@ifx@empty\@AJTissue{For submission to \AJT}{\AJT, \@AJTissue\hfill\raisebox{-\height+.6\baselineskip}[0pt][0pt]{\@KTSlogo}}\par
+    \@ifx@empty\@AJTissue
+       {\@ifx@empty\@AJTrevision{Draft of \today}{Article revision \@AJTrevision}}%
+       {\@ifx@empty\@AJTrevision
+          {\ClassError{ajt}
+            {\string\AJTrevision\space must be defined if
+             \string\AJTissue\space is also}
+            {It is a requirement for PracTeX Journal articles to contain\MessageBreak
+             revision information for version tracking. Please input this\MessageBreak
+             information, or omit \protect\AJTissue.}}
+          {Article revision \@AJTrevision}}}}%
+\def\titlepage@foot{%
+  \vtop{\raggedleft\footnotesize\@AJTcopyright}}%
+\def\odd@heading@rule{\makebox[0pt][l]{\rule[-3.5pt]{\textwidth}{0.3pt}}}%
+\let\even@heading@rule\odd@heading@rule
+\def\ps@headings{%
+  \def\@oddhead{\odd@heading@rule\small\scshape\@AJTissue\hfil\thepage}%
+  \def\@evenhead{\even@heading@rule\small\scshape\thepage\hfil\AJT}%
+  \let\@oddfoot\@empty
+  \let\@evenfoot\@oddfoot}%
+\renewcommand{\topfraction}{.85}
+\renewcommand{\bottomfraction}{.7}
+\renewcommand{\textfraction}{.15}
+\renewcommand{\floatpagefraction}{.66}
+\renewcommand{\dbltopfraction}{.66}
+\renewcommand{\dblfloatpagefraction}{.66}
+\setcounter{topnumber}{9}
+\setcounter{bottomnumber}{9}
+\setcounter{totalnumber}{20}
+\setcounter{dbltopnumber}{9}
+\newcommand\addinfo[2][]{%
+  \ajt@define@info@block[#1]{#2}%
+  \g@addto@macro\ajt@optional@author@info{\ajt@info@container[#1]{#2}}}
+\newcommand\addinfospace[1]{\g@addto@macro\ajt@optional@author@info{\vspace{#1}}}
+\newcommand\ajt@define@info@block[2][]{%
+  \lowercase{\expandafter\long\expandafter\def\csname#2\endcsname}%
+  ##1{\expandafter\def\csname ajt@info@#2\endcsname{##1}}}
+\newcommand\clearinfo{\let\ajt@optional@author@info\@empty}
+\clearinfo
+%\addinfo[\typesetemail]{Email}
+%\addinfo[\url]{Website}
+%\addinfo[\linespread{0.9}\selectfont]{Address}
+\ajt@define@info@block{Keywords}
+\ajt@define@info@block{Abstract}
+\newif\ifajt@noabstract
+\newcommand\noabstract{\ajt@noabstracttrue}
+\def\endabstract{%
+  \ClassError{ajt}
+   {Please input the abstract with \string\abstract{...}, before \string\begin{document}}
+   {Instead of the \string\begin{abstract}...\string\end{abstract} \MessageBreak
+    environment, use \string\abstract{...}. Paragraphs are allowed!\MessageBreak
+                                                                   \MessageBreak
+    Because the abstract is typeset with the title block,          \MessageBreak
+    it must be input before the \string\begin{document}\space command.}}
+\newcommand{\AJTissue}[3]{\gdef\@AJTissue{Volume #1, No.\thinspace #2, #3}}%
+\newcommand{\AJTpage}[1]{\setcounter{page}{#1}}%
+\newcommand{\AJTlang}[1]{\gdef\@AJTlang{#1}}%
+\newcommand{\AJTrevision}[3]{\gdef\@AJTrevision{#1/#2/#3}}%
+\newcommand{\AJTcopyright}[1]{\gdef\@AJTcopyright{#1}}%
+\def\logo@setup#1{%
+  \IfFileExists{#1}
+    {\def\@KTSlogo{\includegraphics[height=12mm]{#1}}}
+    {\let\@KTSlogo\@empty}}%
+\ifx\@dvi@driver\dps@driver
+  \logo@setup{KTS-logo.eps}
+\else
+  \logo@setup{KTS-logo.pdf}
+\fi
+\let\@AJTissue\@empty
+\let\@AJTrevision\@empty
+\let\@AJTcopyright\@empty
+\let\license\AJTcopyright
+\newcommand\ajt@info@container[2][]{%
+  \lowercase{\expandafter\gdef\csname#2\endcsname}%
+    {\ClassError{ajt}{#2 must be defined BEFORE \string\maketitle}{}}
+  \expandafter\ifx\csname ajt@info@#2\endcsname\relax\else
+    \noindent\small
+    \begin{minipage}[t]{0.12\textwidth}
+      \noindent\rmfamily\scshape#2\hfill
+    \end{minipage}\hfill
+    \begin{minipage}[t]{0.85\textwidth}
+      \if@korean\if@korabstract\koreanbodyspread\else\koreaninfospread\fi\fi
+      \if@ptexjs\if@ptexjsabstract\ptexjsbodyspread\else\ptexjsinfospread\fi\fi
+      \setlength\parindent{1.8em}%
+      \noindent\ignorespaces
+      \expandafter#1\expandafter{\csname ajt@info@#2\endcsname}
+    \end{minipage}\par
+  \fi}
+\newcommand\obfuscateemail{%
+  \def\typesetemail##1{\ttfamily\switchemail{##1}}}
+\newcommand\hyperlinkemail{%
+  \def\typesetemail##1{\ttfamily\ajt@compose@mailto{##1}{Re: AJT article}{##1}}}
+\newcommand\ajt@compose@mailto[3]{%
+  \edef\@tempa{mailto:#1?subject=#2 }%
+  \edef\@tempb{\expandafter\html@spaces\@tempa\@empty}%
+  \href{\@tempb}{#3}}
+
+\catcode`\%=11
+\def\html@spaces#1 #2{#1%20\ifx#2\@empty\else\expandafter\html@spaces\fi#2}
+\catcode`\%=14
+\newcommand\note[1]{\unskip\footnote{#1}}
+\DeclareRobustCommand\dash{%
+  \unskip\nobreak\thinspace\textemdash\thinspace\ignorespaces}
+%\pdfstringdefDisableCommands{\renewcommand{\dash}{ - }}
+\newcommand\ctanfile[1]{%
+  \href{http://www.ctan.org/get?fn=/#1}
+       {\path{CTAN:#1}}}
+\newcommand\ctanloc[1]{%
+  \href{http://www.ctan.org/tex-archive/#1}
+       {\path{CTAN:#1}}}
+\ifx\@dvi@driver\xtx@driver\else % not XeTeX
+  \DeclareTextSymbol{\textbackslash}{OT1}{`\\}
+  \DeclareTextSymbol{\textbraceleft}{OT1}{`\{}
+  \DeclareTextSymbol{\textbraceright}{OT1}{`\}}
+\fi
+\newcommand\cs[1]{%
+  \texttt{\textbackslash#1}}
+\DeclareRobustCommand\TeX{T\kern-.15em\lower.5ex\hbox{E}\kern-.07em X\spacefactor1000\relax}
+\DeclareRobustCommand\eTeX{\ensuremath{\varepsilon}-\kern-.125em\TeX}
+\DeclareRobustCommand\LaTeX{L\kern-.32em\raise.37ex\hbox{\scalebox{0.76}{A}}\kern-.15em\TeX}
+\DeclareRobustCommand\LaTeXe{\LaTeX2$_{\textstyle\varepsilon}$}
+\DeclareRobustCommand\LuaTeX{Lua\TeX}
+\DeclareRobustCommand\LuaLaTeX{Lua\LaTeX}
+\DeclareRobustCommand\kotex{\textsf{k}\textit{o}\kern-1pt\lower.15ex\hbox{.}\kern-1pt\TeX}
+\DeclareRobustCommand\xetexko{\XeTeX-\textsf{k}\textit{o}}
+\DeclareRobustCommand\luatexko{\LuaTeX-\textsf{k}\textit{o}}
+\DeclareRobustCommand\BibTeX{B{\textsc i\kern-.025em\textsc b}\kern-.08em\TeX}
+\DeclareRobustCommand\logofamily{%
+  \not@math@alphabet\logofamily\relax
+  \fontencoding{U}\fontfamily{logo}\selectfont}
+\DeclareTextFontCommand{\textlogo}{\logofamily}
+\DeclareRobustCommand\MF{\textlogo{META}\@dischyph\textlogo{FONT}\@}
+\DeclareRobustCommand\MP{\textlogo{META}\@dischyph\textlogo{POST}\@}
+\DeclareRobustCommand\ConTeXt{C\kern-.03em on\-\kern-.10em\TeX\kern-0.04em t}%
+\DeclareRobustCommand\pdfTeX{pdf\/\TeX}
+\DeclareRobustCommand\pdfeTeX{pdf\/\eTeX}
+\DeclareRobustCommand\pdfLaTeX{pdf\/\LaTeX}
+\DeclareRobustCommand\PS{PostScript}
+\DeclareRobustCommand\PracTeX{Prac\kern-0.07em\TeX}
+\DeclareRobustCommand\pTeX{p\kern-0.05em\TeX}
+\DeclareRobustCommand\AJT{The Asian Journal of \TeX}
+\DeclareRobustCommand\XeTeX{%
+      X\lower.5ex\hbox{\kern-.07em\reflectbox{E}}%
+      \kern-.15em\TeX}
+\DeclareRobustCommand\ExTeX{\textrm{\relax
+ \ensuremath{\textstyle\varepsilon_{\kern-0.15em\mathcal{X}}}\relax
+ \kern-.15em\TeX}}
+\def\write@ID@aux{%
+ \@ifx@empty\@AJTrevision{}{%
+  \begingroup
+   \let\thanks\@gobble
+   \immediate\openout\ID@aux _rev.tex
+   \immediate\write\ID@aux{\@AJTrevision}%
+   \immediate\closeout\ID@aux
+  \endgroup
+ }%
+}%
+\newwrite\ID@aux
+\def\read@issue{%
+ \openin\@inputcheck _iss.tex
+ \@ifeof\@inputcheck{}
+   {\ifx\@AJTissue\@empty\else
+      \typeout{---------^^J
+               ajt: \protect\AJTissue\space info overwritten due to _iss.tex file^^J
+               ---------}
+    \fi
+    \read\@inputcheck to\@AJTissue
+    \closein\@inputcheck
+    \expandafter\parse@iss\@AJTissue\@nil}}
+\def\parse@iss AJT #1 No #2, #3-#4-#5\@nil{%
+  \@tempcnta#2\relax
+  \protected@xdef\@AJTissue{\AJT, #1, No.\thinspace\the\@tempcnta}}
+\def\set@pdfpage{%
+  \ifx\@dvi@driver\tpd@driver
+    \@ifx@undefined\pdfoutput{}{%
+      \pdfpagewidth =\paperwidth
+      \pdfpageheight=\paperheight
+    \relax}%
+  \else
+    \special{papersize=\the\paperwidth,\the\paperheight}%
+  \fi}
+\AtBeginDocument{\if@print\else\set@pdfpage\fi}
+\let\thebibliography@ltx\thebibliography
+\let\endthebibliography@ltx\endthebibliography
+\renewenvironment{thebibliography}[1]
+  {\if@korean\normalbodyspread\renewcommand{\refname}{참고 문헌}\fi%
+   \if@ptexjs\ptexjsinfospread\renewcommand{\refname}{参考文献}\fi%
+   \thebibliography@ltx{#1}\setlength{\itemsep}{0pt}\small}
+  {\endthebibliography@ltx}
+\renewcommand\@biblabel[1]{#1.}
+\def\head@setup#1{%
+  \IfFileExists{#1}
+    {\def\@AJThead{\includegraphics[width=.25\textwidth]{#1}}}
+    {\let\@AJThead\@empty}}%
+\ifx\@dvi@driver\dps@driver
+  \head@setup{AJT-head.eps}
+\else
+  \head@setup{AJT-head.pdf}
+\fi
+\newcommand*\putAJThead[1]{%
+  \raisebox{-\textheight-3em}[0pt][0pt]{%
+    \makebox[0pt][l]{\hspace*{-3em}\@AJThead}%
+  }%
+}
+\if@reprint
+  \let\cleardoublepage\relax
+\else
+  \renewcommand\cleardoublepage{\clearpage\if@twoside\ifodd\c@page\else
+    \pagestyle{empty}\noindent\putAJThead\newpage\if@twocolumn\hbox{}\newpage\fi\fi\fi}
+\fi
+\pagestyle{headings}
+\endinput
+%%
+%% End of file `ajt.cls'.
diff --git a/doc/tc11-abst.pdf b/doc/tc11-abst.pdf
new file mode 100644 (file)
index 0000000..69f73ca
Binary files /dev/null and b/doc/tc11-abst.pdf differ
diff --git a/doc/tc11-abst.tex b/doc/tc11-abst.tex
new file mode 100755 (executable)
index 0000000..d73bc8e
--- /dev/null
@@ -0,0 +1,158 @@
+%#!lualatex
+\documentclass[a4paper]{bxjsarticle}
+\setpagelayout*{left=20truemm, right=20truemm,top=15truemm,bottom=20truemm}
+\pagestyle{empty}
+\usepackage{luatextra,booktabs,amsmath,lmodern}
+\usepackage[unicode=true]{hyperref}
+\usepackage{luatexja}
+
+\def\title{\LuaTeX-jaの開発}
+\def\author{北川 弘典}
+\def\mail{h\_kitagawa2001@yahoo.co.jp}
+\hypersetup{pdftitle=\title, pdfauthor=\author}
+
+\makeatletter
+\baselineskip=15pt
+\DeclareFontShape{JY3}{mc}{m}{n}{<-> s*[0.92489] psft:Ryumin-Light:jfm=ujis}{}
+\DeclareFontShape{JY3}{gt}{m}{n}{<-> s*[0.92489] psft:GothicBBB-Medium:jfm=ujis}{}
+\ltjsetparameter{alxspmode={`\\,3}}
+
+  \renewcommand{\section}{%
+    \@startsection{section}{1}{\z@}%
+    {.5\Cvs}% 前アキ
+    {.25\Cvs}% 後アキ
+    {\normalfont\large\headfont\raggedright}}
+  \renewcommand{\paragraph}{\@startsection{paragraph}{4}{\z@}%
+    {0.25\Cvs}{-1\zw}% 改行せず 1zw のアキ
+    {\normalfont\normalsize\headfont}}
+\let\subsection=\paragraph
+
+\def\@listI{\leftmargin\leftmargini
+  \parsep \z@\topsep\z@\itemsep\z@}
+\@listI
+\def\headfont{\normalfont\bfseries\mathversion{bold}}
+\def\emph#1{\textbf{\mathversion{bold}#1}}
+\def\centerbaseline#1#2{%
+  \setbox0=\hbox{#1\ltjsetparameter{yjabaselineshift=\z@}あ}%
+  \@tempdima=\dimexpr\cht-\cdp-\ht0+\dp0-1pt\relax{#1%
+  \ltjsetparameter{yjabaselineshift=-0.5\@tempdima, yalbaselineshift=-0.5\@tempdima}#2%
+  }}
+\def\.#1{{\normalfont\it$\langle$#1$\rangle$}}
+\def\:#1{{\normalfont\tt\char92 #1}}
+\begin{document}
+\begin{center}
+\LARGE\bfseries\title
+\end{center}
+\smallskip
+\begin{flushright}
+\author~({\tt\mail})
+\end{flushright}
+\smallskip
+
+\noindent\textgt{概要}\hskip1\zw
+Lua\TeX-ja は,p\TeX と同等あるいはそれ以上の水準の日本語組版を,
+次世代標準\TeX エンジンであるLua\TeX で可能にすることを目的とした,開発中のマクロパッケージである.
+本発表では,Lua\TeX-ja の現在の状況について,p\TeX との相違点を中心に報告する.
+
+\section{開発方針}
+\begin{itemize}
+\item \emph{最低でもp\TeX と同等の組版の自由度を確保する.}
+p\TeX のprimitiveに相当するレベルから開発を行う.
+\item \emph{p\TeX との100\%互換は目的としない.}
+p\TeX において不自然/不都合な実装があれば,積極的に改める.
+\end{itemize}
+
+
+\section{p\TeX との主な違い}
+\subsection{縦書きはまだ未実装}
+落ち着いてきたら縦書きも開発したいが,現状は左横書きのみに集中している.
+
+\subsection{命令名称の変更}
+大半のパラメタへの代入は\:{ltjsetparameter}へ
+{\tt \.{key}=\.{value}}の形で渡す.
+
+例:行頭禁則用ペナルティ({\sf prebreakpenalty})
+\begin{center}\medskip\small%
+\begin{tabular}{lll}
+\toprule
+&p\TeX&Lua\TeX-ja\\\midrule
+代入&\:{prebreakpenalty}\.{chr}{\tt =}\.{pena}&
+\verb+\ltjsetparameter{prebreakpenalty={+\.{chr}{\tt,}\.{pena}\verb+}}+\\
+取得&\:{prebreakpenalty}\.{chr}(count)&
+\verb+\ltjgetparameter{prebreakpenalty}{+\.{chr}\verb+}+(string)\\
+\bottomrule
+\end{tabular}
+\end{center}
+\ 
+
+\subsection{行末が和文文字の場合の改行の扱い}
+Lua\TeX の仕様上,「前行行末時の設定値」で判定するad hocな仕様.
+%1行を外部から読み込むとき,前行行末のcatcodeの状態で,行の末尾が次の形のときに改行を無視する:
+%\[
+% \hbox{(catcodeが11 or 12の和文文字)}\hbox{(catcodeが1 or 2の文字)}^*
+%\]
+
+\subsection{和文間・和欧文間の空白挿入処理}
+p\TeX のそれをベースに,1から書き直しを行った.
+\begin{enumerate}
+\item 空白挿入処理をノードベースに変更(Lua\TeX の合字・カーニング処理に合わせた).
+\item \inhibitglue「和文フォント」はメトリックと実際の字形,そしてサイズとの組で定義される:
+\begin{center}
+$\tt\mathcode`\:="703A\mathcode`\*="7020
+\mathcode`\=="703D\mathcode`\-="702D\mathcode`\|="705C%"
+\mathcode`\<="707B\mathcode`\>="707D
+|jfont|tenmin=\underbrace{\tt psft:Ryumin-Light}_{\text{PostScriptフォント(非埋込)}}:%
+\underbrace{\tt jfm=ujis}_{\text{メトリック}}*at*13.5|jQ
+$\smallskip
+\end{center}
+空白挿入処理では,メトリックとサイズの同じ和文フォントは同一視される.
+
+\item 異なるメトリック・サイズの2つの和文文字の間には,両メトリックから決まる空白の平均値が入る.
+\end{enumerate}
+
+\begin{center}\medskip\small%
+\begin{tabular}{ccc}
+\toprule
+\textbf{入力}&\textbf{p\TeX}&\textbf{Lua\TeX-ja}\\\midrule
+$
+\tt\mathcode`\:="703A\mathcode`\*="7020
+\mathcode`\=="703D\mathcode`\-="702D\mathcode`\|="705C%"
+\mathcode`\<="707B\mathcode`\>="707D
+あ\overbrace{\tt)<|gt(}^{\text{2.}}い
+\overbrace{\tt)<>(}^{\text{1.}}>う\overbrace{\tt)<|Large(}^{\text{3.}}え>
+$
+&\large あ)\hbox{}{\gt(い)\hbox{}(}う)\hbox{}{\Large(え}&
+\large あ){\gt(い){}(}う){\Large(え}\\
+\bottomrule
+\end{tabular}
+\end{center}
+\
+
+\section{現在の実装状況}
+\subsection{\inhibitglue 「エンジン拡張部分」%
+\centerbaseline{\scriptsize\normalfont}{(\TeX\inhibitglue →\inhibitglue p\TeX のエンジン拡張部分
+に相当)}}\ \par概ね実装済みであるが,細かい仕様変更の可能性あり.また,
+従来ではprimitiveとして実装されていた機能をLuaコードと\TeX マクロを用いて実装しな
+いといけないので,予想外のバグの可能性があるとともに,処理速度が非常に遅い.
+
+\subsection{\LaTeXe への対応
+\centerbaseline{\scriptsize\normalfont}{(p\LaTeXe 実装に相当)}}\ \par
+p\LaTeXe のソースを参考に,NFSS2へのパッチなど主な部分の実装は行った.
+まだ自前の日本語用クラスファイルは製作しておらず,
+八登さんによるBXjsclsを使用するのが現状では手っ取り早い.
+\centerbaseline{\scriptsize\normalfont}{(本文書も同クラスを使用している)}
+
+
+\subsection{{\tt fontspec}, {\tt otf}パッケージの対応}\ \par
+\verb+\setmainjfont+, \verb+\CID+など一部の機能が実装され,ある程度は使える状況である.
+
+
+
+\vfill
+\hrule\medskip
+\subsection{Lua\TeX-ja プロジェクトについて}\ 
+
+プロジェクト Wiki:\url{http://sourceforge.jp/projects/luatex-ja/wiki/}
+
+開発メンバー:北川 弘典,前田 一貴,八登 崇之,黒木 裕介,阿部 紀行,本田 知亮,山本 宗宏
+\end{document}
\ No newline at end of file
diff --git a/doc/tc11-slide.pdf b/doc/tc11-slide.pdf
new file mode 100644 (file)
index 0000000..45752e1
Binary files /dev/null and b/doc/tc11-slide.pdf differ
diff --git a/doc/tc11-slide.tex b/doc/tc11-slide.tex
new file mode 100644 (file)
index 0000000..a162e39
--- /dev/null
@@ -0,0 +1,667 @@
+%#! lualatex -shell-escape tc11-slide.tex
+\documentclass[notheorems,12pt,hyperref={unicode=true}]{beamer}
+\usepackage{luatexja,luatexja-otf,luatexja-fontspec,showexpl,lltjlisting}
+\usepackage{mathtools,graphicx,pict2e}
+\usepackage{amsmath,bm,mflogo,booktabs}
+\usepackage[all]{xy}
+
+\SelectTips{cm}{}
+
+%%% theme
+\useinnertheme{rectangles}
+\useoutertheme{split}
+\usecolortheme{rose}
+\usecolortheme{dolphin}
+\setbeamertemplate{navigation symbols}{}
+\setbeamertemplate{headline}{}
+
+\makeatletter
+\definecolor{purple}{rgb}{0.60, 0.0, 1.0}
+\definecolor{green}{rgb}{0.0, 0.60, 0.0}
+\definecolor{lblue}{rgb}{0.30, 0.0, 1.00}
+\definecolor{gray}{rgb}{0.60, 0.60, 0.60}
+\definecolor{linenavy}{rgb}{0.0 ,0.0 ,0.50}
+\definecolor{linesky}{rgb} {0.50,0.75,1.00}
+\newdimen\lineheight \lineheight=6pt
+\def\lines#1{%
+  \noindent\null\hskip-30pt\setbox0=\hbox{%
+  {\color{linenavy}\vrule height \lineheight width #1\lineheight}%
+  \kern 0.2\lineheight{\color{linenavy!80!linesky}\vrule height\lineheight width 0.6\lineheight}%
+  \kern 0.2\lineheight{\color{linenavy!60!linesky}\vrule height\lineheight width 0.52\lineheight}%
+  \kern 0.2\lineheight{\color{linenavy!40!linesky}\vrule height\lineheight width 0.44\lineheight}%
+  \kern 0.2\lineheight{\color{linenavy!20!linesky}\vrule height\lineheight width 0.36\lineheight}%
+  \kern 0.2\lineheight}\copy0\nobreak
+  \@tempdima=\textwidth\advance\@tempdima64pt\advance\@tempdima-\wd0
+  \hbox to 0pt{\color{linesky}\vrule height \lineheight width \@tempdima \hss}\par
+}
+\setbeamertemplate{frametitle}{
+  \noindent\insertframetitle\par\vskip-8pt\lines{12}\vskip-16pt
+}
+\setbeamertemplate{footline}{
+  \leavevmode%
+  \hbox{\begin{beamercolorbox}[wd=.5\paperwidth,ht=2.5ex,dp=1.125ex,
+leftskip=.3cm,rightskip=.3cm]{author in head/foot}%
+    \usebeamerfont{author in head/foot}\ \hfill \insertshortauthor
+  \end{beamercolorbox}%
+  \begin{beamercolorbox}[wd=.5\paperwidth,ht=2.5ex,dp=1.125ex,
+leftskip=.3cm,rightskip=.3cm plus1fil]{title in head/foot}%
+    \usebeamerfont{title in head/foot}\insertshorttitle
+  \end{beamercolorbox}}%
+  \vskip0pt%
+}
+\expandafter\let\csname beamer@@tmpop@title page@default\endcsname=\relax
+\defbeamertemplate*{title page}{default}[1][]
+{
+  \vbox{}
+  \vfill
+  \begin{centering}
+    \begin{beamercolorbox}[sep=8pt,center,#1]{title}
+      \usebeamerfont{title}\inserttitle
+    \end{beamercolorbox}
+  \end{centering}
+
+\lines{29.5}\vskip8pt
+  \begin{centering}
+    \begin{beamercolorbox}[sep=8pt,center,#1]{author}
+      \usebeamerfont{author}\insertauthor
+    \end{beamercolorbox}
+    \begin{beamercolorbox}[sep=8pt,center,#1]{date}
+      \usebeamerfont{date}\insertdate
+    \end{beamercolorbox}
+  \end{centering}
+  \vskip-8pt\vfill
+}
+
+\AtBeginSection[]{
+  \begin{frame}
+    \frametitle{Outline}
+    \tableofcontents[currentsection,hideothersubsections]
+  \end{frame}
+}
+
+\setbeamercolor{structure}{fg=linenavy}
+\setbeamercolor{author in head/foot}{fg=white,bg=linenavy}
+\setbeamercolor{title in head/foot}{fg=black,bg=linesky}
+\setbeamercolor{block title}{bg=linenavy!50!linesky,fg=white}
+\setbeamercolor{block body}{fg=black,bg=linesky!20!white}
+\setbeamertemplate{section in toc}{■\null\inserttocsection\par\smallskip}
+\setbeamerfont{section in toc}{size=\normalsize}
+\setbeamerfont{title}{size=\Large, series=\bfseries}
+\setbeamerfont{frametitle}{size=\Large, series=\bfseries, shape=\upshape}
+
+\def\mcdefault{gt}
+\DeclareFontShape{JY3}{gt}{bx}{n}{ <-> s*[0.924872] psft:FutoGoB101-Bold:jfm=ujis}{}
+\DeclareFontShape{JY3}{gt}{m}{n}{ <-> s*[0.924872] psft:GothicBBB-Medium:jfm=ujis}{}
+\DeclareFontShape{JY3}{mc}{m}{n}{ <-> s*[0.924872] psft:Ryumin-Light:jfm=ujis}{}
+\def\notice#1{{\color{blue!50!black}#1}}
+\def\alert#1{{\color{red}\bfseries#1}}
+\def\pTeX{p\TeX}
+\parindent=0pt
+\catcode`\|=13\def|{\char92 }
+\def\{{{\ttfamily\char`\{}}
+\def\}{{\ttfamily\char`\}}}
+\ltjsetparameter{alxspmode={`\\,allow}}
+\lstset{numbers=left, basicstyle=\ttfamily}
+\makeatother
+
+\title{Lua\TeX-jaの開発}
+\author[北川 弘典]{北川 弘典\\\footnotesize(Lua\TeX-jaプロジェクトチーム)}
+\date{2011年10月22日}
+
+\begin{document}
+
+\begin{frame}
+  \titlepage
+\end{frame}
+
+\section{導入}
+
+
+\subsection{背景}
+\begin{frame}
+  \frametitle{Lua\TeX-ja}
+  {\large\[
+    \xymatrix{
+      \text{\TeX}\ar[r]\ar[d]&\text{$\varepsilon$-\TeX}\ar[d]\ar[r]
+      &\text{pdf\TeX}\ar[r]&\text{Lua\TeX}\ar@{-->}[d]\\
+      \text{p\TeX}\ar[r]&\text{$\varepsilon$-p\TeX}
+      \ar@{-->}[rr]&&\text{\alert{Lua\TeX-ja}}
+    }
+  \]}%
+  \begin{center}
+    \bfseries\Large 
+    Lua\TeX-jaは,Lua\TeX 上で日本語組版を実現させるマクロパッケージである.
+  \end{center}
+\end{frame}
+
+\begin{frame}[fragile]
+  \frametitle{Lua\TeX}
+  {\large\begin{align*}
+    \text{Lua\TeX}&\simeq \text{pdf\TeX}+ \text{Lua}+\text{\MP}\\
+    &\qquad+\text{Omega}+\text{OpenType}+ \cdots
+  \end{align*}}
+  \textbf{主な特徴:}
+  \begin{itemize}
+    \item pdfへの直接出力(pdf\TeX の後継)
+    \item Unicodeへの対応{\small (SIP内の文字も余裕)}
+    \item TrueType/OpenTypeフォントの直接利用
+    \item Luaスクリプトで\TeX 内部処理のカスタマイズが可能\\
+      \quad →もはやエンジンレベルで拡張する必要はない
+  \end{itemize}
+
+  \footnotesize 詳しくは,昨年度の八登さんの講演を参照.
+\end{frame}
+
+\subsection{開発方針}
+\begin{frame}
+  \frametitle{開発方針1}
+  \begin{flushleft}
+   \alert{\bfseries\large 
+    p\TeX のプリミティブに対応する機能から実装.}%
+  \end{flushleft}\vskip-\medskipamount
+  \begin{itemize}
+  \item 以前から存在した,Lua\TeX で日本語組版を行う実験:
+  \begin{itemize}
+    \item \texttt{luaums.sty}(北川)\\\quad
+      {\small 適当にでっち上げた最低限の実装.}
+    \item \texttt{luajalayout}パッケージ(作者:前田一貴)\\\quad
+      {\small フォント合成・fontspecパッケージを用いた実装.}
+  \end{itemize}
+  は「\LaTeX ベース」で,組版の調整機能が不足していた.\medskip
+  \item 最低でもp\TeX と同等の組版の自由度を確保する.
+  \end{itemize}
+\end{frame}
+
+\begin{frame}
+  \frametitle{開発方針2}
+  \begin{flushleft}
+    \alert{\bfseries\large 
+    p\TeX と100\%の互換性は目指さない.}%
+  \end{flushleft}\vskip-\medskipamount
+  \begin{itemize}
+    \item p\TeX の不都合・不可解な点があれば,積極的に改める.
+    \item p\TeX と全く同じ文法・動作の実装は事実上不可能.
+  \end{itemize}\medskip
+  \begin{flushleft}
+    \alert{\bfseries\large 
+    最終的に,(空白挿入等の)仕様を文書化する.}
+  \end{flushleft}\vskip-\medskipamount
+  とは言いながら,ドキュメントはまだまだ未完成.
+\end{frame}
+
+\subsection{使い方: plain \TeX}
+\begin{frame}
+  \frametitle{\only<1>{plain p\TeX 用ソース}\only<2>{``plain Lua\TeX-ja''用ソース}}
+\begin{flushleft}\ttfamily
+\only<2>{\alert{|input luatexja.sty} \notice{\% \normalfont Lua\TeX-ja本体}}\ \\
+|hsize=20\alert{\only<2>{|zw}}\only<1>{zw}\\
+\only<1>{|font|bigmc=jis at 14.4pt}
+\alert{\only<2>{|jfont|bigmc=psft:Ryumin-Light:jfm=ujis at14.4pt}}\\
+\notice{\ \ \% 和文フォント定義}\\
+こんにちは,|TeX の世界へ!\\
+\{|bigmc 大きい文字だよ.\}\\
+|end
+\end{flushleft}
+\uncover<2>{
+\begin{itemize}
+\item {\tt luatexja.sty}を読み込む{\footnotesize(これがないと話が始まらない)}
+\item {\tt zw}, {\tt zh}は{\tt |zw}, {\tt |zh}に.
+\item 和文フォント定義は{\tt |jfont}のみ可.書式も変化.
+\end{itemize}}
+\end{frame}
+
+
+\subsection{使い方: \LaTeX}
+\begin{frame}
+  \frametitle{\only<1>{p\LaTeX}\only<2>{``Lua\LaTeX-ja''}用ソース}
+\begin{flushleft}\ttfamily
+|documentclass[a4paper,10pt]\{\only<1>{jsarticle}\alert{\only<2>{ltjsarticle}}\}\\
+|usepackage\{lmodern\}|begin\{document\}\\
+「これはまったく意味がない日本語の文だ.」\\
+(あいう)\{|large|gtfamily(abcゴシック)\}\\
+\ \\
+何かalphabet(欧文文字)も打ってみるか.\\
+\only<1>{\notice{\%}}\only<2>{\$|zeta(2) |simeq}\\
+\only<2>{\ \ |directlua\{tex.print(math.pi\char`\^2/6)\}\$.}\only<1>{\notice{\%}}\\
+|end\{document\}
+\end{flushleft}
+\uncover<2>{
+\begin{itemize}
+\item クラスを\alert{Lua\TeX-ja 同梱のもの}に変える.
+\item 欧文用クラスに対しても,{\ttfamily|usepackage\{luatexja\}}で\\
+最低限の設定がされる.
+\end{itemize}
+}
+\end{frame}
+
+\begin{frame}
+  \frametitle{組版結果}
+\begin{center}
+\fboxsep=1\zw
+\fbox{\large\parbox{20\zw}{\parindent=1\zw%
+\fontfamily{mc}\fontfamily{rm}\selectfont
+\baselineskip=1.6em
+「これはまったく意味がない日本語の文だ.」
+(あいう){\Large\gtfamily(abcゴシック)}
+
+何かalphabet(欧文文字)も打ってみるか.
+$\zeta(2) \simeq
+  \directlua{tex.print(math.pi^2/6)}$.
+}}
+\end{center}
+\end{frame}
+
+
+
+\section{現在の状況}
+
+\begin{frame}
+  \frametitle{実装の模式図}
+  \begin{center}\unitlength=10mm
+  \begin{picture}(9.2,6.5)
+    \linethickness{1pt}
+    % primitive:
+    \only<1>{%
+    \color{lblue!20!white}
+    \put(0,0){\vrule width 9.2\unitlength height 3.2\unitlength depth 0pt}
+    \put(7.2,3.2){\vrule width 2\unitlength height 3.3\unitlength depth 0pt}
+    \color{lblue}
+    \put(0,0){\line(1,0){9.2}}
+    \put(0,0){\line(0,1){3.2}}
+    \put(9.2,0){\line(0,1){6.5}}
+    \put(0,3.2){\line(1,0){7.2}}
+    \put(7.2,3.2){\line(0,1){3.3}}
+    \put(7.2,6.5){\line(1,0){2}}
+    \color{lblue!50!black}
+    \put(4.6,1.6){\makebox(0,0)[c]{「エンジン拡張」}}
+    }%
+    % primitive (detailed)
+    \only<2>{%
+    %% typesetting
+    \color{linenavy!20!white}
+    \put(0,0){\vrule width 9.2\unitlength height \unitlength depth 0pt}
+    \color{linenavy}
+    \put(0,0){\line(1,0){9.2}}
+    \put(0,0){\line(0,1){1}}
+    \put(0,1){\line(1,0){9.2}}
+    \put(9.2,0){\line(0,1){1}}
+    \color{linenavy!50!black}
+    \put(4.6,0.5){\makebox(0,0)[c]{実際の組版処理用Luaコード}}
+    \color{blue!20!white}
+    \put(0,1.1){\vrule width 9.2\unitlength height \unitlength depth 0pt}
+    \color{blue}
+    \put(0,1.1){\line(1,0){9.2}}
+    \put(0,1.1){\line(0,1){1}}
+    \put(0,2.1){\line(1,0){9.2}}
+    \put(9.2,1.1){\line(0,1){1}}
+    \color{blue!50!black}
+    \put(4.6,1.6){\makebox(0,0)[c]{パラメタ設定用Luaコード}}
+    \color{lblue!20!white}
+    \put(0,2.2){\vrule width 9.2\unitlength height \unitlength depth 0pt}
+    \put(7.2,3.2){\vrule width 2\unitlength height 3.3\unitlength depth 0pt}
+    \color{lblue}
+    \put(0,2.2){\line(1,0){9.2}}
+    \put(0,2.2){\line(0,1){1}}
+    \put(9.2,2.2){\line(0,1){4.3}}
+    \put(0,3.2){\line(1,0){7.2}}
+    \put(7.2,3.2){\line(0,1){3.3}}
+    \put(7.2,6.5){\line(1,0){2}}
+    \color{lblue!50!black}
+    \put(4.6,2.7){\makebox(0,0)[c]{\TeX インターフェース}}
+    }%
+    % plain
+    \color{green!20!white}
+    \put(0,3.3){\vrule width 2\unitlength height 3.2\unitlength depth 0pt}
+    \color{green}
+    \put(0,3.3){\line(1,0){2}}
+    \put(0,3.3){\line(0,1){3.2}}
+    \put(2,3.3){\line(0,1){3.2}}
+    \put(0,6.5){\line(1,0){2}}
+    \color{green!50!black}
+    \put(1,4.9){\makebox(0,0)[c]{\parbox[c]{7\zw}{\centering plain \TeX\\対応}}}
+    % LaTeX kernel
+    \color{purple!20!white}
+    \put(2.1,3.3){\vrule width 5\unitlength height \unitlength depth 0pt}
+    \color{purple}
+    \put(2.1,3.3){\line(1,0){5}}
+    \put(2.1,3.3){\line(0,1){1}}
+    \put(7.1,3.3){\line(0,1){1}}
+    \put(2.1,4.3){\line(1,0){5}}
+    \color{purple!50!black}
+    \put(4.6,3.8){\makebox(0,0)[c]{\LaTeX 対応}}
+    % class file
+    \color{gray!20!white}
+    \put(2.1,4.4){\vrule width 5\unitlength height \unitlength depth 0pt}
+    \color{gray}
+    \put(2.1,4.4){\line(1,0){5}}
+    \put(2.1,4.4){\line(0,1){1}}
+    \put(7.1,4.4){\line(0,1){1}}
+    \put(2.1,5.4){\line(1,0){5}}
+    \color{gray!50!black}
+    \put(4.6,4.9){\makebox(0,0)[c]{日本語用クラスファイル}}
+    % patches for packages
+    \color{red!20!white}
+    \put(2.1,5.5){\vrule width 5\unitlength height \unitlength depth 0pt}
+    \color{red}
+    \put(2.1,5.5){\line(1,0){5}}
+    \put(2.1,5.5){\line(0,1){1}}
+    \put(7.1,5.5){\line(0,1){1}}
+    \put(2.1,6.5){\line(1,0){5}}
+    \color{red!50!black}
+    \put(4.6,6.0){\makebox(0,0)[c]{各種パッケージへの対応}}
+  \end{picture}
+  \end{center}
+\end{frame}
+
+\subsection{「エンジン拡張」部分・plain \TeX 対応}
+\begin{frame}
+  \frametitle{「エンジン拡張」部分・plain \TeX 対応}
+  \begin{flushleft}
+    \large\bfseries
+    \color{linenavy!50!black}概ね実装完了,テスト段階.
+  \end{flushleft}\vskip-\medskipamount
+  \begin{itemize}
+    \item 和文フォントの(欧文フォントとの)独立管理
+    \item 和文文字間・和欧文間の空白挿入
+    \item 禁則処理用のペナルティ挿入
+    \item 欧文・和文のベースライン上下移動
+    \item 和文文字直後の改行での空白挿入抑制\alert{(限定的)}
+    \item \alert{縦書き関連はまだ}.また,\alert{速度が非常に遅い}.
+  \end{itemize}
+  しかし,細かい仕様変更はまだ行う可能性はある.
+\end{frame}
+
+\subsection{\LaTeX 対応}
+\begin{frame}
+  \frametitle{\LaTeX 対応}
+  \begin{flushleft}
+    \large\bfseries
+    \color{purple!50!black}(横組みに関する)大半のp\LaTeXe 拡張を実装.
+  \end{flushleft}\vskip-\medskipamount
+  \begin{itemize}
+    \item 和文フォントの管理(\texttt{plfonts.dtx}相当)
+    \item \LaTeX カーネルへのパッチ(\texttt{plcore.dtx}相当)\\
+    但し,次の変更はomitしている:
+    \begin{itemize}
+      \item ボトムフロートの出力順序
+      \item 脚注マクロ
+    \end{itemize}
+    \item 日本語用クラスファイルを試験的に作成.\\
+    {\small(しかし,最終的にどうなるかは未決定)}
+    \begin{itemize}
+     \def\ {\setbox0=\hbox{M}\hskip\wd0}
+      \item \alert{\texttt{ltjclasses\ }}: \texttt{jclasses\ }%
+           \hskip\ltjgetparameter{xkanjiskip}のLua\TeX-ja対応版
+      \item \alert{\texttt{ltjsclasses}}: \texttt{jsclasses}のLua\TeX-ja対応版
+    \end{itemize}
+  \end{itemize}
+\end{frame}
+
+
+\subsection{fontspec等への対応}
+
+\begin{frame}[fragile]
+  \frametitle{fontspec等への対応}
+\noindent\textbf{fontspec対応}
+\begin{itemize}
+\item \verb+luatexja-fontspec+パッケージを使用する.
+\item 和文フォント用命令は\verb+\setmainjfont+, \verb+\setsansjfont+のように「j」がつく.
+\end{itemize}
+
+\noindent\textbf{OTFパッケージの機能}
+\begin{itemize}
+\item \verb+luatexja-otf+パッケージを使用する.
+\item 例:「\verb+\CID{8705}と高+」→\quad\CID{8705}と高
+\item \verb+\CID+, \verb+\UTF+と,\texttt{ajmacros.sty}の一部機能が実装.
+\end{itemize}
+
+\end{frame}
+
+\section{p\TeX との主要な変更点}
+
+\subsection{命令名称・書式}
+\def\.#1{{\rm\fontshape{it}\selectfont$\langle$#1$\rangle$}}
+\begin{frame}
+\frametitle{命令名称の変更}
+{\large 殆どの組版パラメタは\texttt{|ltjsetparameter}にkey-valueリストを渡すことで設定.}
+
+\medskip
+\begin{tabular}{cll}
+\toprule
+\multicolumn{2}{l}{\bf 和欧文間空白}\\
+\hskip1\zw代入&\tt
+|ltjsetparameter\{xkanjiskip=\.{length}\}\\
+\hskip1\zw取得&\tt
+|ltjgetparameter\{xkanjiskip\}\sf\ (as string)\\\midrule
+\multicolumn{2}{l}{\bf 禁則用ペナルティ\hss}\\
+\hskip1\zw代入&\tt
+|ltjsetparameter\{\\
+&\tt\hskip2emprebreakpenalty=\{\.{chr\_code},\.{penalty}\}\}\\
+\hskip1\zw取得&\tt
+|ltjgetparameter\\
+&\tt\hskip2em\{prebreakpenalty\}\{\.{chr\_code}\}\sf\ (as string)\\
+\bottomrule
+\end{tabular}
+
+\end{frame}
+
+\begin{frame}[fragile]
+\frametitle{和文フォントの指定方法}
+
+\begin{flushleft}
+\tt\Large |jfont|piyo=\textcolor{green}{psft:FutoMinA101-Bold}\\
+\hskip5em:\textcolor{blue}{jfm=ujis};...\ \textcolor{red}{at 15pt}
+\end{flushleft}
+
+和文フォントは,次の3要素の組である:
+\begin{description}[metric]\def\makelabel#1{\hbox to \labelwidth{\bf#1}}
+\item[\textcolor{green}{字形}]
+  OpenType/TrueTypeフォントも可.\\
+  prefix \texttt{psft:}で非埋込フォントを指定可能.
+\item[\textcolor{blue}{metric}] p\TeX のJFMに相当するが,若干設定項目が増加.\\
+上の例では\texttt{jfm-\textcolor{blue}{ujis}.lua}が使われる.
+\item[\textcolor{red}{サイズ}]\ 
+\end{description}
+\medskip
+\noindent →\hfill
+\jfont\piyo=psft:FutoMinA101-Bold:jfm=ujis at 15pt
+\piyo 明朝の太文字(非埋込)だよ!
+\hfill\null
+\end{frame}
+
+\subsection{空白挿入処理}
+
+\newdimen\bx\bx=3.2pt
+\newdimen\by
+\makeatletter
+\def\fw#1#2#3#4#5{\fboxsep0pt\vtop{\centering\by=#3\bx\hsize=\by
+  \leavevmode\fcolorbox{#4}{#4!25!white}{%
+  \hbox to\by{\fontsize{\by}{\by}\selectfont\color{black}%
+  \inhibitglue#1\inhibitglue}}\par\vskip5pt#2\par#5}\ignorespaces}
+\def\hw#1#2#3#4#5{\fboxsep0pt\vtop{\centering\by=#3\bx\hsize=0.5\by
+  \leavevmode\fcolorbox{#4}{#4!25!white}{%
+  \hbox to0.5\by{\fontsize{\by}{\by}\selectfont\color{black}%
+  \inhibitglue#1\inhibitglue}}\par\vskip5pt#2\par#5}\ignorespaces}
+\def\spc#1#2{\fboxsep0pt\vtop{\centering\by=#1\bx\hsize=0.5\by
+  \leavevmode\color{#2}\vrule width 0.5\by height 2pt depth 2pt}\ignorespaces}
+\def\bar{\vrule width 0.4pt height 5pt depth 5pt}
+
+\begin{frame}
+\frametitle{空白挿入の単位:\only<1>{p\TeX}\only<2>{\alert{Lua\TeX-ja}}の場合}
+
+\textbf{入力例:\quad}{\large\tt
+\textcolor{green}{$\underbracket{\mathstrut\hbox{)\{\}(}}_{\scriptstyle 1}$}%
+\textcolor{blue}{$\underbracket{\mathstrut\hbox{)|typeout\{\}(}}_{\scriptstyle 2}$}%
+\textcolor{red}{$\underbracket{\mathstrut\hbox{)\{|gt (}}_{\scriptstyle 3}$}\}}
+
+\begin{center}
+\vskip-\bigskipamount
+\leavevmode\bx=3.6pt
+\only<1>{%
+\hw{\fontfamily{mc}\selectfont )}{jis}{10}{green}{\ }
+\spc{10}{green}\bar
+\spc{10}{green}
+\hw{\fontfamily{mc}\selectfont (}{jis}{10}{green}{}
+\hw{\fontfamily{mc}\selectfont )}{jis}{10}{blue}{}
+\spc{10}{blue}
+\hw{\hss\setbox0=\hbox{\rotatebox{270}{\small whatsit}}\raise.5\dp0\copy0\hss}{}{10}{blue}{}
+\spc{10}{blue}
+\hw{\fontfamily{mc}\selectfont (}{jis}{10}{blue}{}
+\hw{\fontfamily{mc}\selectfont )}{jis}{10}{red}{}
+\spc{10}{red}\bar
+\spc{10}{red}
+\hw{(}{jisg}{10}{red}{}
+}%
+\only<2>{%
+\hw{\fontfamily{mc}\selectfont )}{ujis}{10}{green}{R}
+\spc{10}{green}
+\hw{\fontfamily{mc}\selectfont (}{ujis}{10}{green}{R}
+\hw{\fontfamily{mc}\selectfont )}{ujis}{10}{blue}{R}
+\hw{\hss\setbox0=\hbox{\rotatebox{270}{\small whatsit}}\raise.5\dp0\copy0\hss}{}{10}{blue}{}
+\spc{10}{blue}
+\hw{\fontfamily{mc}\selectfont (}{ujis}{10}{blue}{R}
+\hw{\fontfamily{mc}\selectfont )}{ujis}{10}{red}{R}
+\spc{10}{red}
+\hw{(}{ujis}{10}{red}{G}
+}
+\end{center}
+
+\vskip-\medskipamount
+\vbox to 5\baselineskip{%
+\only<1>{
+\alert{入力ソース中で連続していなければ,空白挿入処理は分断.}\\
+元来の\TeX でも,{\tt of\{\}fice}では合字は抑制される.
+}%
+\only<2>{
+\begin{enumerate}
+\item \alert{水平リスト内に寄与しないものは無視}\\
+ Lua\TeX でも,{\tt of\{\}fice}では合字は抑制されない
+\item 行分割に影響しないものも無視
+\item 例え\textcolor{green}{字形}が異なっても,
+\textcolor{blue}{metric}と\textcolor{red}{サイズ}が同じならば,
+空白挿入処理では同じフォントとして扱われる\\
+(違うフォントとして扱うことも設定により可能)
+\end{enumerate}
+}}
+\end{frame}
+
+\begin{frame}
+\frametitle{異フォントの文字:p\TeX の場合}
+
+\pTeX では,異なるフォントの文字間には,\\
+両者のJFM由来の空白が(両方別々に)入る:
+
+\medskip
+
+\leavevmode
+\vtop{\parindent=0pt\hsize=40pt\ \par\vskip5pt JFM\par size}
+\fw{\fontfamily{mc}\selectfont あ}{jis}{10}{green}{10}
+\hw{\fontfamily{mc}\selectfont 〗}{\textcolor{green}{jis}}{10}{green}{10}
+\spc{10}{green}\bar\spc{10}{blue}
+\hw{〖}{\textcolor{blue}{jisg}}{10}{blue}{10}
+\fw{い}{jisg}{10}{blue}{10}
+\hw{】}{jisg}{10}{blue}{\textcolor{blue}{10}}
+\spc{10}{blue}\bar\spc{14.4}{red}
+\hw{【}{jisg}{14.4}{red}{\textcolor{red}{14.4}}
+\fw{う}{jisg}{14.4}{red}{14.4}
+
+\begin{itemize}
+\item \leavevmode
+\smash{\spc{10}{green}\bar\spc{10}{blue}\hskip7.04pt}%
+:$\textcolor{green}{5\,\text{pt\footnotesize (左側由来)}}
++\textcolor{blue}{5\,\text{pt\footnotesize (右側由来)}}=10\,\text{pt}$
+\item \leavevmode
+\smash{\spc{10}{blue}\bar\spc{14.4}{red}}%
+:$\textcolor{blue}{5\,\text{pt\footnotesize (左側由来)}}
++\textcolor{red}{7.2\,\text{pt\footnotesize (右側由来)}}=12.2\,\text{pt}$
+\end{itemize}
+\end{frame}
+\begin{frame}
+\frametitle{異フォントの文字:\alert{Lua\TeX-ja} の場合}
+
+Lua\TeX-jaにおいて,異なるフォントの文字間には,\\
+両者のmetric由来の空白の\alert{平均}値が入る{\small(設定で変更可)\inhibitglue\hbox{}}:
+
+\medskip
+
+
+\leavevmode
+\vtop{\parindent=0pt\hsize=40pt\ \par\vskip5pt metric\par size}
+\fw{\fontfamily{mc}\selectfont あ}{min}{10}{green}{10}
+\hw{\fontfamily{mc}\selectfont〗}{\textcolor{green}{min}}{10}{green}{10}
+\spc{10}{green!50!blue}
+\hw{〖}{\textcolor{blue}{ujis}}{10}{blue}{10}
+\fw{い}{ujis}{10}{blue}{10}
+\hw{】}{ujis}{10}{blue}{\textcolor{blue}{10}}
+\spc{12.2}{purple}
+\hw{【}{ujis}{14.4}{red}{\textcolor{red}{14.4}}
+\fw{う}{ujis}{14.4}{red}{14.4}
+
+\begin{itemize}
+\item \leavevmode
+\smash{\spc{10}{blue!50!green}\hskip3.52pt}%
+:$(\textcolor{green}{5\,\text{pt\footnotesize (左側由来)}}
++\textcolor{blue}{5\,\text{pt\footnotesize (右側由来)}})/2=5\,\text{pt}$
+\item \leavevmode
+\smash{\spc{12.2}{purple}}%
+:$(\textcolor{blue}{5\,\text{pt\footnotesize (左側由来)}}
++\textcolor{red}{7.2\,\text{pt\footnotesize (右側由来)}})/2=6.1\,\text{pt}$
+\end{itemize}
+\end{frame}
+
+\subsection{和文文字直後の改行}
+\begin{frame}[fragile]
+\frametitle{和文文字直後の改行}
+{\bf\large Lua\TeX の仕様により,限定的な実装}
+
+\medskip
+改行による空白が抑制されるかは,\\
+\alert{その行を入力から読み込む前}の内部状態で決まる.
+
+\bigskip
+\textbf{入力例}:\hskip2\zw\unitlength=1\zw
+{\color{green}\begin{picture}(0,0)\thicklines\put(0,0.38){\vector(0,-1){1.1}}\end{picture}%
+「ひらがな他を欧文扱いにする」}
+\fbox{\vbox{\tt
+{\color{green}|ltjsetparameter\{jacharrange=\{-6\}\}}xあ\\
+y
+}}
+
+→出力は「xy」となる(\alert{行末空白は入らない}).
+
+∵1行目を入力から読み込む時点で,「あ」は和文文字扱い.
+\end{frame}
+\section*{まとめ}
+\begin{frame}
+\frametitle{まとめ}
+\large Lua\TeX-ja は,
+\begin{itemize}
+\item 日本語組版をLua\TeX 上で行うパッケージ.
+\item p\TeX をかなり意識しているが,\\ 100\% 互換とはならない.
+\item \LaTeX, fontspec用コードが試験的に整備され,ある程度は使える.
+しかし,バグが埋まっている可能性ありなので,使用には注意.
+\end{itemize}
+\end{frame}
+
+
+\AtBeginSection[]{}
+\section{プロジェクトについて}
+\begin{frame}
+\frametitle{Lua\TeX-ja プロジェクトについて}
+\begin{itemize}
+\item \textbf{公式ページ}\\
+{\tt http://sourceforge.jp/projects/\alert{luatex-ja}/\\\hfill wiki/FrontPage}
+\item まだ安定版のリリースはない.\\スナップショットがダウンロード可能.
+\item \textbf{開発メンバー}
+\begin{itemize}
+\item 北川 弘典
+\item 前田 一貴
+\item 八登 崇之
+\item 黒木 裕介
+\item 阿部 紀行
+\item 本田 知亮
+\item 山本 宗宏
+\end{itemize}
+\end{itemize}
+\end{frame}
+\end{document}