[XeTeX] Ruby Annotation using XeTex?

Jonathan Kew jonathan_kew at sil.org
Thu Jul 20 18:35:19 CEST 2006


On 20 Jul 2006, at 4:46 pm, Pektiong Tân wrote:

> Hi there,
> I am wondering if there is a way to create ruby annotation using
> xetex? ( similar to what can be done using cjk-latex package + ruby
> package).
> Since the package "ruby" depends on "cjk", I can't just use this
> package. I think the ability of ruby annotation is important to some
> of the CJK users.

I haven't ever tried this (well, I haven't ever tried to use CJK  
stuff in standard LaTeX), but I just took a look at the ruby.sty  
file, and I think it should be pretty easy to modify it to work with  
xetex.

As a first step, try making a copy of ruby.sty, rename it xeruby.sty,  
and make two changes (besides the file identification at the top):

(1) remove the \RequirePackage line, so that it won't insist on  
loading CJK -- that's what will really interfere with xetex's built- 
in handling of the Unicode characters.

(2) add the definition (copied from CJK.sty)

     \newcommand\CJKglue{\hskip \z@ \@plus .08\baselineskip}

to the xeruby.sty file, as it wants to use this in some cases.

Then try a Unicode CJK document in xelatex, with \usepackage 
{xeruby}.... you should be able to say things like

   \ruby{你}{ni}\ruby{好}{hao}

and get ruby annotations.

This will not precisely reproduce everything that CJK+ruby does, but  
it should get you started.

JK



More information about the XeTeX mailing list