% ruby.sty by Hideki ISOZAKI isozaki@ntt-20.ntt.junet
% Jan. 25, 1988
%
% Usage:
% $@@h9TJ8(J\ruby{$@$U$j$,$J(J}{$@4A;z$d=O8l(J}$@8eB3J8(J
%

% for JLaTeX
\font\fivedmjhira=dmjhira5
\font\sixdmjhira=dmjhira6
\font\sevendmjhira=dmjhira7
% for JSliTeX
%\font\eightdmjhira=dmjhira8
%\font\tendmjhira=dmjhira10
%\font\twelvedmjhira=dmjhira12
%\font\fourteendmjhira=dmjhira14
%\font\seventeendmjhira=dmjhira17

\def\rubyfont{%
% for JLaTeX
\ifnum\jfsize=10\let\jhira=\fivedmjhira\fi%
\ifnum\jfsize=12\let\jhira=\sixdmjhira\fi%
\ifnum\jfsize=14\let\jhira=\sevendmjhira\fi%
\ifnum\jfsize=17\let\jhira=\eightdmjhira\fi%
% for JSliTeX
%\ifnum\jfsize=20\let\jhira=\tendmjhira\fi%
%\ifnum\jfsize=24\let\jhira=\twelvedmjhira\fi%
%\ifnum\jfsize=29\let\jhira=\fourteendmjhira\fi%
%\ifnum\jfsize=34\let\jhira=\seventeendmjhira\fi%
}

\def\ruby#1#2{%
\leavevmode\vbox{%
\baselineskip0.1em\hbox{\rubyfont #1}\hbox{#2}}%
\hskip\jintercharskip}
