OSDN Git Service

luatexja.dtx doesn't depend on the makecell package.
[luatex-ja/luatexja.git] / doc / luatexja.dtx
index 3bfca43..cffc469 100644 (file)
@@ -1,17 +1,35 @@
-%#! lualatex -shell-escape manual.ins
+%<*!showexpl>
+%#! lualatex -shell-escape
+
+%<en> \documentclass[a4paper,titlepage]{article}
+%<ja> \documentclass[a4paper,titlepage]{ltjsarticle}
+%<zh> \documentclass[a4paper,titlepage]{ltjsarticle}
+
+\makeatletter
+\let\ltjpkglist\empty
+\newif\if@real@append@list
+\def\@append@newentry#1#2{{%
+  \@real@append@listtrue \def\@tempa{#2}%
+  \let\@pkglist\@append@newentry@pkglist#1%
+  \if@real@append@list
+    \let\@pkglist=\relax\xdef#1{#1\@pkglist{#2}}%
+  \fi}}
+\def\@append@newentry@pkglist#1{%
+  \def\@tempb{#1}%
+  \ifx\@tempa\@tempb\@real@append@listfalse\fi}
+\def\@addtofilelist#1{\@append@newentry\ltjpkglist{#1}}
+\let\@listfiles\empty
+\makeatother
 
 %<*en>
-\documentclass[a4paper,titlepage]{article}
 \usepackage[margin=25mm,footskip=5mm]{geometry}
 \usepackage{mathptmx}
 %</en>
 %<*ja>
-\documentclass[a4paper,titlepage]{ltjsarticle}
 \usepackage[textwidth=45\zw, lines=45, footskip=5mm]{geometry}
 \advance\leftmargini-1\zw\advance\leftmarginii-1\zw
 %</ja>
 %<*zh>
-\documentclass[a4paper,titlepage]{ltjsarticle}
 \usepackage[margin=25mm, footskip=5mm]{geometry}
 \advance\leftmargini-1\zw\advance\leftmarginii-1\zw
 \def\postpartname{编}
@@ -56,8 +74,8 @@
 \makeatother
 %</zh>
 
-\usepackage{amsmath,amssymb,xcolor,pict2e,multienum,amsthm,float,makecell}
-\usepackage{booktabs,listings,showexpl,multicol}
+\usepackage{amsmath,amssymb,xcolor,pict2e,multienum,amsthm,float}
+\usepackage{booktabs,listings,showexpl,multicol,metalogo}
 \usepackage{luatexja-otf}
 \usepackage{luatexja-fontspec}
 \usepackage{hyperref}
