OSDN Git Service

lltjfont.sty: \adjustbaseline is re-implemented by luafunction
[luatex-ja/luatexja.git] / doc / luatexja.dtx
index 6ac495c..964cb60 100644 (file)
@@ -8,6 +8,7 @@
 
 %%%%% section ==> 章
 %%%%% subsection => 節
+\IfFileExists{luatex85.sty}{\RequirePackage{luatex85}}{}
 
 %<en>\documentclass[a4paper,titlepage]{article}
 %<ja>\documentclass[a4paper,titlepage]{ltjsarticle}
 %%%%%%%% fonts
 \usepackage{luatexja-otf}
 \directlua{luatexja.otf.enable_ivs()}
-\usepackage[match,no-math]{luatexja-fontspec}
-\usepackage[kozuka-pr6n]{luatexja-preset}
-\usepackage{unicode-math}
+\usepackage[no-math]{fontspec}
 \setmainfont[Ligatures=TeX]{Linux Libertine O}
 \setmonofont[Scale=MatchLowercase, ItalicFont=lmmono10-italic.otf,
   BoldFont=lmmonolt10-bold.otf, BoldItalicFont=lmmonolt10-boldoblique.otf
 ]{lmmono10-regular.otf}
+\setsansfont[Scale=MatchLowercase,Ligatures=TeX]{Linux Biolinum O}
+\usepackage[match]{luatexja-fontspec}
+\usepackage[kozuka-pr6n]{luatexja-preset}
+\usepackage{unicode-math}
 \setmonojfont{KozGoPr6N-Regular.otf}
 \setmathfont[Scale=MatchLowercase]{xits-math.otf}
-\setsansfont[Scale=MatchLowercase,Ligatures=TeX]{Linux Biolinum O}
 
 \setLaTeXa{\scshape a}
 %<*ja>
