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.)



\setCJKmainfont{Hiragino Mincho Pro}
%\setCJKmainfont{VL Gothic}



rendering of previous code

  • I'm not surprised that hyphenation isn't possible when furigana is used. TeX hyphenates words, not sequences of boxes. – egreg Oct 12 '14 at 12:23
  • 1
    Tht ruby package is not fully compatible with xeCJK. Actually, the luatexja package is much better than xeCJK in Japanese typesetting. luatexja contains an addon package luatexja-ruby. It provides functionality of furigana annotation. You can check their manuals for details. – Qing Lee Oct 12 '14 at 14:07

ruby package is not implemented correct. I think this code piece will solve the problem:

\def\addCJKglue{\ifx\next\ruby \CJKglue \fi}

See also Displaying pinyin over Chinese characters, without impacting word spacing

| improve this answer | |
  • It is tricky. luatexja-ruby is more powerful. – Qing Lee Oct 12 '14 at 14:30
  • FWIW, in addition to your monkeypatch, I had to supply the package with the nooverlap option for proper rendering. Previously nooverlap and overlap did not seem to have much effect. – oals Oct 12 '14 at 15:24
  • @QingLee: Indeed. But luatexja-ruby requires LuaTeX. It would be nice if some Japanese developer (e.g. 八登崇之) could provide a better solution for XeTeX. – Leo Liu Oct 12 '14 at 15:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.