diff options
author | Karl Berry <karl@freefriends.org> | 2015-09-06 23:21:08 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2015-09-06 23:21:08 +0000 |
commit | 63418fbbd680a1772e0c63b5043ae52de45e6e47 (patch) | |
tree | ed8310b4c6c06617ff889f6d1ca6312e4c967337 /Master/texmf-dist | |
parent | 1d472d214213c24b5cd6fc136a8834c121ebf922 (diff) |
luatexja (6sep15)
git-svn-id: svn://tug.org/texlive/trunk@38309 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist')
39 files changed, 783 insertions, 452 deletions
diff --git a/Master/texmf-dist/doc/luatex/luatexja/README b/Master/texmf-dist/doc/luatex/luatexja/README index 41db8ab0593..7a41ed61878 100644 --- a/Master/texmf-dist/doc/luatex/luatexja/README +++ b/Master/texmf-dist/doc/luatex/luatexja/README @@ -1,4 +1,4 @@ -The LuaTeX-ja Package 20150518.0 +The LuaTeX-ja Package 20150906.0 -------------------------------- Copyright (c) 2011--2015 The LuaTeX-ja project License: modified BSD (see COPYING) @@ -34,9 +34,9 @@ Installation 2. If you must/want to install manually: a. Download the source archive from CTAN, - or tagged as 20150518.0 in the Git repository by + or tagged as 20150906.0 in the Git repository by <http://git.osdn.jp/view?p=luatex-ja/luatexja.git - ;a=snapshot;h=refs/tags/20150518.0;sf=tgz> + ;a=snapshot;h=refs/tags/20150906.0;sf=tgz> b. Extract the archive and process following three files by LuaLaTeX to generate classes for Japanese typesetting: @@ -81,4 +81,4 @@ Notes * src/*.{ins.dtx} and src/ltj-kinsoku_make.tex are not needed in regular use. -Last commit date: Mon May 18 18:40:28 2015 +0900 +Last commit date: Sun Sep 6 07:23:14 2015 +0900 diff --git a/Master/texmf-dist/doc/luatex/luatexja/ltjsclasses.pdf b/Master/texmf-dist/doc/luatex/luatexja/ltjsclasses.pdf Binary files differindex 4b7241b4fb4..031a168f10d 100644 --- a/Master/texmf-dist/doc/luatex/luatexja/ltjsclasses.pdf +++ b/Master/texmf-dist/doc/luatex/luatexja/ltjsclasses.pdf diff --git a/Master/texmf-dist/doc/luatex/luatexja/luatexja-en.pdf b/Master/texmf-dist/doc/luatex/luatexja/luatexja-en.pdf Binary files differindex 2cafee0b9c3..9a3f30149a2 100644 --- a/Master/texmf-dist/doc/luatex/luatexja/luatexja-en.pdf +++ b/Master/texmf-dist/doc/luatex/luatexja/luatexja-en.pdf diff --git a/Master/texmf-dist/doc/luatex/luatexja/luatexja-ja.pdf b/Master/texmf-dist/doc/luatex/luatexja/luatexja-ja.pdf Binary files differindex 7516f0ee2cf..13139cdb093 100644 --- a/Master/texmf-dist/doc/luatex/luatexja/luatexja-ja.pdf +++ b/Master/texmf-dist/doc/luatex/luatexja/luatexja-ja.pdf diff --git a/Master/texmf-dist/doc/luatex/luatexja/luatexja-ruby.pdf b/Master/texmf-dist/doc/luatex/luatexja/luatexja-ruby.pdf Binary files differindex aee015b9256..d3904f315ca 100644 --- a/Master/texmf-dist/doc/luatex/luatexja/luatexja-ruby.pdf +++ b/Master/texmf-dist/doc/luatex/luatexja/luatexja-ruby.pdf diff --git a/Master/texmf-dist/doc/luatex/luatexja/luatexja-ruby.tex b/Master/texmf-dist/doc/luatex/luatexja/luatexja-ruby.tex index 86167b031c4..4d4be4f4f11 100644 --- a/Master/texmf-dist/doc/luatex/luatexja/luatexja-ruby.tex +++ b/Master/texmf-dist/doc/luatex/luatexja/luatexja-ruby.tex @@ -10,7 +10,7 @@ \usepackage[textwidth=45\zw, lines=45, footskip=6mm]{geometry} \advance\leftmargini-1\zw\advance\leftmarginii-1\zw - +\protected\def\Param#1{\underline{\smash{\textsf{\mdseries #1}}}} \usepackage{luatexja-ruby,showexpl,booktabs} \lstset{ @@ -37,7 +37,7 @@ \DeclareFontShape{JY3}{mc}{mc}{n}{<-> [0.92487] KozMinPr6N-Regular:extend=0.67;jfm=ujisc33}{} -\title{\texttt{luatexja-ruby.sty}} +\title{\textsf{luatexja-ruby}パッケージ} \begin{document} \catcode`\<=13 \def<#1>{{\normalfont\rm\itshape$\langle$#1\/$\rangle$}} @@ -46,7 +46,7 @@ \maketitle \begin{abstract} -\texttt{luatexja-ruby.sty} は,\LuaTeX-jaの機能を利用してルビの組版処理を行う追加パッケージである. +\textsf{luatexja-ruby}パッケージは,\LuaTeX-jaの機能を利用してルビの組版処理を行う追加パッケージである. \LuaTeX, \LuaTeX-jaの内部処理に割り込むことにより,熟語ルビ中の行分割や, 行頭形・行中形・行末形の自動検出,また進入許容量の自動設定などを可能とした. \end{abstract} @@ -62,7 +62,7 @@ plain \LuaTeX でのロードはまだサポートしておらず, \subsection{\ltjruby{用|語}{よう|ご}} 「進入(intrusion)」「突出(protrusion)」という用語は, -\href{http://zrbabbler.sp.land.to/pxrubrica.html}{\texttt{pxrubrica}\ パッケージ}% +\href{http://zrbabbler.sp.land.to/pxrubrica.html}{\textsf{pxrubrica}パッケージ}% での用法に準ずる. \begin{quotation} @@ -194,7 +194,7 @@ plain \LuaTeX でのロードはまだサポートしておらず, このキーの指定では最後に\ \verb+\selectfont+ を加える必要はない. この \texttt{fontcmd} キーの内容は多くの回数実行される. -例えば,\texttt{luatexja-fontspec}パッケージを用いてOpenTypeフォントを用いる場合, +例えば,\textsf{luatexja-fontspec}パッケージを用いてOpenTypeフォントを用いる場合, \begin{lstlisting} fontcmd=\addjfontfeatures{Style=Ruby} \end{lstlisting} @@ -220,7 +220,7 @@ mode=9, stretch={1}{2}{1}, stretchruby={0}{0}{1} \end{description} \paragraph{\tt\textbackslash ltjsetruby\{<option>\}} -<option>の既定値を指定する.\texttt{luatexja-ruby} 読み込み時の値は +<option>の既定値を指定する.\textsf{luatexja-ruby}読み込み時の値は 各項目の所で既に説明してあるが,次のようになっている. \begin{verbatim} pre=-1, post=-1, mode=1, @@ -232,19 +232,19 @@ mode=9, stretch={1}{2}{1}, stretchruby={0}{0}{1} \paragraph{\texttt{\textbackslash ltjsetparamater} に追加されるキー} \begin{description} -\item[\textsf{\mdseries rubypreintrusion}\tt =\{<chr\_code>, <pre\_int>\}] +\item[\Param{rubypreintrusion}\tt =\{<chr\_code>, <pre\_int>\}] 文字<chr\_code> に,その\textbf{直後}のルビによって掛けられるルビ文字列の最大長をルビ全角単位で指定. -\item[\textsf{\mdseries rubypostintrusion}\tt =\{<chr\_code>, <post\_int>\}] +\item[\Param{rubypostintrusion}\tt =\{<chr\_code>, <post\_int>\}] 文字<chr\_code> に,その\textbf{直前}のルビによって掛けられるルビ文字列の最大長をルビ全角単位で指定. \end{description} -既定値は,\textsf{rubypreintrusion},~\textsf{rubypostintrusion}とも +既定値は,\Param{rubypreintrusion},~\Param{rubypostintrusion}とも 以下の文字に対しては1,その他の文字については0である: \begin{quote} 平仮名(\texttt{U+3040}--\texttt{U+309F}),カギ括弧「」,読点「,」「、」,中黒「・」 \end{quote} また,ここでは「文字コード$-1$の文字」は,「段落開始の \verb+\parindent+」を表す% \footnote{通常の\LuaTeX-jaにおける指定では文中数式境界を表していることに注意.}. -この「文字」に対する\textsf{rubypreintrusion}の値も1である. +この「文字」に対する\Param{rubypreintrusion}の値も1である. \paragraph{\texttt{\textbackslash ltjkenten}} 圏点を出力する命令で,\verb+\kenten+ という別名を定義している. @@ -376,7 +376,7 @@ auxファイルに保存する際,各 \verb+\ltjruby+ 命令の呼び出しを 同様に,段落先頭のルビは行頭形にはならない. \texttt{pre}が負(つまり,自動指定)のとき,段落最初の \verb+\parindent+ 部分への 進入は可能である.\verb+\parindent+ 部分への進入許容量は -「文字$-1$」に対する\textsf{rubypreintrusion}(既定値は1,ルビ全角単位)と +「文字$-1$」に対する\Param{rubypreintrusion}(既定値は1,ルビ全角単位)と \ \verb+\parindent+ の長さのうち小さい方である. \begin{LTXexample}[preset=\Large,width=0.4\textwidth] \parindent1\zw\noindent 012345\par diff --git a/Master/texmf-dist/doc/luatex/luatexja/luatexja.dtx b/Master/texmf-dist/doc/luatex/luatexja/luatexja.dtx index b95b4d60b97..16bb3972dae 100644 --- a/Master/texmf-dist/doc/luatex/luatexja/luatexja.dtx +++ b/Master/texmf-dist/doc/luatex/luatexja/luatexja.dtx @@ -17,7 +17,7 @@ %%%%%%%% \directlua{if jit then jit.on() end} -\usepackage{amsmath,array,tikz,pict2e,multienum,float} +\usepackage{metalogo,amsmath,array,tikz,pict2e,multienum,float} \usepackage{booktabs,multicol,luatexja-ruby} \usepackage[all]{xy} \usepackage{lltjext,alltt} @@ -35,6 +35,8 @@ \setmonojfont{KozGoPr6N-Regular.otf} \setmathfont[Scale=MatchLowercase]{xits-math.otf} \setsansfont[Scale=MatchLowercase,Ligatures=TeX]{Linux Biolinum O} + +\setLaTeXa{\scshape a} %<*ja> \def\emph#1{\textbf{\textgt{#1}}} \def\headfont{\normalfont\bfseries\gtfamily}\normalsize @@ -44,6 +46,7 @@ \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}% @@ -77,6 +80,7 @@ explpreset={numberstyle=\tiny, numbers=left, numbersep=1em, columns=fixed} } % Suppress output from showexpl to stdout. +\makeatletter \let\SX@Info\relax %%%%%%%% colors @@ -156,7 +160,8 @@ \vskip\belowcaptionskip} \def\_{\leavevmode \kern .06em\vbox {\hrule \@width .333em}} -\def\cs#1{\texttt{\upshape\textbackslash\ltjsetparameter{autoxspacing=false}#1}} +\def\cs#1{\texttt{\upshape + \texorpdfstring{\textbackslash\ltjsetparameter{autoxspacing=false}#1}{\textbackslash#1}}} %%%%%%%% \makeatother @@ -169,9 +174,9 @@ width:\hfill\ #2\cr height:\hfill\ #3\cr depth:\hfill\ #4\cr }}}}}\,} -\protected\def\Param#1{\hyperlink{fld:#1}{\textsf{#1}}} % parameter name -\protected\def\DParam#1{\hypertarget{fld:#1}{\textsf{#1}}} % parameter name (definition) -\protected\def\Pkg#1{\underline{\smash{\texttt{#1}}}} % packages/classes +\protected\def\Param#1{\hyperlink{fld:#1}{\underline{\smash{\textsf{#1}}}}} % parameter name +\protected\def\DParam#1{\hypertarget{fld:#1}{\underline{\smash{\textsf{#1}}}}} % parameter name (definition) +\protected\def\Pkg#1{\textsf{#1}} % packages/classes \begin{document} @@ -268,7 +273,7 @@ scripts for appropriate callbacks. が始まったパッケージである. %</ja> -%<en>\subsection{Major Changes from \pTeX} +%<en>\subsection{Major changes from \pTeX} %<ja>\subsection{\pTeX からの主な変更点} \label{ssec:chgptex} @@ -328,8 +333,8 @@ 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. %</en> %<*ja> -特に注意してほしいのは,\pTeX で追加された \texttt{zw} と \texttt{zh} という単位を -\LuaTeX-ja で扱うには,\cs{zw}, \cs{zh} と制御綴の形にしないといけないという点である. +特に注意してほしいのは,\pTeX で追加された \texttt{zw} と \texttt{zh} という単位は +\LuaTeX-ja では使用できず,\cs{zw}, \cs{zh} と制御綴の形にしないといけないという点である. %</ja> %<*en> @@ -349,7 +354,6 @@ In \pTeX, a line break after Japanese character is ignored (and %</ja> %<*en> - \paragraph{Spaces related to Japanese characters} The insertion process of glues/kerns between two Japanese characters and between a Japanese character and other characters @@ -418,17 +422,19 @@ The insertion process of glues/kerns between two Japanese %<*en> \paragraph{Directions} -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. ... +From version~20150420.0, \LuaTeX-ja supports vertical writing. +We implement this feature by using callbacks of \LuaTeX; so it must \emph{not} be confused +with $\Omega$-style direction support of \LuaTeX\ itself. +Due to implementation, the dimension returned by \cs{wd},~\cs{ht}, or~\cs{dp} depends +on the content of the register \emph{only}. This is major difference with \pTeX. %</en> %<*ja> \paragraph{組方向} 20150420.0版からは,不安定ながらも\LuaTeX-ja における縦組みをサポートしている. -なお,\LuaTeX 本体も,$\Omega$流の組方向をサポートしているが,それとは全くの別物であること +なお,\LuaTeX 本体も$\Omega$流の組方向をサポートしているが,それとは全くの別物であること に注意してほしい. -\LuaTeX のコールバックや実装により,特に異なった組方向のボックスを扱う場合には -\cs{wd}, \cs{ht}, \cs{dp}等の仕様が異なるので注意.詳細は第\ref{sec-direction}章を参照. +特に,異なった組方向のボックスを扱う場合には +\cs{wd}, \cs{ht}, \cs{dp}等の仕様が\pTeX と異なるので注意.詳細は第\ref{sec-direction}章を参照. %</ja> %<*en> @@ -442,7 +448,35 @@ Japanese characters in discretionary break (\cs{discretionary}) is not supported しても使いたい場合は \cs{hbox} で括ること. %</ja> +%<*en> +\paragraph{Greek and Cyrillic letters, and ISO~8859-1 symbols} +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}. +From this version, characters which belongs both ISO~8859-1 and JIS~X~0208, + such as \P~and~\S, are now typeset in alphabetic fonts. This means that + without the \cs{fontspec} (and~\Pkg{luatexja-fontspec}) package, these characters are not typeset correctly. +%</en> +%<*ja> +\paragraph{ギリシャ文字・キリル文字とISO~8859-1の記号} +標準では,\LuaTeX-jaはギリシャ文字やキリル文字を和文フォントを使っ + て組む.ギリシャ語などを本格的に組むなどこの状況が望ましくない場合, + プリアンブルに +\begin{lstlisting} + \ltjsetparameter{jacharrange={-2,-3}} +\end{lstlisting} + を入れると + 上記種類の文字は欧文フォントを用いて組まれるようになる. + 詳しい説明は\ref{ssec-setrange}節を参照してほしい. + +また,\P,~\S といったISO~8859-1の上位領域とJIS~X~0208の共通部分の文字は + 本バージョンから標準で欧文扱いとなり,\emph{ソース中に直接記述しても + \Pkg{fontspec}パッケージ(および\Pkg{luatexja-fontspec}パッケージ)非読み込みの状態では出力されなくなった}. + 和文扱いで出力するには \verb+\ltjjachar`§+ のように \cs{ltjjachar} 命令 + を使えばよい. +%</ja> %<en>\subsection{Notations} %<ja>\subsection{用語と記法} @@ -486,21 +520,21 @@ and \emph{Japanese fonts} for fonts used in \textbf{JAchar}. \textbf{JAchar}の出力に用いられるフォントを\emph{和文フォント}と呼ぶ. %</ja> %<*en> -\item A word in a sans-serif font (like \Param{prebreakpenalty}) +\item A word in a sans-serif font with underline (like \Param{prebreakpenalty}) means an internal parameter for Japanese typesetting, and it is used as a key in \cs{ltjsetparameter} command. %</en> %<*ja> -\item サンセリフ体で書かれた語(例:\Param{prebreakpenalty})は日本語組版用の +\item 下線つきローマン体で書かれた語(例:\Param{prebreakpenalty})は日本語組版用の パラメータを表し,これらは \cs{ltjsetparameter} 命令のキーとして 用いられる. %</ja> %<*en> -\item A word in typewriter font with underline (like \Pkg{fontspec}) +\item A word in a sens-serif font without underline (like \Pkg{fontspec}) means a package or a class of \LaTeX. %</en> %<*ja> -\item 下線付きタイプライタ体の語(例:\Pkg{fontspec})は\LaTeX の +\item 下線なしサンセリフ体の語(例:\Pkg{fontspec})は\LaTeX の パッケージやクラスを表す. %</ja> %<*en> @@ -512,7 +546,7 @@ and \emph{Japanese fonts} for fonts used in \textbf{JAchar}. %</ja> \end{itemize} -%<en>\subsection{About the Project} +%<en>\subsection{About the project} %<ja>\subsection{プロジェクトについて} %<en>\paragraph{Project Wiki} Project Wiki is under construction. @@ -650,13 +684,13 @@ the forefront of development is not the \texttt{master} branch. \begin{lstlisting} $ git clone git://git.osdn.jp/gitroot/luatex-ja/luatexja.git \end{lstlisting} -\item \texttt{master}ブランチのスナップショット(\texttt{tar.gz}形式)をダウンロードする. +\item \texttt{master} ブランチのスナップショット(\texttt{tar.gz} 形式)をダウンロードする. \begin{flushleft} \url{http://git.osdn.jp/view?p=luatex-ja/luatexja.git;a=snapshot;h=HEAD;sf=tgz}. \end{flushleft} \end{itemize} -\texttt{master}ブランチ(従って,CTAN内のアーカイブも)はたまにしか更新されないことに注意. -主な開発は\texttt{master}の外で行われ,比較的まとまってきたらそれを\texttt{master}に +\texttt{master} ブランチ(従って,CTAN内のアーカイブも)はたまにしか更新されないことに注意. +主な開発は\texttt{master}の外で行われ,比較的まとまってきたらそれを \texttt{master} に 反映させることにしている. %</ja> @@ -666,8 +700,8 @@ But only the contents in \texttt{src/} are needed to work \LuaTeX-ja. %</en> %<*ja> \item 「Gitリポジトリをクローン」以外の方法でアーカイブを取得したならば,それを展開する. - \texttt{src/}をはじめとしたいくつかのディレクトリができるが, - 動作には\texttt{src/}以下の内容だけで十分. + \texttt{src/} をはじめとしたいくつかのディレクトリができるが, + 動作には \texttt{src/} 以下の内容だけで十分. %</ja> %<*en> @@ -707,7 +741,7 @@ $ luatex ltj-kinsoku_make.tex instead copying is also good. %</en> %<*ja> -\item \texttt{src}の中身を自分の\texttt{TEXMF}ツリーにコピーする. +\item \texttt{src} の中身を自分の \texttt{TEXMF} ツリーにコピーする. 場所の例としては,例えば \begin{quote} \texttt{TEXMF/tex/luatex/luatexja/} @@ -735,7 +769,7 @@ For changes from \pTeX, see Subsection~\ref{ssec:chgptex}. %</ja> \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. %</en> %<*ja> @@ -743,20 +777,6 @@ For changes from \pTeX, see Subsection~\ref{ssec:chgptex}. 従来日本語の文字コードとして用いられてきたEUC-JPやShift-JISは使用できない. %</ja> %<*en> -\item By default, \LuaTeX-ja uses Japanese fonts to typeset Greek and Cyrillic letters, - and some Unicode symbols such as \P~and~\S. To change this behavior, - put \lstinline!\ltjsetparameter{jacharrange={-2,-3,-8}}! in the preamble. - For the detailed description, see Subsection~\ref{ssec-setrange}. -%</en> -%<*ja> -\item -標準では,\LuaTeX-jaはギリシャ文字やキリル文字,それに\P や\S などの記号を和文フォントを使っ - て組む.ギリシャ語などを本格的に組むなどこの状況が望ましくない場合, - プリアンブルに \lstinline!\ltjsetparameter{jacharrange={-2,-3,-8}}! を入れると - 上記種類の文字は欧文フォントを用いて組まれるようになる. - 詳しい説明は\ref{ssec-setrange}節を参照してほしい. -%</ja> -%<*en> \item \LuaTeX-ja is very slower than \pTeX. Generally speaking, LuaJIT\TeX\ processes \LuaTeX-ja about 30\% faster than \LuaTeX, but not always. @@ -802,7 +822,7 @@ and finally delete the temporary directory. \href{https://osdn.jp/projects/luatex-ja/wiki/FrontPage%28en%29}{% プロジェクトWiki英語版トップページ}中に書かれているバッチファイルを 実行して欲しい.このバッチファイルは,作業用ディレクトリにCMap達を -コピーし,その中で\LuaTeX-ja の初回起動を行い,作業用ディレクトリを消す作業をしている. +コピーし,その中で\LuaTeX-jaの初回起動を行い,作業用ディレクトリを消す作業をしている. %</ja> \end{itemize} @@ -1019,7 +1039,7 @@ Okumura), namely, \Pkg{ltjclasses}\footnote{% しかしながら,上記の設定は日本語の文書にとって十分とは言えない. 日本語文書を組版するためには,\texttt{article.cls}, \texttt{book.cls}といった 欧文用のクラスファイルではなく,和文用のクラスファイルを用いた方がよい. -現時点では,\Pkg{jclasses}(\pLaTeX の標準クラス)と\Pkg{jsclasses} +現時点では,\Pkg{jclasses}(\pLaTeX の標準クラス)と\Pkg{jsclasses}% (奥村晴彦氏による「\pLaTeXe 新ドキュメントクラス」)に対応するものとして, \Pkg{ltjclasses}\footnote{% 横組用は \texttt{ltjarticle.cls},~\texttt{ltjbook.cls}, \texttt{ltjreport.cls} であり, @@ -1103,13 +1123,12 @@ For \LaTeXe, \LuaTeX-ja adopted most of the font selection system of \pLaTeXe\ ( %</ja> \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. %</en> %<*ja> -\item 和文フォントの属性を変更するには,\cs{fontfamily}, \cs{fontseries}, \cs{fontshape}, - そしてそれらを反映させるために \cs{selectfont} を用いればよい. +\item 和文フォントの属性を変更するには,\cs{fontfamily}, \cs{fontseries}, \cs{fontshape} を使用する. + もちろん,それらを実際に反映させるには手動で \cs{selectfont} を実行する必要がある. %</ja> %<*en> @@ -1170,14 +1189,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}: %</en> %<*ja> \item 和文フォントファミリの定義には \cs{DeclareFontFamily} の - 代わりに \cs{DeclareKanjiFamily} を用いる.しかし,現在の - 実装では \cs{DeclareFontFamily} を用いても問題は生じない. + 代わりに \cs{DeclareKanjiFamily} を用いる.以前の + 実装では \cs{DeclareFontFamily} を用いても問題は生じなかったが,現在の実装では + そうはいかない. \item 和文フォントのシェイプを定義するには,通常の \cs{DeclareFontShape} を使えば良い: %</ja> \begin{lstlisting} @@ -1251,12 +1272,12 @@ this chapter. For the method, please see Subsection~\ref{ssec-math}. 記述しない.この方法については\ref{ssec-math}節を参照のこと. %</ja> - -\subsection{fontspec} +%<en>\subsection{\Pkg{luatexja-fontspec} package} +%<ja>\subsection{\Pkg{luatexja-fontspec}パッケージ} \label{ssec-fontspec} %<*en> -To coexist with the \Pkg{fontspec} package, it is needed to load -the \Pkg{luatexja-fontspec} package in the preamble, as follows: +To use the functionality of the \Pkg{fontspec} package to Japanese fonts, +it is needed to load the \Pkg{luatexja-fontspec} package in the preamble, as follows: \begin{quote} \ttfamily \textbackslash usepackage[<options>]\{luatexja-fontspec\} \end{quote} @@ -1265,13 +1286,18 @@ automatically loads \Pkg{luatexja} and \Pkg{fontspec} packages, if needed. %</en> %<*ja> -\Pkg{fontspec}パッケージと同様の機能を和文フォントに対しても用いる場合, -\Pkg{luatexja-fontspec}パッケージを読み込めばよい. +\Pkg{fontspec}パッケージは,\LuaTeX・\XeTeX において +TrueType・OpenTypeフォントを容易に扱うためのパッケージであり,このパッケージを読み込んでお +けばUnicodeによる各種記号の直接入力もできるようになる. +\LuaTeX-jaでは和文と欧文を区別しているため,\Pkg{fontspec}パッケージの機能は欧文フォントに +対してのみ有効なものとなっている. + +\LuaTeX-ja上において,\Pkg{fontspec}パッケージと同様の機能を和文フォントに対しても用いる場 +合は\Pkg{luatexja-fontspec}パッケージを読み込む: \begin{quote} \ttfamily \textbackslash usepackage[<options>]\{luatexja-fontspec\} \end{quote} -このパッケージ -は必要ならば自動で\Pkg{luatexja}パッケージと\Pkg{fontspec}パッケージを読み込む. +このパッケージは自動で\Pkg{luatexja}パッケージと\Pkg{fontspec}パッケージを読み込む. %</ja> %<*en> @@ -1323,19 +1349,60 @@ alphabetic fonts \end{tabular} \end{center} %</ja> -%<*en> -The package option of \Pkg{luatexja-fontspec} are the followings: + +%<en> The package option of \Pkg{luatexja-fontspec} are the followings: +%<ja> \Pkg{luatexja-fontspec} パッケージのオプションは以下の通りである: \begin{cslist} \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. Note that \emph{\cs{setmonojfont} is defined if and only if this \texttt{\textup{match}} option is specified}. +%</en> + +%<*ja> +このオプションが指定されると,「\pLaTeXe 新ドキュメントクラス」のように\ +\cs{rmfamily}, \verb+\textrm{...}+, \cs{sffamily} 等が +欧文フォントだけでなく和文フォントも変更するようになる. + +\emph{なお,\cs{setmonojfont} はこの \texttt{match} オプションが +指定された時のみ定義される.}この命令は標準の「タイプライタ体に対応する和文フォント」を指定する. +%</ja> \item[pass=<opts>] -Specify options <opts> which will be passed to the \Pkg{fontspec} package. +%<en> \emph{(Obsoleted)}\ Specify options <opts> which will be passed to the \Pkg{fontspec} package. +%<ja> \Pkg{fontspec} パッケージに渡すオプション <opts> を指定する.本オプションは時代遅れである. + +\item[scale=<float>] +%<*en> +Override the ratio of the font size of Japanese fonts to that of alphabetic fonts. +The default value is calculated automatically (for~example, about~0.924865 when + the \Pkg{ltjsarticle} class is used). +%</en> +%<*ja> +欧文に対する和文の比率は,標準では \Pkg{luatexja-fontspec}読み込み時の和欧文比率から +自動計算される(例えば,\Pkg{ltjsarticle}クラス使用時には和文は欧文の約0.924865倍となる)が, +それを手動で上書きするときに使用する. +%</ja> \end{cslist} + +%<*en> +All other options listed above are simply passed to the \Pkg{fontspec} package. +This means that two lines below are equivalent, for example. +%</en> +%<*ja> +上記にないオプションは全て \Pkg{fontspec} パッケージに渡される. +例えば,下の2行は同じ意味になる: +%</ja> +\begin{lstlisting} +\usepackage[no-math]{fontspec}\usepackage{luatexja-fontspec} +\usepackage[no-math]{luatexja-fontspec} +\end{lstlisting} + + +%<*en> The reason that \cs{setmonojfont} is not defined by default is that it is popular for Japanese fonts that nearly all Japanese glyphs have same widths. Also note that kerning information in a font is not used @@ -1346,19 +1413,6 @@ This is because of the compatibility with previous versions of \LuaTeX-ja Below is an example of \cs{jfontspec}. %</en> %<*ja> -\Pkg{luatexja-fontspec} パッケージのオプションは以下の通りである: -\begin{cslist} - \item[match] -このオプションが指定されると,「\pLaTeXe 新ドキュメントクラス」のように\ -\cs{rmfamily}, \verb+\textrm{...}+, \cs{sffamily} 等が -欧文フォントだけでなく和文フォントも変更するようになる. - -\emph{なお,\cs{setmonojfont} はこの \texttt{match} オプションが -指定された時のみ定義される.}この命令は標準の「タイプライタ体に対応する和文フォント」を指定する. - - \item[pass=<opts>] -\Pkg{fontspec} パッケージに渡すオプション <opts> を指定する. -\end{cslist} 標準で \cs{setmonojfont} コマンドが定義されないのは, 和文フォントではほぼ全ての和文文字のグリフが等幅であるのが伝統的であったことによる. また,これらの和文用のコマンドではフォント内のペアカーニング情報は標準では使用されない, @@ -1375,21 +1429,39 @@ JIS~X~0213:2004→辻\par JIS~X~0208:1990→辻 \end{LTXexample} -%<en>\subsection{Presets} -%<ja>\subsection{プリセット設定} +%<en>\subsection{Presets of Japanese fonts} +%<ja>\subsection{和文フォントのプリセット設定} \label{ssec-preset} %<*en> -To use standard Japanese font settings easily, one can load the \Pkg{luatexja-preset} -package with several options. This package provides functions in a part of +One can load the \Pkg{luatexja-preset} +package to use several ``presets'' of Japanese fonts. +This package provides functions in a part of \Pkg{japanese-otf} package and a part of \Pkg{PXchfon} package by Takayuki Yato. + +One can specified other options other than listed in this subsection. +These are simply passed to the \Pkg{luatexja-fontspec}\footnote{if \texttt{nfssonly} option is +\emph{not} specified; in this case these options are simply ignored.}. +For example, the line~5 in below example is eqivalent to lines 1--3. %</en> %<*ja> よく使われている和文フォント設定を一行で指定できるようにしたのが \Pkg{luatexja-preset}パッケージである.このパッケージは, \Pkg{otf}パッケージの一部機能と八登崇之氏による\Pkg{PXchfon}パッケージの一部機能とを 合わせたような格好をしている. + +オプションとして,本節にないものも指定することができるが,それらは +\Pkg{luatexja-fontspec}パッケージに渡される\footnote{\texttt{nfssonly} オプションが +指定されていた場合は,\Pkg{luatexja-fontspec}パッケージは読み込まれないので単純に無視され +る.}.例えば,下の1--3行目は5行目のように一行にまとめることができる. %</ja> +\begin{lstlisting} +\usepackage[no-math]{fontspec} +\usepackage[match]{luatexja-fontspec} +\usepackage[kozuka-pr6n]{luatexja-preset} +%%-------- +\usepackage[no-math,match,kozuka-pr6n]{luatexja-preset} +\end{lstlisting} %<en>\paragraph{General options} %<ja>\paragraph{一般的なオプション} @@ -1402,7 +1474,7 @@ the \Pkg{luatexja-fontspec} package. This means that the \Pkg{fontspec} package automatically loaded by this package. \emph{This option is enabled by default.} -If you need to pass some options to \Pkg{fontspec}, load \Pkg{fontspec} manually +If you need to pass some options to \Pkg{fontspec}, you can load \Pkg{fontspec} manually before \Pkg{luatexja-preset}: %</en> %<*ja> @@ -1422,17 +1494,19 @@ before \Pkg{luatexja-preset}: \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. +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. -This option will be disabled when \Pkg{luatexja-fontspec} package is loaded. -Note that the \Pkg{fontspec} can coexist with the option as the following: +When this option is specified, \Pkg{fontspec}~and~\Pkg{luatexja-fontspec} are +\emph{not} loaded by default. Nevertheless, +the package\Pkg{fontspec} can coexist with the option, as the following: \begin{lstlisting} \usepackage{fontspec} \usepackage[hiragino-pron,nfssonly]{luatexja-preset} \end{lstlisting} -Note that the functionality of the \Pkg{luatexja-fontspec} package, such as - \cs{setmainjfont}, cannot be used in the example above. +In this case, one can use \cs{setmainfont} etc.\ to select \emph{alphabetic} fonts. %</en> %<*ja> \LaTeX 標準のフォント選択機構(NFSS2)を用いて @@ -1440,12 +1514,15 @@ Note that the functionality of the \Pkg{luatexja-fontspec} package, such as ションが指定された場合には \texttt{ltjpmg}(丸ゴシック)という 3つの和文フォントファミリを定義し,これらを用いる. -欧文フォントの指定で\Pkg{fontspec}パッケージを読み込んでいる場合でも +本オプション指定時には\Pkg{fontspec}・\Pkg{luatexja-fontspec}パッケージは +自動では読み込まれない,しかし, \begin{lstlisting} \usepackage{fontspec} \usepackage[hiragino-pron,nfssonly]{luatexja-preset} \end{lstlisting} -のようにこのオプションを指定することは可能である.一方, +のようにすれば,このオプションを指定すれば +欧文フォントを\Pkg{fontspec}パッケージの機能を使って指定することができる. +一方, パッケージ読み込み時に既に\Pkg{luatexja-fontspec}パッケージが読み込まれて いる場合は \texttt{nfssonly} オプションは無視される. %</ja> @@ -1583,8 +1660,6 @@ There is not rounded gothic family in Kozuka fonts. \end{tabular} \end{center} -%<ja>\newpage - \item[hiragino-pro] Hiragino Pro (Adobe-Japan1-5) fonts. %<en> \\*[-\dimexpr\medskipamount+\baselineskip\relax] \item[hiragino-pron] Hiragino ProN (Adobe-Japan1-5, JIS04-savvy) fonts. @@ -1964,6 +2039,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, @@ -1972,18 +2048,18 @@ removed from the range~4. %</en> %<*ja> 各文字はただ一つの文字範囲に所属することができる. -例えば,SIPは全て\LuaTeX-jaのデフォルトでは4番の文字範囲に -属しているが,上記の指定を行えばSIPは100番に属すようになり,4番からは除かれる. +例えば,SIP内の文字は全て\LuaTeX-jaのデフォルトでは4番の文字範囲に +属しているが,上記の指定を行えばSIP内の文字は100番に属すようになり,4番からは除かれる. %</ja> %<*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} %</en> %<*ja> @@ -1991,12 +2067,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} %</ja> \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. @@ -2011,12 +2087,21 @@ and positive integer $+n$ means that ``\dots\ is a \textbf{JAchar}''. %</ja> %<*en> -\paragraph{Default setting} +Note that characters \texttt{U+0000}--\texttt{U+007F} are always treated as an +\textbf{ALchar} (this cannot be customized). +%</en> +%<*ja> +なお,\texttt{U+0000}--\texttt{U+007F} は常に\textbf{ALchar}として扱われる(利用者が変更す +ることは出来ない). +%</ja> + +%<*en> +\paragraph{Default character ranges} \LuaTeX-ja predefines eight character ranges for convenience. They are determined from the following data: %</en> %<*ja> -\paragraph{初期設定} +\paragraph{文字範囲の初期値} \LuaTeX-jaでは8つの文字範囲を予め定義しており, これらは以下のデータに基づいて決定している. %</ja> @@ -2034,24 +2119,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. %</en> %<*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番の文字範囲に属することになっている. %</ja> \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: %</en> %<*ja> -\item[範囲8${}^{\kern.1em\text{J}}$] ISO~8859-1の上位領域(ラテン1補助)と +\item[範囲8${}^{\text{A}}$] ISO~8859-1の上位領域(ラテン1補助)と JIS~X~0208の共通部分.この文字範囲は 以下の文字で構成される: %</ja> @@ -2085,9 +2172,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\ +%<en>\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 +%<ja>\par\ \end{itemize} \end{multicols} %<*en> @@ -2096,7 +2184,7 @@ This range consists of the following Unicode ranges, \emph{except characters in %</en> %<*ja> \item[範囲2${}^{\text{\kern.1emJ}}$] ギリシャ文字とキリル文字.JIS~X~0208(したがってほとんどの - 和文フォント)はこれらの文字を持つ. + 和文フォント)には,これらの文字の一部が含まれている. %</ja> \begin{multicols}{2} \begin{itemize} @@ -2221,6 +2309,59 @@ 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} and \textbf{JAchar} regardless the range +setting, you can use \cs{ltjalchar} and \cs{ltjjachar} respectively, as the following example. +\begin{LTXexample}[width=0.3\textwidth] +\gtfamily\large % default, ALchar, JAchar +¶, \ltjalchar`¶, \ltjjachar`¶\\ % default: ALchar +α, \ltjalchar`α, \ltjjachar`α % default: JAchar +\end{LTXexample} +%</en> +%<*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`§」を出力することになる. + +このような事態を避けるために,本バージョンからは \texttt{U+0080}--\texttt{U+00FF} の範囲の +文字は全て\textbf{ALchar}となるように初期設定を変更している. +特に影響を受けるのが,JIS~X~0208の一部分である文字範囲8内の文字であり, +\emph{\Pkg{fontspec}パッケージを読み込んだりして欧文記号としてこれらの文字の出力環境を整え +ないと,ソース中に直接記述しても出力されない}ことになる. + +なお,文字範囲の設定に関わらず1つの文字を\textbf{ALchar}, \textbf{JAchar}で出力したい場合には, +以下の例のようにそれぞれ \cs{ltjalchar},~\cs{ltjjachar} に該当文字の文字コードを渡せばよい. +\begin{LTXexample}[width=0.3\textwidth] +\gtfamily\large % default, ALchar, JAchar +¶, \ltjalchar`¶, \ltjjachar`¶\\ % default: ALchar +α, \ltjalchar`α, \ltjjachar`α % default: JAchar +\end{LTXexample} +%</ja> + %<en>\subsection{\Param{kanjiskip} and \Param{xkanjiskip}} %<ja>\subsection{\Param{kanjiskip}と\Param{xkanjiskip}} \label{subs-kskip} @@ -2304,7 +2445,7 @@ JFMは「望ましい\Param{kanjiskip}の値」や \cs{ltjgetparameter} によって取得することはできないので注意が必要である. %</ja> -%<en>\subsection{Insertion Setting of \Param{xkanjiskip}} +%<en>\subsection{Insertion setting of \Param{xkanjiskip}} %<ja>\subsection{\Param{xkanjiskip} の挿入設定} %<*en> @@ -2427,7 +2568,7 @@ Here the horizontal line in the below example is the baseline of a line. 下の例において引かれている水平線がベースラインである. %</ja> \begin{LTXexample} -\vrule width 150pt height 0.4pt depth 0pt \hskip-120pt +\vrule width 150pt height 0.2pt depth 0.2pt \hskip-120pt \ltjsetparameter{yjabaselineshift=0pt, yalbaselineshift=0pt}abcあいう \ltjsetparameter{yjabaselineshift=5pt, yalbaselineshift=2pt}abcあいう \end{LTXexample} @@ -2442,13 +2583,15 @@ The following is an example (beware the value is not well tuned): 異なる文字を中心線に揃えることができる. 以下は一つの例である(値はあまり調整されていないことに注意): %</ja> -\begin{LTXexample} -xyz漢字 +\begin{LTXexample}[width=0.4\textwidth] +\vrule width 150pt height4.417pt depth-4.217pt% +\kern-150pt +\large xyz漢字 {\scriptsize - \ltjsetparameter{yjabaselineshift=-1pt, - yalbaselineshift=-1pt} - XYZひらがな -}abcかな + \ltjsetparameter{yjabaselineshift=-1.757pt, + yalbaselineshift=-1.757pt} + 漢字xyzあいう +}あいうabc \end{LTXexample} %<*en> @@ -2505,20 +2648,20 @@ becuse a \emph{JAchar} is encapsulated by a horizontal box if needed. \toprule \emph{入力}&\vspace*{\dimexpr-\origbaselineskip-\smallskipamount} \begin{lstlisting} -数式abc: $あa\hbox{い}$, $\int_0^x t\,dt=x^2\!/2$, +数式abc: $あa\hbox{い}$, $\int_0^x t\,dt=x^2/2$, $\Phi\vdash F(x)\ \hbox{for all}\ x\in A$ \end{lstlisting}\\ \noalign{\vskip-\origbaselineskip} \midrule \emph{\pTeX}& {\ltjsetparameter{yalbaselineshift=10pt}% -数式abc: $あa\lower10pt\hbox{い}$, $\int_0^x t\,dt=x^2\!/2$, +数式abc: $あa\lower10pt\hbox{い}$, $\int_0^x t\,dt=x^2/2$, $\Phi\vdash F(x)\ \lower10pt\hbox{for all}\ x\in A$ \par}\\ \midrule \emph{\LuaTeX-ja}& {\ltjsetparameter{yalbaselineshift=10pt}% -数式abc: $あa\hbox{い}$, $\int_0^x t\,dt=x^2\!/2$, +数式abc: $あa\hbox{い}$, $\int_0^x t\,dt=x^2/2$, $\Phi\vdash F(x)\ \hbox{for all}\ x\in A$ \par}\\ \noalign{\vskip-\origbaselineskip} @@ -2534,15 +2677,16 @@ Among parameters which related to Japanese word-wrapping process (\emph{kinsoku \Param{jaxspmode},~\Param{alxspmode}, \Param{prebreakpenalty}, \Param{postbreakpenalty}~and~\Param{kcatcode} \end{quote} -are stored by each character codes. ... +are stored by each character codes. +OpenType font features are ignored in these parameters. For example, a fullwidth katakana ``ア'' on line~10 in the below input is replaced to its halfwidth variant ``ア'', by \verb+hwid+ feature. However, the penalty inserted after it is 10 which is the \Param{postbreakpenalty} of ``ア'', not 20. %</en> %<*ja> -\subsection{禁則処理関連パラメータとfont feature} +\subsection{禁則処理関連パラメータとOpenTypeのfont feature} 禁則処理や \Param{kanjiskip}, \Param{xkanjiskip} の挿入に関連したパラメータのうち \begin{quote} \Param{jaxspmode},~\Param{alxspmode}, \Param{prebreakpenalty}, @@ -2552,7 +2696,7 @@ However, the penalty inserted after it is 10 which is the \Param{postbreakpenalt \Pkg{fontspec}パッケージを使う(\ref{ssec-fontspec}節)場合など, 各種のOpenType featureを適用することもあると思うが,前段落に述べたパラメータ類は, -\emph{OpenType featureの適用前の文字コードによって判定される.} +\emph{OpenType featureの適用前の文字コードによって適用される.} 例えば,以下の例において10行目の「ア」は,\verb+hwid+ featureの適用により半角カタカナの「ア」 に置き換わる.しかし,その直後に挿入される \Param{postbreakpenalty}は,置換前の「ア」に対する値10である. %</ja> @@ -2807,7 +2951,7 @@ for \LuaTeX, \emph{to match the \cs{catcode} setting with that of \XeTeX.} \end{table} %<*en> -\subsection{Non-kanji Characters in a Control Word} +\subsection{Non-kanji characters in a control word} Because the engine differ, so non-kanji JIS~X~0208 characters which can be used in a control word differ in \pTeX, in \upTeX,~and~in \LuaTeX-ja. Table~\ref{table-kcat-diff} shows the difference. @@ -3007,7 +3151,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) @@ -3018,7 +3162,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) @@ -3029,7 +3173,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 @@ -3135,7 +3279,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) @@ -3893,7 +4037,7 @@ Please contact the LuaTeX-ja project team. ? \end{lstlisting} -%<en>\subsection{Structure of a JFM File} +%<en>\subsection{Structure of a JFM file} %<ja>\subsection{JFMファイルの構造} \label{ssec-jfm-str} %<en>A JFM file is a Lua script which has only one function call: @@ -4525,7 +4669,7 @@ JFM側で一部の対処ができることにより,\Pkg{jsclasses}のよう %</ja> -%<en>\subsection{Math Font Family} +%<en>\subsection{Math font family} %<ja>\subsection{数式フォントファミリ} \label{ssec-math} @@ -5469,7 +5613,7 @@ The correct way is using a temporary register. %<en>\section{Other Commands for plain \TeX\ and \LaTeXe} %<ja>\section{plainでも\LaTeX でも利用可能なその他の命令} -%<en>\subsection{Commands for Compatibility with \pTeX} +%<en>\subsection{Commands for compatibility with \pTeX} %<ja>\subsection{\pTeX 互換用命令} %<*en> @@ -5585,7 +5729,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<base\_font\_cs><alt\_font\_cs>{<range>} +\ttfamily \textbackslash ltjdeclarealtfont<base\_font\_cs><alt\_font\_cs>\{<range>\} \end{quote} where <base\_font\_cs>~and~<alt\_font\_cs> are defined by \cs{jfont}. Its meaning is @@ -5593,8 +5737,7 @@ Its meaning is If the current Japanese font is <base\_font\_cs>, characters which belong to <range> is typeset by another Japanese font <alt\_font\_cs>, instead of <base\_font\_cs>. \end{quote} - -<range> is a comma-separated list of character codes, but also accepts negative integers: +Here <range> 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 <base\_font\_cs>. Note that characters which do not exist in <alt\_font\_cs> are ignored. @@ -5618,7 +5761,7 @@ are typeset by \cs{piyo}. \cs{ltjdeclarealtfont} は以下の書式で使用する: \begin{quote} -\ttfamily \textbackslash ltjdeclarealtfont<base\_font\_cs><alt\_font\_cs>{<range>} +\ttfamily \textbackslash ltjdeclarealtfont<base\_font\_cs><alt\_font\_cs>\{<range>\} \end{quote} これは「現在の和文フォント」が<base\_font\_cs>であるとき, <range>に属する文字は<alt\_font\_cs>を用いて組版される,という意味である. @@ -5646,6 +5789,28 @@ are typeset by \cs{piyo}. マクロの都合による. %</ja> +%<*ja> +\subsection{\cs{ltjalchar} と \cs{ltjjachar}} +文字コードが$\text{<chr\_code>}~(\geq 128=\mathtt{0x80})$の文字を +\ \cs{char} プリミティブを使い \cs{char}<chr\_code> として出力させると, +その文字の属する文字範囲(\ref{ssec-setrange}節参照)によって +\textbf{ALchar}か\textbf{JAchar}か,つまり欧文フォントで出力されるか和文フォントで出力され +るかが決まる. + +文字範囲の設定を無視し,文字コードが$\text{<chr\_code>}~(\geq 128=\mathtt{0x80})$の文字を強制的に +\textbf{ALchar}, \textbf{JAchar}で出力する命令がそれぞれ +\ \cs{ltjalchar},~\cs{ltjjachar} である.使用方法は \cs{char} と同じく +\ \cs{ltjalchar}<chr\_code>, \cs{ltjjachar}<chr\_code>とすればよい. +<chr\_code>が127以下の場合は,\cs{ltjjachar} であっても\textbf{ALchar}として出力されること +に注意. + +以下は\ref{ssec-setrange}節に載せた例に,\cs{char} の動作を追加したものである. +\begin{LTXexample}[width=0.25\textwidth] +\gtfamily\large % default, ALchar, JAchar +¶, \char`¶, \ltjalchar`¶, \ltjjachar`¶\\ % default: ALchar +α, \char`α, \ltjalchar`α, \ltjjachar`α % default: JAchar +\end{LTXexample} +%</ja> %<en>\section{Commands for \LaTeXe} @@ -5837,66 +6002,12 @@ In \LuaTeX-ja, this \cs{adjustbaseline} does same task, namely setting the \item[\cs{fontfamily}\{<family>\}] %<*en> As in \LaTeXe, this command changes current font family (alphabetic, Japanese,~\emph{or both}) -to <family>. Which family will be changed is determined as follows: +to <family>. See Subsection~\ref{ssec-fontfamilycmd} for detail. %</en> %<*ja> 元々の\LaTeXe におけるものと同様に,このコマンドは現在のフォントファミリ(欧文, -和文,\emph{もしくは両方})を<family>に変更する. -どのファミリが変更されるかは以下のようにして決定される: +和文,\emph{もしくは両方})を<family>に変更する.詳細は\ref{ssec-fontfamilycmd}節を参照すること. %</ja> -\begin{itemize} -%<*en> -\item Let current encoding scheme for Japanese fonts be - <ja-enc>. Current Japanese font family will be changed to - <family>, if one of the following two conditions is met: -%</en> -%<*ja> -\item 現在の和文フォントに対するエンコーディングが<ja-enc>であるとしよう. - 現在の和文フォントファミリは,以下の2つの条件のうちの1つが満たされているときに - <family>に変更される: -%</ja> -\begin{itemize} -%<*en> -\item The family <family> under the encoding <ja-enc> has been already defined by - \cs{DeclareKanijFamily}. -%</en> -%<*ja> -\item エンコーディング<ja-enc>におけるファミリ<family>が -既に \cs{DeclareKanjiFamily} によって定義されている. -%</ja> -%<*en> -\item A font definition named \texttt{<ja-enc><family>.fd} (the file name is - all lowercase) exists. -%</en> -%<*ja> -\item フォント定義ファイル\texttt{<ja-enc><family>.fd}(ファイル名は全て小文字)が存在する. -%</ja> -\end{itemize} -%<*en> -\item Let current encoding scheme for alphabetic fonts be - <al-enc>. For alphabetic font family, the criterion as above is used. -%</en> -%<*ja> -\item 現在の欧文フォントに対するエンコーディングを<al-enc>とする. - 欧文フォントファミリに対しても,上記の基準が用いられる. -%</ja> -%<*en> -\item There is a case which none of the above applies, that is, the font - family named <family> doesn't seem to be defined neither under the - encoding <ja-enc>, nor under <al-enc>. -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 <family>, unlike the original implementation in \LaTeX. -%</en> -%<*ja> -\item 上記のいずれもが適用されない,つまり<family>が<ja-enc>と<al-enc>の - どちらでも定義されないような場合がある. - この場合,代替フォントに用いられるデフォルトのフォントファミリが欧文フォントと - 和文フォントに用いられる.\LaTeX のオリジナルの実装とは異なり, - 現在のエンコーディングは<family>には設定されないことに注意する. -%</ja> -\end{itemize}% -%<en>\vspace{-\medskipamount} \begin{figure}[!tb] @@ -5973,21 +6084,187 @@ Avant Garde (OT1/pag/m/n) に変わっていることがわかる. \userelfont\selectfont あいうabc \end{LTXexample} +%<en>\subsection{Detail of \cs{fontfamily} command} +%<ja>\subsection{\cs{fontfamily}コマンドの詳細} +\label{ssec-fontfamilycmd} +%<*en> +In this subsection, we describe when \cs{fontfamily}<family> changes current +Japanese/alphabetic font family. Basically, current Japanese fotn family is changed to +<family> 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 +<family>, and another case that <family> 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}}$. +%</en> +%<*ja> +本節では,\cs{fontfamily}<family> がいつ和文/欧文フォントファミリを変更するかについて解説 +する.基本的には,<family>が和文フォントファミリだと認識されれば和文側が,欧文フォントファ +ミリだと認識されれば欧文側が変更される.どちらとも認識されれば和文・欧文の両方が変わるこ +とになるし,当然どちらとも認識されないこともある. + +\paragraph{和文フォントファミリとしての認識} +まず,<family>が和文フォントファミリとして認識されるかは以下の順序で決定される. +これは\pLaTeXe の \cs{fontfamily} にとても似ているが,ここではLuaによって実装している. +補助的に「和文フォントファミリではないと認識された」ファミリを格納したリスト$N_{\mathrm{J}}$を用いる. +%</ja> +\begin{enumerate} %<*en> -\section{Addons} +\item If the family~<family> has been defined already by \cs{DeclareKanjiFamily}, + <family> is recognized as a Japanese font family. + Note that <family> need not be defined under \emph{current} Japanese font encoding. +%</en> +%<*ja> +\item ファミリ<family>が既に \cs{DeclareKanjiFamily} によって定義されている場合, + <family>は和文フォントファミリであると認識される. + ここで,<family>は現在の和文フォントエンコーディングで定義されていなくてもよい. +%</ja> +%<*en> +\item If the family~<family> has been listed in a list~$N_{\mathrm{J}}$, this means + that <family> is not a Japanese font family. +%</en> +%<*ja> +\item ファミリ<family>がリスト$N_{\mathrm{J}}$に既に含まれていれば,それは + <family>が和文フォントファミリではないことを意味する. +%</ja> +%<*en> +\item If the \Pkg{luatexja-fontspec} package is loaded, we stop here, and <family> 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~<enc> such that + a font definition named \texttt{<enc><family>.fd} (the file name is + all lowercase) exists. If so, <family> is recognized as a Japanese font family (the font definition file won't be loaded here). + If not, <family> is not a Japanese font family, and + <family> is appended to the list~$N_{\mathrm{J}}$. +%</en> +%<*ja> +\item もし\Pkg{luatexja-fontspec}パッケージが読み込まれていれば,ここで終了であり, +<family>は和文フォントファミリとして認識されないことになる. + +もし\Pkg{luatexja-fontspec}パッケージが読み込まれていなければ,和文エンコーディング<enc>で +フォント定義ファイル\texttt{<enc><family>.fd}(ファイル名は全て小文字)が存在するようなも + のがあるかどうかを調べる. +存在すれば,<family>は和文フォントファミリと認識される(フォント定義ファイルは読み込まれな + い). +存在しなければ,<family>は和文フォントファミリでないと認識され,リスト$N_{\mathrm{J}}$に<family>を追加することでそれを記憶する. + +%</ja> +\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}}$, +%</en> +%<*ja> +\paragraph{欧文フォントファミリとしての認識} +同様に,<family>が和文フォントファミリとして認識されるかは以下の順序で決定される. +補助的に「欧文フォントファミリと既に認識された」ファミリのリスト$F_{\textrm{A}}$と, +「欧文フォントファミリではないと認識された」ファミリを格納したリスト$N_{\mathrm{A}}$を用いる. +%</ja> + +\begin{enumerate} +%<*en> +\item If the family~<family> has been listed in a list~$F_{\mathrm{A}}$, + <family> is recognized as an alphabetic font family. +%</en> +%<*ja> +\item ファミリ<family>がリスト$F_{\mathrm{A}}$に既に含まれていれば, + <family>は欧文フォントファミリと認識される. +%</ja> +%<*en> +\item If the family~<family> has been listed in a list~$N_{\mathrm{A}}$, this means + that <family> is not an alphabetic font family. +%</en> +%<*ja> +\item ファミリ<family>がリスト$N_{\mathrm{A}}$に既に含まれていれば,それは + <family>が欧文フォントファミリではないことを意味する. +%</ja> +%<*en> +\item If there exists an alphabetic font encoding such that the family~<family> has been + defined under it, <family> is recognized as an alphabetic font family, and + to memorize this, <family> is appended to the list~$F_{\mathrm{A}}$. +%</en> +%<*ja> +\item ある欧文フォントエンコーディング下でファミリ<family>が定義されていれば, + <family>は欧文フォントファミリと認識され,リスト$F_{\mathrm{A}}$に<family>を追加することでこのことを記憶する. +%</ja> +%<*en> +\item Now \LuaTeX-ja looks whether there exists an alphabetic font encoding~<enc> such that + a font definition named \texttt{<enc><family>.fd} (the file name is + all lowercase) exists. If so, current alphabetic font family will be changed to + <family>~(the font definition file won't be loaded here). + If not, current alphabetic font family won't be changed, and + <family> is appended to the list~$N_{\mathrm{A}}$. +%</en> +%<*ja> +\item 最終段階では,欧文エンコーディング<enc>で +フォント定義ファイル\texttt{<enc><family>.fd}(ファイル名は全て小文字)が存在するようなも + のがあるかどうかを調べる. +存在すれば,<family>は欧文フォントファミリと認識される(フォント定義ファイルは読み込まれない). +存在しなければ,<family>は欧文フォントファミリと認識されないので,リスト$N_{\mathrm{A}}$に + <family>を追加してそのことを記憶する. +%</ja> +\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}}$. +%</en> +%<*ja> +また,\cs{DeclareFontFamily}が\LuaTeX-jaの読み込み後に実行された場合は, +第2引数(ファミリ名)が自動的に$F_{\mathrm{A}}$に追加される. +%</ja> + +%<*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. +%</en> +%<*ja> +以上の方針は\pLaTeXe における \cs{fontfamily} にやはり類似しているが,3.が加わり若干複雑になっている. +それは\pLaTeXe がフォーマットであるのに対し\LuaTeX-jaはそうでないため, +\LuaTeX-jaは自身が読み込まれる前にどういう\cs{DeclareFontFamily}の呼び出しがあったか +把握できないからである. +%</ja> + +%<en>\paragraph{Remarks} +%<ja>\paragraph{注意} +%<*en> +Of course, there is a case that <family> is not recognized as a Japanese font family, nor +an alphabetic font family. +In this case, \LuaTeX-ja treats ``the argument <family> is wrong'', so +set both current alphabetic and Japanese font family to <family>, +to use the default family for font substitution. +%</en> +%<*ja> +さて,引数によっては,「和文フォントファミリとも欧文フォントファミリも認識されなかった」 +という事態もあり得る. + この場合,引数<family>は不正だった,ということになるので, +和文・欧文の両方のフォントファミリを<family>に設定し,代用フォントが使われるに任せることにする. +%</ja> + + +%<*en> +\section{Addon packages} \LuaTeX-ja has several addon packages. These addons are written as \LaTeX\ packages, but \Pkg{luatexja-otf} and~\Pkg{luatexja-adjust} can be loaded in plain \LuaTeX\ by \cs{input}. %</en> %<*ja> -\section{拡張} +\section{拡張パッケージ} \LuaTeX-jaには(動作には必須ではないが)自由に読み込める拡張が付属している. これらは\LaTeX のパッケージとして制作しているが, \Pkg{luatexja-otf}と\Pkg{luatexja-adjust}についてはplain \LuaTeX でも\ \cs{input} で読み込み可能である. %</ja> -\subsection{\texttt{luatexja-fontspec.sty}} +\subsection{\Pkg{luatexja-fontspec}} \label{ssec-fontspec2} %<*en> As described in Subsection~\ref{ssec-fontspec}, this optional package @@ -6210,7 +6487,7 @@ BoldFeatures = { %</ja> -\subsection{\texttt{luatexja-otf.sty}} +\subsection{\Pkg{luatexja-otf}} \label{ssec-ltjotf} %<*en> This optional package supports typesetting characters in @@ -6385,7 +6662,7 @@ Lua・\TeX コードが参考になるだろう. %</ja> -\subsection{\texttt{luatexja-adjust.sty}} +\subsection{\Pkg{luatexja-adjust}} \label{ssec-adj} \begin{figure}[t] \def\sq{% @@ -6465,7 +6742,7 @@ for making the difference obvious. \end{cslist} %</ja> -\subsection{\texttt{luatexja-ruby.sty}} +\subsection{\Pkg{luatexja-ruby}} %<*en> This addon package provides functionality of ``ruby'' (\emph{furigana}) annotations using callbacks of \LuaTeX-ja. @@ -6569,7 +6846,7 @@ among the line-head form, the line-middle form, and the line-end form. %<*ja> -\subsection{\texttt{lltjext.sty}} +\subsection{\Pkg{lltjext}} \pLaTeX では縦組用の拡張として \Pkg{plext} パッケージが用意されていたが, それを\LuaTeX-ja用に書きなおしたものが本追加パッケージ \Pkg{lltjext} である. @@ -6709,7 +6986,7 @@ In this case, <contents> will be aligned \dots %<en>\section{Storing Parameters} %<ja>\section{パラメータの保持} \label{sec-para} -%<en>\subsection{Used Dimensions, Attributes and Whatsit Nodes} +%<en>\subsection{Used dimensions, attributes and whatsit nodes} %<ja>\subsection{\LuaTeX-jaで用いられるレジスタとwhatsitノード} %<*en> @@ -7020,7 +7297,7 @@ These whatsits will be removed during the process of inserting \textbf{JAglue}s. これらのwhatsitノードは\textbf{JAglue}の挿入処理の間に取り除かれる. %</ja> -%<en>\subsection{Stack System of \LuaTeX-ja} +%<en>\subsection{Stack system of \LuaTeX-ja} %<ja>\subsection{\LuaTeX-jaのスタックシステム} \label{ssec-stack} @@ -7200,7 +7477,7 @@ To solve this problem, we use another trick: the assignment %</ja> %<*en> -\subsection{Lua Functions of the Stack System} +\subsection{Lua functions of the stack system} In this subsection, we will see how a user use \LuaTeX-ja's stack system to store some data which obeys the grouping of \TeX. %</en> @@ -7406,7 +7683,7 @@ end %<en>\section{Linebreak after a Japanese Character} %<ja>\section{和文文字直後の改行} \label{sec-lbreak} -%<en>\subsection{Reference: Behavior in \pTeX} +%<en>\subsection{Reference: behavior in \pTeX} %<ja>\subsection{参考:\pTeX の動作} %<*en> In~\pTeX, a line break after a Japanese character doesn't emit a space, @@ -8599,7 +8876,7 @@ With this key, the above input now produces better output. \end{lstlisting} %</ja> -%<en>\subsection{Class of Characters} +%<en>\subsection{Class of characters} %<ja>\subsection{文字種} %<en>Roughly speaking, the \Pkg{listings} package processes input as follows: @@ -9008,7 +9285,7 @@ CMapが必要である. 縦組時における幅を格納している.構造は以下の通り: %</ja> %<*en> -\subsection{Use of Cache} +\subsection{Use of cache} \LuaTeX-ja uses the following cache: \begin{cslist} diff --git a/Master/texmf-dist/source/luatex/luatexja/ltj-kinsoku_make.tex b/Master/texmf-dist/source/luatex/luatexja/ltj-kinsoku_make.tex index 14ee0a11dc2..acd3b6e9137 100644 --- a/Master/texmf-dist/source/luatex/luatexja/ltj-kinsoku_make.tex +++ b/Master/texmf-dist/source/luatex/luatexja/ltj-kinsoku_make.tex @@ -1,8 +1,8 @@ %#!luatex ltj-kinsoku_make.tex +%\tracingall \input luatexja.sty \catcode`\@=11 - \ltj@tempcnta="0%" \loop\ifnum\ltj@tempcnta<"100%" \ltjsetparameter{alxspmode={\ltj@tempcnta,0}}% @@ -452,4 +452,4 @@ table.tofile('ltj-kinsoku.lua', s, 'return', false, true, false) } -\bye
\ No newline at end of file +\bye diff --git a/Master/texmf-dist/source/luatex/luatexja/ltjsclasses.dtx b/Master/texmf-dist/source/luatex/luatexja/ltjsclasses.dtx index d0ce6836b9d..1327cf0d355 100644 --- a/Master/texmf-dist/source/luatex/luatexja/ltjsclasses.dtx +++ b/Master/texmf-dist/source/luatex/luatexja/ltjsclasses.dtx @@ -22,7 +22,7 @@ % ----------------------------------------- % % \fi -% \CheckSum{5223} +% \CheckSum{5219} %% \CharacterTable %% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z %% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z @@ -50,7 +50,7 @@ %<*driver> \ProvidesFile{ltjsclasses.dtx} %</driver> - [2015/01/07 ] + [2015/05/26 ] %<*driver> \documentclass{ltjsarticle} \usepackage{doc} @@ -3886,15 +3886,21 @@ % % [2003-11-05] ロジックを少し変えてみました。 % +% [2015-05-26] |listings| パッケージを使うときに|title| を指定すると次のエラーが出るのを修正. +% \begin{verbatim} +% ! Missing number, treated as zero. +% \end{verbatim} +% +% % \begin{macrocode} %<*!jspf> % \long\def\@makecaption#1#2{{\small % \advance\leftskip1cm % \advance\rightskip1cm % \vskip\abovecaptionskip -% \sbox\@tempboxa{#1\hskip1\zw\relax #2}% +% \sbox\@tempboxa{#1{\hskip1\zw}#2}% % \ifdim \wd\@tempboxa >\hsize -% #1\hskip1\zw\relax #2\par +% #1{\hskip1\zw}#2\par % \else % \global \@minipagefalse % \hb@xt@\hsize{\hfil\box\@tempboxa\hfil}% @@ -3904,9 +3910,9 @@ \advance\leftskip .0628\linewidth \advance\rightskip .0628\linewidth \vskip\abovecaptionskip - \sbox\@tempboxa{#1\hskip1\zw\relax #2}% + \sbox\@tempboxa{#1{\hskip1\zw}#2}% \ifdim \wd\@tempboxa <\hsize \centering \fi - #1\hskip1\zw\relax #2\par + #1{\hskip1\zw}#2\par \vskip\belowcaptionskip}} %</!jspf> %<*jspf> diff --git a/Master/texmf-dist/tex/luatex/luatexja/addons/luatexja-adjust.sty b/Master/texmf-dist/tex/luatex/luatexja/addons/luatexja-adjust.sty index b25e7060d39..1ba9cda333f 100644 --- a/Master/texmf-dist/tex/luatex/luatexja/addons/luatexja-adjust.sty +++ b/Master/texmf-dist/tex/luatex/luatexja/addons/luatexja-adjust.sty @@ -64,7 +64,7 @@ \expandafter\let\csname ifltj@in@latex\expandafter\endcsname \csname iftrue\endcsname \NeedsTeXFormat{LaTeX2e} - \ProvidesPackage{luatexja-adjust}[2013/05/14] + \ProvidesPackage{luatexja-adjust}[2014/05/13] \fi %</LaTeX> % Load core module if not yet. diff --git a/Master/texmf-dist/tex/luatex/luatexja/addons/luatexja-ajmacros.sty b/Master/texmf-dist/tex/luatex/luatexja/addons/luatexja-ajmacros.sty index 89e0953cecb..016fda3055b 100644 --- a/Master/texmf-dist/tex/luatex/luatexja/addons/luatexja-ajmacros.sty +++ b/Master/texmf-dist/tex/luatex/luatexja/addons/luatexja-ajmacros.sty @@ -68,7 +68,7 @@ \expandafter\let\csname ifltj@in@latex\expandafter\endcsname \csname iftrue\endcsname \NeedsTeXFormat{LaTeX2e} - \ProvidesPackage{luatexja-ajmacros}[2013/05/14] + \ProvidesPackage{luatexja-ajmacros}[2014/07/02] \fi %</LaTeX> %%------------------ diff --git a/Master/texmf-dist/tex/luatex/luatexja/addons/luatexja-fontspec-24.sty b/Master/texmf-dist/tex/luatex/luatexja/addons/luatexja-fontspec-24.sty index 14f3e3b6172..3a4b3caf6ac 100644 --- a/Master/texmf-dist/tex/luatex/luatexja/addons/luatexja-fontspec-24.sty +++ b/Master/texmf-dist/tex/luatex/luatexja/addons/luatexja-fontspec-24.sty @@ -3,7 +3,7 @@ % \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{luatexja-fontspec-24}[2015/01/15 fontspec support of LuaTeX-ja] +\ProvidesPackage{luatexja-fontspec-24}[2015/06/28 fontspec support of LuaTeX-ja] \RequirePackage{l3keys2e,luatexja} \ExplSyntaxOn @@ -45,14 +45,6 @@ \cs_generate_variant:Nn \prg_new_conditional:Nnn {Nnx} -%%%%%%%% \g_ltj_fontspec_scale_fp -%% Default scale value for jfont. -\fp_new:N \g_ltj_fontspec_scale_fp -\group_begin: -\fontsize{10}{10}\selectfont -\fp_gset:Nn \g_ltj_fontspec_scale_fp {\zw / 10} -\group_end: - %%%%%%%% Internal control sequences %% Each CS is ltj_fontspec version that corresponds to original CS of fontspec. \cs_new:Nn \ltj_fontspec_define_option:nn { diff --git a/Master/texmf-dist/tex/luatex/luatexja/addons/luatexja-fontspec.sty b/Master/texmf-dist/tex/luatex/luatexja/addons/luatexja-fontspec.sty index 695ff385c66..d0b3c1306c1 100644 --- a/Master/texmf-dist/tex/luatex/luatexja/addons/luatexja-fontspec.sty +++ b/Master/texmf-dist/tex/luatex/luatexja/addons/luatexja-fontspec.sty @@ -3,25 +3,35 @@ % \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{luatexja-fontspec}[2015/01/15 fontspec support of LuaTeX-ja] +\ProvidesPackage{luatexja-fontspec}[2015/08/26 fontspec support of LuaTeX-ja] \RequirePackage{l3keys2e,luatexja} \ExplSyntaxOn +%%%%%%%% \g_ltj_fontspec_scale_fp +%% Default scale value for jfont. +\fp_new:N \g_ltj_fontspec_scale_fp +\group_begin: +\fontsize{10}{10}\selectfont +\fp_gset:Nn \g_ltj_fontspec_scale_fp {\zw / 10} +\group_end: + \bool_new:N \ltj_fontspec_match -\cs_set:Nn \ltj_fontspec_pass_opts: {} \keys_define:nn { luatexja-fontspec } { match .bool_set:N = \ltj_fontspec_match_bool, match .default:n = true, - pass .code:n = \cs_set:Nn \ltj_fontspec_pass_opts: {#1},% 互換性 + pass .code:n = \PassOptionsToPackage{#1} {fontspec}, + % 互換性のために残したオプション + scale .fp_gset:N = \g_ltj_fontspec_scale_fp, + unknown .code:n = \PassOptionsToPackage { \l_keys_key_tl } {fontspec}, } -\ProcessKeysOptions { luatexja-fontspec } -\RequirePackage[\ltj_fontspec_pass_opts:]{fontspec}[2014/06/01]% v2.4 +\ProcessKeysOptions{ luatexja-fontspec } +\RequirePackage{fontspec}[2014/06/01]% v2.4 \RequirePackage{luatexja-fontspec-24} \ExplSyntaxOff %%%%%%%% Now we completely ignore kanjifont definition file. -\@ltj@use@fdfalse +\def\@ltj@use@fd{false} % We must redefine \try@load@fontshape to ignore kanjifont definitions at all. \def\try@load@fontshape{% diff --git a/Master/texmf-dist/tex/luatex/luatexja/addons/luatexja-preset.sty b/Master/texmf-dist/tex/luatex/luatexja/addons/luatexja-preset.sty index c23fb3fb4cb..9a8ee54c350 100644 --- a/Master/texmf-dist/tex/luatex/luatexja/addons/luatexja-preset.sty +++ b/Master/texmf-dist/tex/luatex/luatexja/addons/luatexja-preset.sty @@ -1,5 +1,5 @@ % luatexja-preset.sty -\ProvidesPackage{luatexja-preset}[2015/04/05 Japanese font presets] +\ProvidesPackage{luatexja-preset}[2015/06/28 Japanese font presets] \RequirePackage{expl3} \RequirePackage{luatexja} @@ -26,6 +26,7 @@ \DeclareOption{deluxe}{\int_set:Nn \l_ltjpreset_deluxe_int { 2 }} % 6 fonts \DeclareOption{nodeluxe}{\int_set:Nn \l_ltjpreset_deluxe_int { 0 }} % 2 fonts +\DeclareOption*{\PassOptionsToPackage{\CurrentOption}{luatexja-fontspec}} % JFM \cs_set:Npn \ltjpreset_use_jfm: {ujis} % 使用する JFM %%% \DeclareOption{min}{\cs_set:Npn \ltjpreset_use_jfm: {min}} % min @@ -205,13 +206,6 @@ \ExecuteOptions{ipaex} -% match -\DeclareOption{match} { - \bool_if:NF \ltj_fontspec_match_bool { - \ltj_fontspec_match_cmd - \bool_set_true:N \ltj_fontspec_match_bool - } -} \ProcessOptions* %%%%%%%% main routine diff --git a/Master/texmf-dist/tex/luatex/luatexja/addons/luatexja-ruby.sty b/Master/texmf-dist/tex/luatex/luatexja/addons/luatexja-ruby.sty index 1f73ea1b733..b40ec97800b 100644 --- a/Master/texmf-dist/tex/luatex/luatexja/addons/luatexja-ruby.sty +++ b/Master/texmf-dist/tex/luatex/luatexja/addons/luatexja-ruby.sty @@ -4,7 +4,7 @@ % LaTeX only! \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{luatexja-ruby}[2014/03/28 v0.21] +\ProvidesPackage{luatexja-ruby}[2015/05/09 v0.22] \RequirePackage{luatexja} %%------------------ @@ -18,12 +18,12 @@ %% 引数:ルビ全角を単位とした実数 %% この文字への pre-, post-intrusion の許容量 \define@key[ltj]{japaram}{rubypreintrusion}{% - \expandafter\ltj@@set@stack@real#1:{RIPRE}{0}{0x7FFFFFFF}} + \ltj@@set@stack@real{RIPRE}{0}{0x7FFFFFFF}#1 } \define@key[ltj]{japaram}{rubypostintrusion}{% - \expandafter\ltj@@set@stack@real#1:{RIPOST}{0}{0x7FFFFFFF}} -\def\ltj@@set@stack@real#1,#2:#3#4#5{% - \directlua{luatexja.stack.set_stack_perchar(luatexja.stack_table_index.#3, - \ltj@safe@num@or\ltj@defnum{#1},\ltj@safe@real{#2},#4,#5)}} + \ltj@@set@stack@real{RIPOST}{0}{0x7FFFFFFF}#1 } +\def\ltj@@set@stack@real#1#2#3{% + \directlua{luatexja.stack.set_stack_perchar(luatexja.stack_table_index.#1, + #2, #3, luatexja.token.scan_word)}} % ルビ用のキー設定 \def\ltj@@rkeydef#1{ diff --git a/Master/texmf-dist/tex/luatex/luatexja/addons/luatexja-zhfonts.sty b/Master/texmf-dist/tex/luatex/luatexja/addons/luatexja-zhfonts.sty index fd5f7741cda..8e215d3f6eb 100644 --- a/Master/texmf-dist/tex/luatex/luatexja/addons/luatexja-zhfonts.sty +++ b/Master/texmf-dist/tex/luatex/luatexja/addons/luatexja-zhfonts.sty @@ -1,6 +1,6 @@ % luatexja-zhfonts.sty \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{luatexja-zhfonts}[2013/05/20 Setting for Chinese fonts] +\ProvidesPackage{luatexja-zhfonts}[2013/09/10 Setting for Chinese fonts] \RequirePackage{luatexja-fontspec} % SinoType 华文字体 diff --git a/Master/texmf-dist/tex/luatex/luatexja/lltjext.sty b/Master/texmf-dist/tex/luatex/luatexja/lltjext.sty index 5cf1849b92b..572863c70ff 100644 --- a/Master/texmf-dist/tex/luatex/luatexja/lltjext.sty +++ b/Master/texmf-dist/tex/luatex/luatexja/lltjext.sty @@ -3,8 +3,7 @@ % \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{lltjext} - [2014/09/06 v1.2-ltj-3 Macros for vertical writing] +\ProvidesPackage{lltjext}[2014/10/15 v1.2-ltj-3 Macros for vertical writing] \RequirePackage{luatexja} \let\ltj@lltjext@orig@tabular=\tabular diff --git a/Master/texmf-dist/tex/luatex/luatexja/ltj-base.sty b/Master/texmf-dist/tex/luatex/luatexja/ltj-base.sty index b8b7855476f..1c7e3b7df1d 100644 --- a/Master/texmf-dist/tex/luatex/luatexja/ltj-base.sty +++ b/Master/texmf-dist/tex/luatex/luatexja/ltj-base.sty @@ -13,7 +13,7 @@ \ifltj@in@latex %<*LaTeX> \NeedsTeXFormat{LaTeX2e} - \ProvidesPackage{ltj-base}[2013/05/14] + \ProvidesPackage{ltj-base}[2014/07/18] \fi %</LaTeX> %%------------------ Tiny helpers diff --git a/Master/texmf-dist/tex/luatex/luatexja/ltj-direction.lua b/Master/texmf-dist/tex/luatex/luatexja/ltj-direction.lua index c05d0ed6c35..b334ed46426 100644 --- a/Master/texmf-dist/tex/luatex/luatexja/ltj-direction.lua +++ b/Master/texmf-dist/tex/luatex/luatexja/ltj-direction.lua @@ -761,6 +761,8 @@ do luatexja.direction.get_box_dim = get_box_dim -- return value: (changed dimen of box itself?) + local scan_dimen, scan_int = luatexja.token.scan_dimen, luatexja.token.scan_int + local scan_keyword = luatexja.token.scan_keyword local function set_box_dim_common(key, s, l_dir) local s_dir, wh = get_box_dir(s, dir_yoko) s_dir = s_dir%dir_math_mod @@ -781,10 +783,10 @@ do setfield(db, 'next', dnh) setfield(wh, 'value',to_node(db)) end - setfield(db, key, tex.getdimen('ltj@tempdima')) + setfield(db, key, scan_dimen()) return false else - setfield(s, key, tex.getdimen('ltj@tempdima')) + setfield(s, key, scan_dimen()) if wh then -- change dimension of dir_nodes which are created "automatically" local bw, bh, bd @@ -803,8 +805,7 @@ do end end local function set_box_dim(key) - local n = tex_getcount('ltj@tempcnta') - local s = getbox(n) + local s = getbox(scan_int()); scan_keyword('=') if s then local l_dir = (get_dir_count())%dir_math_mod s = to_direct(s) @@ -813,7 +814,7 @@ do set_box_dim_common(key, s, l_dir) elseif b_dir%dir_math_mod == l_dir then -- s is dir_node - setfield(s, key, tex.getdimen('ltj@tempdima')) + setfield(s, key, scan_dimen()) if b_dir<dir_node_manual then set_attr(s, attr_dir, b_dir%dir_node_auto + dir_node_manual) end diff --git a/Master/texmf-dist/tex/luatex/luatexja/ltj-jfont.lua b/Master/texmf-dist/tex/luatex/luatexja/ltj-jfont.lua index cda9d1d33e0..62b0e329c3a 100644 --- a/Master/texmf-dist/tex/luatex/luatexja/ltj-jfont.lua +++ b/Master/texmf-dist/tex/luatex/luatexja/ltj-jfont.lua @@ -50,7 +50,7 @@ luatexbase.create_callback("luatexja.load_jfm", "data", function (ft, jn) return local jfm_file_name, jfm_var local defjfm_res -local jfm_dir, is_def_jfont +local jfm_dir, is_def_jfont, is_vert_enabled function define_jfm(t) local real_char -- Does current character class have the 'real' character? @@ -280,6 +280,7 @@ do chars = sz.chars, char_type = sz.char_type, kanjiskip = sz.kanjiskip, xkanjiskip = sz.xkanjiskip, chars_cbcache = {}, + vert_activated = is_vert_enabled, } fmtable = luatexbase.call_callback("luatexja.define_jfont", fmtable, fn) @@ -350,9 +351,12 @@ do end end if jfm_dir == 'tate' then + is_vert_enabled = (not name:match('-vert')) and (not name:match('-vrt2')) if not name:match('vert') and not name:match('vrt2') then name = name .. ';vert;vrt2' end + else + is_vert_enabled = nil end return name end @@ -377,7 +381,8 @@ end ------------------------------------------------------------------------ do -- these function are called from ltj-latex.sty - local kyenc_list, ktenc_list = {}, {} + local fenc_list, kyenc_list, ktenc_list = {}, {}, {} + function add_fenc_list(enc) fenc_list[enc] = 'true ' end function add_kyenc_list(enc) kyenc_list[enc] = 'true ' end function add_ktenc_list(enc) ktenc_list[enc] = 'true ' end function is_kyenc(enc) @@ -392,36 +397,57 @@ do end local kfam_list, Nkfam_list = {}, {} - function add_kfam_list(enc, fam) - if not kfam_list[enc] then kfam_list[enc] = {} end - kfam_list[enc][fam] = 'true ' - end - function add_Nkfam_list(enc, fam) - if not Nkfam_list[enc] then Nkfam_list[enc] = {} end - Nkfam_list[enc][fam] = 'true ' + function add_kfam(fam) + kfam_list[fam]=true + end + function search_kfam(fam, use_fd) + if kfam_list[fam] then + tex.sprint(cat_lp, '\\let\\ifin@\\iftrue '); return + elseif Nkfam_list[fam] then + tex.sprint(cat_lp, '\\let\\ifin@\\iffalse '); return + elseif use_fd then + for i,_ in pairs(kyenc_list) do + if kpse.find_file(string.lower(i)..fam..'.fd') then + tex.sprint(cat_lp, '\\let\\ifin@\\iftrue '); return + end + end + for i,_ in pairs(ktenc_list) do + if kpse.find_file(string.lower(i)..fam..'.fd') then + tex.sprint(cat_lp, '\\let\\ifin@\\iftrue '); return + end + end + Nkfam_list[fam]=true; tex.sprint(cat_lp, '\\let\\ifin@\\iffalse '); return + else + tex.sprint(cat_lp, '\\let\\ifin@\\iffalse '); return + end end - function is_kfam(enc, fam) - tex.sprint(cat_lp, '\\let\\ifin@\\if' - .. (kfam_list[enc] and kfam_list[enc][fam] or 'false ')) end - function is_Nkfam(enc, fam) - tex.sprint(cat_lp, '\\let\\ifin@\\if' - .. (Nkfam_list[enc] and Nkfam_list[enc][fam] or 'false ')) end - local ffam_list, Nffam_list = {}, {} - function add_ffam_list(enc, fam) - if not ffam_list[enc] then ffam_list[enc] = {} end - ffam_list[enc][fam] = 'true ' - end - function add_Nffam_list(enc, fam) - if not Nffam_list[enc] then Nffam_list[enc] = {} end - Nffam_list[enc][fam] = 'true ' + function is_ffam(fam) + tex.sprint(cat_lp, '\\let\\ifin@\\if' .. (ffam_list[fam] or 'false ')) + end + function add_ffam(fam) + ffam_list[fam]='true ' + end + function search_ffam_declared() + local s = '' + for i,_ in pairs(fenc_list) do + s = s .. '\\cdp@elt{' .. i .. '}' + end + tex.sprint(cat_lp, s) + end + function search_ffam_fd(fam) + if Nffam_list[fam] then + tex.sprint(cat_lp, '\\let\\ifin@\\iffalse '); return + else + for i,_ in pairs(fenc_list) do + if kpse.find_file(string.lower(i)..fam..'.fd') then + tex.sprint(cat_lp, '\\let\\ifin@\\iftrue '); return + end + end + Nffam_list[fam]=true; tex.sprint(cat_lp, '\\let\\ifin@\\iffalse '); return + end end - function is_ffam(enc, fam) - tex.sprint(cat_lp, '\\let\\ifin@\\if' - .. (ffam_list[enc] and ffam_list[enc][fam] or 'false ')) end - function is_Nffam(enc, fam) - tex.sprint(cat_lp, '\\let\\ifin@\\if' - .. (Nffam_list[enc] and Nffam_list[enc][fam] or 'false ')) end + end ------------------------------------------------------------------------ -- ALTERNATE FONTS @@ -651,8 +677,9 @@ do end local sort = table.sort - local function add_fl_table(dest, tg, unitable, glyphmax, asc_des, units) - for i = 0, glyphmax-1 do + local function add_fl_table(dest, glyphs, unitable, asc_des, units) + local tg, glyphmin, glyphmax = glyphs.glyphs, glyphs.glyphmin or 0, glyphs.glyphmax + for i = glyphmin, glyphmax-1 do local gv = tg[i] if gv then if gv.altuni then @@ -711,12 +738,12 @@ do local fl = fontloader.open(id.filename) local unicodes = id.resources.unicodes if fl.glyphs then - dest = add_fl_table(dest, fl.glyphs, id.resources.unicodes, fl.glyphmax, + dest = add_fl_table(dest, fl, unicodes, fl.ascent + fl.descent, fl.units_per_em) end if fl.subfonts then for _,v in pairs(fl.subfonts) do - dest = add_fl_table(dest, v.glyphs, id.resources.unicodes, v.glyphmax, + dest = add_fl_table(dest, v, unicodes, fl.ascent + fl.descent, fl.units_per_em) end end @@ -862,6 +889,34 @@ luatexbase.add_to_callback( end, 1, 'ltj.v_advance' ) end + +------------------------------------------------------------------------ +-- supply tounicode entries +------------------------------------------------------------------------ +do + local ltjr_prepare_cid_font = ltjr.prepare_cid_font + luatexbase.add_to_callback( + 'luaotfload.patch_font', + function (tfmdata) + if tfmdata.cidinfo then + local rd = ltjr_prepare_cid_font(tfmdata.cidinfo.registry, tfmdata.cidinfo.ordering) + if rd then + local ru, rc = rd.resources.unicodes, rd.characters + for i,v in pairs(tfmdata.characters) do + local w = ru["Japan1." .. tostring(v.index)] + if w then + v.tounicode = v.tounicode or rc[w]. tounicode + end + end + end + end + + return tfmdata + end, + 'ltj.supply_tounicode', 1) +end + + ------------------------------------------------------------------------ -- MISC ------------------------------------------------------------------------ @@ -901,3 +956,17 @@ do node_free(TEMP) end end + +------------------------------------------------------------------------ +-- VERT VARIANT TABLE +------------------------------------------------------------------------ +vert_form_table = { + [0x2013]=0xFE32, [0x2014]=0xFE31, [0x2025]=0xFE30, + [0xFF08]=0xFE35, [0xFF09]=0xFE36, [0xFF5B]=0xFE37, [0xFF5D]=0xFE38, + [0x3014]=0xFE39, [0x3015]=0xFE3A, [0x3010]=0xFE3B, [0x3011]=0xFE3C, + [0x300A]=0xFE3D, [0x300B]=0xFE3E, [0x3008]=0xFE3F, [0x3009]=0xFE40, + [0x300C]=0xFE41, [0x300D]=0xFE42, [0x300E]=0xFE43, [0x300F]=0xFE44, + [0xFF3B]=0xFE47, [0xFF3D]=0xFE48, [0xFF3F]=0xFE33, +} +setmetatable(vert_form_table, {__index=function(t,k) return k end}); + diff --git a/Master/texmf-dist/tex/luatex/luatexja/ltj-latex.sty b/Master/texmf-dist/tex/luatex/luatexja/ltj-latex.sty index 9fc3f307441..6b9c643ef7f 100644 --- a/Master/texmf-dist/tex/luatex/luatexja/ltj-latex.sty +++ b/Master/texmf-dist/tex/luatex/luatexja/ltj-latex.sty @@ -12,7 +12,7 @@ \def\luatexjalatexLoaded{\endinput} \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{ltj-latex}[2015/02/22 LaTeX support of LuaTeX-ja] +\ProvidesPackage{ltj-latex}[2015/03/17 LaTeX support of LuaTeX-ja] % cleanup at end of the document %\let\ltj@@orig@end=\@@end diff --git a/Master/texmf-dist/tex/luatex/luatexja/ltj-plain.sty b/Master/texmf-dist/tex/luatex/luatexja/ltj-plain.sty index 62cfcf7b19d..ad2c4ad6563 100644 --- a/Master/texmf-dist/tex/luatex/luatexja/ltj-plain.sty +++ b/Master/texmf-dist/tex/luatex/luatexja/ltj-plain.sty @@ -14,7 +14,7 @@ \ifltj@in@latex %<*LaTeX> \NeedsTeXFormat{LaTeX2e} \PackageWarning{ltj-plain}{Don't load this package directly; load luatexja.sty instead.} - \ProvidesPackage{ltj-plain}[2015/02/22] + \ProvidesPackage{ltj-plain}[2015/08/29] \fi %</LaTeX> %%------------------ @@ -86,7 +86,7 @@ "1100-"11FF, "2F00-"2FFF, "3100-"31EF, "A000-"A4CF, "A830-"A83F, "AC00-"D7FF} \ltjdefcharrange{8}{"B4, "A8, "B1, "D7, "F7, "B0, "A7, "B6} -\ltjsetparameter{jacharrange={-1, +2, +3, -4, -5, +6, +7, +8}} +\ltjsetparameter{jacharrange={-1, +2, +3, -4, -5, +6, +7, -8}} \directlua{for x=128,255 do luatexja.math.is_math_letters[x] = true end} \let\ltj@@orig@end=\@@end diff --git a/Master/texmf-dist/tex/luatex/luatexja/ltj-pretreat.lua b/Master/texmf-dist/tex/luatex/luatexja/ltj-pretreat.lua index c21de3ffdc5..42507758e02 100644 --- a/Master/texmf-dist/tex/luatex/luatexja/ltj-pretreat.lua +++ b/Master/texmf-dist/tex/luatex/luatexja/ltj-pretreat.lua @@ -124,6 +124,8 @@ end -- mode: true iff this function is called from hpack_filter local ltjs_report_stack_level = ltjs.report_stack_level +local ltjf_vert_form_table = ltjf.vert_form_table +local ltjf_font_metric_table = ltjf.font_metric_table local function set_box_stack_level(head, mode) local box_set, cl = 0, tex.currentgrouplevel + 1 for _,p in pairs(wt) do @@ -138,7 +140,12 @@ local function set_box_stack_level(head, mode) if (has_attr(p, attr_icflag) or 0)<=0 and getfield(p, 'lang')==lang_ja then local pfn = has_attr(p, attr_curtfnt) or getfont(p) local pc = ltjs_orig_char_table[p] - setfield(p, 'font', ltjf_replace_altfont(pfn, pc)) + local nf = ltjf_replace_altfont(pfn, pc) + setfield(p, 'font', nf) + if ltjf_font_metric_table[nf].vert_activated then + pc = ltjf_vert_form_table [getchar(p)] + if font.getfont(nf).characters[pc] then setfield(p, 'char', pc) end + end end end end diff --git a/Master/texmf-dist/tex/luatex/luatexja/ltj-rmlgbm.lua b/Master/texmf-dist/tex/luatex/luatexja/ltj-rmlgbm.lua index 2430ef3f7c1..a4a06c77750 100644 --- a/Master/texmf-dist/tex/luatex/luatexja/ltj-rmlgbm.lua +++ b/Master/texmf-dist/tex/luatex/luatexja/ltj-rmlgbm.lua @@ -230,10 +230,18 @@ local function read_cid_font() if not v.width then v.width = 655360 end v.height, v.depth = 576716.8, 78643.2 -- optimized for jfm-ujis.lua end + return cidfont_data[cid_name] + else + return nil end end -- High-level +local function prepare_cid_font(reg, ord) + cid_reg, cid_order, cid_name, cid_supp = reg, ord, reg .. '-' .. ord + return cidfont_data[cid_name] or read_cid_font() +end + local definers = fonts.definers local function mk_rml(name, size, id) @@ -345,17 +353,13 @@ local function font_callback(name, size, id, fallback) if not cid_reg then cid_reg, cid_order = string.match(s, "^(.-)%-(.-)$") end - cid_name = cid_reg .. '-' .. cid_order - if not cidfont_data[cid_name] then - read_cid_font() - if not cidfont_data[cid_name] then - ltjb.package_error('luatexja', - "bad cid key `" .. s .. "'", - "I couldn't find any non-embedded font information for the CID\n" .. - '`' .. s .. "'. For now, I'll use `Adobe-Japan1-6'.\n".. - 'Please contact the LuaTeX-ja project team.') - cid_name = "Adobe-Japan1" - end + if not prepare_cid_font(cid_reg, cid_order) then + ltjb.package_error('luatexja', + "bad cid key `" .. s .. "'", + "I couldn't find any non-embedded font information for the CID\n" .. + '`' .. s .. "'. For now, I'll use `Adobe-Japan1-6'.\n".. + 'Please contact the LuaTeX-ja project team.') + cid_name = "Adobe-Japan1" end return mk_rml(basename, size, id) else @@ -368,10 +372,10 @@ local function font_callback(name, size, id, fallback) end luatexja.rmlgbm = { + prepare_cid_font = prepare_cid_font, cidfont_data = cidfont_data, font_callback = font_callback, vert_addfunc = function () end, -- dummy, set in ltj-direction.lua } -cid_reg, cid_order, cid_name, cid_supp = 'Adobe', 'Japan1', 'Adobe-Japan1' -read_cid_font() +prepare_cid_font('Adobe', 'Japan1') diff --git a/Master/texmf-dist/tex/luatex/luatexja/ltj-stack.lua b/Master/texmf-dist/tex/luatex/luatexja/ltj-stack.lua index ef7a36926ee..72e8b8222f5 100644 --- a/Master/texmf-dist/tex/luatex/luatexja/ltj-stack.lua +++ b/Master/texmf-dist/tex/luatex/luatexja/ltj-stack.lua @@ -20,6 +20,7 @@ local sid_user = node.subtype('user_defined') local STCK = luatexja.userid_table.STCK local fastcopy = table.fastcopy local setcount = tex.setcount +local scan_int, scan_keyword = luatexja.token.scan_int, luatexja.token.scan_keyword hmode = 0 -- dummy charprop_stack_table={}; @@ -62,8 +63,11 @@ end local set_stack_table = set_stack_table -- EXT -function set_stack_perchar(m,c,p,lb,ub) - if type(p)~='number' or p<lb or p>ub then +function set_stack_perchar(m,lb,ub, getter) + local c = scan_int() + scan_keyword(',') + local p = tonumber((getter or scan_int)()) + if p<lb or p>ub then ltjb.package_error('luatexja', "invalid code (".. tostring(p) .. ")", "The code should in the range "..tostring(lb) .. '..' .. diff --git a/Master/texmf-dist/tex/luatex/luatexja/ltjsarticle.cls b/Master/texmf-dist/tex/luatex/luatexja/ltjsarticle.cls index d24a48dabb9..e962e19c561 100644 --- a/Master/texmf-dist/tex/luatex/luatexja/ltjsarticle.cls +++ b/Master/texmf-dist/tex/luatex/luatexja/ltjsarticle.cls @@ -38,7 +38,7 @@ %% Right brace \} Tilde \~} \NeedsTeXFormat{LaTeX2e} \ProvidesClass{ltjsarticle} - [2015/01/07 ] + [2015/05/26 ] \RequirePackage{luatexja} \newif\if@restonecol \newif\if@titlepage @@ -1137,9 +1137,9 @@ \advance\leftskip .0628\linewidth \advance\rightskip .0628\linewidth \vskip\abovecaptionskip - \sbox\@tempboxa{#1\hskip1\zw\relax #2}% + \sbox\@tempboxa{#1{\hskip1\zw}#2}% \ifdim \wd\@tempboxa <\hsize \centering \fi - #1\hskip1\zw\relax #2\par + #1{\hskip1\zw}#2\par \vskip\belowcaptionskip}} \DeclareOldFontCommand{\mc}{\normalfont\mcfamily}{\mathmc} \DeclareOldFontCommand{\gt}{\normalfont\gtfamily}{\mathgt} diff --git a/Master/texmf-dist/tex/luatex/luatexja/ltjsbook.cls b/Master/texmf-dist/tex/luatex/luatexja/ltjsbook.cls index 861d97debf3..31c40552de3 100644 --- a/Master/texmf-dist/tex/luatex/luatexja/ltjsbook.cls +++ b/Master/texmf-dist/tex/luatex/luatexja/ltjsbook.cls @@ -38,7 +38,7 @@ %% Right brace \} Tilde \~} \NeedsTeXFormat{LaTeX2e} \ProvidesClass{ltjsbook} - [2015/01/07 ] + [2015/05/26 ] \RequirePackage{luatexja} \newif\if@restonecol \newif\if@titlepage @@ -1200,9 +1200,9 @@ \advance\leftskip .0628\linewidth \advance\rightskip .0628\linewidth \vskip\abovecaptionskip - \sbox\@tempboxa{#1\hskip1\zw\relax #2}% + \sbox\@tempboxa{#1{\hskip1\zw}#2}% \ifdim \wd\@tempboxa <\hsize \centering \fi - #1\hskip1\zw\relax #2\par + #1{\hskip1\zw}#2\par \vskip\belowcaptionskip}} \DeclareOldFontCommand{\mc}{\normalfont\mcfamily}{\mathmc} \DeclareOldFontCommand{\gt}{\normalfont\gtfamily}{\mathgt} diff --git a/Master/texmf-dist/tex/luatex/luatexja/ltjskiyou.cls b/Master/texmf-dist/tex/luatex/luatexja/ltjskiyou.cls index 5d5d3f6bf92..e8bfdf3484b 100644 --- a/Master/texmf-dist/tex/luatex/luatexja/ltjskiyou.cls +++ b/Master/texmf-dist/tex/luatex/luatexja/ltjskiyou.cls @@ -38,7 +38,7 @@ %% Right brace \} Tilde \~} \NeedsTeXFormat{LaTeX2e} \ProvidesClass{ltjskiyou} - [2015/01/07 ] + [2015/05/26 ] \RequirePackage{luatexja} \newif\if@restonecol \newif\if@titlepage @@ -1121,9 +1121,9 @@ \advance\leftskip .0628\linewidth \advance\rightskip .0628\linewidth \vskip\abovecaptionskip - \sbox\@tempboxa{#1\hskip1\zw\relax #2}% + \sbox\@tempboxa{#1{\hskip1\zw}#2}% \ifdim \wd\@tempboxa <\hsize \centering \fi - #1\hskip1\zw\relax #2\par + #1{\hskip1\zw}#2\par \vskip\belowcaptionskip}} \DeclareOldFontCommand{\mc}{\normalfont\mcfamily}{\mathmc} \DeclareOldFontCommand{\gt}{\normalfont\gtfamily}{\mathgt} diff --git a/Master/texmf-dist/tex/luatex/luatexja/ltjspf.cls b/Master/texmf-dist/tex/luatex/luatexja/ltjspf.cls index 6bc3923f211..a640f22b67d 100644 --- a/Master/texmf-dist/tex/luatex/luatexja/ltjspf.cls +++ b/Master/texmf-dist/tex/luatex/luatexja/ltjspf.cls @@ -38,7 +38,7 @@ %% Right brace \} Tilde \~} \NeedsTeXFormat{LaTeX2e} \ProvidesClass{ltjspf} - [2015/01/07 ] + [2015/05/26 ] \RequirePackage{luatexja} \newif\if@restonecol \newif\if@titlepage diff --git a/Master/texmf-dist/tex/luatex/luatexja/luatexja-compat.sty b/Master/texmf-dist/tex/luatex/luatexja/luatexja-compat.sty index 687d395fb4a..3bba582fc4b 100644 --- a/Master/texmf-dist/tex/luatex/luatexja/luatexja-compat.sty +++ b/Master/texmf-dist/tex/luatex/luatexja/luatexja-compat.sty @@ -65,7 +65,7 @@ \expandafter\let\csname ifltj@in@latex\expandafter\endcsname \csname iftrue\endcsname \NeedsTeXFormat{LaTeX2e} - \ProvidesPackage{luatexja-compat}[2015/02/22 Compatibility with pTeX] + \ProvidesPackage{luatexja-compat}[2015/05/09 Compatibility with pTeX] \fi %</LaTeX> % Load core module if not yet. @@ -107,8 +107,7 @@ \directlua{luatexja.compat.to_kansuji(luatexja.token.scan_int())}% } -\define@key[ltj]{japaram}{kansujichar}{% - \expandafter\ltj@@set@stack#1:{KSJ}{0}{0x7FFFFFFF}} +\define@key[ltj]{japaram}{kansujichar}{\ltj@@set@stack{KSJ}{0}{0x7FFFFFFF}#1 } \ltjsetparameter{kansujichar={0,`〇}} \ltjsetparameter{kansujichar={1,`一}} diff --git a/Master/texmf-dist/tex/luatex/luatexja/luatexja-core.sty b/Master/texmf-dist/tex/luatex/luatexja/luatexja-core.sty index dd20eeead9f..69c409836df 100644 --- a/Master/texmf-dist/tex/luatex/luatexja/luatexja-core.sty +++ b/Master/texmf-dist/tex/luatex/luatexja/luatexja-core.sty @@ -65,7 +65,7 @@ \expandafter\let\csname ifltj@in@latex\expandafter\endcsname \csname iftrue\endcsname \NeedsTeXFormat{LaTeX2e} - \ProvidesPackage{luatexja-core}[2015/05/03 Core of LuaTeX-ja] + \ProvidesPackage{luatexja-core}[2015/05/17 Core of LuaTeX-ja] \fi %</LaTeX> %% Load prerequisite packages. @@ -263,15 +263,14 @@ \setbox\z@\box\voidb@x % prebreakpenalty = {<char_code>, <penalty>} -\define@key[ltj]{japaram}{kcatcode}{% - \expandafter\ltj@@set@stack#1:{KCAT}{0}{0x7FFFFFFF}} -\define@key[ltj]{japaram}{prebreakpenalty}{% - \expandafter\ltj@@set@stack#1:{PRE}{-10000}{10000}} -\define@key[ltj]{japaram}{postbreakpenalty}{% - \expandafter\ltj@@set@stack#1:{POST}{-10000}{10000}} -\def\ltj@@set@stack#1,#2:#3#4#5{% - \directlua{luatexja.stack.set_stack_perchar(luatexja.stack_table_index.#3, - \ltj@safe@num@or{nil}{#1},\ltj@safe@num@or{nil}{#2},#4,#5)}} +\define@key[ltj]{japaram}{kcatcode}{\ltj@@set@stack{KCAT}{0}{0x7FFFFFFF}#1\relax} +\define@key[ltj]{japaram}{prebreakpenalty}{\ltj@@set@stack{PRE}{-10000}{10000}#1\relax} +\define@key[ltj]{japaram}{postbreakpenalty}{\ltj@@set@stack{POST}{-10000}{10000}#1\relax} +\def\ltj@@set@stack#1#2#3{% + \directlua{luatexja.stack.set_stack_perchar(luatexja.stack_table_index.#1,#2,#3)}} +%\def\ltj@@set@stack#1,#2:#3#4#5{% +% \directlua{luatexja.stack.set_stack_perchar(luatexja.stack_table_index.#3, +% \ltj@safe@num@or{nil}{#1},\ltj@safe@num@or{nil}{#2},#4,#5)}} % jatextfont = {<char_code>, <font_cs>} % only horizontal font is supported @@ -300,16 +299,16 @@ % yjabaselineshift = <dimen> \define@key[ltj]{japaram}{yalbaselineshift}{% \directlua{tex.setattribute(luatexja.isglobal, - luatexbase.attributes['ltj@yablshift'], luatexja.token.scan_dimen())}#1} + luatexbase.attributes['ltj@yablshift'], luatexja.token.scan_dimen())}#1\relax} \define@key[ltj]{japaram}{yjabaselineshift}{% \directlua{tex.setattribute(luatexja.isglobal, - luatexbase.attributes['ltj@ykblshift'], luatexja.token.scan_dimen())}#1} + luatexbase.attributes['ltj@ykblshift'], luatexja.token.scan_dimen())}#1\relax} \define@key[ltj]{japaram}{talbaselineshift}{% \directlua{tex.setattribute(luatexja.isglobal, - luatexbase.attributes['ltj@tablshift'], luatexja.token.scan_dimen())}#1} + luatexbase.attributes['ltj@tablshift'], luatexja.token.scan_dimen())}#1\relax} \define@key[ltj]{japaram}{tjabaselineshift}{% \directlua{tex.setattribute(luatexja.isglobal, - luatexbase.attributes['ltj@tkblshift'], luatexja.token.scan_dimen())}#1} + luatexbase.attributes['ltj@tkblshift'], luatexja.token.scan_dimen())}#1\relax} % jaxspmode = {<char_code>, <mode>} % mode: inhibit, preonly, postonly, allow @@ -322,25 +321,13 @@ \def\ltj@tempa{preonly}\ifx\ltj@temp\ltj@tempa\def\ltj@temp{1}\fi \def\ltj@tempa{postonly}\ifx\ltj@temp\ltj@tempa\def\ltj@temp{2}\fi \def\ltj@tempa{allow}\ifx\ltj@temp\ltj@tempa\def\ltj@temp{3}\fi - \directlua{luatexja.stack.set_stack_perchar(luatexja.stack_table_index.XSP, - \ltj@safe@num@or{nil}{#1}, - \ltj@safe@num@or{nil}{\ltj@temp},0,3)}} - + \ltj@@set@stack{XSP}03#1 \ltj@temp} % alxspmode = {<char_code>, <mode>} % mode: inhibit, preonly, postonly, allow % or 0 1 2 3 \define@key[ltj]{japaram}{alxspmode}{% \inhibitxspcode - \expandafter\ltj@set@alxspmode#1:\relax} -\def\ltj@set@alxspmode#1,#2:{% - \lowercase{\edef\ltj@temp{#2}}% - \def\ltj@tempa{inhibit}\ifx\ltj@temp\ltj@tempa\def\ltj@temp{0}\fi - \def\ltj@tempa{preonly}\ifx\ltj@temp\ltj@tempa\def\ltj@temp{1}\fi - \def\ltj@tempa{postonly}\ifx\ltj@temp\ltj@tempa\def\ltj@temp{2}\fi - \def\ltj@tempa{allow}\ifx\ltj@temp\ltj@tempa\def\ltj@temp{3}\fi - \directlua{luatexja.stack.set_stack_perchar(luatexja.stack_table_index.XSP, - \ltj@safe@num@or{nil}{#1}, - \ltj@safe@num@or{nil}{\ltj@temp},0,3)}} + \expandafter\ltj@set@jaxspmode#1:\relax}% same code as jaxspmode % autospacing = <bool> (default: true) \define@boolkey[ltj]{japaram}{autospacing}[true]{% @@ -359,8 +346,8 @@ \fi} % [x]]kanjiskip = <skip> - \define@key[ltj]{japaram}{kanjiskip}{\ltjsetkanjiskip #1} - \define@key[ltj]{japaram}{xkanjiskip}{\ltjsetxkanjiskip #1} + \define@key[ltj]{japaram}{kanjiskip}{\ltjsetkanjiskip#1} + \define@key[ltj]{japaram}{xkanjiskip}{\ltjsetxkanjiskip#1} \protected\def\ltjsetkanjiskip{% % SKIP \directlua{% local d = luatexja.token.scan_glue() @@ -374,7 +361,7 @@ % jcharwidowpenalty = <count> \define@key[ltj]{japaram}{jcharwidowpenalty}{% %COUNT - \ltj@@set@stack0,#1:{JWP}{-10000}{10000}} + \ltj@@set@stack{JWP}{-10000}{10000}\z@#1 } % differentjfm = { large | small | average | pleft | pright | paverage | both} \define@choicekey*+[ltj]{japaram}{differentjfm}[\ltj@temp\ltj@tempr]% @@ -471,18 +458,16 @@ \csname ltj@kcat6\endcsname="7FFFFFFF }%" \protected\def\ltjjachar{\afterassignment\ltj@@jachar\ltj@tempcnta} -\def\ltj@@jachar{{\directlua{tex.globaldefs = 0}\ltj@alljachar\ltj@@origchar\ltj@tempcnta}} +\def\ltj@@jachar{{\directlua{tex.globaldefs=0}\ltj@alljachar\ltj@@origchar\ltj@tempcnta}} \protected\def\ltjalchar{\afterassignment\ltj@@alchar\ltj@tempcnta} -\def\ltj@@alchar{{\directlua{tex.globaldefs = 0}\ltj@allalchar\ltj@@origchar\ltj@tempcnta}} +\def\ltj@@alchar{{\directlua{tex.globaldefs=0}\ltj@allalchar\ltj@@origchar\ltj@tempcnta}} %%%%%%%% \ltjsetmathletter<number>, \ltjunsetmathletter<number> \protected\def\ltjsetmathletter#1{% - \ltj@tempcnta=#1 - \directlua{luatexja.math.is_math_letters[\the\ltj@tempcnta]=true}% + \directlua{luatexja.math.is_math_letters[luatexja.token.scan_int()]=true}#1\relax } \protected\def\ltjunsetmathletter#1{% - \ltj@tempcnta=#1 - \directlua{luatexja.math.is_math_letters[\the\ltj@tempcnta]=false}% + \directlua{luatexja.math.is_math_letters[luatexja.token.scan_int()]=false}#1\relax } %%%%%%%% \ltjdeclarealtfont<base_font_cs><alt_font_cs>{100-200,3000-,5000,...} @@ -677,24 +662,9 @@ \let\ltjgetwd=\ltj@@getwd\let\ltjgetht=\ltj@@getht\let\ltjgetdp=\ltj@@getdp %%%%%%%% \ltjsetwd<box_num>=<dimen> etc. -\protected\def\ltjsetwd{\begingroup - \ltj@reset@globaldefs\afterassignment\ltj@@setwd@a\ltj@tempcnta} -\def\ltj@@setwd@a{\afterassignment\ltj@@setwd@b\ltj@tempdima} -\def\ltj@@setwd@b{% - \directlua{luatexja.direction.set_box_dim('width')}% - \ltj@restore@globaldefs\endgroup} -\protected\def\ltjsetht{\begingroup - \ltj@reset@globaldefs\afterassignment\ltj@@setht@a\ltj@tempcnta} -\def\ltj@@setht@a{\afterassignment\ltj@@setht@b\ltj@tempdima} -\def\ltj@@setht@b{% - \directlua{luatexja.direction.set_box_dim('height')}% - \ltj@restore@globaldefs\endgroup} -\protected\def\ltjsetdp{\begingroup - \ltj@reset@globaldefs\afterassignment\ltj@@setdp@a\ltj@tempcnta} -\def\ltj@@setdp@a{\afterassignment\ltj@@setdp@b\ltj@tempdima} -\def\ltj@@setdp@b{% - \directlua{luatexja.direction.set_box_dim('depth')}% - \ltj@restore@globaldefs\endgroup} +\protected\def\ltjsetwd{\directlua{luatexja.direction.set_box_dim('width')}} +\protected\def\ltjsetht{\directlua{luatexja.direction.set_box_dim('height')}} +\protected\def\ltjsetdp{\directlua{luatexja.direction.set_box_dim('depth')}} %%------------------ Load module for the format diff --git a/Master/texmf-dist/tex/luatex/luatexja/luatexja.sty b/Master/texmf-dist/tex/luatex/luatexja/luatexja.sty index 29a839eb00b..496e28facd3 100644 --- a/Master/texmf-dist/tex/luatex/luatexja/luatexja.sty +++ b/Master/texmf-dist/tex/luatex/luatexja/luatexja.sty @@ -34,7 +34,7 @@ \expandafter\let\csname ifltj@in@latex\expandafter\endcsname \csname iftrue\endcsname \NeedsTeXFormat{LaTeX2e} - \ProvidesPackage{luatexja}[2013/05/14 Japanese Typesetting with LuaTeX] + \ProvidesPackage{luatexja}[2015/08/27 Japanese Typesetting with LuaTeX] \fi %</LaTeX> \directlua{require('ltj-unicode-ccfix.lua')}% catcode of ideographs diff --git a/Master/texmf-dist/tex/luatex/luatexja/patches/lltjcore.sty b/Master/texmf-dist/tex/luatex/luatexja/patches/lltjcore.sty index 94254e77222..63ba2336175 100644 --- a/Master/texmf-dist/tex/luatex/luatexja/patches/lltjcore.sty +++ b/Master/texmf-dist/tex/luatex/luatexja/patches/lltjcore.sty @@ -4,7 +4,7 @@ % \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{lltjcore}[2013/05/14 Patch to LaTeX2e Kernel for LuaTeX-ja] +\ProvidesPackage{lltjcore}[2015/01/01 Patch to LaTeX2e Kernel for LuaTeX-ja] \def\cleardoublepage{\clearpage\if@twoside \ifodd\c@page diff --git a/Master/texmf-dist/tex/luatex/luatexja/patches/lltjdefs.sty b/Master/texmf-dist/tex/luatex/luatexja/patches/lltjdefs.sty index 7eaf0c41bed..dac8b4eff92 100644 --- a/Master/texmf-dist/tex/luatex/luatexja/patches/lltjdefs.sty +++ b/Master/texmf-dist/tex/luatex/luatexja/patches/lltjdefs.sty @@ -3,7 +3,7 @@ % \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{lltjdefs}[2015/02/22 Default font settings of LuaTeX-ja] +\ProvidesPackage{lltjdefs}[2015/08/29 Default font settings of LuaTeX-ja] \def\ltj@stdmcfont{IPAExMincho} \def\ltj@stdgtfont{IPAExGothic} @@ -70,7 +70,7 @@ "1100-"11FF, "2F00-"2FFF, "3100-"31EF, "A000-"A4CF, "A830-"A83F, "AC00-"D7FF} \ltjdefcharrange{8}{"A7, "A8, "B0, "B1, "B4, "B6, "D7, "F7} -\ltjsetparameter{jacharrange={-1, +2, +3, -4, -5, +6, +7, +8}} +\ltjsetparameter{jacharrange={-1, +2, +3, -4, -5, +6, +7, -8}} \directlua{for x=128,255 do luatexja.math.is_math_letters[x] = true end} \def\<{\inhibitglue} diff --git a/Master/texmf-dist/tex/luatex/luatexja/patches/lltjfont.sty b/Master/texmf-dist/tex/luatex/luatexja/patches/lltjfont.sty index e53384d88cf..4855f503306 100644 --- a/Master/texmf-dist/tex/luatex/luatexja/patches/lltjfont.sty +++ b/Master/texmf-dist/tex/luatex/luatexja/patches/lltjfont.sty @@ -3,7 +3,7 @@ % \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{lltjfont}[2014/10/29 Patch to NFSS2 for LuaTeX-ja] +\ProvidesPackage{lltjfont}[2015/08/28 Patch to NFSS2 for LuaTeX-ja] \let\k@encoding\@empty \let\ck@encoding\@empty @@ -44,6 +44,13 @@ \ifmmode\copy\tstrutbox\else\unhcopy\tstrutbox\fi}} \def\zstrut{\relax\hbox{\tate \ifmmode\copy\zstrutbox\else\unhcopy\zstrutbox\fi}} + +{% + \def\cdp@elt#1#2#3#4{% + \directlua{luatexja.jfont.add_fenc_list('\luatexluaescapestring{#1}')}}% + \cdp@list% +} + \def\DeclareFontEncoding{% \begingroup \nfss@catcodes @@ -57,7 +64,7 @@ {\default@family}{\default@series}% {\default@shape}}% \expandafter\let\csname#1-cmd\endcsname\@changed@cmd - \def\enc@elt{\noexpand\enc@elt}% + \directlua{luatexja.jfont.add_fenc_list('\luatexluaescapestring{#1}')}% \else \@font@info{Redeclaring font encoding #1}% \fi @@ -88,7 +95,7 @@ {\default@k@family}{\default@k@series}% {\default@k@shape}}% \expandafter\let\csname#1-cmd\endcsname\@changed@kcmd - \directlua{luatexja.jfont.add_kyenc_list('\luatexluaescapestring{#1}')}% + \directlua{luatexja.jfont.add_kyenc_list('\luatexluaescapestring{#1}')}% \else \@font@info{Redeclaring KANJI (yoko) font encoding #1}% \fi @@ -145,6 +152,7 @@ \@empty \else \reserved@a \fi + \directlua{luatexja.jfont.add_ffam('\luatexluaescapestring{#2}')}% }% } \def\DeclareKanjiFamily#1#2#3{% @@ -157,6 +165,7 @@ \@empty \else \reserved@a \fi + \directlua{luatexja.jfont.add_kfam('\luatexluaescapestring{#2}')}% }% } \def\DeclareKanjiSubstitution#1#2#3#4{% @@ -443,65 +452,39 @@ \newif\if@notkfam \newif\if@notffam \newif\if@tempswz -\newif\if@ltj@use@fd -\@ltj@use@fdtrue +\def\@ltj@use@fd{true} \DeclareRobustCommand\romanfamily[1]{\edef\f@family{#1}} \DeclareRobustCommand\kanjifamily[1]{\edef\k@family{#1}} \DeclareRobustCommand\fontfamily[1]{% \@notkfamfalse\@notffamfalse \edef\tmp@item{'\luatexluaescapestring{#1}'}% - \edef\tmp@enc{'\luatexluaescapestring{\k@encoding}'}% - \ifcsname \k@encoding+#1\endcsname % if \k@encoding+#1 is already defined - \edef\k@family{#1}% - \else\if@ltj@use@fd - % search font definition file... - \directlua{luatexja.jfont.is_kfam(\tmp@enc, \tmp@item)}% - \ifin@\edef\k@family{#1}\else% - \directlua{luatexja.jfont.is_Nkfam(\tmp@enc, \tmp@item)}% - \ifin@\@notkfamtrue\else% - % filename of font definition file is always lowercase - \edef\@temp{\lowercase{\noexpand\IfFileExists{\k@encoding#1.fd}}}% - \message{(I search kanjifont definition file)}% - \@temp{\@tempswztrue}{\@tempswzfalse}% - \if@tempswz - \directlua{luatexja.jfont.add_kfam_list(\tmp@enc, \tmp@item)}% - \edef\k@family{#1}% - \else - \directlua{luatexja.jfont.add_Nkfam_list(\tmp@enc, \tmp@item)}% - \@notkfamtrue% - \fi - \fi - \fi - \else % do not use font definition file - \@notkfamtrue% - \fi\fi - \edef\tmp@enc{'\luatexluaescapestring{\f@encoding}'}% - \ifcsname \f@encoding+#1\endcsname - \edef\f@family{#1}% - \else % search font definition file... - \directlua{luatexja.jfont.is_ffam(\tmp@enc, \tmp@item)}% - \ifin@\edef\f@family{#1}\else - \directlua{luatexja.jfont.is_Nffam(\tmp@enc, \tmp@item)}% - \ifin@\@notffamtrue\else - % filename of font definition file is always lowercase - \edef\@temp{\lowercase{\noexpand\IfFileExists{\f@encoding#1.fd}}}% - \message{(I search font definition file)}% - \@temp{\@tempswztrue}{\@tempswzfalse}% - \if@tempswz - \directlua{luatexja.jfont.add_ffam_list(\tmp@enc, \tmp@item)}% - \edef\f@family{#1}% - \else - \directlua{luatexja.jfont.add_Nffam_list(\tmp@enc, \tmp@item)}% - \@notffamtrue% - \fi - \fi - \fi + % + \directlua{luatexja.jfont.search_kfam(\tmp@item, \@ltj@use@fd)}% + \ifin@\edef\k@family{#1}\else\@notkfamtrue\fi + % + % alphabetic fonts part + \directlua{luatexja.jfont.is_ffam(\tmp@item)}% + \ifin@\edef\f@family{#1}\else + % checking is_stored_ffam is not sufficient, + % since LuaTeX-ja doesn't know whats fonts are defined before LuaTeX-ja is loaded. + \ifcsname \f@encoding+#1\endcsname % easy case + \directlua{luatexja.jfont.add_ffam(\tmp@item)}\edef\f@family{#1}% + \else + \@tempswafalse + \def\cdp@elt##1{\ifcsname ##1+#1\endcsname\@tempswatrue\fi}% + \directlua{luatexja.jfont.search_ffam_declared()}% + \if@tempswz + \directlua{luatexja.jfont.add_ffam(\tmp@item)}\edef\f@family{#1}% + \else + % now we search Nffam_list and font definition files. + \directlua{luatexja.jfont.search_ffam_fd(\tmp@item)}% + \ifin@\edef\f@family{#1}\else\@notffamtrue\fi + \fi + \fi \fi + % \if@notkfam\if@notffam - {\ifcsname D@\k@encoding\endcsname\@nameuse{D@\k@encoding}\fi - \xdef\@@temp{\default@family}}\edef\k@family{\@@temp}% - {\ifcsname D@\f@encoding\endcsname\@nameuse{D@\f@encoding}\fi - \xdef\@@temp{\default@family}}\edef\f@family{\@@temp}% + \edef\k@family{#1}\edef\f@family{#1}% \fi\fi } \DeclareRobustCommand\romanseries[1]{\edef\f@series{#1}} diff --git a/Master/texmf-dist/tex/luatex/luatexja/patches/lltjp-geometry.sty b/Master/texmf-dist/tex/luatex/luatexja/patches/lltjp-geometry.sty index 1ac1cc0bd4e..76c983a9e7b 100644 --- a/Master/texmf-dist/tex/luatex/luatexja/patches/lltjp-geometry.sty +++ b/Master/texmf-dist/tex/luatex/luatexja/patches/lltjp-geometry.sty @@ -3,7 +3,7 @@ % \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{lltjp-geometry}[2015/01/01 Patch to geometry for LuaTeX-ja with vertical writing mode] +\ProvidesPackage{lltjp-geometry}[2015/01/04 Patch to geometry for LuaTeX-ja with vertical writing mode] \RequirePackage{ifluatex} \ifdefined\if@ltj@@geometry@tate\expandafter\endinput\fi diff --git a/Master/texmf-dist/tex/luatex/luatexja/patches/lltjp-listings.sty b/Master/texmf-dist/tex/luatex/luatexja/patches/lltjp-listings.sty index d14a48801ac..f2fc58a2335 100644 --- a/Master/texmf-dist/tex/luatex/luatexja/patches/lltjp-listings.sty +++ b/Master/texmf-dist/tex/luatex/luatexja/patches/lltjp-listings.sty @@ -3,7 +3,7 @@ % \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{lltjp-listings}[2015/01/07 Patch to listings for LuaTeX-ja] +\ProvidesPackage{lltjp-listings}[2015/01/08 Patch to listings for LuaTeX-ja] \RequirePackage{listings,luatexbase-cctb} %%%%%%%%%%%%%%%% Japanese support diff --git a/Master/texmf-dist/tex/luatex/luatexja/patches/lltjp-tascmac.sty b/Master/texmf-dist/tex/luatex/luatexja/patches/lltjp-tascmac.sty index 4498e824e1b..4f03d1ff751 100644 --- a/Master/texmf-dist/tex/luatex/luatexja/patches/lltjp-tascmac.sty +++ b/Master/texmf-dist/tex/luatex/luatexja/patches/lltjp-tascmac.sty @@ -4,7 +4,7 @@ % \dimen...=\tbaselineshift ==> \dimen...=\ltj@tablshift sp \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{lltjp-tascmac}[2014/12/17 Patch to (t)ascmac for LuaTeX-ja] +\ProvidesPackage{lltjp-tascmac}[2014/12/18 Patch to (t)ascmac for LuaTeX-ja] \RequirePackage{tascmac,luatexja} diff --git a/Master/texmf-dist/tex/luatex/luatexja/patches/lltjp-unicode-math.sty b/Master/texmf-dist/tex/luatex/luatexja/patches/lltjp-unicode-math.sty index d33e44f3787..0b6e5563733 100644 --- a/Master/texmf-dist/tex/luatex/luatexja/patches/lltjp-unicode-math.sty +++ b/Master/texmf-dist/tex/luatex/luatexja/patches/lltjp-unicode-math.sty @@ -3,14 +3,30 @@ % \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{lltjp-unicode-math}[2013/05/14 Patch to unicode-math for LuaTeX-ja] +\ProvidesPackage{lltjp-unicode-math}[2015/08/27 Patch to unicode-math for LuaTeX-ja] \RequirePackage{unicode-math,luatexja} \ExplSyntaxOn \group_begin: - \cs_gset:Npn \um_cs_set_eq_active_char:Nw #1 = "#2 \q_nil {%" + \tl_set:Nn \l_tmpa_tl { um_cs_set_eq_active_char:Nw } + \cs_if_exist:cT { __um_cs_set_eq_active_char:Nw } { + \tl_set:Nn \l_tmpa_tl { __um_cs_set_eq_active_char:Nw } + \cs_gset:Npn \use@mathgroup #1 #2 + { + \mode_if_math:T % <- not sure if this is really necessary since we've just checked for mmode and raised an error if not! + { + \math@bgroup + \cs_if_eq:cNF {M@\f@encoding} #1 {#1} + \__um_switchto_literal: + \ltj@tempcnta=#2 \expandafter\ltj@@mathJapaneseFonts\string#1\relax% + \ifin@ \jfam #2 \relax \else \mathgroup #2 \relax \fi + \math@egroup + } + } + } + \cs_gset:cpn { \tl_use:N \l_tmpa_tl } #1 = "#2 \q_nil {%" \group_begin: %\typeout {um: \string#1, \int_from_hexadecimal:n {#2}, #2}% <- for debug \char_set_lccode:nn { `! } { "#2 }%" |