%%% a test of ruby.
\documentclass[a4paper,10pt]{ltjsarticle}
\usepackage{luatexja-otf,amsmath}
-
+\usepackage[match]{luatexja-fontspec}
\usepackage[kozuka-pr6n]{luatexja-preset}\normalsize
\def\emph#1{\textbf{\textgt{#1}}}
\def\headfont{\normalfont\bfseries\gtfamily}
-\makeatletter
-\DeclareRobustCommand\ttfamily
- {\not@math@alphabet\ttfamily\mathtt
- \romanfamily\ttdefault\ttjfam\selectfont}
-\makeatother
-\newjfontfamily\ttjfam{KozGoPr6N-Regular.otf}
+\setmonojfont{KozGoPr6N-Regular.otf}
\usepackage[textwidth=45\zw, lines=45, footskip=6mm]{geometry}
-\usepackage{luatexja-adjust}%\ltjdisableadjust
\advance\leftmargini-1\zw\advance\leftmarginii-1\zw
-
+\protected\def\Param#1{\underline{\smash{\textsf{\mdseries #1}}}}
\usepackage{luatexja-ruby,showexpl,booktabs}
\lstset{
preset=\normalsize, basicstyle=\small\ttfamily, basewidth=0.5em,
explpreset={numberstyle=\tiny, numbers=left, numbersep=1em, columns=fixed},
}
+\makeatletter\let\SX@Info=\relax\makeatother
\fboxsep=0mm
\usepackage{hyperref,bookmark,xcolor}
pdftitle={luatexja-ruby.sty}
}
-
-\def\kata{\ltjsetruby{kata}}
-\def\notalign{\setkeys[ltj]{ruby}{stretchhead = {1}{2}{1}, stretchend = {1}{2}{1}}}
-% 行頭・行末で揃えない
-
\def\Node#1#2{\,\vcenter{\hbox{\fboxsep=1pt\fbox{\vbox{\small\halign{\hfil##\hfil\cr
#1\mathstrut\cr\noalign{\hrule height.4pt}\strut#2\cr}}}}\,}}
\def\LuaTeX{Lua\TeX}
\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$}}
\maketitle
\begin{abstract}
-\texttt{luatexja-ruby.sty} は,\LuaTeX-jaの機能を利用してルビの組版処理を行う追加パッケージである.
+\textsf{luatexja-ruby}パッケージは,\LuaTeX-jaの機能を利用してルビの組版処理を行う追加パッケージである.
\LuaTeX, \LuaTeX-jaの内部処理に割り込むことにより,熟語ルビ中の行分割や,
行頭形・行中形・行末形の自動検出,また進入許容量の自動設定などを可能とした.
\end{abstract}
\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}
\item[後突出禁止] \verb+{1}{1}{0}+
\end{description}
-\item[stretchhead=\{<left>\}\{<middle>\}\{<right>\}] 行頭形〜.
+\item[stretchbol=\{<left>\}\{<middle>\}\{<right>\}] 行頭形〜.
既定値は\ \verb+{0}{1}{1}+ である.
-\item[stretchend=\{<left>\}\{<middle>\}\{<right>\}] 行末形〜.
+\item[stretcheol=\{<left>\}\{<middle>\}\{<right>\}] 行末形〜.
既定値は\ \verb+{1}{1}{0}+ である.
\item[maxmargin=<real>] 親文字の方がルビより長い時に,ルビの先頭と親文字の先頭,及び
\item[kenten=<command>]各文字につく圏点の出力命令を指定する.既定値は「\verb+\ltjalchar`•+」
であり,\texttt{U+2022} (Bullet)を\textbf{ALchar}として出力することを指定している.
+
\item[fontcmd=<command>]ルビ用のフォント切り替え命令を指定する.
このキーの内容が実行された後に\ \verb+\fontsize...\selectfont+\ が実行されるので,
このキーの指定では最後に\ \verb+\selectfont+ を加える必要はない.
+この \texttt{fontcmd} キーの内容は多くの回数実行される.
+例えば,\textsf{luatexja-fontspec}パッケージを用いてOpenTypeフォントを用いる場合,
+\begin{lstlisting}
+ fontcmd=\addjfontfeatures{Style=Ruby}
+\end{lstlisting}
+のようにしてルビ用字形を用いることが可能だが,現在の実装ではタイプセットに時間がかかるようになる.
+
+
\end{description}
\medskip
\end{description}
\paragraph{\tt\textbackslash ltjsetruby\{<option>\}}
-<option>の既定値を指定する.\texttt{luatexja-ruby} 読み込み時の値は
+<option>の既定値を指定する.\textsf{luatexja-ruby}読み込み時の値は
各項目の所で既に説明してあるが,次のようになっている.
\begin{verbatim}
pre=-1, post=-1, mode=1,
stretchruby={1}{2}{1}, stretch = {1}{2}{1},
- stretchhead={0}{1}{1}, stretchend={1}{1}{0},
+ stretchbol={0}{1}{1}, stretcheol={1}{1}{0},
maxmargin=0.5, size=0.5, intergap=0, rubysmash=false,
kenten=\ltjalchar`•, fontcmd=\relax
\end{verbatim}
\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+ という別名を定義している.
同様に,段落先頭のルビは行頭形にはならない.
\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
は\ruby{俄}{にわか}に
\quad \ruby{休|憩|中}{きゆう|けい|ちゆう}かつ\ruby{視|聴|中}{し|ちよう|ちゆう}}
\item[標準] \sample
-\item[肩つき] {\kata\sample}
+\item[肩つき] {\ltjsetruby{kata}\sample}
\end{description}
\newpage
\ruby[maxmargin=0.75]{なげきの聖母像}{ピエタ}% ルビ全角1.5倍まで
% ルビが長い場合
3.71 \ruby{顧客}{クライアント}\quad \ruby{境界面}{インターフエース}
-3.72 {\ltjsetruby{stretch=010, stretchhead=010, stretchend=010}% はみ出さない流儀
+3.72 {\ltjsetruby{stretch=010, stretchbol=010, stretcheol=010}% はみ出さない流儀
\ruby{顧客}{クライアント}\quad \ruby{境界面}{インターフエース}}
\end{LTXexample}
% モノルビ配置.望ましくない
3.76× の\ruby{流}{りゆう}\ruby{儀}{ぎ}を\quad の\ruby{無}{む}\ruby{常}{じよう}を\quad%
-要調整 3.77\ {\ltjsetruby{stretchhead=121, stretchend=121}% 行頭・行末揃えず
+要調整 3.77\ {\ltjsetruby{stretchbol=121, stretcheol=121}% 行頭・行末揃えず
\hbox{\vrule\vbox{\hsize=10\zw ああああああああの%
\ruby{流|儀}{りゆう|ぎ}がある.}\vrule}\textbf{←なぜ改行できない}\quad%
\hbox{\vrule\vbox{\hsize=5\zw ……等の\ruby{無|常}{む|じよう}を}\vrule}}
\end{LTXexample}
\begin{LTXexample}[pos=t]
\obeylines
-3.85\ {\ltjsetruby{stretchhead=121, stretchend=121}% 行頭・行末揃えず
+3.85\ {\ltjsetruby{stretchbol=121, stretcheol=121}% 行頭・行末揃えず
\hbox{\vrule\vbox{\hsize=15\zw
\hskip9.5\zw……の\ruby{徑}{こみち}を……%
\hskip9\zw……の\ruby{徑}{こみち}を……}\vrule}}