@@ -304,8 +322,11 @@ The followings are major changes from \pTeX:
       `variation'.
 %</en>
 %<*ja>
-\item 和文フォントは(小塚明朝,IPA明朝などの)実際のフォント,和文フォントメトリック(JFMと呼ぶ),そ
-      して`variation'と呼ばれる文字列の組である.
+\item 和文フォントは(小塚明朝,IPA明朝などの)実際のフォント,和文フォン
+      トメトリック(JFMと呼ぶ\footnote{混乱を防ぐため,p\TeX の意味での
+      JFM (\texttt{min10.tfm}) などは本ドキュメントでは\textbf{和文用
+      TFM}とよぶことにする.}),そして`variation'と呼ばれる文字列の組で
+      ある.
 %</ja>
 %<*zh>
 \item 一个日文字体是由三部分构成的元组:实际的字体(如小塚明
@@ -416,6 +437,12 @@ The followings are major changes from \pTeX:
 %</zh>
 \end{itemize}
 
+%<*ja>
+\item \LuaTeX-jaでは,\pTeX と同様に漢字・仮名を制御綴内に用いることができ,
+\verb+\西暦+ などが正しく動作するようにしている.
+但し,制御綴中に使える和文文字が\pTeX・\upTeX と全く同じではないことに注意すること.
+%</ja>
+
 %<*en>
 \item At the present, vertical typesetting (\emph{tategaki}), is not
       supported in \LuaTeX-ja.
@@ -815,7 +842,6 @@ But only the contents in \texttt{src/} are needed to work \LuaTeX-ja.
 %</zh>
 \end{enumerate}
 
-
 %<en>\subsection{Cautions}
 %<ja>\subsection{注意点}
 %<zh>\subsection{注意}
@@ -901,20 +927,6 @@ This does minimal settings (like \texttt{ptex.tex}) for typesetting Japanese doc
 %</zh>
 \begin{itemize}
 %<*en>
-\item The `Q(級)' is a unit used in Japanese phototypesetting, and
-      $1\,\textrm{Q}=0.25\,\textrm{mm}$. This length is stored in a
-      dimension \verb+\jQ+.
-%</en>
-%<*ja>
-\item `Q(級)'は日本の写植で用いられる単位で,$1\,\textrm{Q}=0.25\,\textrm{mm}$
-      である.この長さは \verb+\jQ+ に保持されている.
-%</ja>
-%<*zh>
-\item “Q(级)”是日本照排中使用的尺寸单位,$1 \mathrm{Q} = 0.25\mathrm{mm}$。
-该长度保存在长度\verb!\jQ!中。
-%</zh>
-
-%<*en>
 \item It is widely accepted that the font `Ryumin-Light' and
       `GothicBBB-Medium' aren't embedded into PDF files, and PDF reader
       substitute them by some external Japanese fonts (\textit{e.g.},
@@ -1098,42 +1110,6 @@ Okumura), namely, \Pkg{ltjclasses} and \Pkg{ltjsclasses}.
 (奥村晴彦)的文档类,即\Pkg{ltjclasses}和\Pkg{ltjsclasses}。
 %</zh>
 
-%<*en>
-\paragraph{\texttt{\char92 CID}, \texttt{\char92 UTF} and macros in OTF package}
-Under \pLaTeX, \Pkg{otf} package (developed by Shuzaburo Saito) is
-used for typesetting characters which is in Adobe-Japan1-6 CID but not
-in JIS~X~0208. Since this package is widely used, \LuaTeX-ja
-supports some of functions in \Pkg{otf} package.
-If you want to use these functions, load \Pkg{luatexja-otf} package.
-%</en>
-%<*ja>
-\paragraph{\texttt{\char92 CID}, \texttt{\char92 UTF}とOTFパッケージのマクロ}
-\pLaTeX では,JIS~X~0208にないAdobe-Japan1-6の文字を出力するために,
-齋藤修三郎氏による\Pkg{otf}パッケージが用いられていた.このパッケージは
-広く用いられているため,\LuaTeX-jaにおいても\Pkg{otf}パッケージの機能の
-一部をサポートしている.これらの機能を用いるためには\Pkg{luatexja-otf}パッケージ
-を読み込めばよい.
-%</ja>
-%<*zh>
-\paragraph{OTF包中的\texttt{\char92CID},\texttt{\char92UTF}及其他宏} 
-\pLaTeX 下,\underline{\texttt{otf}}宏包(斋藤修三郎开发)是用来排印存在
-于Adobe-Japan1-6但不存在于JIS X 0208中的字符。
-该包已经广泛使用,\LuaTeX-ja支持部分\Pkg{otf}包中的部分功能。
-如果你想使用这些功能,加载\Pkg{luatexja-otf}宏包。
-\bgroup
-\fontencoding{JY3}\selectfont
-%</zh>
-
-\begin{LTXexample}
-森\UTF{9DD7}外と内田百\UTF{9592}とが\UTF{9AD9}島屋に行く。
-
-\CID{7652}飾区の\CID{13706}野家,
-葛飾区の吉野家
-\end{LTXexample}
-%<*zh>
-\egroup
-%</zh>
-
 %<en>\subsection{Changing Fonts}
 %<ja>\subsection{フォントの変更}
 %<zh>\subsection{字体更改}
@@ -1483,6 +1459,59 @@ featureが\textbf{JAglue}と衝突するためである(\ref{para-kern}節を
 另注意,出格特性在这7个命令中默认关闭,因为此特性会与\textbf{JAglue}冲突(参见\ref{para-kern})。
 %</zh>
 
+%<*en>
+\subsection{\texttt{\char92 CID}, \texttt{\char92 UTF} and macros in \Pkg{otf} package}
+Under \pLaTeX, \Pkg{otf} package (developed by Shuzaburo Saito) is
+used for typesetting characters which is in Adobe-Japan1-6 CID but not
+in JIS~X~0208. Since this package is widely used, \LuaTeX-ja
+supports some of functions in \Pkg{otf} package.
+If you want to use these functions, load \Pkg{luatexja-otf} package.
+%</en>
+%<*ja>
+\subsection{\texttt{\char92 CID}, \texttt{\char92 UTF}と\Pkg{otf}パッケージのマクロ}
+\pLaTeX では,JIS~X~0208にないAdobe-Japan1-6の文字を出力するために,
+齋藤修三郎氏による\Pkg{otf}パッケージが用いられていた.このパッケージは
+広く用いられているため,\LuaTeX-jaにおいても\Pkg{otf}パッケージの機能の
+一部をサポートしている.これらの機能を用いるためには\Pkg{luatexja-otf}パッケージ
+を読み込めばよい.
+%</ja>
+%<*zh>
+\subsection{\Pkg{otf}包中的\texttt{\char92CID},\texttt{\char92UTF}及其他宏} 
+\pLaTeX 下,\underline{\texttt{otf}}宏包(斋藤修三郎开发)是用来排印存在
+于Adobe-Japan1-6但不存在于JIS X 0208中的字符。
+该包已经广泛使用,\LuaTeX-ja支持部分\Pkg{otf}包中的部分功能。
+如果你想使用这些功能,加载\Pkg{luatexja-otf}宏包。
+\bgroup
+\fontencoding{JY3}\selectfont
+%</zh>
+
+\begin{LTXexample}
+森\UTF{9DD7}外と内田百\UTF{9592}とが\UTF{9AD9}島屋に行く。
+
+\CID{7652}飾区の\CID{13706}野家,
+葛飾区の吉野家
+\end{LTXexample}
+%<*zh>
+\egroup
+%</zh>
+
+%<*ja>
+\Pkg{otf}パッケージでは,それぞれ次のようなオプションが存在した:
+\begin{description}
+\item[\texttt{deluxe}] 明朝体・ゴシック体各2ウェイトと,丸ゴシック体を扱えるようになる.
+\item[\texttt{expert}] 仮名が横組・縦組専用のものに切り替わり,ルビ用仮名も扱えるようになる.
+\item[\texttt{bold}] ゴシック体を標準で太いウェイトのものに設定する.
+\end{description}
+これらは,\Pkg{otf}パッケージが文書中で使用する
+和文用TFMを自前の物に置き換えていることで可能になっている.
+
+一方,\Pkg{luatexja-otf}パッケージでは,文書中で使用する和文用JFMを置き換えることはしない.
+そのため,上に述べた3つのオプションと同等のことを実現するには,\ref{ssub-chgfnt}節 (NFSS2) や
+\ref{ssec-fontspec}節 (\Pkg{fontspec}) によって\textbf{事前に}設定しておかなければならない.
+
+TODO: 設定方法と例を載せる.フォントの関係上(複数の)別ファイルでよい?
+%</ja>
+
 %<en>\section{Changing Parameters}
 %<ja>\section{パラメータの変更}
 %<zh>\section{变量更改}
@@ -2455,7 +2484,7 @@ JFMの名前を指定する.もし以前に指定されたJFMが読み込ま
 %</en>
 %<*ja>
 \item[\tt jfm-ujis.lua] \LuaTeX-jaの標準JFMである.このJFMは\upTeX で
-  用いられるUTF/OTFパッケージ用のメトリックである \verb+upnmlminr-h.tfm+ を
+  用いられるUTF/OTFパッケージ用の和文用TFMである \verb+upnmlminr-h.tfm+ を
   元にしている.\Pkg{luatexja-otf}パッケージを使うときはこのJFMを指定するべきである.
 %</ja>
 %<*zh>
@@ -2489,7 +2518,7 @@ JFMの名前を指定する.もし以前に指定されたJFMが読み込ま
   shown in Table~\ref{tab-difjfm}.
 %</en>
 %<*ja>
-\item[\tt jfm-min.lua] \pTeX に同梱されているデフォルトの和文フォントメトリック
+\item[\tt jfm-min.lua] \pTeX に同梱されているデフォルトの和文用TFM
   である \verb+min10.tfm+ に相当するJFMである.このJFMと他の2つのJFMの間には
   表\ref{tab-difjfm}に示すような特筆すべき違いがある.
 %</ja>
@@ -3093,8 +3122,8 @@ The following is the list of `imaginary characters':
 \end{list}
 
 %<en>\paragraph{Porting JFM from \pTeX}
