[tex-live] MacOS X + CJK

Werner LEMBERG wl at gnu.org
Wed Aug 2 08:51:50 CEST 2006

[This is also a bug report regarding mf-nowin vs. mf in the fmtutil

> ] Emacs doesn't use UTF-8 internally;
> ] instead, UTF-8 is mapped onto its internal encodings.
> I was referring to the problem mentioned in
>   http://lists.ffii.org/pipermail/cjk/2003-May/000394.html
> If a file is opened with Unicode encoding, cjk-write-file is unable
> to use GB or Big5 encoded fonts and so *latex falls back to cyberbit
> or else bitmapped fonts which look bad.

Exactly.  This is unavoidable.  You have to wait after the release of
Emacs 22; the development branch will then be switched to the (already
working) Emacs-Unicode.

> It looks fine but when I run it with texlive/2005 on MacOSX, I get
> various problems probably because I don't have X installed:
> pdflatex CJKutf8.tex
> ...
> kpathsea: Running mktextfm larm1000

Hmm.  On TeXLive, the LH fonts are mapped to the cm-super family which
are available in Type 1 already.  You can probably do something similar.

> mktextfm: Running mf-nowin -progname=mf \mode:=ljfour; mag:=1; nonstopmode; input larm1000
> This is METAFONT, Version 2.71828 (Web2C 7.5.5)
> kpathsea: Running mktexfmt mf.base
> fmtutil: running `mf -ini   -jobname=mf -progname=mf -translate-file=cp227.tcx mf.ini' ...
> dyld: Library not loaded: /usr/X11R6/lib/libXt.6.dylib
>   Referenced from: /usr/local/texlive/2005/bin/i386-darwin/mf
>   Reason: image not found
> /usr/local/texlive/2005/bin/i386-darwin/mktexfmt: line 882:   712 Trace/BPT trap          ${1+"$@"} 1>&2

Uh, oh, this is a TeX distribution bug on your platform!  The first
line already uses `mf-nowin', but fmtutil tries to use `mf' again
which is linked with the X libraries!  This should be fixed.

> I understand that if I write enough CJK macros, I can get things to
> work.  Perhaps I was lulled into a sense that cjk-write-file would
> do that work for me.

How do you come to this impression?  There are so many different font
shapes available; it's almost the same as with non-CJK fonts.
cjk-write-file can't know in advance which font shape you want to use.

> But apparently it relies on a font (song) that isn't by default
> installed in texlive.  If song is not available, it tries kai, and
> if kai is not available, it fails.

As mentioned in another mail, you should use \CJKencfamily to set up
your fonts.

> I found out from where to get these fonts (they're right there in
> CTAN).

Those are all bitmap fonts.

> My point is simply that out-of-the-box, the examples don't work.

???  The CJK examples in TeXLive have been adjusted to work without
any further changes!

> (And for cjk-write-file, I had to hand-installed the .el files of
> course.)

Yes.  TeXLive doesn't come with Emacs.

> The example file for cjk-write-file that I was using was chinese.tex
> in the texshowcase on TUG's web page:
> 	http://www.tug.org/texshowcase/chinese.tex
> The page doesn't guarantee that everything works immediately, but
> since this file included text that indicated that cjk-write-file
> would handle the "messy" CJK macros that I as a neophyte didn't want
> to meddle with, I had hoped it would work, and indeed it did work
> with help from this list and the CTAN CJK fonts

Just insert



in the preamble, and all main CJK encodings (Big 5, GB 2312, KS X
1001, JIS 0208) are set up to outline fonts from TeXLive.

It might be a good idea to contact the author of chinese.tex so that
he or she inserts a proper comment how to make the example file work
with TeXLive.


More information about the tex-live mailing list