X-Git-Url: http://git.osdn.jp/view?a=blobdiff_plain;f=doc%2Fluatexja.dtx;h=271315a375bdddbbc2ade11baafcc5c4f4da275d;hb=db94e608b0fe848b08a050d4226f7fae8be1f87d;hp=98ad53fbfd3da95d69d0f448c5375261814413aa;hpb=09fa919ae761b3ba95df5d55681fdf888c979432;p=luatex-ja%2Fluatexja.git diff --git a/doc/luatexja.dtx b/doc/luatexja.dtx index 98ad53f..271315a 100644 --- a/doc/luatexja.dtx +++ b/doc/luatexja.dtx @@ -47,7 +47,8 @@ % \usepackage{amsmath,array,tikz,pict2e,multienum,float} -\usepackage{booktabs,multicol} +\usepackage{booktabs,multicol,luatexja-ruby} +\usepackage{xy} %%%%%%%% listings @@ -180,6 +181,7 @@ \catcode`\<=13 \def<#1>{{\normalfont\rm\itshape$\langle$#1\/$\rangle$}} +\let\LARG=< \maketitle \tableofcontents @@ -389,12 +391,10 @@ The followings are major changes from \pTeX: 但し,制御綴中に使える和文文字が\pTeX・\upTeX と全く同じではないことに注意すること. % -%<*en> -\item At the present, vertical typesetting (\emph{tategaki}), is not - supported in \LuaTeX-ja. -% %<*ja> -\item 現時点では,縦書きは\LuaTeX-jaではサポートされていない. +\item ****版からは,不安定ながらも\LuaTeX-ja における縦組みをサポートしている. +\LuaTeX のコールバックの制限などにより,特に異なった組方向のボックスを扱う場合には +仕様が異なるので注意すること. % \end{itemize} @@ -532,6 +532,7 @@ and \emph{Japanese fonts} for fonts used in \textbf{JAchar}. \item \Pkg{luatexbase} v0.6 \item \Pkg{xunicode} v0.981~(2011/09/09) \item \Pkg{adobemapping} (Adobe cmap and pdfmapping files) +\item \Pkg{everysel} \end{itemize} %<*en> @@ -569,7 +570,7 @@ $ tlmgr install luatexja \item W32\TeX\ (\texttt{luatexja.tar.xz}) \end{itemize} -例えば\TeX~Live~2013を利用しているなら,\LuaTeX-jaは\TeX~Live manager (\texttt{tlmgr})を +例えば\TeX~Live~2013以降を利用しているなら,\LuaTeX-jaは\TeX~Live manager (\texttt{tlmgr})を 使ってインストールすることができる. \begin{verbatim} $ tlmgr install luatexja @@ -702,7 +703,7 @@ IPA mj明朝などの大きいフォントを用いた場合には\LuaTeX より %<*en> \textbf{Note for MiK\TeX\ users}\quad \LuaTeX-ja requires that several CMap files% -\footnote{\texttt{UniJIS2004-UTF32-H} and \texttt{Adobe-Japan1-UCS2}.} +\footnote{\texttt{UniJIS2004-UTF32-\{H,V\}} and \texttt{Adobe-Japan1-UCS2}.} must be found from \LuaTeX. Strictly speaking, those CMaps are needed only in the first run of \LuaTeX-ja after installing or updating. @@ -711,7 +712,7 @@ so you will encounter an error like the following: % %<*ja> \LuaTeX-jaが動作するためには,\emph{導入・更新後の初回起動時に} -\texttt{UniJIS2004-UTF32-H}, \texttt{Adobe-Japan1-UCS2}という2つのCMapが +\texttt{UniJIS2004-UTF32-\{H,V\}}, \texttt{Adobe-Japan1-UCS2}という3つのCMapが \LuaTeX によって見つけられることが必要である. しかしMiK\TeX ではそのようになっていないので,次のエラーが発生するだろう: % @@ -750,25 +751,36 @@ run \LuaTeX-ja in this directory, and finally delete the temporaly directory. \begin{itemize} %<*en> -\item The following 6~Japanese fonts are preloaded: +\item The following 12~Japanese fonts are preloaded: \begin{center}\small -\begin{tabular}{ccccc} +\begin{tabular}{cccccc} \toprule +\textbf{direction}& \textbf{classification}&\textbf{font name}&\bf `10\,pt'&\bf`7\,pt'&\bf`5\,pt'\\\midrule +\smash{\raisebox{-1ex}{\emph{yoko} (horizontal)}}& \emph{mincho}&Ryumin-Light &\verb+\tenmin+&\verb+\sevenmin+&\verb+\fivemin+\\ \emph{gothic}&GothicBBB-Medium&\verb+\tengt+ &\verb+\sevengt+ &\verb+\fivegt+\\ +\midrule +\smash{\raisebox{-1ex}{\emph{tate} (vertical)}}& +\emph{mincho}&Ryumin-Light &\verb+\tentmin+&\verb+\seventmin+&\verb+\fivetmin+\\ +\emph{gothic}&GothicBBB-Medium&\verb+\tentgt+ &\verb+\seventgt+ &\verb+\fivetgt+\\ \bottomrule \end{tabular} \end{center} % %<*ja> -\item 以下の6つの和文フォントが定義される: +\item 以下の12個の和文フォントが定義される: \begin{center}\small -\begin{tabular}{ccccc} +\begin{tabular}{cccccc} \toprule -\emph{字体}&\emph{フォント名}&\bf `10\,pt'&\bf`7\,pt'&\bf`5\,pt'\\\midrule +\emph{組方向}&\emph{字体}&\emph{フォント名}&\bf `10\,pt'&\bf`7\,pt'&\bf`5\,pt'\\\midrule +\smash{\raisebox{-1ex}{横組}}& 明朝体&Ryumin-Light &\verb+\tenmin+&\verb+\sevenmin+&\verb+\fivemin+\\ ゴシック体&GothicBBB-Medium&\verb+\tengt+ &\verb+\sevengt+ &\verb+\fivegt+\\ +\midrule +\smash{\raisebox{-1ex}{縦組}}& +明朝体&Ryumin-Light &\verb+\tentmin+&\verb+\seventmin+&\verb+\fivetmin+\\ +ゴシック体&GothicBBB-Medium&\verb+\tentgt+ &\verb+\seventgt+ &\verb+\fivetgt+\\ \bottomrule \end{tabular} \end{center} @@ -845,13 +857,12 @@ plfonts.dtx} and \texttt{pldefs.ltx}): \begin{itemize} %<*en> -\item \texttt{JY3} is the font encoding for Japanese fonts (in horizontal direction).\\ -When vertical typesetting is supported by \LuaTeX-ja in the future, \texttt{JT3} will be used for vertical fonts. +\item The font encoding for Japanese fonts (fot horizontal direction) is \texttt{JY3}.\\ +\texttt{JT3} is used for Japanese fonts for vertical diraction. % %<*ja> -\item \texttt{JY3}は和文フォント用のフォントエンコーディングである(横書き用).\\ -将来的に,\LuaTeX-jaで縦書きがサポートされる際には,\texttt{JT3}を縦書き用として -用いる予定である. +\item 和文フォントのエンコーディングとしては,横組用には \texttt{JY3},縦組用には\ +\texttt{JT3}が用いられる. % %<*en> @@ -937,15 +948,16 @@ Okumura), namely, \Pkg{ltjclasses} and \Pkg{ltjsclasses}. %\section{フォントの変更} \subsection{plain \TeX~and~\LaTeXe} -\label{ssub-chgfnt} +\label{ssec-chgfnt} \paragraph{plain \TeX} %<*en> To change Japanese fonts in plain \TeX, you must use the command -\verb+\jfont+. So please see Subsection~\ref{ssec-jfont}. +\verb+\jfont+~and~\verb+\tfont+. So please see Subsection~\ref{ssec-jfont}. % %<*ja> -plain \TeX で和文フォントを変更するためには,\pTeX のように \verb+\jfont+ 命令を直接用いる. +plain \TeX で和文フォントを変更するためには, +\pTeX のように \verb+\jfont+ 命令や \verb+\tfont+ 命令を直接用いる. \ref{ssec-jfont}節を参照. % @@ -1011,7 +1023,7 @@ auto select&\verb+\fontencoding+&\verb+\fontfamily+&---&---&\verb+\usefont+\\ alphabetic fonts to \texttt{T1}. \verb+\fontfamily+ also changes the current Japanese font family, the current alphabetic font family, \emph{or both}. - For the detail, see Subsection~\ref{ssub-nfsspat}. + For the detail, see Subsection~\ref{ssec-nfsspat}. % %<*ja> ここで,\verb+\fontencoding{+\verb+}+ は,引数により和文側か欧文 @@ -1020,7 +1032,7 @@ auto select&\verb+\fontencoding+&\verb+\fontfamily+&---&---&\verb+\usefont+\\ \texttt{JY3}に変更し,\verb+\fontencoding{T1}+ は欧文フォント側を \texttt{T1}へと変更する.\verb+\fontfamily+ も引数により和文側,欧文 側,\emph{あるいは両方}のフォントファミリを変更する.詳細は - \ref{ssub-nfsspat}節を参照すること. + \ref{ssec-nfsspat}節を参照すること. % %<*en> @@ -1043,7 +1055,7 @@ auto select&\verb+\fontencoding+&\verb+\fontfamily+&---&---&\verb+\usefont+\\ %<*ja> 仮名書体を使う場合など,複数の和文フォントを組み合わせて使いたい場合は \ref{ssec-altfont}節の \verb+\ltjdeclarealtfont+ と,その\LaTeX 版の\ -\verb+\DeclareAlternateKanjiFont+(\ref{ssub-nfsspat}節)を参照せよ. +\verb+\DeclareAlternateKanjiFont+(\ref{ssec-nfsspat}節)を参照せよ. % \end{itemize} @@ -1644,7 +1656,7 @@ If you want to use these functions, load \Pkg{luatexja-otf} package. これら3オプションについては, \Pkg{luatexja-preset} パッケージにプリセットを使う時に一緒に指定するか, -あるいは対応する内容を\ref{ssub-chgfnt}節,\ref{ssub-nfsspat}節 (NFSS2) や +あるいは対応する内容を\ref{ssec-chgfnt}節,\ref{ssec-nfsspat}節 (NFSS2) や \ref{ssec-fontspec}節 (\Pkg{fontspec}) の方法で手動で指定する必要がある. % @@ -2442,6 +2454,380 @@ JIS~X~0213の範囲に広げると,差異はさらに大きくなる. % + + +%<*ja> +\section{縦組} +\label{sec-direction} +\LuaTeX 本体でも,$\Omega$・$\aleph$由来の機能として,複数の組方向をサポートしている. +しかし,\LuaTeX がサポートするのは \texttt{TLT},~\texttt{TRT}, \texttt{RTT},~\texttt{LTL}\ +のみであり,日本語の縦書きに使うのは望ましくない\footnote{% +和文文字だけならば \texttt{RTT} を使えばなんとかなると思うが, +欧文文字が入ってきた場合はうまくいかず,\texttt{RTR} という組方向が必要になる. +}.そのため,\LuaTeX-jaでは横組(\texttt{TLT})で組んだボックスを回転させる方式で +縦組を実装した. + +\subsection{サポートする組方向} +\begin{table}[t] +\caption{\LuaTeX-ja のサポートする組方向} +%\medskip +\label{tab-dir} +\centering\small +\def\obox#1{% + \setbox0=\hbox{\yoko\hbox{#1% + \large\ltjsetparameter{talbaselineshift=0pt}% + \vrule height 25pt width 0.4pt depth 15pt\kern-.2pt% + \raise25pt\hbox to 0pt{\hss\composite{*r^@{>>}}\hss}% + \raise-15pt\hbox to 0pt{\hss\composite{*l^@{>|}}\hss}\kern.2pt% + \vrule height.2pt depth.2pt width 60pt\hbox to 0pt{\hss\composite{*d^@{>}}\hss}\kern-60pt + \hbox to 60pt{\,銀は、Ag\hss}}}% + \raise\dimexpr 0.5\ltjgetdp0-0.5\ltjgetht0\box0% +} +\begin{tabular}{>{\bfseries}lccc} +\toprule +&\texttt{\textbackslash yoko}(横組)&\texttt{\textbackslash tate}(縦組) + &\texttt{\textbackslash dtou}\\ +\midrule +字送り方向&水平右向き(→)&垂直下向き(↓)&垂直上向き(↑)\\ +行送り方向&垂直下向き(↓)&水平左向き(←)&水平右向き(→)\\ +使用する和文フォント&横組用(\verb+\jfont+)&縦組用(\verb+\tfont+)&横組用(\verb+\jfont+)の + $90^\circ$回転\\[\smallskipamount] +組版例\null $^*$ &\obox{\yoko}&\obox{\tate}&\obox{\dtou}\\ +\noalign{\medskip} +\bottomrule +\end{tabular} + +\medskip\raggedright +\def\R#1{% + \raise0.38\zw\hbox{% + \vrule height.2pt depth.2pt width2\zw% + \hbox to 0pt{\hss\composite{*d^@{#1}}\hss}% + }% +} +$^*$\ 幅(width),高さ(height),深さ(depth)の増加方向を, +それぞれ「\R{>}」,「\R{>>}」,「\R{>|}」で表している. +\raggedright + +\end{table} + +\LuaTeX-jaがサポートする組方向は表\ref{tab-dir}に示す3つである. +4列目の \verb+\dtou+ は聞き慣れない命令だと思うが, +実は\pTeX に同名の命令が(ドキュメントには書かれていないが)存在する. +Down-TO-Upの意味なのだろう.\verb+\dtou+ を使用する機会はないだろうが, +\LuaTeX-jaではデバッグ用に実装している. + + +組方向は,\verb+\yoko+,~\verb+\tate+,~\verb+\dtou+ をそれぞれ使用することで, +現在作成中のリストやボックスが空の時にのみ変更可能である. + + +\subsection{異方向のボックス} + +縦組の中に「42」などの2桁以上の算用数字を横組で組むなど, +異なる組方向を混在させることがしばしば行われる. +組方向の混在も\pTeX と同じようにできる: +\begin{LTXexample} +ここは横組% yoko +\hbox{\tate % tate + \hbox{縦組}% tate + の中に + \hbox{\yoko 横組の内容}% yoko + を挿入する +} +また横組に戻る% yoko +\end{LTXexample} + +異なる組方向のボックスを配置した場合にどう組まれるかの仕様も,\pTeX を +踏襲している.表\ref{tab-diffdir}に示す. + +\begin{table}[t] +\caption{異方向のボックスの配置} +%\medskip +\label{tab-diffdir} + \centering\small\unitlength3mm + \def\TATEeg{% + \hbox{\smash{\begin{picture}(0,0)(-2,0) + \thicklines + \polyline(-2,0)(-2,-7)(5,-7)(5,0) + \put(0,0){\circle*{0.3}} + \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}}} + } + \def\DTOUeg{% + \hbox{\smash{\begin{picture}(0,0)(-5,0) + \thicklines + \polyline(-5,0)(-5,7)(2,7)(2,0) + \put(0,0){\circle*{0.3}} + \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}}} + } + \def\YOKOeg{% + \hbox{\smash{\begin{picture}(0,0) + \thicklines + \polyline(0,5)(7,5)(7,-2)(0,-2) + \put(0,0){\circle*{0.3}} + \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}}} + } +\begin{tabular}{ccc} +\toprule +\emph{横組中に配置}&\emph{縦組中に配置}&% +\emph{組方向\hskip\ltjgetparameter{xkanjiskip}\texttt{\textbackslash dtou}中に配置}\\ +\midrule + \parbox[c]{15\unitlength}{\begin{picture}(15,15)(0,-4) + \put(0,0){\line(1,0){3.8}} + \put(4,7){\TATEeg} + \put(11.2,0){\line(1,0){3.8}} +% + \put(2,7){\line(1,0){1.8}} + \put(3,3.5){\vector(0,1){3.5}\vector(0,-1){3.5}} + \put(2.8,3.5){\makebox(0,0)[r]{$H_{\mathrm{Y}}$}} + \put(3,-2){\vector(0,1){2}} + \put(2.8,-1){\makebox(0,0)[r]{$D_{\mathrm{Y}}$}} +% + \put(4,7.2){\line(0,1){1.8}} + \put(11,7.2){\line(0,1){1.8}} + \put(6,8){\vector(-1,0){2}} + \put(9,8){\vector(1,0){2}} + \put(7.5,8){\makebox(0,0){$W_{\mathrm{Y}}$}} +% + \end{picture}\vspace{-\baselineskip} + \begin{align*} + W_{\mathrm{Y}} &= h_{\mathrm{T}}+d_{\mathrm{T}},\\ + H_{\mathrm{Y}} &= w_{\mathrm{T}},\\ + D_{\mathrm{Y}} &=0\,\mathrm{pt} + \end{align*}% + }& + \parbox[c]{15\unitlength}{\begin{picture}(15,15)(0,-4) + \put(7.5,-0.2){\line(0,-1){2.8}} + \put(4,2){\YOKOeg} + \put(7.5, 7.2){\line(0,1){3.8}} +% + \put(2,7){\line(1,0){1.8}} + \put(2,0){\line(1,0){1.8}} + \put(3,5){\vector(0,1){2}} + \put(3,2){\vector(0,-1){2}} + \put(3,3.5){\makebox(0,0){$W_{\mathrm{T}}$}} +% + \put(4,7.2){\line(0,1){1.8}} + \put(11,7.2){\line(0,1){1.8}} + \put(8,8){\vector(-1,0){0.5}\vector(1,0){3}} + \put(7,8){\vector(-1,0){3}\vector(1,0){0.5}} + \put(9.25,8.2){\makebox(0,0)[b]{$H_{\mathrm{T}}$}} + \put(5.75,8.2){\makebox(0,0)[b]{$D_{\mathrm{T}}$}} +% + \end{picture}\vspace{-\baselineskip} + \begin{align*} + W_{\mathrm{T}} &= h_{\mathrm{Y}}+d_{\mathrm{Y}},\\ + H_{\mathrm{T}} &= w_{\mathrm{Y}}/2,\\ + D_{\mathrm{T}} &= w_{\mathrm{Y}}/2 + \end{align*}% + }& + \parbox[c]{15\unitlength}{\begin{picture}(15,15)(0,-4) + \put(11,-0.2){\line(0,-1){2.8}} + \put(4,2){\YOKOeg} + \put(11, 7.2){\line(0,1){3.8}} +% + \put(2,7){\line(1,0){1.8}} + \put(2,0){\line(1,0){1.8}} + \put(3,5){\vector(0,1){2}} + \put(3,2){\vector(0,-1){2}} + \put(3,3.5){\makebox(0,0){$W_{\mathrm{D}}$}} +% + \put(4,7.2){\line(0,1){1.8}} + \put(11,7.2){\line(0,1){1.8}} + \put(7.5,8){\vector(-1,0){3.5}\vector(1,0){3.5}} + \put(13,8){\vector(-1,0){2}} + \put(7.5,8.2){\makebox(0,0)[b]{$H_{\mathrm{D}}$}} + \put(12,8.2){\makebox(0,0)[b]{$D_{\mathrm{D}}$}} +% + \end{picture}\vspace{-\baselineskip} + \begin{align*} + W_{\mathrm{D}} &= h_{\mathrm{Y}}+d_{\mathrm{Y}},\\ + H_{\mathrm{D}} &= w_{\mathrm{Y}},\\ + D_{\mathrm{D}} &= 0\,\mathrm{pt} + \end{align*}% + }% +\\\midrule + \parbox[c]{15\unitlength}{\begin{picture}(15,15)(0,-4) + \put(0,0){\line(1,0){3.8}} + \put(4,0){\DTOUeg} + \put(11.2,0){\line(1,0){3.8}} +% + \put(2,7){\line(1,0){1.8}} + \put(3,3.5){\vector(0,1){3.5}\vector(0,-1){3.5}} + \put(2.8,3.5){\makebox(0,0)[r]{$H_{\mathrm{Y}}$}} + \put(3,-2){\vector(0,1){2}} + \put(2.8,-1){\makebox(0,0)[r]{$D_{\mathrm{Y}}$}} +% + \put(4,7.2){\line(0,1){1.8}} + \put(11,7.2){\line(0,1){1.8}} + \put(6,8){\vector(-1,0){2}} + \put(9,8){\vector(1,0){2}} + \put(7.5,8){\makebox(0,0){$W_{\mathrm{Y}}$}} +% + \end{picture}\vspace{-\baselineskip} + \begin{align*} + W_{\mathrm{Y}} &= h_{\mathrm{D}}+d_{\mathrm{D}},\\ + H_{\mathrm{Y}} &= w_{\mathrm{D}},\\ + D_{\mathrm{Y}} &= 0\,pt + \end{align*}% + }& + \parbox[c]{15\unitlength}{\begin{picture}(15,15)(0,-4) + \put(9,-0.2){\line(0,-1){2.8}} + \put(4,0){\DTOUeg} + \put(9, 7.2){\line(0,1){3.8}} +% + \put(2,7){\line(1,0){1.8}} + \put(2,0){\line(1,0){1.8}} + \put(3,5){\vector(0,1){2}} + \put(3,2){\vector(0,-1){2}} + \put(3,3.5){\makebox(0,0){$W_{\mathrm{T}}$}} +% + \put(4,7.2){\line(0,1){1.8}} + \put(11,7.2){\line(0,1){1.8}} + \put(6.5,8){\vector(-1,0){2.5}\vector(1,0){2.5}} + \put(10,8){\vector(-1,0){1}\vector(1,0){1}} + \put(10,8.2){\makebox(0,0)[b]{$H_{\mathrm{T}}$}} + \put(6.5,8.2){\makebox(0,0)[b]{$D_{\mathrm{T}}$}} +% + \end{picture}\vspace{-\baselineskip} + \begin{align*} + W_{\mathrm{T}} &= h_{\mathrm{D}}+d_{\mathrm{D}},\\ + H_{\mathrm{T}} &= d_{\mathrm{D}},\\ + D_{\mathrm{T}} &= h_{\mathrm{D}} + \end{align*}% + }& + \parbox[c]{15\unitlength}{\begin{picture}(15,15)(0,-4) + \put(6,-0.2){\line(0,-1){2.8}} + \put(4,7){\TATEeg} + \put(6, 7.2){\line(0,1){3.8}} +% + \put(2,7){\line(1,0){1.8}} + \put(2,0){\line(1,0){1.8}} + \put(3,5){\vector(0,1){2}} + \put(3,2){\vector(0,-1){2}} + \put(3,3.5){\makebox(0,0){$W_{\mathrm{D}}$}} +% + \put(4,7.2){\line(0,1){1.8}} + \put(11,7.2){\line(0,1){1.8}} + \put(5,8){\vector(-1,0){1}\vector(1,0){1}} + \put(8.5,8){\vector(-1,0){2.5}\vector(1,0){2.5}} + \put(5,8.2){\makebox(0,0)[b]{$H_{\mathrm{D}}$}} + \put(8.5,8.2){\makebox(0,0)[b]{$D_{\mathrm{D}}$}} +% + \end{picture}\vspace{-\baselineskip} + \begin{align*} + W_{\mathrm{D}} &= w_{\mathrm{T}},\\ + H_{\mathrm{D}} &= d_{\mathrm{T}},\\ + D_{\mathrm{D}} &= h_{\mathrm{T}} + \end{align*}% + }\\ +\bottomrule +\end{tabular} +\end{table} + + +\paragraph{\texttt{\textbackslash wd} は組方向には対応しない} +ボックスレジスタ \verb+\box+ にセットされているボックスの幅・高さ・深さの取得や +変更にはそれぞれ \verb+\wd+,~\verb+\ht+,~\verb+\dp+ プリミティブを用いるのであった. +\pTeX ではこれらのプリミティブは,「現在の組方向におけるボックスの寸法」を指すものであった. + +\LuaTeX-jaにおいては状況が異なり,\verb+\wd+,~\verb+\ht+,~\verb+\dp+ は\emph{組方向が +混在する状況においては正しく機能しない}.まず,現在の組方向に依存しないことが挙げられる. +\begin{LTXexample} +% yoko direction +\setbox0=\hbox to 20pt{foo} +\the\wd0,~\hbox{\tate\vrule\the\wd0} +\wd0=100pt +\the\wd0,~\hbox{\tate \the\wd0} +\end{LTXexample} +また,異方向のボックスの配置処理の関係で, +\verb+\lastbox+ を駆使してボックスのコピーを +作成した場合でも,\verb+\wd+ 等の値が異なる場合もある. +例えば,下の実行例における \verb+\wd1+ の値は,「縦組で組んだ時の \verb+\box0+ の +専有する幅」となる. +\begin{LTXexample} +% yoko direction +\setbox0=\hbox to 20pt{Xy} +\the\wd0, +\setbox0=\hbox{\tate\copy0} +\setbox0=\hbox{\tate\unhbox0 + \global\setbox1\lastbox} +\the\wd1 +\end{LTXexample} + +\paragraph{\texttt{\textbackslash wd} 等の代替命令} + +\pTeX のように現在の組方向に応じたボックスの寸法の取得・設定を行うため, +次の命令を新設した. + +\begin{cslist} + + \item[ltjgetwd\{\}\textrm{, }\textbackslash ltjgetht\{\}\textrm{, }% + \textbackslash ltjgetdp\{\}] +現在の組方向に応じたボックスの寸法の取得を行う.結果は内部長さであるため, +{\let\item=\origitem +\begin{verbatim} +\dimexpr 2\ltjgetwd{42}-3pt\relax, \the\ltjgetwd{1701} +\end{verbatim} +のように \verb+\wd+ の代わりとして扱うことができる.引数が1桁の場合は, +\verb+\ltjgetwd3+ のように引数をグループで括らなくても良いが,そうでない場合は +(通常の命令への引数のように)\verb+\ltjgetwd{42}+ とグループに括る必要がある. +使用例は以下の通りである. +\begin{LTXexample}[width=0.3\textwidth] +\parindent0pt +\setbox32767=\hbox{\yoko よこぐみ} +\fboxsep=0mm\fbox{\copy32767} +\vbox{\hsize=20mm +\yoko YOKO \the\ltjgetwd{32767}, \\ + \the\ltjgetht{32767}, \\ \the\ltjgetdp{32767}.} +\vbox{\hsize=20mm\raggedleft +\tate TATE \the\ltjgetwd{32767}, \\ + \the\ltjgetht{32767}, \\ \the\ltjgetdp{32767}.} +\vbox{\hsize=20mm\raggedleft +\dtou DTOU \the\ltjgetwd{32767}, \\ + \the\ltjgetht{32767}, \\ \the\ltjgetdp{32767}.} +\end{LTXexample}} + + \item[ltjsetwd=\textrm{, }\textbackslash ltjsetht=\textrm{, }% + \textbackslash ltjsetdp=] +現在の組方向に応じたボックスの寸法の設定を行う.\verb+\afterassignment+ を2回利用して +実装しているので,次の4通りは全て同じ意味である. +{\let\item=\origitem +\begin{verbatim} +\ltjsetwd42 20pt, \ltjsetwd42=20pt, \ltjsetwd=42 20pt, \ltjsetwd=42=20pt +\end{verbatim} +}% + +設定値は組方向ごとに独立して記録される. + +\end{cslist} + +\subsection{組方向の取得・条件判断} +「現在の組方向」や「番のボックスの組方向」は,以下の命令によって +知ることができる. + +\begin{cslist} + \item[ifydir\textrm{, }\textbackslash iftdir\textrm{, }\textbackslash ifddir] +現在の組方向が横組(\verb+\yoko+),縦組(\verb+\tate+),\verb+\dtou+ 方向であるかを +それぞれ判定する. + + \item[ifybox\{\}\textrm{, }\textbackslash iftbox\{\}\textrm{, }% + \textbackslash ifdbox\{\}] +番のレジスタの中身が横組ボックス,縦組ボックス,\verb+\dtou+ 方向の +ボックスか否かをそれぞれ判定する. + +\end{cslist} + +% + %\section{Font Metric and Japanese Font} %\section{フォントメトリックと和文フォント} %\subsection{\texttt{\textbackslash jfont}} @@ -2449,14 +2835,14 @@ JIS~X~0213の範囲に広げると,差異はさらに大きくなる. \label{ssec-jfont} %<*en> -To load a font as a Japanese font, you must use the +To load a font as a Japanese font (for horizontal direction), you must use the \verb+\jfont+ instead of~\verb+\font+, while \verb+\jfont+ admits the same syntax used in~\verb+\font+. \LuaTeX-ja automatically loads \Pkg{luaotfload} package, so TrueType/OpenType fonts with features can be used for Japanese fonts: % %<*ja> -フォントを和文フォントとして読み込むためには,\verb+\jfont+ を +フォントを(横組用)和文フォントとして読み込むためには,\verb+\jfont+ を \verb+\font+ プリミティブの代わりに用いる. \verb+\jfont+ の文法は \verb+\font+ と同じである. \LuaTeX-jaは\Pkg{luaotfload}パッケージを自動的に読み込むので, @@ -2524,8 +2910,8 @@ which JFM will be used for this font by the following keys: \toprule &\tt jfm-ujis.lua&\tt jfm-jis.lua&\tt jfm-min.lua\\ \midrule -%Example~1\cite{min10} -%例1\cite{min10} +%Example~1~\cite{min10} +%例1~\cite{min10} &\r{ujis}&\r{jis}&\r{min}\\ %Example~2 %例2 @@ -2540,14 +2926,15 @@ Bounding Box&\t{ujis}&\t{jis}&\t{min}\\ \begin{list}{}{\def\makelabel{\ttfamily}\def\{{\char`\{}\def\}{\char`\}}\advance\leftmargin1\zw} \item[jfm=] %<*en> -Specify the name of JFM. If specified JFM has not been loaded, \LuaTeX-ja search and load +Specify the name of (horizontal) JFM. +If specified JFM has not been loaded, \LuaTeX-ja search and load a file named \texttt{jfm-.lua}. The following JFMs are shipped with \LuaTeX-ja: % %<*ja> -JFMの名前を指定する.もし以前に指定されたJFMが読み込まれていなければ, -\texttt{jfm-.lua}を読み込む.以下のJFMが\LuaTeX-jaには同梱されている: +用いる(横組用)JFMの名前を指定する.もし以前に指定されたJFMが読み込まれていなければ, +\texttt{jfm-.lua}を読み込む.以下の横組用JFMが\LuaTeX-jaには同梱されている: % \begin{description} %<*en> @@ -2666,7 +3053,7 @@ because of the compatibility with previous versions of \LuaTeX-ja. 図\ref{fig:kern-jfm}を参照. \begin{itemize} \item \emph{\texttt{\textbackslash jfont} や, -NFSS2用の命令(\ref{ssub-chgfnt}節,\ref{ssub-nfsspat}節)における指定では +NFSS2用の命令(\ref{ssec-chgfnt}節,\ref{ssec-nfsspat}節)における指定では カーニング情報は標準で使用する}ことになっているようである. 言い換えれば,カーニング情報を使用しない設定にするには,面倒でも \begin{verbatim} @@ -2714,6 +3101,30 @@ letter-spacing and the width of italic correction are not correct: \S あいう\/ABC \end{LTXexample} +%\subsection{\texttt{\textbackslash tfont}} +%\subsection{\texttt{\textbackslash tfont} 命令} + +%<*en> +... +% +%<*ja> +\verb+\tfont+ はフォントを縦組用の和文フォントとして読み込む命令であり, +\verb+\jfont+ の文法は \verb+\jfont+ と同じである. +\verb+\tfont+ で定義された縦組用和文フォントは, +以下の点が \verb+\jfont+ による横組用和文フォントとは異なる: +\begin{itemize} + \item 出力時に,自動的に「\verb+vert+ feature相当」のグリフ置換が行われる. + これは,\Pkg{luaotfload}による各種featureのサポートとは全く別個に行われるもので, + いちいち \verb+vert+ featureを指定する必要はない. +\begin{verbatim} +\tfont\S=file:KozMinPr6N-Regular.otf:jfm=ujis % OK +\end{verbatim} + \item \ref{ssec-math}節で述べる,数式中の和文フォントには縦組用和文フォントは指定できない. + \item \texttt{jfm=}\ の部分には縦組用JFMを指定する.現在同梱されているのは, +OTFパッケージの \verb+upnmlminr-v.tfm+ を元にした\texttt{jfm-ujisv.lua}\ のみである. +\end{itemize} +% + %\subsection{Prefix \texttt{psft}} %\subsection{\texttt{psft}プリフィックス} \label{ssec-psft} @@ -2842,8 +3253,13 @@ floating-point numbers in design-size unit. %(required) %(必須) -%The direction of JFM. At the present, only \texttt{'yoko'} is supported. -%JFMの書字方向.現時点では横書き(\texttt{'yoko'})のみがサポートされる. +%<*en> +The direction of JFM. \texttt{'yoko'}~(horizontal) +or \texttt{'tate'}~(vertical) are supported. +% +%<*ja> +JFMの書字方向.\texttt{'yoko'}(横組)と \texttt{'tate'}(縦組)がサポートされる. +% \item[zw=] %(required) @@ -3851,6 +4267,8 @@ for the same character. %[\TeX の \verb+\scriptscriptfont+] \item[\Param{yjabaselineshift}\,=]\ \item[\Param{yalbaselineshift}\,=] [\verb+\ybaselineshift+] +\item[\Param{tjabaselineshift}\,=]\ +\item[\Param{talbaselineshift}\,=] [\verb+\tbaselineshift+] \item[\Param{jaxspmode}\,=\{,\}$^\ast$] @@ -4294,30 +4712,19 @@ are typeset by \verb+\piyo+. %\subsection{Patch for NFSS2} %\subsection{NFSS2へのパッチ} -\label{ssub-nfsspat} +\label{ssec-nfsspat} \begin{figure}[!tb] -\begin{lstlisting}[numberstyle=\tiny, numbers=left, numbersep=1em] +\begin{LTXexample}[pos=b] \DeclareKanjiFamily{JY3}{edm}{} -\DeclareFontShape{JY3}{edm}{m}{n} {<-> s*KozMinPr6N-Regular:jfm=ujis;-kern}{} -\DeclareFontShape{JY3}{edm}{m}{green}{<-> s*KozMinPr6N-Regular:jfm=ujis;-kern;color=007F00}{} -\DeclareFontShape{JY3}{edm}{m}{blue} {<-> s*KozMinPr6N-Regular:jfm=ujis;-kern;color=0000FF}{} +\DeclareFontShape{JY3}{edm}{m}{n} {<-> s*KozMinPr6N-Regular:jfm=ujis;}{} +\DeclareFontShape{JY3}{edm}{m}{green}{<-> s*KozMinPr6N-Regular:jfm=ujis;color=007F00}{} +\DeclareFontShape{JY3}{edm}{m}{blue} {<-> s*KozMinPr6N-Regular:jfm=ujis;color=0000FF}{} \DeclareAlternateKanjiFont{JY3}{edm}{m}{n}{JY3}{edm}{m}{green}{"4E00-"67FF,{-2}-{-2}} \DeclareAlternateKanjiFont{JY3}{edm}{m}{n}{JY3}{edm}{m}{blue}{ "6800-"9FFF} {\kanjifamily{edm}\selectfont 日本国民は、正当に選挙された国会における代表者を通じて行動し、……} -\end{lstlisting} -\begin{quote} -\DeclareKanjiFamily{JY3}{edm}{} -\DeclareFontShape{JY3}{edm}{m}{n} {<-> s*KozMinPr6N-Regular:jfm=ujis;-kern}{} -\DeclareFontShape{JY3}{edm}{m}{green}{<-> s*KozMinPr6N-Regular:jfm=ujis;-kern;color=007F00}{} -\DeclareFontShape{JY3}{edm}{m}{blue} {<-> s*KozMinPr6N-Regular:jfm=ujis;-kern;color=0000FF}{} -\DeclareAlternateKanjiFont{JY3}{edm}{m}{n}{JY3}{edm}{m}{green}{"4E00-"67FF,{-2}-{-2}} -\DeclareAlternateKanjiFont{JY3}{edm}{m}{n}{JY3}{edm}{m}{blue}{ "6800-"9FFF} - -{\kanjifamily{edm}\selectfont -日本国民は、正当に選挙された国会における代表者を通じて行動し、……} -\end{quote} +\end{LTXexample} %\caption{\texttt{\textbackslash DeclareAlternateKanjiFont} の使用例} %\caption{An example of \texttt{\textbackslash DeclareAlternateKanjiFont}} \label{fig:altkanji} @@ -4327,13 +4734,13 @@ are typeset by \verb+\piyo+. Japanese patch for NFSS2 in \LuaTeX-ja is based on \texttt{plfonts.dtx} which plays the same role in \pLaTeXe. We will describe -commands which are not described in Subsection~\ref{ssub-chgfnt}. +commands which are not described in Subsection~\ref{ssec-chgfnt}. % %<*ja> \LuaTeX-jaのNFSS2への日本語パッチは \pLaTeXe で同様の役割を果たす \texttt{plfonts.dtx} をベースに, 和文エンコーディングの管理等をLuaで書きなおしたものである. -ここでは\ref{ssub-chgfnt}節で述べていなかった命令について +ここでは\ref{ssec-chgfnt}節で述べていなかった命令について 記述しておく. % @@ -4379,22 +4786,23 @@ but on the other hand \verb+\zw+~and~\verb+\zh+ are specified by JFM. \item[DeclareYokoKanjiEncoding\{\}\{\}\{\}] +\item[DeclareYokoKanjiEncoding\{\}\{\}\{\}] %<*en> In NFSS2 under \LuaTeX-ja, distinction between alphabetic font families and Japanese font families are only made by their encodings. For example, encodings OT1 and T1 are for alphabetic font families, and a Japanese font family cannot - have these encodings. This command defines a new encoding - scheme for Japanese font family (in horizontal direction). + have these encodings. These command define a new encoding + scheme for Japanese font family. % %<*ja> \LuaTeX-jaのNFSS2においては,欧文フォントファミリと和文フォントファミリは そのエンコーディングによってのみ区別される. 例えば,OT1とT1のエンコーディングは欧文フォントファミリに対するものであり, 和文フォントファミリはこれらのエンコーディングを持つことはできない. -このコマンドは横書き用和文フォントのための新しいエンコーディングを -定義する. +これらコマンドは横組用・縦組用和文フォントのための新しいエンコーディングを +それぞれ定義する. % \item[DeclareKanjiEncodingDefaults\{\}\{\}] @@ -4482,9 +4890,7 @@ to match the vertical center of ``M'' and that of ``あ'' in vertical typesetti + d_{\text{あ}} - d_{\text{M}}, \] where $h_{a}$~and~$d_{a}$ denote the height of ``$a$'' and the depth, respectively. - -Current \LuaTeX-ja does not support vertical typesetting, so -this \verb+\adjustbaseline+ has almost no effect. +In \LuaTeX-ja, this \verb+\adjustbaseline+ does same task. % %<*ja> \pLaTeXe では,\verb+\adjustbaseline+ は縦書時に「M」と「あ」の中心線を一致させるために, @@ -4495,9 +4901,7 @@ this \verb+\adjustbaseline+ has almost no effect. + d_{\text{あ}} - d_{\text{M}}, \] ここで,$h_{a}$,~$d_{a}$はそれぞれ「$a$」の高さ・深さを表す. - -現在の\LuaTeX-jaは縦書きをサポートしていないので,この \verb+\adjustbaseline+ は -ほとんど何もしていない. +\LuaTeX-jaにおいても\verb+\adjustbaseline+ は同様の処理を行っている. % \item[fontfamily\{\}] @@ -4531,7 +4935,8 @@ to . Which family will be changed is determined as follows: \verb+\DeclareKanijFamily+. % %<*ja> -\item エンコーディングにおけるファミリが既に \verb+\DeclareKanjiFamily+ によって定義されている. +\item エンコーディングにおけるファミリが +既に \verb+\DeclareKanjiFamily+ によって定義されている. % %<*en> \item A font definition named \texttt{.fd} (the file name is @@ -4571,9 +4976,11 @@ In this case, the default family for font substitution is used for \item[DeclareAlternateKanjiFont\{\}\{\}\{\}\{\}\\ \null\hfill\{\}\{\}\{\}\{\}\{\}] %<*ja> -\ref{ssec-altfont}節の -\verb+\ltjdeclarealtfont+ と同様に,前半の4引数の和文フォント(基底フォント)のうち中の文字を -第5--第8引数の和文フォントを使って組むように指示する.使用例を図\ref{fig:altkanji}に載せた. +\ref{ssec-altfont}節の\ +\verb+\ltjdeclarealtfont+ と同様に,前半の4引数の +和文フォント(基底フォント)のうち中の文字を +第5--第8引数の和文フォントを使って組むように指示する. +使用例を図\nobreak\ref{fig:altkanji}に載せた. {\let\item\origitem %\advance\linewidth-2em @@ -4696,6 +5103,60 @@ will not be embedded in the output PDF file. See Subsection~\ref{ssec-psft}. これを指定することで,PDFに埋め込まれない「名前だけ」のフォントを指定することが できる.\ref{ssec-psft}節を参照. % + + +\begin{figure}[!tb] +\begin{LTXexample}[pos=b] +\jfontspec[ + AltFont={ + {Range="4E00-"67FF, Color=007F00}, + {Range="6800-"9EFF, Color=0000FF}, + {Range="3040-"306F, Font=KozGoPr6N-Regular}, + } +]{KozMinPr6N-Regular} +日本国民は、正当に選挙された国会における代表者を通じて行動し、われらとわれらの子孫のために、 +諸国民との協和による成果と、わが国全土にわたつて自由のもたらす恵沢を確保し、…… +\end{LTXexample} +%\caption{\texttt{AltFont} の使用例} +%\caption{An example of \texttt{AltFont}} +\label{fig:altkanji-fontspec} +\end{figure} + +\item[AltFont]\ + +%<*en> +As \verb+\ltjdeclarealtfont+~(Subsection~\ref{ssec-altfont}) and +\verb+\DeclareAlternateKanjiFont+~(Subsection~\ref{ssec-nfsspat}), +with this key, one can typeset some Japanese characters +by a different font and/or using different features. +The \texttt{AltFont} feature takes a comma-separated list of comma-separated lists, +as the following: +% +%<*ja> +\ref{ssec-altfont}節の \verb+\ltjdeclarealtfont+ や, +\ref{ssec-nfsspat}節の \verb+\DeclareAlternateKanjiFont+ と同様に, +このキーを用いると一部の文字を異なったフォントやfont featureを使って組むことができる. +\texttt{AltFont} に指定する値は,次のように二重のコンマ区切りリストである: +% +\begin{lstlisting}[escapechar=\#] +AltFont = { + ... + { Range=#\LARG range>#, #\LARG features>#}, + { Range=#\LARG range>#, Font=#\LARG font~name>#, #\LARG features># }, + { Range=#\LARG range>#, Font=#\LARG font~name># }, + ... +} +\end{lstlisting} +%<*en> +Each sublist should have the \texttt{Range} key +(sublist which does not contain \texttt{Range} key is simply ignored). +A demonstrartion is shown in Figure~\ref{fig:altkanji-fontspec}. +% +%<*ja> +各部分リストには \texttt{Range} キーが必須である(含まれない部分リストは +単純に無視される). +指定例は図\ref{fig:altkanji-fontspec}に示した. +% \end{list} %<*ja> @@ -4704,7 +5165,6 @@ will not be embedded in the output PDF file. See Subsection~\ref{ssec-psft}. % - \subsection{\texttt{luatexja-otf.sty}} \label{ssec-ltjotf} %<*en> @@ -4949,15 +5409,113 @@ for making the difference obvious. \item[\textsf{adjust}\,=] \verb+\ltjsetparameter+ で指定可能な追加パラメータであり, が\textit{true}なら \verb+\ltjenableadjust+ を, そうでなければ \verb+\ltjdisableadjust+ を実行する. - - \end{list} +% +\subsection{\texttt{luatexja-ruby.sty}} +%<*en> +This addon package provides functionality of ``ruby'' (\emph{furigana}) annotations +using callbacks of \LuaTeX-ja. +There is no detailed manual of \Pkg{luatexja-ruby.sty} in English. +(Japanese manual is another PDF file, \url{luatexja-ruby.pdf}.) +% +%<*ja> +この追加パッケージは,\LuaTeX-jaの機能を利用したルビ(振り仮名)の組版機能を提供する. +前後の文字種に応じた前後への自動進入や, +行頭形・行中形・行末形の自動的な使い分けが特徴である. +ルビ組版に設定可能な項目や注意事項が多いため,本追加パッケージの詳細な説明は +使用例と共に \url{luatexja-ruby.pdf}\ という別ファイルに載せている. +この節では簡単な使用方法のみ述べる. +% +\begin{description} +%<*en> + \item[Group-ruby] +By default, ruby characters (the second argument of \verb+\ruby+) +are attached to base characters (the first argument), as one object. +This type of ruby is called \emph{group-ruby}. +% +%<*ja> + \item[グループルビ] 標準ではグループルビの形で組まれる.第1引数に親文字, +第2引数にルビを記述する. +% +\begin{LTXexample}[width=0.3\textwidth] +東西線\ruby{妙典}{みようでん}駅は……\\ +東西線の\ruby{妙典}{みようでん}駅は……\\ +東西線の\ruby{妙典}{みようでん}という駅……\\ +東西線\ruby{葛西}{かさい}駅は…… +\end{LTXexample} +%<*en> +As the above example, ruby hangover is allowed on the Hiragana before/after +its base characters. +% +% この例のように,標準では前後の平仮名にルビ全角までかかるようになっている. + +%<*en> +\item[Mono-ruby] +To attach ruby characters to each base characters (\emph{mono-ruby}), +one should use \verb+\ruby+ multiple times: +% +%<*ja> + \item[モノルビ] 親文字を1文字にするとモノルビとなる. +2文字以上の熟語をモノルビの形で組みたい場合は,面倒でも +その数だけ \verb+\ruby+ を書く必要がある. +% +\begin{LTXexample}[width=0.3\textwidth] +東西線の\ruby{妙}{みよう}\ruby{典}{でん}駅は…… +\end{LTXexample} +%<*en> + \item[Jukugo-ruby] +Vertical bar~\verb+|+ denotes a boundary of \emph{groups}. +% +%<*ja> + \item[熟語ルビ] 引数内の縦棒 \verb+|+ はグループの区切りを表し, +複数グループのルビは熟語ルビとして組まれる. +\cite{x4051}にあるように, +どのグループでも「親文字」が対応するルビ以上の長さの場合は +各グループごとに,そうでないときは全体をまとめて1つのグループルビとして組まれる. +\cite{jlreq}で規定されている組み方とは異なるので注意. +% +\begin{LTXexample} +\ruby{妙|典}{みよう|でん}\ +\ruby{葛|西}{か|さい}\ +\ruby{神楽|坂}{かぐら|ざか} +\end{LTXexample} +%<*en> +If there are multiple groups in one \verb+\ruby+ call, +A linebreak between two groups is allowed. +% +% 複数ルビではグループとグループの間で改行が可能である. +\begin{LTXexample}[width=0.3\textwidth] +\vbox{\hsize=6\zw\noindent + \hbox to 2.5\zw{}\ruby{京|急|蒲|田}{けい|きゆう|かま|た} + \hbox to 2.5\zw{}\ruby{京|急|蒲|田}{けい|きゆう|かま|た} + \hbox to 3\zw{}\ruby{京|急|蒲|田}{けい|きゆう|かま|た} +} +\end{LTXexample} +\end{description} +%<*en> +If the width of ruby characters are longer than that of base characters, +\verb+\ruby+ automatically selects the appropriate form +among the line-head form, the line-middle form, and the line-end form. +% +%<*ja> +また,ルビ文字のほうが親文字よりも長い場合は,自動的に +行頭形・行中形・行末形のいずれか適切なものを選択する. % +\begin{LTXexample}[width=0.3\textwidth] +\vbox{\hsize=8\zw\noindent +\null\kern3\zw ……を\ruby{承}{うけたまわ}る + \kern1\zw ……を\ruby{承}{うけたまわ}る\\ +\null\kern5\zw ……を\ruby{承}{うけたまわ}る +} +\end{LTXexample} + + + @@ -4980,6 +5538,7 @@ Here the following is the list of dimensions and attributes which are used in \L \begin{list}{}{% \def\makelabel{\ttfamily}\advance\leftmargin1\zw \def\dim#1{\item[\textbackslash #1\ \textrm{(dimension)}]} +\def\cnt#1{\item[\textbackslash #1\ \textrm{(counter)}]} \def\attr#1{\item[\textbackslash #1\ \textrm{(attribute)}]} } @@ -5041,10 +5600,18 @@ Current number of Japanese font family for math formulas. \attr{ltj@curjfnt} %<*en> -The font index of current Japanese font. +The font index of current Japanese font for horizontal direction. % %<*ja> -現在の和文フォントのフォント番号. +現在の横組用和文フォントのフォント番号. +% + +\attr{ltj@curtfnt} +%<*en> +The font index of current Japanese font for vertical direction. +% +%<*ja> +現在の縦組用和文フォントのフォント番号. % \attr{ltj@charclass} @@ -5071,6 +5638,9 @@ The amount of shifting the baseline of Japanese fonts in scaled point ($2^{-16}\ スケールド・ポイント($2^{-16}\,\textrm{pt}$)を単位とした和文フォントのベースラインの移動量. % +\attr{ltj@tablshift} +\attr{ltj@tkblshift} + \attr{ltj@autospc} %<*en> Whether the auto insertion of \Param{\hyperlink{fld:kanjiskip}{kanjiskip}} is allowed at the node. @@ -5154,18 +5724,42 @@ $i$は7より小さい自然数. これら7つの属性レジスタは,どの文字ブロックが\textbf{JAchar}のブロックとして 扱われるかを示すビットベクトルを格納する. % + +\cnt{ltj@dir@count} +%<*ja> +現在の組方向を表す. +% +\begin{description} +\item[\textit{dir\_dtou} (1)] +\item[\textit{dir\_tate} (3)] +\item[\textit{dir\_yoko} (4)] +\end{description} + +\attr{ltj@dir} +%<*ja> +ボックスにおける組方向を示す.上記の3つの値(1,~3,~4)の他に, +それらに次を加えた値(17,~19, 20, 33, 35,~36)もとり得る. +% +\begin{description} +\item[\textit{dir\_node\_auto} (16)] +\item[\textit{dir\_node\_manual} (32)] +\end{description} + + \end{list} %<*en> Furthermore, \LuaTeX-ja uses several user-defined whatsit nodes for -inrernal processing. All those nodes store a natural number (hence the node's -\texttt{type} is 100). +inrernal processing. All those nodes except \emph{direction} whatsits +store a natural number (hence its \texttt{type} is 100). +\emph{direction} whatsits store a node list, hence its \texttt{type} is 110. Their \texttt{user\_id} (used for distinguish user-defined whatsits) are allocated by \texttt{luatexbase.newuserwhatsitid}. % %<*ja> さらに,\LuaTeX-jaはいくつかのuser-defined whatsit nodeを内部処理に用いる. -これらのwhatsitノードの \texttt{type} は100であり,ノードは自然数を格納している. +\textit{direction} whatsitはノードリストを格納するが, +それ以外のwhatsitノードの \texttt{type} は100であり,ノードは自然数を格納している. user-defined whatsitを識別するための \texttt{user\_id} は\ \texttt{luatexbase.newuserwhatsitid} により確保されており, 下の見出しは単なる識別用でしかない. @@ -5231,6 +5825,9 @@ for its label before the actual contents. So \dots 「段落の開始」を意味するノード. list環境,itemize環境などにおいて,\verb+\item+ で始まる各項目は…… % + +\item[\textit{direction}] + \end{description} %<*en> @@ -6597,7 +7194,7 @@ Consider the following input: 例えば次のような入力を考えよう: % \begin{verbatim*} -\begin{lstlisting}[escapechar=`\#] +\begin{lstlisting}[escapechar=\#] #\ほげ xぴよ# \end{lstlisting} \end{verbatim*} @@ -7213,6 +7810,13 @@ nilでないをキャッシュに保存する. \end{list} % + +%<*ja> +\section{縦組の実装} + + +% + \begin{thebibliography}{99} \addcontentsline{toc}{section}{\refname} \bibitem{texbytopic} @@ -7232,10 +7836,14 @@ TUG 2013, October 2013. Requirements for Japanese Text Layout (W3C Working Group Note), 2011, 2012. \newblock \url{http://www.w3.org/TR/jlreq/}% % \\日本語訳の書籍版:W3C日本語組版タスクフォース(編),『W3C技術ノート 日本語組版処理の要件』,東京電機大学出版局,2012. -\bibitem{min10} 乙部厳己,min10フォントについて.\\\null\hfill +\bibitem{min10} 乙部厳己.min10フォントについて.\\\null\hfill \url{http://argent.shinshu-u.ac.jp/~otobe/tex/files/min10.pdf} -\bibitem{x4051} 日本工業規格(Japanese Industrial Standard), JIS~X~4051, +\bibitem{x4051} 日本工業規格(Japanese Industrial Standard). JIS~X~4051, 日本語文書の組版方法(Formatting rules for Japanese documents), 1993, 1995, 2004. +\bibitem{ptexdoc} 濱野尚人,田村明史,倉沢良一.\TeX の出版への応用—縦組み機能の組み込み—. +\\\null\hfill\texttt{.../texmf-dist/doc/ptex/base/ptexdoc.pdf} +\bibitem{ptextug} Hisato Hamano. \newblock +\textit{Vertical Typesetting with \TeX}, TUGBoat~\textbf{11}(3), 346--352, 1990. \end{thebibliography} \newpage