X-Git-Url: http://git.osdn.jp/view?a=blobdiff_plain;f=doc%2Fluatexja.dtx;h=f3e910c44198d84be6277b5b9dbba48a6ea2de3f;hb=029c74784e3acac4ca96ef9c8c3789faf7334d38;hp=1754cf3adbbbc5b2eca3ddbb482c79277b362e57;hpb=64d5453fc9921203551a7f8f82af2738026998fc;p=luatex-ja%2Fluatexja.git diff --git a/doc/luatexja.dtx b/doc/luatexja.dtx index 1754cf3..f3e910c 100644 --- a/doc/luatexja.dtx +++ b/doc/luatexja.dtx @@ -29,22 +29,22 @@ \usepackage[kozuka-pr6n]{luatexja-preset} \usepackage{unicode-math} \setmainfont[Ligatures=TeX]{Linux Libertine O} -\setsansfont[Scale=0.95,Ligatures=TeX]{TeX Gyre Heros} \setmonofont[Scale=MatchLowercase, ItalicFont=lmmono10-italic.otf, BoldFont=lmmonolt10-bold.otf, BoldItalicFont=lmmonolt10-boldoblique.otf ]{lmmono10-regular.otf} \setmonojfont{KozGoPr6N-Regular.otf} \setmathfont[Scale=MatchLowercase]{xits-math.otf} +\setsansfont[Scale=MatchLowercase,Ligatures=TeX]{Linux Biolinum O} %<*ja> \def\emph#1{\textbf{\textgt{#1}}} \def\headfont{\normalfont\bfseries\gtfamily}\normalsize % -%\frenchspacing - %<*en> +\frenchspacing \usepackage[margin=25mm,lmargin=30mm,rmargin=30mm,footskip=6mm]{geometry} \usepackage{luatexja-adjust}\ltjdisableadjust \parskip=\smallskipamount +\makeatletter \renewcommand\paragraph{\@startsection{paragraph}{4}{\z@}% {3.25ex \@plus1ex \@minus.2ex}% {-1em}% @@ -78,6 +78,7 @@ explpreset={numberstyle=\tiny, numbers=left, numbersep=1em, columns=fixed} } % Suppress output from showexpl to stdout. +\makeatletter \let\SX@Info\relax %%%%%%%% colors @@ -157,7 +158,8 @@ \vskip\belowcaptionskip} \def\_{\leavevmode \kern .06em\vbox {\hrule \@width .333em}} -\def\cs#1{\texttt{\upshape\textbackslash #1}} +\def\cs#1{\texttt{\upshape + \texorpdfstring{\textbackslash\ltjsetparameter{autoxspacing=false}#1}{\textbackslash#1}}} %%%%%%%% \makeatother @@ -275,8 +277,8 @@ scripts for appropriate callbacks. %<*en> The \LuaTeX-ja package is under much influence of \pTeX\ engine. The initial -target of development was to implement features of \pTeX. However, -implementing all feature of \pTeX\ is impossible, +target of development was to implement features of \pTeX. However, +implementing all feature of \pTeX\ is impossible, since all process of \LuaTeX-ja must be implemented only by Lua and \TeX\ macros. Hence \emph{\LuaTeX-ja is not a just porting of \pTeX; unnatural specifications/behaviors of \pTeX\ were not adopted}. @@ -301,7 +303,7 @@ For more detailed information, see Part~\ref{part-imp} or other sections of this % %<*en> -\paragraph{Command names} \pTeX\ addes several primitives, such as \cs{kanjiskip}, +\paragraph{Command names} \pTeX\ addes several primitives, such as \cs{kanjiskip}, \cs{prebreakpenalty},~and,~\cs{ifydir}. They can be used as follows: % %<*ja> @@ -314,7 +316,7 @@ For more detailed information, see Part~\ref{part-imp} or other sections of this \prebreakpenalty`ぁ=100 \ifydir ... \fi \end{verbatim} -% However, we cannot use them under \LuaTeX-ja. +% However, we cannot use them under \LuaTeX-ja. % Instead of them, we have to write as the following. % は\LuaTeX-jaには存在しない.\LuaTeX-jaでは以下のように記述することになる. \begin{verbatim} @@ -324,9 +326,9 @@ For more detailed information, see Part~\ref{part-imp} or other sections of this \ltjsetparameter{prebreakpenalty={`ぁ,100}} \ifnum\ltjgetparemeter{direction}=4 ... \fi \end{verbatim} -%<*en> +%<*en> Note that \pTeX\ adds new two useful units, namely \texttt{zw}~and~\texttt{zh}. -As shown above, they are changed by \cs{zw}~and\cs{zh} respectively, in \LuaTeX-ja. +As shown above, they are changed by \cs{zw}~and~\cs{zh} respectively, in \LuaTeX-ja. % %<*ja> 特に注意してほしいのは,\pTeX で追加された \texttt{zw} と \texttt{zh} という単位を @@ -365,9 +367,9 @@ The insertion process of glues/kerns between two Japanese \begin{itemize} %<*en> -\item As \LuaTeX's internal ligature handling is ``node-based'' +\item As \LuaTeX's internal ligature handling is \emph{node-based} (\textit{e.g.}, \verb+of{}fice+ doesn't prevent ligatures), the - insertion process of \textbf{JAglue} is now ``node-based''. + insertion process of \textbf{JAglue} is now \emph{node-based}. % %<*ja> \item \LuaTeX の内部での合字の扱いは「ノード」を単位として行われるようになっている(例えば, @@ -419,17 +421,17 @@ The insertion process of glues/kerns between two Japanese %<*en> \paragraph{Directions} -From this version, \LuaTeX-ja supports vertical writing; +From version~20150420.0, \LuaTeX-ja supports vertical writing; but this feature must \emph{not} be confused with $\Omega$-style direction support of \LuaTeX\ itself. ... % %<*ja> \paragraph{組方向} -本版からは,不安定ながらも\LuaTeX-ja における縦組みをサポートしている. +20150420.0版からは,不安定ながらも\LuaTeX-ja における縦組みをサポートしている. なお,\LuaTeX 本体も,$\Omega$流の組方向をサポートしているが,それとは全くの別物であること に注意してほしい. \LuaTeX のコールバックや実装により,特に異なった組方向のボックスを扱う場合には -\cs{wd}, \cs{ht}, \cs{dp}等の仕様が異なるので注意.詳細は第\ref{sec-direction}節を参照. +\cs{wd}, \cs{ht}, \cs{dp}等の仕様が異なるので注意.詳細は第\ref{sec-direction}章を参照. % %<*en> @@ -520,21 +522,21 @@ and \emph{Japanese fonts} for fonts used in \textbf{JAchar}. %\paragraph{プロジェクトWiki} プロジェクトWikiは構築中である. %<*en> \begin{itemize} -\item \url{http://sourceforge.jp/projects/luatex-ja/wiki/FrontPage%28en%29} (English) -\item \url{http://sourceforge.jp/projects/luatex-ja/wiki/FrontPage} (Japanese) -\item \url{http://sourceforge.jp/projects/luatex-ja/wiki/FrontPage%28zh%29} (Chinese) +\item \url{https://osdn.jp/projects/luatex-ja/wiki/FrontPage%28en%29} (English) +\item \url{https://osdn.jp/projects/luatex-ja/wiki/FrontPage} (Japanese) +\item \url{https://osdn.jp/projects/luatex-ja/wiki/FrontPage%28zh%29} (Chinese) \end{itemize} % %<*ja> \begin{itemize} -\item \url{http://sourceforge.jp/projects/luatex-ja/wiki/FrontPage}(日本語) -\item \url{http://sourceforge.jp/projects/luatex-ja/wiki/FrontPage%28en%29}(英語) -\item \url{http://sourceforge.jp/projects/luatex-ja/wiki/FrontPage%28zh%29}(中国語) +\item \url{https://osdn.jp/projects/luatex-ja/wiki/FrontPage}(日本語) +\item \url{https://osdn.jp/projects/luatex-ja/wiki/FrontPage%28en%29}(英語) +\item \url{https://osdn.jp/projects/luatex-ja/wiki/FrontPage%28zh%29}(中国語) \end{itemize} % -%This project is hosted by SourceForge.JP. -%本プロジェクトはSourceForge.JPのサービスを用いて運営されている. +%This project is hosted by OSDN. +%本プロジェクトはOSDNのサービスを用いて運営されている. %\paragraph{Members}\ %\paragraph{開発メンバー}\ @@ -565,23 +567,24 @@ and \emph{Japanese fonts} for fonts used in \textbf{JAchar}. %\subsection{インストール} %The following packages are needed for the \LuaTeX-ja\ package. -%\LuaTeX-jaパッケージには,次のパッケージ類が必要である. +%\LuaTeX-jaパッケージの動作には次のパッケージ類が必要である. \begin{itemize} \item \LuaTeX\ beta-0.80.0 (or later) \item \Pkg{luaotfload} v2.5 (or later) \item \Pkg{adobemapping} (Adobe cmap and pdfmapping files) \item \Pkg{everysel} (if you want to use \LuaTeX-ja with \LaTeXe) -%\item \emph{IPAex fonts}(\url{http://ipafont.ipa.go.jp/}) +\item \Pkg{fontspec} v2.4 +%\item \emph{IPAex fonts} (\url{http://ipafont.ipa.go.jp/}) %\item \emph{IPAexフォント(\url{http://ipafont.ipa.go.jp/})} \end{itemize} +%In summary, this version of \LuaTeX-ja no longer supports \TeX~Live~2014 (or older version). +%<*ja> +要約すると,本バージョンの\LuaTeX-jaは\TeX~Live~2014以前では動作しない\footnote{% + もっとも,自分で\LuaTeX のバイナリをSubversionリポジトリからビルドしていれば話は別である. +}. +% %<*en> -\emph{This version of \LuaTeX-ja no longer supports \TeX~Live~2013 (or older version). -If you want to use this version with \TeX~Live~2014, you have to build a development -version of \LuaTeX\ from its source.} - -\medskip - Now \LuaTeX-ja is available from CTAN (in the \texttt{macros/luatex/generic/luatexja} directory), and the following distributions: @@ -593,11 +596,6 @@ the following distributions: IPAex fonts are also available in these distributions. % %<*ja> -\emph{本バージョンの\LuaTeX-jaは\TeX~Live~2013以前では動作しない.\TeX~Live~2014で -用いたい場合は,自力で\LuaTeX 開発版をソースからビルドする必要がある.} - -\medskip - 現在,\LuaTeX-jaはCTAN (\texttt{macros/luatex/generic/luatexja})に収録されている他, 以下のディストリビューションにも収録されている: \begin{itemize} @@ -635,11 +633,11 @@ W32\TeX においてはIPAexフォントは \texttt{luatexja.tar.xz} 内にあ \begin{itemize} \item Clone the Git repository: \begin{lstlisting} -$ git clone git://git.sourceforge.jp/gitroot/luatex-ja/luatexja.git +$ git clone git://git.osdn.jp/gitroot/luatex-ja/luatexja.git \end{lstlisting} \item Download the \texttt{tar.gz} archive of HEAD in the \texttt{master} branch from \begin{flushleft} -\url{http://git.sourceforge.jp/view?p=luatex-ja/luatexja.git;a=snapshot;h=HEAD;sf=tgz}. +\url{http://git.osdn.jp/view?p=luatex-ja/luatexja.git;a=snapshot;h=HEAD;sf=tgz}. \end{flushleft} \end{itemize} @@ -653,11 +651,11 @@ the forefront of development is not the \texttt{master} branch. \begin{itemize} \item Gitリポジトリをクローンする: \begin{lstlisting} -$ git clone git://git.sourceforge.jp/gitroot/luatex-ja/luatexja.git +$ git clone git://git.osdn.jp/gitroot/luatex-ja/luatexja.git \end{lstlisting} \item \texttt{master}ブランチのスナップショット(\texttt{tar.gz}形式)をダウンロードする. \begin{flushleft} -\url{http://git.sourceforge.jp/view?p=luatex-ja/luatexja.git;a=snapshot;h=HEAD;sf=tgz}. +\url{http://git.osdn.jp/view?p=luatex-ja/luatexja.git;a=snapshot;h=HEAD;sf=tgz}. \end{flushleft} \end{itemize} \texttt{master}ブランチ(従って,CTAN内のアーカイブも)はたまにしか更新されないことに注意. @@ -694,9 +692,11 @@ $ lualatex ltjltxdoc.ins $ luatex ltj-kinsoku_make.tex \end{lstlisting} %<*en> -Note that \texttt{*.\{dtx,ins\}} and \texttt{ltj-kinsoku\_make.tex} are not needed in regular use. +\emph{Do not forget The last line (processing \texttt{ltj-kinsoku\_make.tex})}. +\texttt{*.\{dtx,ins\}} and \texttt{ltj-kinsoku\_make.tex} used here are not needed in regular use. % %<*ja> +\emph{最後の \texttt{ltj-kinsoku\_make.tex} の実行を忘れないように注意}. ここで使用した \texttt{*.\{dtx,ins\}} と \texttt{ltj-kinsoku\_make.tex} は 通常の使用にあたっては必要ない. % @@ -723,7 +723,7 @@ Note that \texttt{*.\{dtx,ins\}} and \texttt{ltj-kinsoku\_make.tex} are not need \item If \texttt{mktexlsr} is needed to update the file name database, make it so. % %<*ja> -\item 必要があれば,\texttt{mktexlsr}を実行する. +\item 必要があれば,\texttt{mktexlsr} を実行する. % \end{enumerate} @@ -738,7 +738,7 @@ For changes from \pTeX, see Subsection~\ref{ssec:chgptex}. % \begin{itemize} %<*en> -\item The encoding of your source file must be UTF-8. No other +\item The encoding of your source file must be UTF-8. Other encodings, such as EUC-JP or Shift-JIS, are not supported. % %<*ja> @@ -746,6 +746,26 @@ For changes from \pTeX, see Subsection~\ref{ssec:chgptex}. 従来日本語の文字コードとして用いられてきたEUC-JPやShift-JISは使用できない. % %<*en> +\item By default, \LuaTeX-ja uses Japanese fonts to typeset Greek and Cyrillic letters. + To change this behavior, + put \verb!\ltjsetparameter{jacharrange={-2,-3}}! in the preamble. + For the detailed description, see Subsection~\ref{ssec-setrange}. +% +%<*ja> +\item +標準では,\LuaTeX-jaはギリシャ文字やキリル文字を和文フォントを使っ + て組む.ギリシャ語などを本格的に組むなどこの状況が望ましくない場合, + プリアンブルに +\begin{lstlisting} + \ltjsetparameter{jacharrange={-2,-3}} +\end{lstlisting} + を入れると + 上記種類の文字は欧文フォントを用いて組まれるようになる. + なお,\P,~\S といったISO~8859-1の上位領域とJIS~X~0208の共通部分の文字は + 本バージョンから標準で欧文扱い(\textbf{ALchar})となった. + 詳しい説明は\ref{ssec-setrange}節を参照してほしい. +% +%<*en> \item \LuaTeX-ja is very slower than \pTeX. Generally speaking, LuaJIT\TeX\ processes \LuaTeX-ja about 30\% faster than \LuaTeX, but not always. @@ -756,9 +776,10 @@ about 30\% faster than \LuaTeX, but not always. LuaJIT\TeX を用いると\LuaTeX のだいたい1.3倍の速度で動くようであるが, IPA mj明朝などの大きいフォントを用いた場合には\LuaTeX よりも遅くなることもある. % + \item% %<*en> -\textbf{Note for MiK\TeX\ users}\quad +\textbf{(Outdated) note for MiK\TeX\ users}\quad \LuaTeX-ja requires that several CMap files% \footnote{\texttt{UniJIS2004-UTF32-\{H,V\}} and \texttt{Adobe-Japan1-UCS2}.} must be found from \LuaTeX. @@ -771,7 +792,7 @@ so you will encounter an error like the following: \LuaTeX-jaが動作するためには,\emph{導入・更新後の初回起動時に} \texttt{UniJIS2004-UTF32-\{H,V\}}, \texttt{Adobe-Japan1-UCS2}という3つのCMapが \LuaTeX によって見つけられることが必要である. -しかしMiK\TeX ではそのようになっていないので,次のエラーが発生するだろう: +しかし古いバージョンのMiK\TeX ではそのようになっていないので,次のエラーが発生するだろう: % \begin{lstlisting} ! LuaTeX error ...iles (x86)/MiKTeX 2.9/tex/luatex/luatexja/ltj-rmlgbm.lua @@ -780,13 +801,14 @@ bad argument #1 to 'open' (string expected, got nil) %<*en> If so, please execute a batch file which is written on -\href{http://sourceforge.jp/projects/luatex-ja/wiki/FrontPage%28en%29}{ the Project Wiki (English)}. +\href{https://osdn.jp/projects/luatex-ja/wiki/FrontPage%28en%29}{ the Project Wiki (English)}. This batch file creates a temporary directory, copy CMaps in it, -run \LuaTeX-ja in this directory, and finally delete the temporary directory. +run a test file which loads \LuaTeX-ja in this directory, +and finally delete the temporary directory. % %<*ja> そのような場合には, -\href{http://sourceforge.jp/projects/luatex-ja/wiki/FrontPage%28en%29}{% +\href{https://osdn.jp/projects/luatex-ja/wiki/FrontPage%28en%29}{% プロジェクトWiki英語版トップページ}中に書かれているバッチファイルを 実行して欲しい.このバッチファイルは,作業用ディレクトリにCMap達を コピーし,その中で\LuaTeX-ja の初回起動を行い,作業用ディレクトリを消す作業をしている. @@ -813,7 +835,7 @@ run \LuaTeX-ja in this directory, and finally delete the temporary directory. \begin{tabular}{cccccc} \toprule \textbf{direction}& -\textbf{classification}&\textbf{font name}&\bf `10\,pt'&\bf`7\,pt'&\bf`5\,pt'\\\midrule +\textbf{classification}&\textbf{font name}&\bf ``10\,pt''&\bf``7\,pt''&\bf``5\,pt''\\\midrule \smash{\raisebox{-1ex}{\emph{yoko} (horizontal)}}& \emph{mincho}&IPAex Mincho&\cs{tenmin}&\cs{sevenmin}&\cs{fivemin}\\ &\emph{gothic}&IPAex Gothic&\cs{tengt} &\cs{sevengt} &\cs{fivegt}\\ @@ -830,7 +852,7 @@ run \LuaTeX-ja in this directory, and finally delete the temporary directory. \begin{center}\small \begin{tabular}{cccccc} \toprule -\emph{組方向}&\emph{字体}&\emph{フォント名}&\bf `10\,pt'&\bf`7\,pt'&\bf`5\,pt'\\\midrule +\emph{組方向}&\emph{字体}&\emph{フォント名}&\bf ``10\,pt''&\bf``7\,pt''&\bf``5\,pt''\\\midrule \smash{\raisebox{-1ex}{横組}}& 明朝体&IPAex明朝&\cs{tenmin}&\cs{sevenmin}&\cs{fivemin}\\ &ゴシック体&IPAexゴシック&\cs{tengt} &\cs{sevengt} &\cs{fivegt}\\ @@ -1044,14 +1066,14 @@ vertical writing is used: % \begin{lstlisting} ! Incompatible direction list can't be unboxed. -\@begindvi ->\unvbox \@begindvibox - \global \let \@begindvi \@empty +\@begindvi ->\unvbox \@begindvibox + \global \let \@begindvi \@empty \end{lstlisting} %<*en> Now, \LuaTeX-ja automatically applies the patch \Pkg{lltjp-geometry} to the \Pkg{geometry} package, when the direction of the document is \emph{tate} (vertical writing). -This patch \Pkg{lltjp-geometry} also can be used in \pLaTeX; for the detail, please refer +This patch \Pkg{lltjp-geometry} also can be used in \pLaTeX; for the detail, please refer \url{lltjp-geometry.pdf}~(Japanese). % %<*ja> @@ -1090,13 +1112,12 @@ For \LaTeXe, \LuaTeX-ja adopted most of the font selection system of \pLaTeXe\ ( % \begin{itemize} %<*en> -\item Commands \cs{fontfamily}, \cs{fontseries}, - \cs{fontshape}, and \cs{selectfont} can be used to change +\item Commands \cs{fontfamily}, \cs{fontseries}, and \cs{fontshape} can be used to change attributes of Japanese fonts. % %<*ja> -\item 和文フォントの属性を変更するには,\cs{fontfamily}, \cs{fontseries}, \cs{fontshape}, - そしてそれらを反映させるために \cs{selectfont} を用いればよい. +\item 和文フォントの属性を変更するには,\cs{fontfamily}, \cs{fontseries}, \cs{fontshape} を使用する. + もちろん,それらを実際に反映させるには手動で \cs{selectfont} を実行する必要がある. % %<*en> @@ -1138,7 +1159,7 @@ auto select&\cs{fontencoding}&\cs{fontfamily}&---&---&\cs{usefont}\\ \verb+\fontencoding{+\verb+}+ changes the encoding of alphabetic fonts or Japanese fonts depending on the argument. For example, \verb+\fontencoding{JY3}+ changes the encoding of Japanese fonts to - \texttt{JY3},and \verb+\fontencoding{T1}+ changes the encoding of + \texttt{JY3}, and \verb+\fontencoding{T1}+ changes the encoding of alphabetic fonts to \texttt{T1}. \cs{fontfamily} also changes the current Japanese font family, the current alphabetic font family, \emph{or both}. @@ -1157,14 +1178,16 @@ auto select&\cs{fontencoding}&\cs{fontfamily}&---&---&\cs{usefont}\\ %<*en> \item For defining a Japanese font family, use \cs{DeclareKanjiFamily} instead of - \cs{DeclareFontFamily}. However, in the present implementation, - using \cs{DeclareFontFamily} doesn't cause any problem. + \cs{DeclareFontFamily}. (In previous version of \LuaTeX-ja, + using \cs{DeclareFontFamily} didn't cause any problem. But this no longer applies + the current version.) \item Defining a Japanese font shape can be done by usual \cs{DeclareFontShape}: % %<*ja> \item 和文フォントファミリの定義には \cs{DeclareFontFamily} の - 代わりに \cs{DeclareKanjiFamily} を用いる.しかし,現在の - 実装では \cs{DeclareFontFamily} を用いても問題は生じない. + 代わりに \cs{DeclareKanjiFamily} を用いる.以前の + 実装では \cs{DeclareFontFamily} を用いても問題は生じなかったが,現在の実装では + そうはいかない. \item 和文フォントのシェイプを定義するには,通常の \cs{DeclareFontShape} を使えば良い: % \begin{lstlisting} @@ -1384,7 +1407,7 @@ package with several options. This package provides functions in a part of \item[fontspec] %<*en> -With this option, Japanese fonts are selected using functionality of +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.} @@ -1408,6 +1431,19 @@ before \Pkg{luatexja-preset}: \end{lstlisting} \item[nfssonly] +%<*en> +With this option, selecting Japanese fonts won't be performed using the functionality of + the \Pkg{fontspec} package, but only standard NFSS2 (hence without + \cs{addjfontfeatures} etc.). +This option is ignored when \Pkg{luatexja-fontspec} package is loaded. + +Note that the \Pkg{fontspec} can coexist with the option as the following: +\begin{lstlisting} +\usepackage{fontspec} +\usepackage[hiragino-pron,nfssonly]{luatexja-preset} +\end{lstlisting} +In this case, one can use \cs{setmainfont} etc.\ to select \emph{alphabetic} fonts. +% %<*ja> \LaTeX 標準のフォント選択機構(NFSS2)を用いて \texttt{ltjpm}(明朝),\texttt{ltjpg}(ゴシック),それに後に述べる \texttt{deluxe} オプ @@ -1419,8 +1455,7 @@ before \Pkg{luatexja-preset}: \usepackage{fontspec} \usepackage[hiragino-pron,nfssonly]{luatexja-preset} \end{lstlisting} -のように「和文側では\Pkg{fontspec}の機能は使わない,つまり\Pkg{luatexja-fontspec}は読み込 - まない」ことは可能である.一方,, +のようにこのオプションを指定することは可能である.一方, パッケージ読み込み時に既に\Pkg{luatexja-fontspec}パッケージが読み込まれて いる場合は \texttt{nfssonly} オプションは無視される. % @@ -1515,7 +1550,7 @@ In following tables, starred fonts (e.g.~KozGo\dots-Regular) are used for medium \texttt{morisawa-pro}, \texttt{morisawa-pr6n}以外はフォントの指定は (ファイル名でなく)フォント名で行われる. 以下の表において,*\,つきのフォント(e,g,~KozGo\dots-Regular)は,\emph{\texttt{deluxe}オプション指定時に} -ゴシック体細字として用いられるものを示している. +ゴシック体中字として用いられるものを示している. % \begin{cslist}[style=standard] \item[kozuka-pro] Kozuka Pro (Adobe-Japan1-4) fonts. @@ -1558,8 +1593,6 @@ There is not rounded gothic family in Kozuka fonts. \end{tabular} \end{center} -%\newpage - \item[hiragino-pro] Hiragino Pro (Adobe-Japan1-5) fonts. % \\*[-\dimexpr\medskipamount+\baselineskip\relax] \item[hiragino-pron] Hiragino ProN (Adobe-Japan1-5, JIS04-savvy) fonts. @@ -1596,7 +1629,7 @@ Std/StdNフォントであり,その他はAdobe-Japan1-5対応である. \midrule %\textit{rounded gothic} %\gt 丸ゴシック -&&Hiragino~Maru~Gothic~ProN~W4&Hiragino~Maru~Gothic~ProN~W4\\ +&&Hiragino~Maru~Gothic~Pro~W4&Hiragino~Maru~Gothic~ProN~W4\\ \bottomrule \end{tabular} \end{center} @@ -1661,6 +1694,37 @@ Std/StdNフォントであり,その他はAdobe-Japan1-5対応である. \end{tabular} \end{center} + \item[moga-mobo] MogaMincho, MogaGothic, and MoboGothic. +%These fonts can be downloaded from\\\hfill \url{http://yozvox.web.fc2.com/}. +%これらのフォントは \url{http://yozvox.web.fc2.com/} からダウンロードできる. + +\begin{center}\small +\begin{tabular}{clll} +\toprule +\bf family&\bf series&\bf default, \texttt{90jis}~option&\bf \texttt{jis2004} option\\ +\midrule + &medium&Moga90Mincho&MogaMincho\\ +%\smash{\raisebox{1.5ex}{\textit{mincho}}}% +%\smash{\raisebox{1.5ex}{\gt 明朝}}% + &bold&Moga90Mincho Bold&MogaMincho Bold\\ +\midrule + &&Moga90Gothic&MogaGothic\\ + &\smash{\raisebox{1.5ex}{medium}} + &Moga90Gothic&MogaGothic\\ +\cmidrule(l){2-4} +%\textit{gothic}% +%\gt ゴシック + &bold&Moga90Gothic Bold&MogaGothic Bold\\ + &heavy&Moga90Gothic Bold&MogaGothic Bold\\ +\midrule +%\textit{rounded gothic} +%\gt 丸ゴシック +&&Mobo90Gothic&MoboGothic\\ +\bottomrule +\end{tabular} +\end{center} + + \end{cslist} %\paragraph{Presets for single weight} %\paragraph{単ウェイト用プリセット一覧} @@ -1777,7 +1841,7 @@ are internally specified by: Under \pLaTeX, \Pkg{japanese-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 the \Pkg{japanese-otf} package, +supports some of functions in the \Pkg{japanese-otf} package, as an external package \Pkg{luatexja-otf}. % %<*ja> @@ -1871,11 +1935,11 @@ Ryumin-Light, GothicBBB-Mediumという名前の非埋込フォントを用い % -%\section{Changing Parameters} +%\section{Changing Internal Parameters} %\section{パラメータの変更} %<*en> -There are many parameters in \LuaTeX-ja. And due to the behavior of \LuaTeX, +There are many internal parameters in \LuaTeX-ja. And due to the behavior of \LuaTeX, most of them are not stored as internal register of \TeX, but as an original storage system in \LuaTeX-ja. Hence, to assign or acquire those parameters, you have to use commands \cs{ltjsetparameter} and @@ -1888,8 +1952,8 @@ parameters, you have to use commands \cs{ltjsetparameter} and 用いる. % -%\subsection{Editing the Range of \textbf{JAchar}s} -%\subsection{\textbf{JAchar}の範囲の設定} +%\subsection{Range of \textbf{JAchar}s} +%\subsection{\textbf{JAchar}の範囲} \label{ssec-setrange} %<*en> @@ -1908,6 +1972,7 @@ and the character ``漢'' to the character range~100. \begin{lstlisting} \ltjdefcharrange{100}{"20000-"2FFFF,`漢} \end{lstlisting} + %<*en> A character can belong to only one character range. For example, whole SIP belong to the range~4 in the default setting of \LuaTeX-ja, @@ -1916,18 +1981,18 @@ removed from the range~4. % %<*ja> 各文字はただ一つの文字範囲に所属することができる. -例えば,SIPは全て\LuaTeX-jaのデフォルトでは4番の文字範囲に -属しているが,上記の指定を行えばSIPは100番に属すようになり,4番からは除かれる. +例えば,SIP内の文字は全て\LuaTeX-jaのデフォルトでは4番の文字範囲に +属しているが,上記の指定を行えばSIP内の文字は100番に属すようになり,4番からは除かれる. % %<*en> -The distinction between \textbf{ALchar} and \textbf{JAchar} is done for character ranges. +The distinction between \textbf{ALchar} and \textbf{JAchar} is performed by character ranges. This can be edited by setting the \textsf{jacharrange} parameter. -For example, this is just the default setting of \LuaTeX-ja, and +For example, the code below is just the default setting of \LuaTeX-ja, and it sets \begin{itemize} - \item a character which belongs character ranges 1,~4, and~5 is \textbf{ALchar}, - \item a character which belongs character ranges 2,~3, 6, 7, and~8 is \textbf{JAchar}. + \item a character which belongs character ranges 1,~4, 5, and~8 is \textbf{ALchar}, + \item a character which belongs character ranges 2,~3, 6, and~7 is \textbf{JAchar}. \end{itemize} % %<*ja> @@ -1935,12 +2000,12 @@ it sets これは\textsf{jacharrange}パラメータによって編集できる. 例えば,以下は\LuaTeX-jaの初期設定であり,次の内容を設定している: \begin{itemize} - \item 1番,4番,5番の文字範囲に属する文字は\textbf{ALchar}. - \item 2番,3番,6番,7番,8番の文字範囲に属する文字は\textbf{JAchar}. + \item 1番,4番,5番,8番の文字範囲に属する文字は\textbf{ALchar}. + \item 2番,3番,6番,7番の文字範囲に属する文字は\textbf{JAchar}. \end{itemize} % \begin{lstlisting} -\ltjsetparameter{jacharrange={-1, +2, +3, -4, -5, +6, +7, +8}} +\ltjsetparameter{jacharrange={-1, +2, +3, -4, -5, +6, +7, -8}} \end{lstlisting} %<*en> The argument to \textsf{jacharrange} parameter is a list of non-zero integer. @@ -1955,12 +2020,12 @@ and positive integer $+n$ means that ``\dots\ is a \textbf{JAchar}''. % %<*en> -\paragraph{Default setting} +\paragraph{Default character ranges} \LuaTeX-ja predefines eight character ranges for convenience. They are determined from the following data: % %<*ja> -\paragraph{初期設定} +\paragraph{文字範囲の初期値} \LuaTeX-jaでは8つの文字範囲を予め定義しており, これらは以下のデータに基づいて決定している. % @@ -1978,24 +2043,26 @@ Now we describe these eight ranges. The superscript ``J'' or ``A'' after the number shows whether each character in the range is treated as \textbf{JAchar}s or not by default. These settings are similar to the \texttt{prefercjk} settings defined in \texttt{PXbase} bundle. -Any characters above \texttt{U+0080} which does not belong to +Any characters equal to or above \texttt{U+0080} which does not belong to these eight ranges belongs to the character range~217. % %<*ja> 以下ではこれら8つの文字範囲について記述する.添字のアルファベット「J」「A」 -は,その文字範囲内の文字が\textbf{JAchar}か\textbf{ALchar}かを表している.これらの設定は -\texttt{PXbase}バンドルで定義されている\texttt{prefercjk}と類似のものである. +は,その文字範囲内の文字が\textbf{JAchar}か\textbf{ALchar}かを表している.これらの初期設定は +\texttt{PXbase}バンドルで定義されている\texttt{prefercjk}と類似のものであるが, +8ビットフォント使用時のトラブルを防ぐために \texttt{U+0080}--\texttt{U+00FF} の文字は全部 +\textbf{ALchar}としている. なお,\texttt{U+0080} 以降でこれら8つの文字範囲に属さない文字は,217番の文字範囲に属することになっている. % \begin{description} %<*en> -\item[Range~8${}^{\kern.1em\text{J}}$] The intersection of the upper half of ISO~8859-1 +\item[Range~8${}^{\text{A}}$] The intersection of the upper half of ISO~8859-1 (Latin-1 Supplement) and JIS~X~0208 (a basic character set for Japanese). This character range consists of the following characters: % %<*ja> -\item[範囲8${}^{\kern.1em\text{J}}$] ISO~8859-1の上位領域(ラテン1補助)と +\item[範囲8${}^{\text{A}}$] ISO~8859-1の上位領域(ラテン1補助)と JIS~X~0208の共通部分.この文字範囲は 以下の文字で構成される: % @@ -2029,9 +2096,10 @@ This range consists of the following Unicode ranges, \emph{except characters in \item \texttt{U+0180}--\texttt{U+024F}: Latin Extended-B \item \texttt{U+0250}--\texttt{U+02AF}: IPA Extensions \item \texttt{U+02B0}--\texttt{U+02FF}: Spacing Modifier Letters -\item \texttt{U+0300}--\texttt{U+036F}: \\\null\hfill Combining Diacritical Marks -\item \texttt{U+1E00}--\texttt{U+1EFF}: \\\null\hfill Latin Extended Additional -\par\ +%\par\ +\item \texttt{U+0300}--\texttt{U+036F}: \\*\null\hfill Combining Diacritical Marks +\item \texttt{U+1E00}--\texttt{U+1EFF}: \\*\null\hfill Latin Extended Additional +%\par\ \end{itemize} \end{multicols} %<*en> @@ -2040,7 +2108,7 @@ This range consists of the following Unicode ranges, \emph{except characters in % %<*ja> \item[範囲2${}^{\text{\kern.1emJ}}$] ギリシャ文字とキリル文字.JIS~X~0208(したがってほとんどの - 和文フォント)はこれらの文字を持つ. + 和文フォント)には,これらの文字の一部が含まれている. % \begin{multicols}{2} \begin{itemize} @@ -2165,6 +2233,54 @@ The block list is indicated in Table~\ref{table-rng7}. \end{table} \end{description} +%<*en> +\paragraph{Notes on \texttt{U+0080}--\texttt{U+00FF}} +You should treat characters in \\texttt{U+0080}--\texttt{U+00FF} as \textbf{ALchar}, +when you use traditional 8-bit fonts, such as the \Pkg{textcomp} package or the +\Pkg{marvosym} package. + +For example, the codepoint \cs{textparagraph} which is provided by the \Pkg{textcomp} +package is 182. This codepoint corresponds \P\ (\text{U+00B6}) in Unicode. +Similarly, \cs{Frowny} which is provided by the \Pkg{marvosym} package has +the same codepoint as \S\ (\text{U+00A7}). +Hence, as previous versions of \LuaTeX-ja, if these characters are treated as +\text{JAchar}s, then \cs{textparagraph} produces ``ltjjachar`¶'' (in a Japanese font), +and \cs{Frowny} produces ``\ltjjachar`§'' (in a Japanese font). + +To avoid such situations, the default setting of \LuaTeX-ja is changed in this release +so that all characters \texttt{U+0080}--\texttt{U+00FF} are treated as \textbf{ALchar}. +If you want to output a character as \textbf{ALchar}/\textbf{JAchar} regardless the range +setting, you can use \cs{ltjalchar}/\cs{ltjjachar} respectively. +\begin{LTXexample}[width=0.3\textwidth] +\gtfamily +¶,\ltjalchar`¶,\ltjjachar`¶\\ % default: ALchar +α,\ltjalchar`α,\ltjjachar`α % default: JAchar +\end{LTXexample} +% +%<*ja> +\paragraph{\texttt{U+0080}--\texttt{U+00FF}についての注意} +\LuaTeX-jaで,\Pkg{textcomp}パッケージや\Pkg{marvosym}パッケージ等,Unicodeフォントでなく +伝統的な8ビットフォントを用いる場合には注意が必要である. + +例えば,\Pkg{textcomp}パッケージの提供する \cs{textparagraph} は, +符号位置が182,つまり \texttt{0xB6} であり,Unicodeではこの符号位置では\P\ (\text{U+00B6}) に対応する. +また,\Pkg{marvosym}パッケージの提供する \cs{Frowny} も,符号位置は167,つまりUnicodeにおける +\S\ (\text{U+00A7}) と同じ符号位置にある. +即ち,以前のバージョンのように,「前節の文字範囲8内の文字は\textbf{JAchar}」という設定で +あったとすると,上記の \cs{textparagraph} は和文フォントで「\ltjjachar`¶」を出力し, +また \cs{Frowny} は和文フォントで「\ltjjachar`§」を出力することになる. +このような事態を避けるために,\emph{本バージョンからは \texttt{U+0080}--\texttt{U+00FF} の範囲の +文字は全て\textbf{ALchar}となるように初期設定を変更}している. + +なお,文字範囲の設定に関わらず文字を\textbf{ALchar}, \textbf{JAchar}で出力したい場合には, +それぞれ \cs{ltjalchar},~\cs{ltjjachar} に該当文字の文字コードを渡せばよい. +\begin{LTXexample}[width=0.3\textwidth] +\gtfamily +¶,\ltjalchar`¶,\ltjjachar`¶\\ % default: ALchar +α,\ltjalchar`α,\ltjjachar`α % default: JAchar +\end{LTXexample} +% + %\subsection{\Param{kanjiskip} and \Param{xkanjiskip}} %\subsection{\Param{kanjiskip}と\Param{xkanjiskip}} \label{subs-kskip} @@ -2174,11 +2290,11 @@ The block list is indicated in Table~\ref{table-rng7}. \begin{itemize} %<*en> \item Glues/kerns specified in JFM. If \cs{inhibitglue} is issued - around a Japanese character, this glue will not be inserted at the + around a \textbf{JAchar}, this glue will not be inserted at the place. % %<*ja> -\item JFMで指定されたグルー/カーン.もし \cs{inhibitglue} が和文文字の周りで +\item JFMで指定されたグルー/カーン.もし \cs{inhibitglue} が\textbf{JAchar}の周りで 発行されていれば,このグルーは挿入されない. % %<*en> @@ -2397,18 +2513,20 @@ xyz漢字 %<*en> Note that setting positive \Param{yalbaselineshift}~or~\Param{talbaselineshift} -parameters does not increase the depth of one-letter ``syllable'' $p$ of \textbf{Alchar}, if +parameters does not increase the depth of one-letter \emph{syllable} $p$ of \textbf{Alchar}, if its left-protrusion~(\cs{lpcode}) and right-protrusion~(\cs{rpcode}) are both non-zero. This is because \begin{itemize} -\item These two parameters are implemented by setting yoffset field of a +\item These two parameters are implemented by setting \texttt{yoffset} field of a glyph node, and this does not increase the depth of the glyph. \item To cope with the above situation, \LuaTeX-ja automatically supplies -a rule in every ``syllable''. -\item However, we cannot use this ``supplying a rule'' method if \dots +a rule in every syllable. +\item However, we cannot use this ``supplying a rule'' method if a syllable comprises just + one letter whose \cs{lpcode}~and~\cs{rpcode} are both non-zero. \end{itemize} -This problem does not apply for \Param{yjabaselineshift}~nor~\Param{tjabaselineshift}. +This problem does not apply for \Param{yjabaselineshift}~nor~\Param{tjabaselineshift}, +becuse a \emph{JAchar} is encapsulated by a horizontal box if needed. % %<*ja> なお,以下の場合には1文字の\textbf{ALchar}からなる「音節」の深さは増加しないことに注意. @@ -2417,6 +2535,7 @@ This problem does not apply for \Param{yjabaselineshift}~nor~\Param{tjabaselines \item 「音節」を構成する唯一の文字$p$の 左余白への突出量(\cs{lpcode}),右余白への突出量(\cs{rpcode})がどちらも非零である. \end{itemize} +\emph{JAchar}は必要に応じて1文字ずつボックスにカプセル化されるため, \Param{yjabaselineshift},~\Param{tjabaselineshift}パラメータについてはこのような問題は起こらない. % @@ -2472,13 +2591,13 @@ $\Phi\vdash F(x)\ \hbox{for all}\ x\in A$ \subsection{\emph{kinsoku} parameters and OpenType features} Among parameters which related to Japanese word-wrapping process (\emph{kinsoku shori}), \begin{quote} - \Param{jaxspmode},~\Param{alxspmode}, \Param{prebreakpenalty}, + \Param{jaxspmode},~\Param{alxspmode}, \Param{prebreakpenalty}, \Param{postbreakpenalty}~and~\Param{kcatcode} \end{quote} are stored by each character codes. ... For example, a fullwidth katakana ``ア'' on line~10 in the below input is replaced to -its halfwidth variant ``ア'', by \verb+hwid+ feature. +its halfwidth variant ``ア'', by \verb+hwid+ feature. However, the penalty inserted after it is 10 which is the \Param{postbreakpenalty} of ``ア'', not 20. % @@ -2600,7 +2719,7 @@ and \LuaTeX-ja can control these four kinds separately: \begin{itemize} \item \emph{Distinction between \textbf{JAchar} or \textbf{ALchar}} -is controlled by using the character range, see Subsection~\ref{ssec-setrange}. +is controlled by the character range, see Subsection~\ref{ssec-setrange}. \item \emph{Whether the character can be used in a control word} is controlled by setting \cs{catcode} to 11~(enabled) or 12~(disabled), as usual. @@ -2608,7 +2727,7 @@ is controlled by setting \cs{catcode} to 11~(enabled) or 12~(disabled), as usual \emph{Whether \Param{jcharwidowpenalty} can be inserted before the character} is controlled by the lowermost bit of the \Param{kcatcode} parameter. \item -\emph{Ignoring linebreak after a \textbf{JAchar}} is always ignored. +\emph{Linebreak after a \textbf{JAchar}} does not produce a space. \end{itemize} % %<*ja> @@ -2622,25 +2741,26 @@ is controlled by the lowermost bit of the \Param{kcatcode} parameter. \LuaTeX 自身の \cs{catcode} でよい \item[\Param{jcharwidowpenalty}が挿入可か] \Param{kcatcode}パラメータの最下位ビット - \item[直後の改行の無視] -日本語しか想定していないので\textbf{JAchar}については一律有効 + \item[直後の改行] +日本語しか想定していないので,\textbf{JAchar}直後の改行で半角スペースが挿入されることはない. \end{description} % %<*en> -Default setting of \cs{catcode} of \LuaTeX\ can be found -in \texttt{luatex-unicode-letters.tex}, -which is based on \texttt{unicode-letters.tex} (for \XeTeX). +Default setting of \cs{catcode} of Unicode characters are located in +\begin{description} + \item[plain \LuaTeX] \texttt{luatex-unicode-letters.tex}, which is based on \texttt{unicode-letters.tex} +(for \XeTeX). + \item[\LuaLaTeX] now included in \LaTeX\ kernel as~\texttt{unicode-letters.def}. +\end{description} However, the default setting of \cs{catcode} differs between \XeTeX\ and \LuaTeX, by the following reasons: \begin{itemize} - \item \texttt{luatex-unicode-letters.tex} is based on old \texttt{unicode-letters.tex}. - \item The latter half of \texttt{unicode-letters.tex} sets -\cs{catcode} of Kanji and kana characters to 11, -via setting \cs{XeTeXcharclass}. + \item (plain format) \texttt{luatex-unicode-letters.tex} is based on old \texttt{unicode-letters.tex}. + \item The latter half of \texttt{unicode-letters.tex}~and~\texttt{unicode-letters.def} +sets\cs{catcode} of Kanji and kana characters to 11, via setting \cs{XeTeXcharclass}. -However, this latter half is simply omitted in -\texttt{luatex-unicode-letters.tex}, hence +However, this latter half does not exist (plain case), or not executed (\LaTeX~case) in \LuaTeX, hence \cs{catcode} of Kanji and kana characters remains 12 in \LuaTeX. \end{itemize} In other words, Kanji nor kana characters cannot be used in @@ -2655,21 +2775,25 @@ for \LuaTeX, \emph{to match the \cs{catcode} setting with that of \XeTeX.} %<*ja> ネイティブにUnicode全部の文字を扱える\XeTeX や\LuaTeX では, 文字が制御綴内で使用できるかは通常の欧文文字と同じく \cs{catcode} -で指定することとなる.\XeTeX における \cs{catcode} の初期設定は\ -\texttt{unicode-letters.tex} 中に記述されており,\LuaTeX ではそれを +で指定することとなる.plain \XeTeX における \cs{catcode} の初期設定は\ +\texttt{unicode-letters.tex} 中に記述されており,plain \LuaTeX ではそれを 元にした \texttt{luatex-unicode-letters.tex} を用いている. +\LaTeX では \cs{catcode} の設定はカーネルに \texttt{unicode-letters.def} として統合され. +このファイルを\XeLaTeX, \LuaLaTeX の両方が用いている. + だが,\XeTeX における \cs{catcode} の初期設定と \LuaTeX におけるそれは一致していない: \begin{itemize} \item \texttt{luatex-unicode-letters.tex} の元になった\ \texttt{unicode-letters.tex} が古い - \item \texttt{unicode-letters.tex} の後半部では + \item \texttt{unicode-letters.tex} 後半部や \texttt{unicode-letters.def} 後半部では \cs{XeTeXcharclass} の設定を行なっており, それによって漢字や仮名の \cs{catcode} が11に設定されている. しかし,\texttt{luatex-unicode-letters.tex} ではこの「後半部」が -まるごと省略されており,漢字や仮名の \cs{catcode} は12のまま. +まるごと省略されており,また\LuaLaTeX でも \texttt{unicode-letters.def} 後半部は実行されな + い.従って漢字や仮名の \cs{catcode} は12のままになっている. \end{itemize} 言い換えると,\LuaTeX の初期状態では漢字や仮名を制御綴内に 使用することはできない. @@ -2749,8 +2873,6 @@ which can be used in a control word differ in \pTeX, in \upTeX,~and~in \LuaTeX-j Table~\ref{table-kcat-diff} shows the difference. Except for four characters ``・'',~``゛'', ``゜'',~``゠'', \LuaTeX-ja admits more characters in a control word than \upTeX. -\emph{Note that the ideographic space~\texttt{U+3000} can be used -in a control word in \LuaTeX-ja.} Difference becomes larger, if we consider non-kanji JIS~X~0213 characters. @@ -2945,7 +3067,7 @@ the direction inside the box and that outside the box differ. \put(0,0){\vector(1,0){5}} \put(2.5,-0.2){\makebox(0,0)[t]{$h_{\mathrm{T}}$}} \put(0,0){\vector(-1,0){2}}\put(-1,-0.2){\makebox(0,0)[t]{$d_{\mathrm{T}}$}} \put(0,0){\vector(0,-1){7}}\put(0.2,-3.5){\makebox(0,0)[l]{$w_{\mathrm{T}}$}} - \end{picture}}} + \end{picture}}}% } \def\DTOUeg{% \hbox{\smash{\begin{picture}(0,0)(-5,0) @@ -2956,7 +3078,7 @@ the direction inside the box and that outside the box differ. \put(0,0){\vector(-1,0){5}} \put(-2.5,0.3){\makebox(0,0)[b]{$h_{\mathrm{D}}$}} \put(0,0){\vector(1,0){2}}\put(1,0.3){\makebox(0,0)[b]{$d_{\mathrm{D}}$}} \put(0,0){\vector(0,1){7}}\put(-0.2,3.5){\makebox(0,0)[r]{$w_{\mathrm{D}}$}} - \end{picture}}} + \end{picture}}}% } \def\YOKOeg{% \hbox{\smash{\begin{picture}(0,0) @@ -2967,7 +3089,7 @@ the direction inside the box and that outside the box differ. \put(0,0){\vector(0,1){5}} \put(0.3,2.5){\makebox(0,0)[l]{$h_{\mathrm{Y}}$}} \put(0,0){\vector(0,-1){2}}\put(0.3,-1){\makebox(0,0)[l]{$d_{\mathrm{Y}}$}} \put(0,0){\vector(1,0){7}}\put(3.5,0.2){\makebox(0,0)[b]{$w_{\mathrm{Y}}$}} - \end{picture}}} + \end{picture}}}% } \begin{tabular}{ccc} \toprule @@ -3073,7 +3195,7 @@ the direction inside the box and that outside the box differ. \begin{align*} W_{\mathrm{Y}} &= h_{\mathrm{D}}+d_{\mathrm{D}},\\ H_{\mathrm{Y}} &= w_{\mathrm{D}},\\ - D_{\mathrm{Y}} &= 0\,pt + D_{\mathrm{Y}} &= 0\,\mathrm{pt} \end{align*}% }& \parbox[c]{15\unitlength}{\begin{picture}(15,15)(0,-4) @@ -3177,7 +3299,7 @@ The following is an example. \item[\cs{ltjsetwd}=\textrm{, }\cs{ltjsetht}=\textrm{, }% \cs{ltjsetdp}=] -These commands set the dimension of \cs{box}. Unlike \cs{ltjgetwd}, one does not need +These commands set the dimension of \cs{box}. One does not need to group the argument ; four calls of \cs{ltjsetwd} below have the same meaning. \begin{lstlisting} \ltjsetwd42 20pt, \ltjsetwd42=20pt, \ltjsetwd=42 20pt, \ltjsetwd=42=20pt @@ -3250,7 +3372,7 @@ These commands set the dimension of \cs{box}. Unlike \cs{ltjgetwd}, one doe %<*en> \subsection{Getting current direction} The \Param{direction} parameter returns the current direction, and -the \Param{boxdir} parameter (with the argumant ) +the \Param{boxdir} parameter (with the argument ) returns the direction of a box register \cs{box}. The returned value of these parameters are a \emph{string}: \begin{center} @@ -3707,7 +3829,7 @@ letter-spacing and the width of italic correction are not correct: 但し,以下の例の3行目に示すように,明示的に \texttt{vert}, \texttt{vrt2}(のいずれか)の 有効・無効を指定した場合は別である. \begin{lstlisting} -\tfont\S=file:KozMinPr6N-Regular.otf:jfm=ujisv +\tfont\S=file:KozMinPr6N-Regular.otf:jfm=ujisv % vert and vrt2 are automatically activated \tfont\T=file:KozMinPr6N-Regular.otf:jfm=ujisv;-vert % vert and vrt2 are not activated \end{lstlisting} @@ -4397,7 +4519,7 @@ The following is the list of imaginary characters: \item['jcharbdd'] %A boundary between \textbf{JAchar} and anything else (such as \textbf{ALchar}, kern, glue,\,\ldots). -%和文文字と「その他のもの」(欧文文字,glue,kern等)との境界. +%\textbf{JAchar}と「その他のもの」(欧文文字,glue,kern等)との境界. \item[$-1$] %The left/right boundary of an inline math formula. @@ -4617,7 +4739,7 @@ For $i\in\omega$, \texttt{char\_type[$i$]} is information of characters whose cl \item \texttt{align} is a number which is determined from \texttt{align}~field in the JFM: \[ \begin{cases} - 0&\text{\texttt{'left'} and the default value}\\0.5&\text{\tt 'middle'}\\1&\text{\tt 'right'} + 0&\text{\texttt{'left'} (default)}\\0.5&\text{\tt 'middle'}\\1&\text{\tt 'right'} \end{cases} \] \item For $j\in \omega$, \texttt{[$j$]} stores a kern or a glue which will be inserted @@ -4677,7 +4799,7 @@ glueであれば,\texttt{[$j$]=\{false, , , \}} で \end{itemize} \item[ascent\textrm{, }descent] …… -\item[chars\_cbcache] +\item[chars\_cbcache] …… \end{cslist} % @@ -4828,8 +4950,7 @@ of \LuaTeX, see Section~\ref{sec-para}. \cs{ltjsetparameter} and \cs{ltjglobalsetparameter} are commands for assigning parameters. These take one argument which is a \texttt{=} list. -The difference between -\cs{ltjsetparameter} and \cs{ltjglobalsetparameter} is only the +The difference between these two commands is the scope of assignment; \cs{ltjsetparameter} does a local assignment and \cs{ltjglobalsetparameter} does a global one. @@ -4838,9 +4959,7 @@ They also obey the value of \cs{globaldefs}, like other assignments. %<*ja> \cs{ltjsetparameter} と \cs{ltjglobalsetparameter} はパラメータを 指定するための命令で,\texttt{=}のリストを -引数としてとる. -\cs{ltjsetparameter} と \cs{ltjglobalsetparameter} の違いはスコープの -違いのみで, +引数としてとる.両者の違いはスコープであり, \cs{ltjsetparameter} はローカルな設定を行うのに対し, \cs{ltjglobalsetparameter} はグローバルな設定を行う. また,他のパラメータ指定と同様に \cs{globaldefs} の値にも従う. @@ -4969,7 +5088,7 @@ to prevent a line ends with this character. \item[\DParam{jaxspmode}\,=\{,\}$^\ast$]\ %<*en> -Setting whether inserting \Param{xkanjiskip} is allowed before/after a \textbf{JAchar} whose character code is . +Set whether inserting \Param{xkanjiskip} is allowed before/after a \textbf{JAchar} whose character code is . The followings are allowed for : % %<*ja> @@ -4997,7 +5116,7 @@ This parameter is similar to the \cs{inhibitxspcode} primitive of \pTeX, but not \item[\DParam{alxspmode}\,=\{,\}$^\ast$] [\cs{xspcode}]\ %<*en> -Setting whether inserting \Param{xkanjiskip} is allowed before/after a +Set whether inserting \Param{xkanjiskip} is allowed before/after a \textbf{ALchar} whose character code is . The followings are allowed for : % @@ -5034,6 +5153,13 @@ Note that parameters \Param{jaxspmode} and \Param{alxspmode} share a common tabl しかし,自然長が \cs{maxdimen} の場合は,例外的に和文フォントのJFM側で指定されている 値を採用(こちらはフォントサイズに比例)することになっている. % +%<*en> +The default glue which inserted between two \textbf{JAchar}s. +Changing current Japanese font does not alter this parameter, as \pTeX. + +If the natural width of this parameter is \cs{maxdimen}, \LuaTeX-ja uses +the value which is specified in the JFM for current Japanese font (See Subsection~\ref{ssec-jfm-str}). +% \item[\DParam{xkanjiskip}\,=$^\ast$] [\cs{xkanjiskip}]\ @@ -5042,6 +5168,14 @@ Note that parameters \Param{jaxspmode} and \Param{alxspmode} share a common tabl \Param{kanjiskip}と同じように,通常ではフォントサイズに比例して変わることはないが, 自然長が \cs{maxdimen} の場合が例外である. % +%<*en> +The default glue which inserted between a \textbf{JAchar} and an + \textbf{ALchar}. +Changing current font does not alter this parameter, as \pTeX. + +As \Param{kanjiskip}, if the natural width of this parameter is \cs{maxdimen}, \LuaTeX-ja uses +the value which is specified in the JFM for current Japanese font (See Subsection~\ref{ssec-jfm-str}). +% \item[\DParam{differentjfm}\,=$^\dagger$]\ @@ -5321,7 +5455,7 @@ The correct way is using a temporary register. \ltjsetparameter{kanjiskip=0\zw plus .1\zw minus .01\zw} \@tempskipa=\ltjgetparameter{xkanjiskip} \ifdim\@tempskipa>\z@ - \if@slide + \if@slide \ltjsetparameter{xkanjiskip=0.1em} \else \ltjsetparameter{xkanjiskip=0.25em plus 0.15em minus 0.06em} @@ -5341,7 +5475,7 @@ The correct way is using a temporary register. \ltjsetkanjiskip{\z@ plus .1\zw minus .01\zw} \@tempskipa=\ltjgetparameter{xkanjiskip} \ifdim\@tempskipa>\z@ - \if@slide + \if@slide \ltjsetxkanjiskip.1em \else \ltjsetxkanjiskip.25em plus .15em minus .06em @@ -5376,7 +5510,7 @@ The correct way is using a temporary register. さて,縦組の欧文ベースライン補正量\Param{talbaselineshift}は, 実際には \cs{ltj@tablshift} という属性レジスタに格納されている (\ref{sec-para}\nobreak 節参照).属性レジスタは長さではなく整数値を格納する\footnote{% - 従って,\texttt{\textbackslash @savetbaselineshift=\textbackslash ltj@tablshift}\ + 従って,\texttt{\textbackslash @savetbaselineshift=\textbackslash ltj@tablshift}\ のように記述することはできない.属性レジスタを \cs{tbaselineshift} という名称にしなかっ たのはそのためである. }ものであり,\cs{ltj@tablshift} は補正量を sp 単位で保持することから, @@ -5511,7 +5645,7 @@ With the help of this example, we remark the specification of \cs{inhibitglue}: Using \cs{ltjdeclarealtfont}, one can ``compose'' more than one Japanese fonts. This \cs{ltjdeclarealtfont} uses in the following form: \begin{quote} -\ttfamily \textbackslash ltjdeclarealtfont{} +\ttfamily \textbackslash ltjdeclarealtfont\{\} \end{quote} where ~and~ are defined by \cs{jfont}. Its meaning is @@ -5519,8 +5653,7 @@ Its meaning is If the current Japanese font is , characters which belong to is typeset by another Japanese font , instead of . \end{quote} - - is a comma-separated list of character codes, but also accepts negative integers: +Here is a comma-separated list of character codes, but also accepts negative integers: $-n$~($n≥1$) means that all characters of character classes~$n$, with respect to JFM used by . Note that characters which do not exist in are ignored. @@ -5544,7 +5677,7 @@ are typeset by \cs{piyo}. \cs{ltjdeclarealtfont} は以下の書式で使用する: \begin{quote} -\ttfamily \textbackslash ltjdeclarealtfont{} +\ttfamily \textbackslash ltjdeclarealtfont\{\} \end{quote} これは「現在の和文フォント」がであるとき, に属する文字はを用いて組版される,という意味である. @@ -5639,18 +5772,18 @@ but on the other hand \cs{zw}~and~\cs{zh} are specified by JFM. \item[\cs{DeclareTateKanjiEncoding}\{\}\{\}\{\}] %<*en> -In NFSS2 under \LuaTeX-ja, distinction between alphabetic font families - and Japanese font families are only made by their - encodings. For example, encodings OT1 and T1 are for - alphabetic font families, and a Japanese font family cannot +In NFSS2 under \LuaTeX-ja, distinction between alphabetic fonts + and Japanese fonts are only made by their + encodings. For example, encodings OT1 and T1 are encodings for + alphabetic fonts, and Japanese fonts cannot have these encodings. These command define a new encoding scheme for Japanese font families. % %<*ja> -\LuaTeX-jaのNFSS2においては,欧文フォントファミリと和文フォントファミリは +\LuaTeX-jaのNFSS2においては,欧文フォントと和文フォントは そのエンコーディングによってのみ区別される. -例えば,OT1とT1のエンコーディングは欧文フォントファミリに対するものであり, -和文フォントファミリはこれらのエンコーディングを持つことはできない. +例えば,OT1とT1のエンコーディングは欧文フォントのエンコーディングであり, +和文フォントはこれらのエンコーディングを持つことはできない. これらコマンドは横組用・縦組用和文フォントのための新しいエンコーディングを それぞれ定義する. % @@ -5667,7 +5800,7 @@ In NFSS2 under \LuaTeX-ja, distinction between alphabetic font families The above 3~commands are just the counterparts for \cs{DeclareFontEncodingDefaults} and~others. % %<*ja> -上記3つのコマンドはちょうど \cs{DeclareFontEncodingDefaults} などに対応するものである. +上記3つのコマンドはちょうどNFSS2 の \cs{DeclareFontEncodingDefaults} などに対応するものである. % \item[\cs{reDeclareMathAlphabet}\{\}\{\}\{\}] @@ -5699,12 +5832,12 @@ The above 3~commands are just the counterparts for \cs{DeclareFontEncodingDefaul \item[\cs{DeclareRelationFont}\{\}\{\}\{\}\{\}\\* \null\hfill\{\}\{\}\{\}\{\}] %<*en> -This command sets the ``accompanied'' alphabetic font family (given by the latter 4~arguments) -with respect to a Japanese font family given by the former 4~arguments. +This command sets the ``accompanied'' alphabetic font (given by the latter 4~arguments) +with respect to a Japanese font given by the former 4~arguments. % %<*ja> -いわゆる「従属欧文」を設定するための命令である.前半の4引数で表される和文フォントファミリに対して, -そのフォントに対応する「従属欧文」のフォントファミリを後半の4引数により与える. +いわゆる「従属欧文」を設定するための命令である.前半の4引数で表される和文フォントに対して, +そのフォントに対応する「従属欧文」のフォントを後半の4引数により与える. % \item[\cs{SetRelationFont}] %<*en> @@ -5727,7 +5860,7 @@ Like \cs{fontfamily}, \cs{selectfont} is required to take an effect. %<*ja> 現在の欧文フォントのエンコーディング/ファミリ/…… を, \cs{DeclareRelationFont} か \cs{SetRelationFont} で指定された -現在の和文フォントファミリに対応する「従属欧文」フォントファミリに変更する. +現在の和文フォントに対応する「従属欧文」フォントに変更する. \cs{fontfamily} のように,有効にするためには \cs{selectfont} が必要である. % @@ -5741,7 +5874,8 @@ 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. +In \LuaTeX-ja, this \cs{adjustbaseline} does same task, namely setting the + \Param{talbaselineshift} parameter. % %<*ja> \pLaTeXe では,\cs{adjustbaseline} は縦組時に「M」と「あ」の中心線を一致させるために, @@ -5752,72 +5886,22 @@ In \LuaTeX-ja, this \cs{adjustbaseline} does same task. + d_{\text{あ}} - d_{\text{M}}, \] ここで,$h_{a}$,~$d_{a}$はそれぞれ「$a$」の高さ・深さを表す. -\LuaTeX-jaにおいても\cs{adjustbaseline} は同様の処理を行っている. +\LuaTeX-jaにおいても\cs{adjustbaseline} は同様に\Param{talbaselineshift}パラメータの調整処 + 理を行っている. + +同時に,これも\pLaTeXe の \cs{adjustbaseline} で行われていたが, +「漢」の寸法を元に,(本節の最初に述べた,小文字で始まる)\cs{cht}, \cs{cwd} といった長さ変数を設定する. % \item[\cs{fontfamily}\{\}] %<*en> As in \LaTeXe, this command changes current font family (alphabetic, Japanese,~\emph{or both}) -to . Which family will be changed is determined as follows: +to . See Subsection~\ref{ssec-fontfamilycmd} for detail. % %<*ja> 元々の\LaTeXe におけるものと同様に,このコマンドは現在のフォントファミリ(欧文, -和文,\emph{もしくは両方})をに変更する. -どのファミリが変更されるかは以下のようにして決定される: -% -\begin{itemize} -%<*en> -\item Let current encoding scheme for Japanese fonts be - . Current Japanese font family will be changed to - , if one of the following two conditions is met: -% -%<*ja> -\item 現在の和文フォントに対するエンコーディングがであるとしよう. - 現在の和文フォントファミリは,以下の2つの条件のうちの1つが満たされているときに - に変更される: -% -\begin{itemize} -%<*en> -\item The family under the encoding has been already defined by - \cs{DeclareKanijFamily}. -% -%<*ja> -\item エンコーディングにおけるファミリが -既に \cs{DeclareKanjiFamily} によって定義されている. -% -%<*en> -\item A font definition named \texttt{.fd} (the file name is - all lowercase) exists. -% -%<*ja> -\item フォント定義ファイル\texttt{.fd}(ファイル名は全て小文字)が存在する. +和文,\emph{もしくは両方})をに変更する.詳細は\ref{ssec-fontfamilycmd}節を参照すること. % -\end{itemize} -%<*en> -\item Let current encoding scheme for alphabetic fonts be - . For alphabetic font family, the criterion as above is used. -% -%<*ja> -\item 現在の欧文フォントに対するエンコーディングをとする. - 欧文フォントファミリに対しても,上記の基準が用いられる. -% -%<*en> -\item There is a case which none of the above applies, that is, the font - family named doesn't seem to be defined neither under the - encoding , nor under . -In this case, the default family for font substitution is used for - alphabetic and Japanese fonts. Note that current encoding will not - be set to , unlike the original implementation in \LaTeX. -% -%<*ja> -\item 上記のいずれもが適用されない,つまりがとの - どちらでも定義されないような場合がある. - この場合,代替フォントに用いられるデフォルトのフォントファミリが欧文フォントと - 和文フォントに用いられる.\LaTeX のオリジナルの実装とは異なり, - 現在のエンコーディングはには設定されないことに注意する. -% -\end{itemize}% -%\vspace{-\medskipamount} \begin{figure}[!tb] @@ -5894,6 +5978,172 @@ Avant Garde (OT1/pag/m/n) に変わっていることがわかる. \userelfont\selectfont あいうabc \end{LTXexample} +%\subsection{\cs{fontfamily}} +%\subsection{\cs{fontfamily}} +\label{ssec-fontfamilycmd} +%<*en> +In this subsection, we describe when \cs{fontfamily} changes current +Japanese/alphabetic font family. Basically, current Japanese fotn family is changed to + if it is recognized as a Japanese font family, and similar with alphabetic font +family. There is a case that current Japanese/alphabetic font family are both changed to +, and another case that isn't recognized as a Japanese/alphabetic font +family either. + +\paragraph{Recognition as Japanese font family} +First, Whether Japanese font family will be changed is determined in following order. +This order is very similar to \cs{fontfamily} in \pLaTeXe, but we re-implemented in Lua. +We use an auxiliary list~$N_{\mathrm{J}}$. +% +%<*ja> +本節では,\cs{fontfamily} がいつ和文/欧文フォントファミリを変更するかについて解説 +する.基本的には,が和文フォントファミリだと認識されれば和文側が,欧文フォントファ +ミリだと認識されれば欧文側が変更される.どちらとも認識されれば和文・欧文の両方が変わるこ +とになるし,当然どちらとも認識されないこともある. + +\paragraph{和文フォントファミリとしての認識} +まず,が和文フォントファミリとして認識されるかは以下の順序で決定される. +これは\pLaTeXe の \cs{fontfamily} にとても似ているが,ここではLuaによって実装している. +補助的に「和文フォントファミリではないと認識された」ファミリを格納したリスト$N_{\mathrm{J}}$を用いる. +% +\begin{enumerate} +%<*en> +\item If the family~ has been defined already by \cs{DeclareKanjiFamily}, + is recognized as a Japanese font family. + Note that need not be defined under \emph{current} Japanese font encoding. +% +%<*ja> +\item ファミリが既に \cs{DeclareKanjiFamily} によって定義されている場合, + は和文フォントファミリであると認識される. + ここで,は現在の和文フォントエンコーディングで定義されていなくてもよい. +% +%<*en> +\item If the family~ has been listed in a list~$N_{\mathrm{J}}$, this means + that is not a Japanese font family. +% +%<*ja> +\item ファミリがリスト$N_{\mathrm{J}}$に既に含まれていれば,それは + が和文フォントファミリではないことを意味する. +% +%<*en> +\item If the \Pkg{luatexja-fontspec} package is loaded, we stop here, and is not + recognized as a Japanese font family. + + If the \Pkg{luatexja-fontspec} package is \emph{not} loaded, +now \LuaTeX-ja looks whether there exists a Japanese font encoding~ such that + a font definition named \texttt{.fd} (the file name is + all lowercase) exists. If so, is recognized as a Japanese font family (the font definition file won't be loaded here). + If not, is not a Japanese font family, and + is appended to the list~$N_{\mathrm{J}}$. +% +%<*ja> +\item もし\Pkg{luatexja-fontspec}パッケージが読み込まれていれば,ここで終了であり, +は和文フォントファミリとして認識されないことになる. + +もし\Pkg{luatexja-fontspec}パッケージが読み込まれていなければ,和文エンコーディングで +フォント定義ファイル\texttt{.fd}(ファイル名は全て小文字)が存在するようなも + のがあるかどうかを調べる. +存在すれば,は和文フォントファミリと認識される(フォント定義ファイルは読み込まれな + い). +存在しなければ,は和文フォントファミリでないと認識され,リスト$N_{\mathrm{J}}$にを追加することでそれを記憶する. + +% +\end{enumerate} + +%<*en> +\paragraph{Recognition as alphabetic font family} +Next, whether alphabetic font family will be changed is determined in following order. +We use auxiliary lists $F_{\mathrm{A}}$~and~$N_{\mathrm{A}}$, +% +%<*ja> +\paragraph{欧文フォントファミリとしての認識} +同様に,が和文フォントファミリとして認識されるかは以下の順序で決定される. +補助的に「欧文フォントファミリと既に認識された」ファミリのリスト$F_{\textrm{A}}$と, +「欧文フォントファミリではないと認識された」ファミリを格納したリスト$N_{\mathrm{A}}$を用いる. +% + +\begin{enumerate} +%<*en> +\item If the family~ has been listed in a list~$F_{\mathrm{A}}$, + is recognized as an alphabetic font family. +% +%<*ja> +\item ファミリがリスト$F_{\mathrm{A}}$に既に含まれていれば, + は欧文フォントファミリと認識される. +% +%<*en> +\item If the family~ has been listed in a list~$N_{\mathrm{A}}$, this means + that is not an alphabetic font family. +% +%<*ja> +\item ファミリがリスト$N_{\mathrm{A}}$に既に含まれていれば,それは + が欧文フォントファミリではないことを意味する. +% +%<*en> +\item If there exists an alphabetic font encoding such that the family~ has been + defined under it, is recognized as an alphabetic font family, and + to memorize this, is appended to the list~$F_{\mathrm{A}}$. +% +%<*ja> +\item ある欧文フォントエンコーディング下でファミリが定義されていれば, + は欧文フォントファミリと認識され,リスト$F_{\mathrm{A}}$にを追加することでこのことを記憶する. +% +%<*en> +\item Now \LuaTeX-ja looks whether there exists an alphabetic font encoding~ such that + a font definition named \texttt{.fd} (the file name is + all lowercase) exists. If so, current alphabetic font family will be changed to + ~(the font definition file won't be loaded here). + If not, current alphabetic font family won't be changed, and + is appended to the list~$N_{\mathrm{A}}$. +% +%<*ja> +\item 最終段階では,欧文エンコーディングで +フォント定義ファイル\texttt{.fd}(ファイル名は全て小文字)が存在するようなも + のがあるかどうかを調べる. +存在すれば,は欧文フォントファミリと認識される(フォント定義ファイルは読み込まれない). +存在しなければ,は欧文フォントファミリと認識されないので,リスト$N_{\mathrm{A}}$に + を追加してそのことを記憶する. +% +\end{enumerate} + +%<*en> +Also, each call of \cs{DeclareFontFamily} \emph{after} loading of \LuaTeX-ja makes +the second argument (family) is appended to the list~$F_{\mathrm{A}}$. +% +%<*ja> +また,\cs{DeclareFontFamily}が\LuaTeX-jaの読み込み後に実行された場合は, +第2引数(ファミリ名)が自動的に$F_{\mathrm{A}}$に追加される. +% + +%<*en> +The above order is very similar to \cs{fontfamily} in \pLaTeXe, but more complicated (clause~3.). +This is because \pLaTeXe\ is a \emph{format} however \LuaTeX-ja is not, +hence \LuaTeX-ja does not know calls of \cs{DeclareFontFamily} \emph{before} itself is +loaded. +% +%<*ja> +以上の方針は\pLaTeXe における \cs{fontfamily} にやはり類似しているが,3.が加わり若干複雑になっている. +それは\pLaTeXe がフォーマットであるのに対し\LuaTeX-jaはそうでないため, +\LuaTeX-jaは自身が読み込まれる前にどういう\cs{DeclareFontFamily}の呼び出しがあったか +把握できないからである. +% + +%\paragraph{Remarks} +%\paragraph{注意} +%<*en> +Of course, there is a case that is not recognized as a Japanese font family, nor +an alphabetic font family. +In this case, \LuaTeX-ja treats ``the argument is wrong'', so +set both current alphabetic and Japanese font family to , +to use the default family for font substitution. +% +%<*ja> +さて,引数によっては,「和文フォントファミリとも欧文フォントファミリも認識されなかった」 +という事態もあり得る. + この場合,引数は不正だった,ということになるので, +和文・欧文の両方のフォントファミリをに設定し,代用フォントが使われるに任せることにする. +% + + %<*en> \section{Addons} \LuaTeX-ja has several addon packages. @@ -5919,9 +6169,8 @@ the following ``font features'' specifications are allowed for the commands of Japanese version: % %<*ja> -\ref{ssec-fontspec}節で述べたように,この追加パッケージは\Pkg{fontspec} +\ref{ssec-fontspec}節で述べたように,この追加パッケージは\Pkg{fontspec}% パッケージで定義されているコマンドに対応する和文フォント用のコマンドを提供する. -\emph{以下に述べる和文版の命令の説明は \Pkg{fontspec}~v2.4 使用時にのみ当てはまる.} \Pkg{fontspec}パッケージで指定可能な各種font featureに加えて,和文版のコマンドには 以下の``font feature''を指定することができる: @@ -5966,14 +6215,14 @@ will not be embedded in the output PDF file. See Subsection~\ref{ssec-psft}. % \begin{figure}[!tb] -\begin{LTXexample} +\begin{LTXexample}[width=0.25\textwidth] \jfontspec[ - YokoFeatures={Color=007F00}, - TateFeatures={Color=00007F}, + YokoFeatures={Color=007F00}, TateFeatures={Color=00007F}, TateFont=KozGoPr6N-Regular ]{KozMinPr6N-Regular} -\hbox{\yoko 横組のテスト} -\hbox{\tate 縦組のテスト} +\hbox{\yoko 横組のテスト}\hbox{\tate 縦組のテスト} +\addjfontfeatures{Color=FF0000} +\hbox{\yoko 横組}\hbox{\tate 縦組} \end{LTXexample} %\caption{\texttt{TateFeatures} 等の使用例} %\caption{An example of \texttt{TateFeatures} etc.} @@ -5982,16 +6231,26 @@ will not be embedded in the output PDF file. See Subsection~\ref{ssec-psft}. \item[TateFeatures=\{\}\textrm{, }TateFont=] -% ... +%<*en> +The \texttt{TateFeatures} key specifies font features which are only turned~on in +vertical writing, such as \texttt{Style=VerticalKana}~(\texttt{vkna} feature). +Similarly, the \texttt{TateFont} key specifies the Japanese font which will be used only + in vertical writing. +A demonstrarion is shown in Figure~\ref{fig:yokotate-fontspec}. +% %<*ja> 縦組において使用されるフォントや,縦組においてのみ適用されるfeature達を 指定する.使用例は図\ref{fig:yokotate-fontspec}参照. % \item[YokoFeatures=\{\}] -% ... +%<*en> +The \texttt{YokoFeatures} key specifies font features which are only turned~on in +horizontal writing,. +A demonstrarion is shown in Figure~\ref{fig:yokotate-fontspec}. +% %<*ja> -横組においてのみ適用されるfeature達を +同様に,横組においてのみ適用されるfeature達を 指定する.使用例は図\ref{fig:yokotate-fontspec}参照. % @@ -6079,6 +6338,12 @@ BoldFeatures = { On the other hand, \texttt{YokoFeatures}, \texttt{TateFeatures} and \texttt{TateFont} keys can be specified in each list in the \texttt{AltFont} key. Also, one can specify \texttt{AltFont} inside \texttt{YokoFeatures},~\texttt{TateFeatures}. + +Note that features which are specified in \texttt{YokoFeatures}~and~\texttt{TateFeatures} +are always interpreted \emph{after} other ``direction-independent'' features. +This explains why \cs{addjfontfeatures} at~line~6 in~Figure~\ref{fig:yokotate-fontspec} +has no effect, because a color specification is already done in +\texttt{YokoFeatures}~and~\texttt{TateFeatures} keys. % %<*ja> \paragraph{\texttt{AltFont}, \texttt{YokoFeatures}, \texttt{TateFeatures} 等の制限} @@ -6107,6 +6372,12 @@ BoldFeatures = { \ \texttt{YokoFeatures},~\texttt{TateFeatures} 及び \texttt{TateFont} キーを 指定することは可能であり.また\ \texttt{YokoFeatures},~\texttt{TateFeatures} キーの 中身に \texttt{AltFont} を指定することができる. + +また,図\ref{fig:yokotate-fontspec}後半部では6行目の色の指定が効かず, +2行目で指定した\ \texttt{YokoFeatures},~\texttt{TateFeatures}\ による色の指定が有効になっ +たままである.これは\emph{\ \texttt{YokoFeatures},~\texttt{TateFeatures}\ によるfeature指定は +組方向に依存しないfeature指定より後に解釈される}からである. + % @@ -6141,16 +6412,24 @@ but please remind remarks below. % %<*ja> 文字コードが(16進で)の文字を出力する. -このコマンドは \verb+\char"+と似ているが,下の記述に注意すること.%" +このコマンドは \verb+\char"+と似ているが,下の注意を参照すること.%" % \end{cslist} %<*ja> -このパッケージは,\texttt{ajmacros.sty}(\Pkg{otf}パッケージ付属のマクロ集,井上浩一氏作)から -漢字コードをUTF8にしたり,plain \LuaTeX でも利用可能にするという -修正を加えた \texttt{luatexja-ajmacros.sty} も自動的に読み込む. -そのため,\texttt{ajmacros.sty} マクロ集にある \verb+\aj半角+ などのマクロもそのまま使用可能である. +このパッケージは,マクロ集 \texttt{luatexja-ajmacros.sty}\footnote{\Pkg{otf}パッケージ付属の井上浩一氏によるマクロ集 +\texttt{ajmacros.sty} に対して +漢字コードをUTF-8にしたり,plain \LuaTeX でも利用可能にするという +修正を加えたものである.}\ も自動的に読み込む. +\texttt{luatexja-ajmacros.sty} は, +そのため,\Pkg{luatexja-otf} を読みこめば \texttt{ajmacros.sty} マクロ集にある \cs{aj半角} などのマクロもそのまま使うことができる. % +%<*en> +This package automatically loads \texttt{luatexja-ajmacros.sty}, which is slightly +modified version of \texttt{ajmacros.sty}\footnote{Useful macros by iNOUE Koich!, for the +\Pkg{japanese-otf} package.}. +Hence one can use macros which sre defined in \texttt{ajmacros.sty}, such as~\cs{aj半角}. +% %\paragraph{Remarks} %\paragraph{注意} @@ -6580,7 +6859,7 @@ This commands typeset in LR-mode, in direction. If is positive, the width of the box becomes this . In this case, will be aligned \dots -\item[picture\textrm{environment}] +\item[picture\textrm{\ environment}] \item[\cs{rensuji}{[]}\{\}\textrm{, }\cs{rensujiskip}] @@ -6692,10 +6971,11 @@ The font index of current Japanese font for vertical direction. \attr{ltj@charclass} %<*en> -The character class of Japanese \textit{glyph\_node}. +The character class of a \textbf{JAchar}. This attribute is only set on a + \textit{glyph\_node} which contains a \textbf{JAchar}. % %<*ja> -和文文字の\textit{glyph\_node}の文字クラス. +\textbf{JAchar}の文字クラス.\textbf{JAchar}が格納された\textit{glyph\_node}でのみ使われる. % \attr{ltj@yablshift} @@ -7179,7 +7459,7 @@ as in \Pkg{luatexja-adjust}. %<*en> \paragraph{Setting parameters} -Figure~\ref{fig:setpar-def} shows the ``most outer'' definition of +Figure~\ref{fig:setpar-def} shows the \emph{most outer} definition of two commands, \cs{ltjsetparameter} and \cs{ltjglobalsetparameter}. Most important part is the last \cs{setkeys}, @@ -7519,7 +7799,7 @@ emits a space. \texttt{lstlisting}系環境などの日本語対応マクロを書かなくてすませるためのものである. しかしながら,\pTeX と完全に同じ挙動が実現できたわけではない. -次のように,和文文字の範囲を変更したちょうどその行においては挙動が異なる: +次のように,\textbf{JAchar}の範囲を変更したちょうどその行においては挙動が異なる: \begin{LTXexample} \fontspec[Ligatures=TeX]{TeX Gyre Termes} \ltjsetparameter{autoxspacing=false} @@ -7527,7 +7807,7 @@ emits a space. y\ltjsetparameter{jacharrange={+6}}zい u \end{LTXexample} -上ソース中の「あ」は欧文文字扱いであり. +上ソース中の「あ」は\textbf{ALchar}(欧文扱い)であり. ここで使用している欧文フォント\TeX\ Gyre Termesは「あ」を含まない. よって,出力に「あ」は現れないことは不思議ではない. それでも,\pTeX とまったく同じ挙動を示すならば,出力は @@ -7535,14 +7815,14 @@ u 上のように異なる挙動となっているが,それは以下の理由による: \begin{itemize} \item 3行目を \texttt{process\_input\_buffer} で処理する時点では, - 「あ」は和文文字扱いである.よって3行目は和文文字で終わることになり, + 「あ」は\textbf{JAchar}(和文扱い)である.よって3行目は\textbf{JAchar}で終わることになり, コメント文字 \texttt{U+FFFFF} が追加される. よって,直後の改行文字は無視されることになり,空白は入らない. \item 4行目を \texttt{process\_input\_buffer} で処理する時点では, - 「い」は欧文文字扱いである.よって4行目は欧文文字で終わることになり, + 「い」は\textbf{ALchar}である.よって4行目は\textbf{ALchar}で終わることになり, 直後の改行文字は空白に置き換わる. \end{itemize} -このため,トラブルを避けるために,和文文字の範囲を\cs{ltjsetparameter}で編集した場合, +このため,トラブルを避けるために,\textbf{JAchar}の範囲を\cs{ltjsetparameter}で編集した場合, その行はそこで改行するようにした方がいいだろう. % @@ -7707,11 +7987,11 @@ $\mathit{Np}.\mathit{id}$の意味を述べるとともに, 説明用に準備した概念であって,実際のLuaコード中にそのように書かれているわけではないことに注意. \begin{description} -\item[\textit{id\_jglyph}] 和文文字.\\ -$\mathit{Np}.\mathit{head}$, $\mathit{Np}.\mathit{tail}$は,その和文文字を表している +\item[\textit{id\_jglyph}] \textbf{JAchar}(和文文字).\\ +$\mathit{Np}.\mathit{head}$, $\mathit{Np}.\mathit{tail}$は,その\textbf{JAchar}を表している \textit{glyph\_node}そのものである. -\item[\textit{id\_glyph}] 和文文字を表していない\textit{glyph\_node}~$p$.\\ -多くの場合,$p$は欧文文字を格納しているが,「ffi」などの合字によって作られた +\item[\textit{id\_glyph}] \textbf{JAchar}(和文文字)以外のものを表す\textit{glyph\_node}~$p$.\\ +多くの場合,$p$は\textbf{ALchar}(欧文文字)を格納しているが,「ffi」などの合字によって作られた \textit{glyph\_node}である可能性もある. 前者の場合,$\mathit{Np}.\mathit{head}$,~$\mathit{Np}.\mathit{tail} = p$である. 一方,後者の場合, @@ -7763,15 +8043,15 @@ $\mathit{Np}.\mathit{head}$, $\mathit{Np}.\mathit{tail}$の算出は, 空白等の実際の挿入を行うことは前に書いたが,ここでの説明では,問題にしているクラスタ\textit{Np}は「後ろ側」のクラスタである とする.「前側」のクラスタについては,以下の説明で\textit{head}が\textit{last}に置き換わることに注意すること. \begin{description} -\item[和文A] リスト中に直接出現している和文文字. +\item[和文A] リスト中に直接出現している\textbf{JAchar}. \textit{id}が\textit{id\_jglyph}であるか,\\ \textit{id}が\textit{id\_pbox}であって$\mathit{Np}.\mathit{head}$が\textbf{JAchar}であるとき. -\item[和文B] リスト中のhboxの中身の先頭として出現した和文文字.和文Aとの違いは,これの前に +\item[和文B] リスト中のhboxの中身の先頭として出現した\textbf{JAchar}.和文Aとの違いは,これの前に JFMグルーの挿入が行われない(\Param{xkanjiskip},~\Param{kanjiskip}は入り得る)ことである.\\ \textit{id}が\textit{id\_hlist}か\textit{id\_disc}であって$\mathit{Np}.\mathit{head}$が\textbf{JAchar}であるとき. -\item[欧文] リスト中に直接/hboxの中身として出現している欧文文字.次の3つの場合が該当: +\item[欧文] リスト中に直接/hboxの中身として出現している「\textbf{JAchar}以外の文字」.次の3つの場合が該当: \begin{itemize} \item \textit{id}が\textit{id\_glyph}である. \item \textit{id}が\textit{id\_math}である. @@ -7819,7 +8099,7 @@ $g$は「文字コード \texttt{'boxbdd'} の文字」と\textit{Np}の間に 一方.前者(段落)の場合は,リストの末尾は常に \cs{penalty10000} と, \cs{parfillskip} 由来のグルーが存在する.%よって,最後のクラスタ\textit{Np}は %この \cs{parfillskip} 由来のグルーとなり,実質的な中身の最後はその1つ前のクラスタ\textit{Nq}となる. -段落の最後の「通常の和文文字${}+{}$句点」が独立した行となるのを防ぐために, +段落の最後の「通常の\textbf{JAchar}${}+{}$句点」が独立した行となるのを防ぐために, \Param{jcharwidowpenalty}の値の分だけ適切な場所のペナルティを増やす. ペナルティ量を増やす場所は,\textit{head}が\textbf{JAchar}であり, @@ -7854,7 +8134,7 @@ $g$は「文字コード \texttt{'boxbdd'} の文字」と\textit{Np}の間に この場合が全ての場合の基本となる. \paragraph{「右空白」の算出} -まず,「右空白」にあたる量を算出する.通常はこれが,隣り合った2つの和文文字間に入る空白量となる. +まず,「右空白」にあたる量を算出する.通常はこれが,隣り合った2つの\textbf{JAchar}間に入る空白量となる. \begin{description} \item[JFM由来{[M]}] JFMの文字クラス指定によって入る空白を以下によって求める.この段階で空白量が未定義(未指定)だった場合, デフォルト値\Param{kanjiskip}を採用することとなるので,次へ. @@ -7933,14 +8213,14 @@ $q$と$r$の間は(実フォントが同じなのに)\texttt{jfmvar} キー \item[\Param{kanjiskip}~{[K]}] 上の[M]において空白が定まらなかった場合, 以下で定めた量「右空白」として採用する. この段階においては,\cs{inhibitglue} は効力を持たないため, -結果として,2つの和文文字間には常に何らかのグルー/カーンが挿入されることとなる. +結果として,2つの\textbf{JAchar}間には常に何らかのグルー/カーンが挿入されることとなる. \begin{enumerate} \item 両クラスタ(厳密には$\mathit{Nq}.\mathit{tail}$,$\mathit{Np}.\mathit{head}$)の中身の文字コードに対する \Param{autospacing}パラメタが両方ともfalseだった場合は,長さ0のglueとする. \item ユーザ側から見た\Param{kanjiskip}パラメタの自然長が$\cs{maxdimen}=(2^{30}-1)\,{\rm sp}$で なければ,\Param{kanjiskip}パラメタの値を持つglueを採用する. \item 2.でない場合は,\textit{Nq}, \textit{Np}で使われているJFMに指定されている\Param{kanjiskip}の値を用いる. -どちらか片方のクラスタだけが和文文字(\textsf{和文A}・\textsf{和文B})のときは,そちらのクラスタで使われている +どちらか片方のクラスタだけが\textbf{JAchar}(\textsf{和文A}・\textsf{和文B})のときは,そちらのクラスタで使われている JFM由来の値だけを用いる.もし両者で使われているJFMが異なった場合は,上の[M]~3.と同様の方法を用いて調整する. \end{enumerate} \end{description} @@ -8062,7 +8342,7 @@ If this attempt fails, \LuaTeX-ja use the method ``\textsf{\Param{kanjiskip}~[K] \item 禁則用ペナルティも,以前述べた\textsf{P-normal~[PN]}と同じである. \end{itemize} \begin{description} -\item[Boundary-B~{[\OB]}] 和文文字と「和文でないもの」との間に入る空白を以下によって求め, +\item[Boundary-B~{[\OB]}] \textbf{JAchar}と「\textbf{JAchar}でないもの」との間に入る空白を以下によって求め, 未定義でなければそれを「右空白」として採用する. \textsf{JFM-origin~[M]}の変種と考えて良い. これによって定まる空白の典型例は,和文の閉じ括弧と欧文文字の間に入る半角アキである. @@ -8102,7 +8382,7 @@ If this attempt fails, \LuaTeX-ja use the method ``\textsf{\Param{kanjiskip}~[K] \item 禁則用ペナルティは,以前述べた\textsf{P-normal~[PN]}と同じである. \end{itemize} \begin{description} -\item[Boundary-A~{[\OA]}] 「和文でないもの」と和文文字との間に入る空白を以下によって求め, +\item[Boundary-A~{[\OA]}] 「\textbf{JAchar}でないもの」と\textbf{JAchar}との間に入る空白を以下によって求め, 未定義でなければそれを「右空白」として採用する. \textsf{JFM-origin~[M]}の変種と考えて良い. これによって定まる空白の典型例は,欧文文字と和文の開き括弧との間に入る半角アキである. @@ -8187,7 +8467,7 @@ $\mathit{Nq}.\mathit{tail}$は無意味なので, \paragraph{和文Aと和文Bの違い} 先に述べたように,\textsf{和文B}はhboxの中身の先頭(or 末尾)として出現している -和文文字である.リスト内に直接ノードとして現れている和文文字(\textsf{和文A})との違いは, +\textbf{JAchar}である.リスト内に直接ノードとして現れている\textbf{JAchar}(\textsf{和文A})との違いは, \begin{itemize} \item \textsf{和文B}に対しては,JFMの文字クラス指定から定まる空白 \textsf{JFM-origin~[M]},\textsf{Boundary-A~[\OA]},\textsf{Boundary-B~[\OB]})の挿入は行われない. @@ -8234,10 +8514,10 @@ $\mathit{Nq}.\mathit{tail}$は無意味なので, 仮想ボディの高さ$h$,深さ$d$については \begin{description} \catcode`\<=12\catcode`\>=12 - \item[$\texttt{yoffset}\geq 0$のとき] -$h = \max(\texttt{height} + \texttt{yoffset}, 0)$, -$d = \max(\texttt{depth} - \texttt{yoffset}, 0)$, - \item[$\texttt{yoffset}<0$のとき] + \item[$\texttt{yoffset}\geq 0$のとき] +$h = \max(\texttt{height} + \texttt{yoffset}, 0)$, +$d = \max(\texttt{depth} - \texttt{yoffset}, 0)$, + \item[$\texttt{yoffset}<0$のとき] $h = \max(\texttt{height} + \texttt{yoffset}, 0)$, $d=\texttt{depth}$. \end{description} という仕様になっている.つまり,\texttt{yoffset} が負(グリフを下ける)の場合に深さは増加しな @@ -8279,7 +8559,7 @@ $h = \max(\texttt{height} + \texttt{yoffset}, 0)$, $d=\texttt{depth}$. \end{itemize} という状況で組んだ場合を例にとって説明しよう. -\LuaTeX・\Pkg{luaotfload}によるカーニング・ハイフネーションが終わった段階では, +\LuaTeX・\Pkg{luaotfload}によるカーニング・ハイフネーションが終わった段階では,…… @@ -8379,9 +8659,9 @@ instead of ``\verb+\ほげ+''. %<*en> \paragraph{Variation selectors} \Pkg{lltjp-listings} add two keys, namely \texttt{vsraw}~and~\texttt{vscmd}, -which specify how variation selectors are treated in +which specify how variation selectors are treated in \texttt{lstlisting} or other enviroments. -Note that these additional keys are not usable in the preamble, +Note that these additional keys are not usable in the preamble, since \Pkg{lltjp-listings} is loaded at \verb+\begin{document}+. \texttt{vsraw} is a key which takes a boolean value, and its default value is @@ -8409,7 +8689,7 @@ variation selectors are ``combined'' with the previous character. \end{lstlisting} \end{LTXexample} %<*en> -\item If the \texttt{vsraw} key is false, then +\item If the \texttt{vsraw} key is false, then variation selectors are typeset by an appropriate command, which is specified by the \texttt{vscmd} key. The default setting of the \texttt{vscmd} key produces the following. @@ -8746,7 +9026,7 @@ JFM中にある文字クラス$n$の定義の \item \Param{kanjiskip} \end{enumerate} \begin{enumerate} - \item 行末の和文文字を移動したことで$\textit{total}=0$となれば, + \item 行末の\textbf{JAchar}を移動したことで$\textit{total}=0$となれば, 調整の必要はなく,行が格納されているhboxの \texttt{glue\_set}, \texttt{glue\_sign}, \texttt{glue\_order}を再計算すればよい. 以降,$\textit{total}\neq 0$と仮定する. @@ -8919,7 +9199,7 @@ as in Page~\pageref{para-cid}. This file stores the table which stores the following. \begin{itemize} \item unicode variants in a font ``\texttt{***}'' - \item vertical width of glyphs, if it is not equal to the sum of + \item vertical width of glyphs, if it is not equal to the sum of the height of ascender and the depth of descender \item vertical variants \end{itemize} @@ -9122,7 +9402,7 @@ direction whatsitはあくまでも組方向処理のための補助的なノー \[ \xymatrix{ {}\Node{glyph}{`平'}\ar[r]&{}\Node{glyph}{`成'}\ar[r]& - {}\HNode{hlist}{10.00003}{3.02779}{0.0}\ar[r]\ar[d]^{\text{中身}}&{}\Node{glyph}{`年'}\\ + {}\HNode{hbox}{10.00003}{3.02779}{0.0}\ar[r]\ar[d]^{\text{中身}}&{}\Node{glyph}{`年'}\\ &&{}\Node{whatsit}{\cs{tate}}\ar[r]&{}\Node{glyph}{`2'}\ar[r]&{}\Node{glyph}{`6'} } \] @@ -9136,10 +9416,10 @@ direction whatsitはあくまでも組方向処理のための補助的なノー &{}\textcolor{blue}{\Node{penalty}{0}} \ar`r[d] `[l] `[ddll] `[dl] [dl] \\ - &&{}\textcolor{red}{\HNode{hlist}{3.02779}{10.00003}{0.0}}\ar[r]\ar[d]^{\text{中身}} + &&{}\textcolor{red}{\HNode{\textit{dir\_box} (\cs{yoko})}{3.02779}{10.00003}{0.0}}\ar[r]\ar[d]^{\text{中身}} &{}\textcolor{blue}{\Node{penalty}{0}}\ar[r] &{}\Node{glyph}{`年'}\\ - &&{}\HNode{\textit{dir\_box} (\cs{yoko})}{10.00003}{3.02779}{0.0}\ar[d]^{\text{中身}}\\ + &&{}\HNode{hbox}{10.00003}{3.02779}{0.0}\ar[d]^{\text{中身}}\\ &&{}\Node{whatsit}{\cs{tate}}\ar[r]&{}\Node{glyph}{`2'}\ar[r]&{}\Node{glyph}{`6'} } \] @@ -9253,7 +9533,7 @@ direction~whatsit内部のノードリストに,\textit{dir\_box}として格 {}\Node{whatsit}{\cs{dtou}}\ar[r]& {}\Node{glyph}{`a'}\ar[r]& {}\textcolor{red}{\HNode{\textit{dir\_box} (\cs{dtou})}{20.0}{9.0}{0.0}}\ar[d]_{\text{中身}}\\ - &&{}\HNode{hlist}{9.0}{5.0}{2.0}\ar[d]_{\text{中身}}\\ + &&{}\HNode{hbox}{9.0}{5.0}{2.0}\ar[d]_{\text{中身}}\\ &&{}\Node{whatsit}{\cs{yoko}}\ar[r]&{}\Node{rule}{} } \] @@ -9275,7 +9555,7 @@ TUG 2013, October 2013. \bibitem{jlisting} Thor Watanabe. \newblock Listings\ -\ MyTeXpert. %\newblock %\\\null\hfill -\url{http://mytexpert.sourceforge.jp/index.php?Listings} +\url{http://mytexpert.osdn.jp/index.php?Listings} \bibitem{jlreq} W3C Japanese Layout Task Force~(ed). \newblock Requirements for Japanese Text Layout (W3C Working Group Note), 2011, 2012. \newblock \url{http://www.w3.org/TR/jlreq/}%