> I am trying to figure out how to solve the problem I am facing in a
> tex file that contains a chunk of CJK text. I copy an example file
> below.

The solution is quite easy:  You can't combine

  \usepackage[utf8]{inputenc}

with

  \usepackage{CJK}

Instead, say

  \usepackage{CJKutf8}

and put everything within the CJK environment.

An additional

  \usepackage[T1]{fontenc}

gives better support for accented letters.

> However, when I now add some other special characters, such as the
> Spanish 'mañana' things break down: the first mañana is rendered
> fine,

It uses the standard mechanism of LaTeX's Unicode support of OT1
encoding.

> the one in the CJK block gives a blank where an 'ñ' should be
> printed,

After entering the CJK environment, the leading bytes of UTF-8
encoding are replaced with versions specific to the CJK package.  It
now searches the glyph in a subfont of the `song' family.  On my box,
`song' maps to the `cyberbit' font, and I *do* get a `ñ' but the glyph
is not taken from cmr12 but from cyberbit.

> and if I don't put a % in front of the third mañana, LaTeX refuses to 
> compile.

You haven't used the `encapsulated' option of the CJK package which
means that the previous binding of the leading bytes aren't restored.
Consequently, you get an error because the CJK bindings are valid only
within the CJK environment.


    Werner

_______________________________________________
Cjk maillist  -  [email protected]
https://lists.ffii.org/mailman/listinfo/cjk

Reply via email to