[XeTeX] Issue with CJK in pdf build

maxwell maxwell at umiacs.umd.edu
Thu Nov 19 04:56:24 CET 2009


Wilfred van Rooijen <wvanrooijen at yahoo.com> wrote:
> What I don't understand is that the dblatex manual apparently states
> that mixing 'languages' (scripts, rather) is not possible.

I'm getting into this conversation late (I'm on vacation), and I haven't
read all the previous msgs.  But--if the dblatex manual says that, then the
manual is out of date wrt the program.  That might be because dblatex was
originally set up to produce only LaTeX output, i.e. with an 8-bit
encoding, for which mixing languages might be a problem.  As it turned out,
that was not a real limitation, and I was able to get XeTeX output from it
by a kludge a couple years ago.  The author of dblatex, Benoît Guillon,
quickly modified his program so as to produce valid XeTeX output using a
command line parameter to specify the target, so I no longer needed the
kludge.

We have used dblatex + XeLaTeX to produce grammars where English is the
language of description, and the examples etc. are in Bengali, Urdu, and
now Pashto.  We use a small xetex command file to set the main font and to
assign commands to use fonts for other languages, and to make a few other
adjustments--basically a small style file.  And it all works together quite
well.

Since xetex needs to know what font to use for particular characters,
unless you have a font that covers all the characters in your document you
need to mark up the text for which font to use.  I won't go into the
details, but in our case, that's made more complex by the fact that Urdu
and Pashto are written in a right-to-left script.  For Chinese, that should
not be an issue.  You can just run a script that selects contiguous
sequences of Chinese text (and possibly other characters, like punctuation)
and tags them in xetex for the Chinese font (i.e. the command to use the
Chinese font, as per the previous paragraph).

Since it sounds like some of your difficulties are with the use of
dblatex, you might want to post some of your questions to the dblatex
mailing list.

   Mike Maxwell


More information about the XeTeX mailing list