@@ -1003,6 +1005,28 @@ Note that the bold series in both family are same as the medium series of \emph{
 
 %<en>\item Japanese characters in math mode are typeset by the font family \texttt{mc}.
 %<ja>\item 数式モード中の和文文字は明朝体(\texttt{mc})で出力される.
+%<*en>
+ \item \cs{jttdefault}%
+  \footnote{%
+       When \Pkg{ltjsclasses} classes are used, or
+       \Pkg{luatexja-fontspec} (or \Pkg{luatexja-preset}) is loaded with \texttt{match} option,
+       \cs{ttfamily} changes the current Japanese font amily to \cs{jttdefault}.
+       These classes and packages also redefine \cs{jttdefault} to
+       \cs{gtdefault} (\emph{gothic}~family).
+  } specifies the Japanese font family in \cs{verb}~or~\texttt{verbatim} environment.
+  The default value of \cs{jttdefault} is \cs{mcdefault}, so \emph{mincho} family is used.
+%</en>
+%<*ja>
+ \item \cs{verb} や \texttt{verbatim} 環境中の和文文字に使われる和文フォントファミリは
+  \ \cs{jttdefault} で指定する%
+  \footnote{%
+       \Pkg{ltjsclasses}を使用したり,あるいは \texttt{match} オプションを指定して\Pkg{luatexja-fontspec}%
+       や\Pkg{luatexja-preset}パッケージを読み込んだときは,単なる \cs{ttfamily} によっても和文フォントが
+       \ \cs{jttdefault}\ に変更される.また,これらのクラスファイルやパッケージは
+       \ \cs{jttdefault}\ を \cs{gtdefault}(ゴシック体)に再定義する.
+  }.標準値は \cs{mcdefault},つまり明朝体として用いるのと
+  同じフォントファミリである.
+%</ja>
 
 %<*en>
 \item If you use the \Pkg{beamer} class with the default font theme (which uses sans serif
@@ -1466,13 +1490,14 @@ For example, the line~5 in below example is eqivalent to lines 1--3.
 %<en>\paragraph{General options}
 %<ja>\paragraph{一般的なオプション}
 \begin{cslist}[before*=]
-
-\item[fontspec]
+\item[fontspec%
+%<en>\textrm{~(enabled by default)}
+%<ja>\emph{\gtfamily (既定)}
+]
 %<*en>
 With this option, Japanese fonts are selected using functionality of
 the \Pkg{luatexja-fontspec} package. This means that the \Pkg{fontspec} package is
             automatically loaded by this package.
-\emph{This option is enabled by default.}
 
 If you need to pass some options to \Pkg{fontspec}, you can load \Pkg{fontspec} manually
 before \Pkg{luatexja-preset}:
@@ -1480,7 +1505,6 @@ before \Pkg{luatexja-preset}:
 %<*ja>
 \Pkg{luatexja-fontspec}パッケージの機能を用いて和文フォントを選択する.
 これは,\Pkg{fontspec}パッケージが自動で読み込まれることを意味する.
-\emph{このオプションは標準で有効になっている.}
 
 もし\Pkg{fontspec}パッケージに何らかのオプションを渡す必要がある
 \footnote{例えば,数式フォントまで置換されてしまい,\cs{mathit}によってギリシャ文字の
@@ -1527,19 +1551,39 @@ In this case, one can use \cs{setmainfont} etc.\ to select \emph{alphabetic} fon
             いる場合は \texttt{nfssonly} オプションは無視される.
 %</ja>
 
-\item[nodeluxe]
+\item[match]
 %<*en>
+If this option is specified, usual family-changing commands such as
+\cs{rmfamily},~\cs{textrm}, \cs{sffamily},~\dots\ also change Japanese font family.
+This option is passed to \Pkg{luatexja-fontspec}, if \texttt{fontspec}
+option is specifed.
+%</en>
+
+%<*ja>
+このオプションが指定されると,「\pLaTeXe 新ドキュメントクラス」のように\
+\cs{rmfamily}, \verb+\textrm{...}+, \cs{sffamily} 等が
+欧文フォントだけでなく和文フォントも変更するようになる.
+\ \texttt{fontspec}\ 
+オプションが有効になっている場合は,このオプションは \Pkg{luatexja-fontspec} パッケージへと渡される.
+%</ja>
+
+
+\item[nodeluxe%
+%<en>\textrm{~(enabled by default)}
+%<ja>\emph{\gtfamily (既定)}
+]
+%<*en>
+The nagation of \texttt{deluxe} option.
 Use one-weighted \textit{mincho} and \textit{gothic} font families.
 This means that \verb+\mcfamily\bfseries+, \verb+\gtfamily\bfseries+ and
 \verb+\gtfamily\mdseries+ use the same font.
-\emph{This option is enabled by default.}
 %</en>
 %<*ja>
+\texttt{deluxe}オプションの否定.
 \LaTeXe 環境下の標準設定のように,明朝体・ゴシック体を各1ウェイトで使用する.
 より具体的に言うと,この設定の下では
 \ \verb+\mcfamily\bfseries+, \verb+\gtfamily\bfseries+,
 \verb+\gtfamily\mdseries+はみな同じフォントとなる.
-\emph{このオプションは標準で有効になっている.}
 %</ja>
 \item[deluxe]
 %<*en>
@@ -1576,8 +1620,17 @@ characters designed for ruby.
 }.
 %</ja>
 \item[bold]
-%<en>Substitute bold series of \textit{gothic} for  bold series of \textit{mincho}.
-%<ja>「明朝の太字」をゴシック体の太字によって代替する.
+%<*en>
+Substitute bold series of \textit{gothic} for  bold series of \textit{mincho}.
+If \texttt{nodeluxe} option is enabled, medium series of \textit{gothic} is also changed, 
+since we use same font for both series of \textit{gothic}.
+%</en>
+%<*ja>
+「明朝の太字」をゴシック体の太字によって代替する.
+もし\texttt{nodeluxe}オプションが指定されている場合は,ゴシック体は1ウェイトしか使用されな
+          いため,
+「ゴシック体の中字」も同時に変更されることになる.
+%</ja>
 \item[90jis]
 %<en>Use 90JIS glyph variants if possible.
 %<ja>出来る限り90JISの字形を使う.
@@ -1593,6 +1646,7 @@ Use the JFM \texttt{jfm-jis.lua}, instead of \texttt{jfm-ujis.lua}, which is the
 用いるJFMを(JISフォントメトリック類似の)\texttt{jfm-jis.lua}にする.このオプションがない時は
 \LuaTeX-ja標準の\texttt{jfm-ujis.lua}が用いられる.
 %</ja>
+
 \end{cslist}
 %<*en>
 Note that \texttt{90jis} and \texttt{jis2004} only affect with \textit{mincho},
@@ -1601,8 +1655,8 @@ We didn't taken account of  when both \texttt{90jis} and \texttt{jis2004} are sp
 %</en>
 %<*ja>
 \texttt{90jis}と\texttt{jis2004}については本パッケージで定義された
-明朝体・ゴシック体(・丸ゴシック体)にのみ有効である.両オプションが
-同時に指定された場合の動作については全く考慮していない.
+明朝体・ゴシック体(・丸ゴシック体)にのみ有効である.
+両オプションが同時に指定された場合の動作については全く考慮していない.
 %</ja>
 
 %<en>\paragraph{Presets for multi weight}
@@ -1701,7 +1755,7 @@ Std/StdNフォントであり,その他はAdobe-Japan1-5対応である.
 \end{tabular}
 \end{center}
 
-%<ja>\medskip
+%<ja>\newpage
 
  \item[morisawa-pro]  Morisawa Pro (Adobe-Japan1-4) fonts.
 %<en>    \\*[-\dimexpr\medskipamount+\baselineskip\relax]
@@ -1761,7 +1815,8 @@ Std/StdNフォントであり,その他はAdobe-Japan1-5対応である.
 \end{tabular}
 \end{center}
 
- \item[moga-mobo]  MogaMincho, MogaGothic, and MoboGothic.
+%<en>\newpage
+\item[moga-mobo]  MogaMincho, MogaGothic, and MoboGothic.
 %<en>These fonts can be downloaded from\\\hfill \url{http://yozvox.web.fc2.com/}.
 %<ja>これらのフォントは \url{http://yozvox.web.fc2.com/} からダウンロードできる.
 
@@ -1775,9 +1830,9 @@ Std/StdNフォントであり,その他はAdobe-Japan1-5対応である.
 %<ja>\smash{\raisebox{1.5ex}{\gt 明朝}}%
  &bold&Moga90Mincho Bold&MogaMincho Bold\\
 \midrule
- &&Moga90Gothic&MogaGothic\\
+ &&Moga90Gothic*&MogaGothic*\\
  &\smash{\raisebox{1.5ex}{medium}}
- &Moga90Gothic&MogaGothic\\
+ &Moga90Gothic Bold&MogaGothic Bold\\
 \cmidrule(l){2-4}
 %<en>\textit{gothic}%
 %<ja>\gt ゴシック
@@ -3902,13 +3957,12 @@ JFM中における \texttt{kanjiskip\_natural}, \texttt{kanjiskip\_stretch},\
 \catcode`\<=12\catcode`\>=12
 \ltjsetparameter{jacharrange={+3}}
 \small
-
 \def\r#1#2{%
   \hbox{\tate\Large\vrule
   \parbox{7\zw}{%
     \addjfontfeatures{TateFeatures={Opacity=0.5, Color=#2, JFM=#1}}\noindent
     ◆◆◆◆◆◆◆
-    ã\81\82ã\82\8bæ\97¥ã\83¢ã\83¢ã\81¡ã\82\83ã\82\93ã\81\8cã\81\8a使ã\81\84ã\81§è¿·å­\90ã\81«ã\81ªã\81£ã\81¦æ³£ã\81\8dã\81¾ã\81\97ã\81\9fï¼\8e
+    ã\81\82ã\82\8bæ\97¥ã\83¢ã\83¢ã\81¡ã\82\83ã\82\93ã\81\8cã\80\8cã\81\8a使ã\81\84ã\80\8dã\81§è¿·å­\90ã\81«ã\81ªã\81£ã\81¦æ³£ã\81\8dã\81¾ã\81\97ã\81\9fã\80\82
   }\vrule}}
 \def\s#1#2{%
   \hbox{\tate\Large
@@ -5187,11 +5241,11 @@ in \pTeX, and symbols beside each parameter has the following meaning:
 %</ja>
 \begin{itemize}
 %<*en>
-\item ``\ast'' : values at the end of a paragraph or a hbox are
+\item ``$\ast$'' : values at the end of a paragraph or a hbox are
 adopted in the whole paragraph or the whole hbox.
 %</en>
 %<*ja>
-\item ``\ast'':段落やhboxの終端での値がその段落/hbox全体で用いられる.
+\item ``$\ast$'':段落やhboxの終端での値がその段落/hbox全体で用いられる.
 %</ja>
 %<*en>
 \item ``\dagger'': assignments are always global.
@@ -6106,8 +6160,10 @@ to match the vertical center of ``M'' and that of ``あ''  in vertical typesetti
   + d_{\text{あ}} - d_{\text{M}},
 \]
 where $h_{a}$~and~$d_{a}$ denote the height of ``$a$'' and the depth, respectively.
-In \LuaTeX-ja, this \cs{adjustbaseline} does same task, namely setting the
+In \LuaTeX-ja, this \cs{adjustbaseline} does similar task, namely setting the
             \Param{talbaselineshift} parameter.
+If the \LaTeX\ is 2015/10/01 release or later, \LuaTeX-ja use a Japanese 
+character whose character class is zero,  instead of `あ'.
 %</en>
 %<*ja>
 \pLaTeXe では,\cs{adjustbaseline} は縦組時に「M」と「あ」の中心線を一致させるために,
@@ -6121,8 +6177,12 @@ In \LuaTeX-ja, this \cs{adjustbaseline} does same task, namely setting the
 \LuaTeX-jaにおいても\cs{adjustbaseline} は同様に\Param{talbaselineshift}パラメータの調整処
             理を行っている.
 
-同時に,これも\pLaTeXe の \cs{adjustbaseline} で行われていたが,
-「漢」の寸法を元に,(本節の最初に述べた,小文字で始まる)\cs{cht}, \cs{cwd} といった長さ変数を設定する.
+同時に,これも\pLaTeXe の \cs{adjustbaseline} で同様の処理が行われていたが,
+「漢」の寸法を元に(本節の最初に述べた,小文字で始まる)\cs{cht}, \cs{cwd} 
+といった長さ変数を設定する.
+
+なお,\LaTeX が2015/10/01 版以降の場合は,「あ」「漢」の代わりに
+「文字クラス0の和文文字」を用いる.
 %</ja>
 
 \item[\cs{fontfamily}\{<family>\}]
@@ -6726,7 +6786,8 @@ JFMの\texttt{chars}テーブルのエントリとして \verb+'AJ1-xxx'+ の形
 Recent fonts support Ideographic Variation Selector (IVS).
 It seems that \Pkg{luaotfload} and \Pkg{fontspec} packages do not support
 IVS, so we implemented IVS support in \Pkg{luatexja-otf}.
-\emph{IVS support is experimental; if you want to enable this, load
+\emph{IVS support by the \Pkg{luatexja-otf} package is experimental.
+If you want to enable IVS support, load
 \Pkg{luatexja-otf} and execute the following:}
 %</en>
 %<*ja>
@@ -6741,8 +6802,9 @@ IVSに対応してはいないようである.これらのパッケージで
 
 \medskip
 
-\emph{IVS対応は試験的なものである.
-有効にするには,\Pkg{luatexja-otf}パッケージを読み込んだ上で以下の命令を実行する%
+\emph{\Pkg{luatexja-otf}によるIVS対応は試験的なものである.
+有効にするには,
+\Pkg{luatexja-otf}パッケージを読み込んだ上で以下の命令を実行する%
 \footnote{この命令を2回以上実行しても意味がない.}:}
 %</ja>
 \begin{lstlisting}
@@ -8857,45 +8919,45 @@ then the patch \Pkg{lltjp-listings} is loaded automatically at \verb+\begin{docu
 
 %<en>\subsection{Notes and additional keys}
 %<ja>\subsection{注意}
-%<*en>
-\paragraph{Escaping to \LaTeX}
-We used the \verb+process_input_buffer+ callback to output \textbf{JAchar}s.
-But it has a drawback; any commands whose name contains a \textbf{JAchar}
-cannot be used in any ``escape to \LaTeX''.
+% %<*en>
+\paragraph{Escaping to \LaTeX}
+We used the \verb+process_input_buffer+ callback to output \textbf{JAchar}s.
+But it has a drawback; any commands whose name contains a \textbf{JAchar}
+cannot be used in any ``escape to \LaTeX''.
 
-Consider the following input:
-%</en>
-%<*ja>
-\paragraph{\LaTeX へのエスケープ}
-日本語対応を行うために \verb+process_input_buffer+ を使用したことで,
-\texttt{texcl},~\texttt{escapeinside}といった\emph{「\LaTeX へのエスケープ」中では,
-\textbf{JAchar}を名称の一部に含む制御綴は使用不可能}である.
-例えば次のような入力を考えよう:
-%</ja>
-\begin{verbatim*}
-\begin{lstlisting}[escapechar=\#]
-#\ほげ xぴよ#
-\end{lstlisting}
-\end{verbatim*}
-%<en>The line~2 is transformed by the callback to
-%<ja>ここで,2行目は \verb+process_input_buffer+ の作用により,
-\begin{lstlisting}[showspaces, escapechar=\!]
-#\!\IVSA FFFFF!ほ!\IVSA FFFFF!げ x!\IVSA FFFFF!ぴ!\IVSA FFFFF!よ#
-\end{lstlisting}
-%<*en>
-before the line is actually processed.
-In the escape (between the character ``\verb+#+''),
-the category code of \texttt{U+FFFFF} is set to 9~(\emph{ignored}).
-Hence the control symbol ``\cs{}\IVSA FFFFF'' will be executed,
-instead of ``\verb+\ほげ+''.
-%</en>
-%<*ja>
-と変換されてから,実際の処理に回される.
-「\verb+#+」で挟まれた「\LaTeX へのエスケープ」中では\
-\texttt{U+FFFFF} のカテゴリーコードは9~(\textit{ignored})となるので,
-結局「\verb+\ほげ+」の代わりに
-「\cs{}\IVSA FFFFF」というcontrol symbolが実行されることになる.
-%</ja>
+Consider the following input:
+% %</en>
+% %<*ja>
+\paragraph{\LaTeX へのエスケープ}
+日本語対応を行うために \verb+process_input_buffer+ を使用したことで,
+\texttt{texcl},~\texttt{escapeinside}といった\emph{「\LaTeX へのエスケープ」中では,
+\textbf{JAchar}を名称の一部に含む制御綴は使用不可能}である.
+例えば次のような入力を考えよう:
+% %</ja>
+\begin{verbatim*}
+\begin{lstlisting}[escapechar=\#]
+#\ほげ xぴよ#
+\end{lstlisting}
+\end{verbatim*}
+% %<en>The line~2 is transformed by the callback to
+% %<ja>ここで,2行目は \verb+process_input_buffer+ の作用により,
+\begin{lstlisting}[showspaces, escapechar=\!]
+#\!\IVSA FFFFF!ほ!\IVSA FFFFF!げ x!\IVSA FFFFF!ぴ!\IVSA FFFFF!よ#
+\end{lstlisting}
+% %<*en>
+before the line is actually processed.
+In the escape (between the character ``\verb+#+''),
+the category code of \texttt{U+FFFFF} is set to 9~(\emph{ignored}).
+Hence the control symbol ``\cs{}\IVSA FFFFF'' will be executed,
+instead of ``\verb+\ほげ+''.
+% %</en>
+% %<*ja>
+と変換されてから,実際の処理に回される.
+「\verb+#+」で挟まれた「\LaTeX へのエスケープ」中では\
+\texttt{U+FFFFF} のカテゴリーコードは9~(\textit{ignored})となるので,
+結局「\verb+\ほげ+」の代わりに
+「\cs{}\IVSA FFFFF」というcontrol symbolが実行されることになる.
+% %</ja>
 
 %<*en>
 \paragraph{Variation selectors}