-%<ja>\paragraph{\pTeX 用和文フォントメトリックの移植}
-%<zh>\paragraph{\pTeX 下使用的JFM移植}
+%<ja>\paragraph{\pTeX 用和文用TFMの移植}
+%<zh>\paragraph{\pTeX 下使用的TFM移植}
 
 % ToDo: English version.
 
@@ -3103,7 +3132,7 @@ The following is the list of `imaginary characters':
 %</en>
 
 %<*ja>
-以下に,\pTeX 用和文フォントメトリックを\LuaTeX-ja用に移植する場合の注意点を挙げておく.
+以下に,\pTeX 用に作られた和文用TFMを\LuaTeX-ja用に移植する場合の注意点を挙げておく.
 \begin{itemize}
 \item 実際に出力される和文フォントのサイズがdesign sizeとなる.
 このため,例えば$1\,\textrm{zw}$がdesign sizeの0.962216倍であるJISフォン
@@ -4189,12 +4218,12 @@ Here the following is the list of dimensions and attributes which are used in \L
 
 \dim{jQ}
 %<*en>
-As explained in Subsection~\ref{ssec-plain}, \verb+\jQ+ is equal to
+\verb+\jQ+ is equal to
                        $1\,\textrm{Q}=0.25\,\textrm{mm}$, where `Q'~(also called `級') is
                        a unit used in Japanese phototypesetting. So one should not change the value of this dimension.
 %</en>
 %<*ja>
