[tex-live] MacOS X + CJK

Jonathan Kew jonathan_kew at sil.org
Tue Aug 1 06:25:02 CEST 2006


On 31 Jul 2006, at 11:11 pm, John Tang Boyland wrote:

> ] A Unicode Chinese document in TeXShop typesets fine through XeTeX  
> (or
> ] XeLaTeX) with no special effort; just choose one of the Unicode-
> ] compliant Chinese fonts included with Mac OS X; no need for special
> ] packages to support different encodings, etc., it "just works".
>
> Well there must be SOME special effort: if I take a Unicode chinese
> file that has no CJK macros in it and process with xelatex, it
> typesets without errors but all chinese characters are omitted (the
> log includes warnings that the characters are not present in cmr10 --
> no surprise).
>
> Obviously the trick is to "choose one of the Unicode-compliant Chinese
> fonts included with Mac OS X" as you said. I tried setting the font
> from the TeXShop Format>Font menu but of course that only sets the
> font for the *viewing* of the file, not the typesetting of it.  What's
> the incantation to set the font for the typesetting of the file?

In xelatex, the best approach (by far) is to use the fontspec  
package; something like

   \usepackage{fontspec}
   \setromanfont{STFangsong}

in the preamble should get you started. (\setromanfont is arguably  
something of a misnomer, as it can be a non-Roman font!)

> ...
> Looking at the SIL XETEX web page, it seems one can define a low-level
> font-changing command, but it seems to me that I would need to have a
> separate command for each size of text I want,

True, if you define fonts at the "primitive" TeX level with \font.  
But fontspec deals with all this and integrates the newly-specified  
font with the LaTeX size-changing commands, etc.

> and that I would also
> need to switch fonts whenever mixing Chinese and English.

Chinese fonts generally contain Latin characters, so you wouldn't  
*need* to switch fonts; but you might want to anyway, just to get an  
appearance that you prefer for the English.

> And unfortunately, emacs' write-cjk-file misbehaves on UTF-8 encoded
> chinese files.....

(Sorry, I know nothing about the emacs side of this...)

> (In any case, things are even more confused because I'm trying to
> maintain two tex distributions on one machine: texlive and the teTeX
> that texShop wants to use.

I think it would be possible to have TeXShop use the texlive  
installation, by setting paths appropriately in the TeXShop  
Preferences. You might also need to modify some of the "engine" files  
(in ~/Library/TeXShop/Engines) if they have full paths to tools, etc.

In general, though, I think using teTeX (or rather the teTeX-based  
gwTeX, installed via i-Installer or the MacTeX package) is the most  
straightforward option on Mac OS X. And there are knowledgeable users  
on both the TeX on Mac OS X list (see http://www.esm.psu.edu/mac- 
tex/) and the XeTeX list (see http://tug.org/mailman/listinfo/xetex)  
who can usually help with any questions/problems that arise.

HTH,

Jonathan




More information about the tex-live mailing list