[XeTeX] Basic CJK support in Polyglossia

Zdenek Wagner zdenek.wagner at gmail.com
Tue Jan 15 22:55:44 CET 2013


2013/1/15 Hans Schmidt <hans.schmidt.5 at gmx.de>:
> Am 14.01.2013 22:53, schrieb Jérôme Étévé:
>
>> Hi,
>>
>> There's a pretty good post here that describes a simple method to fallback
>> to
>> CJK fonts even when they're mixed with roman text.
>>
>> http://latex-my.blogspot.co.uk/2012/06/more-ways-to-typeset-cjk.html
>>
>> Cheers,
>>
>> Jerome.
>
>
> Hello,
>
> Thanks for the help. Although it did not work on my PC (somehow it gives an
> undefined control sequence... weird), this seems to facilitate stuff a lot.
> Although I guess there are still some problems which this approach, leading
> to my previous sugestion in the first place.
>
> 1. You need to know that there _is_ a xeCJK package.
> 2. I don't know if the package automatically detects Chinese and Roman text
> (if yes, that would be nice), but if not, you have the problem that you have
> to set up some things if you only want to write one or two words in Chinese
> in a western text. This is also problematic if you e.g. have Chinese AND
> Japanese in one document.
> 3. You have to read the complete package description.
>
> I guess the first problem is the most severe one: If you write a text with
> Latex, I guess you know about polyglossia. But when you want to write a
> Chinese text, you need to know about xeCJK as well. So I wonder why not just
> implement it in polyglossia: Make a frontend for all the xeCJK options and
> facilitate the usage. You could just write while loading polyglossia that
> you want to insert a Chinese text, and he will load the xeCJK package,
> (maybe load a default font,) and set up the \textchinese command or the
> \begin{chinese} environment.
>
No, polyglossia does not load a default font because the package
cannot know which fonts are available. It merely checks that your
default font is capable of typesetting the text in the required
language or a font was defined to support the language. If I want to
typeset in Hindi, either I have to select a default font supporting
Hindi or I have to define \newfontfamily\hindifont ... If Chinese were
included in polyglossia, you would similarly have to define
\newfontfamily\chinesefont ... giving explicitely all the font options
required for Chinese typesetting. You will have to read the
description of all required packages anyway.

First you will have to read the manual of polyglossia in order to know
how to use it. Polyglossia does not handle fonts itself, it is done
via fontspec, this is another package that you have to know. For
Arabic, Urdu and Persian the bidi package is used automatically. User
writing in these languages have to know bidi as well. If Chinese were
included, users will certainly be requested to read the xeCJK
documentation.

If you need just a few Chinese or Japanese words in a Roman text
without the need of the CJK environment (ie without captions, date
etc), it may be simpler to use just the ucharclasses package.

> I really think that this should be implemented in polyglossia. It already
> has support for all other languages, so why not putting Chinese etc. into it
> as well?
>
It's not a few minutes' job. And of course, I can prepare a long list
of languages not yet supported: marathi, gujarati, tamil, malayalam,
sinhala, oriya, maithili, nepali, tibetan, polish, french, danish,
swedish, norwegian, ewe, amharic, ...

You cannot assume that a single maintainer knows all the languages, it
needs more people involved. It needs volunteers who will help to
prepare the files.
>
> Hans
>
>
>
> --------------------------------------------------
> Subscriptions, Archive, and List information, etc.:
>  http://tug.org/mailman/listinfo/xetex



-- 
Zdeněk Wagner
http://hroch486.icpf.cas.cz/wagner/
http://icebearsoft.euweb.cz



More information about the XeTeX mailing list