-\ref{ssec-plain}節で述べたように,\verb+\jQ+ は$1\,\textrm{Q}=0.25\,\textrm{mm}$
+\verb+\jQ+ は$1\,\textrm{Q}=0.25\,\textrm{mm}$
 と等しい.ここで,`Q'(もしくは「級」)は日本の写植で用いられる単位である.したがって,
 この寸法レジスタの値を変更してはならない.
 %</ja>
@@ -4206,7 +4235,7 @@ There is also a unit called `歯' which equals to $0.25\,\textrm{mm}$ and
                        \verb+\jH+ is a synonym of \verb+\jQ+.
 %</en>
 %<*ja>
\90\8cã\81\98ã\81\8få\86\99æ¤\8dã\81§ç\94¨ã\81\84ã\82\89ã\82\8cã\81¦ã\81\84ã\81\9få\8d\98ä½\8dã\81¨ã\81\97ã\81¦ã\80\8cæ­¯ã\80\8dã\81\8cã\81\82ã\82\8aï¼\8cã\81\93ã\82\8cã\81¯$0.25\,\textrm{mm}$と
\90\8cã\81\98ã\81\8få\86\99æ¤\8dã\81§ç\94¨ã\81\84ã\82\89ã\82\8cã\81¦ã\81\84ã\81\9få\8d\98ä½\8dã\81¨ã\81\97ã\81¦ã\80\8cæ­¯ã\80\8dã\81\8cã\81\82ã\82\8aï¼\8cã\81\93ã\82\8cã\82\82$0.25\,\textrm{mm}$と
 等しい.\verb+\jH+ は \verb+\jQ+ の別名である.
 %</ja>
 
@@ -5227,26 +5256,26 @@ $a$は禁則処理用に\textit{Nq}と\textit{Np}の間に加えられるべき
 \label{tab-jfmglue}
 \begin{center}
 \small
-\begin{tabular}{>{\sf}c|cccccc}
+\begin{tabular}{c|cccccc}
 \toprule
 {\bf\textit{Np}}↓&\sf 和文A&\sf 和文B&\sf 欧文&\sf 箱&\sf glue&\sf kern\\\midrule
-和文A&
+\sf 和文A&
 \gkf{E}{M→K}{PN}&
 \gkf{---}{\OA →K}{PN}&
 \gkf{---}{\OA →X}{PN}&
 \gkf{---}{\OA}{PA}&
 \gkf{---}{\OA}{PN}&
 \gkf{---}{\OA}{PS}\\
-和文B&
+\sf 和文B&
 \gkf{E}{\OB→K}{PA}&
 \gkf{---}{K}{PS}&
 \gkf{---}{X}{PS}\\
-欧文&
+\sf 欧文&
 \gkf{E}{\OB →X}{PA}&
 \gkf{---}{X}{PS}\cr
-箱&\gkf{E}{\OB}{PA}\\
-glue&\gkf{E}{\OB}{PN}\\
-kern&\gkf{E}{\OB}{PS}\\
+\sf 箱&\gkf{E}{\OB}{PA}\\
+\sf glue&\gkf{E}{\OB}{PN}\\
+\sf kern&\gkf{E}{\OB}{PS}\\
 \bottomrule
 \end{tabular}
 \end{center}
@@ -5484,4 +5513,40 @@ $\mathit{Nq}.\mathit{tail}$は無意味なので,
 \bibitem{texbytopic}
 Victor Eijkhout,  \emph{\TeX\ by Topic, A \TeX nician's Reference}, Addison-Wesley, 1992.
 \end{thebibliography}
+
+\newpage
+\appendix
+\section{Package versions used in this document}
+This document was typeset using the following packages:
+
+\medskip
+
+{\makeatletter\tt\footnotesize
+  \def\@pkglist#1{%
+    \filename@parse{#1}\def\@temp{sty}
+    \ifx\@temp\filename@ext
+      \edef\reserved@a{%
+        \filename@base.%
+        \ifx\filename@ext\relax tex\else\filename@ext\fi}%
+      \leavevmode\hskip-13em\hbox to 13em{\filename@area\reserved@a\hss}%
+      \csname ver@\reserved@a\endcsname\par
+    \fi
+  }%
+\parindent0pt\leftskip13em
+\ltjpkglist
+
+\makeatother}
 \end{document}
+%</!showexpl>
+%<*showexpl>
+%%
+%% config file for showexpl.sty
+%%
+%% Copyright The LuaTeX-ja project team, 2005
+%%
+\ProvidesFile{showexpl.cfg}
+  [2012/05/20 v0.01 Definitions for the showexpl package (luatexja)]
+\lstset{}
+\def\SX@Info{}
+\endinput
+%</*showexpl>