If I use the ruby package to supply furigana for a kanji character, it seems to glue the characters right adjacent to the kanji closely together and preventing line breaks, creating odd and possibly excess spacing.
Is this a bug in the package and can I somehow fix it? Are there alternatives? (I found pxrubrica but that seems to be for platex only.)
\documentclass[12pt]{standalone}
\usepackage{setspace}
\usepackage{xeCJK}
\setCJKmainfont{Hiragino Mincho Pro}
%\setCJKmainfont{VL Gothic}
\usepackage{ruby}
\renewcommand\rubysep{-0.7em}
\begin{document}
\fbox{
\parbox{25em}{
\doublespacing
\ruby{青}{あお}いスーツ、\ruby{白}{しろ}いシャツ、\ruby{赤}{あか}いネクタイが\ruby{男}{だん}\ruby{性}{せい}\ruby{従}{じゆう}\ruby{業}{ぎよう}\ruby{員}{いん}\ruby{全
}{ぜん}\ruby{員}{いん}の\ruby{必}{ひつ}\ruby{需}{じゆ}\ruby{品}{ひん}だ。
}}
\end{document}

rubypackage is not fully compatible withxeCJK. Actually, theluatexjapackage is much better thanxeCJKin Japanese typesetting.luatexjacontains an addon packageluatexja-ruby. It provides functionality of furigana annotation. You can check their manuals for details. – Qing Lee Oct 12 '14 at 14:07