> \usepackage[overlap, CJK]{ruby}

You are asking for overlapping ruby.  From ruby.txt:

    o The ruby has a smaller width than its base character:

        The behaviour is identical to an ordinary CJK character.

    o The ruby has a greater width than its base character:

        + Overlapping ruby:

            . If the previous or next character is a CJK character
              (ordinary or punctuation), insert unbreakable glue
              between.

            . If the previous or next character is a ruby, handle both
              ruby as non-overlapping and insert unbreakable glue
              between.

    [...]

> It seems that it is due to adjusting CJKglue.

The problem is twofold.

  1. Almost all Pinyin syllables have a greater width than the
     corresponding CJK base glyphs.  Since you increase \CJKglue you
     shouldn't use the `overlap' option.

  2. The kern value marker emitted by \ruby doesn't handle CJK glyphs
     properly.  This is a buglet which I have to fix -- I have to
     introduce a new kern value marker which indicates both ruby and
     CJK.  As a workaround, extend \ruby as in the code below.

BTW, you don't need `%' since the \ruby macro ends with \ignorespaces
if option `CJK' of ruby.sty is used.


    Werner


======================================================================


\documentclass[12pt]{article}
\usepackage{CJK}
\usepackage[CJK]{ruby}
\usepackage{pinyin}


\DeclareRobustCommand{\Ruby}[2]{%
  \ruby{#1}{#2}%
  \kern -1sp
  \kern 1sp}

\renewcommand{\baselinestretch}{1.5}   % ~ double space
\renewcommand{\rubysep}{-1ex}          % compensate \baselinestretch
\renewcommand{\CJKglue}{\hskip 6pt plus 0.08\baselineskip}


\begin{document}
\begin{CJK}{UTF8}{bsmi}
\Ruby{以}{\yi3}
\Ruby{前}{\qian2}
\Ruby{在}{\zai4}
\Ruby{我}{\wo3}
\Ruby{六}{\liu4}
\Ruby{歲}{\sui4}
\Ruby{的}{\de5}
\Ruby{時}{\shi2}
\Ruby{候}{\hou4}
,
\Ruby{我}{\wo3}
\Ruby{在}{\zai4}
\Ruby{一}{\yi4}
\Ruby{本}{\ben3}
\Ruby{書}{\shu1}
\Ruby{上}{\shang4}
\Ruby{看}{\kan4}
\Ruby{到}{\dao4}
\Ruby{一}{\yi4}
\Ruby{張}{\zhang1}
\Ruby{非}{\fei1}
\Ruby{常}{\chang2}
\Ruby{駭}{\hai4}
\Ruby{人}{\ren2}
\Ruby{的}{\de5}
\Ruby{圖}{\tu2}
。
\end{CJK}
\end{document}
_______________________________________________
Cjk maillist  -  [email protected]
https://lists.ffii.org/mailman/listinfo/cjk

Reply via email to