I'm just trying to get LaTeX output spaces between Korean words. At the moment all it can do is to give long chains of syllables just like in Chinese or in Japanese, ignoring all the spaces I set.

Here is the code:


\setCJKmainfont{Batang} % for \rmfamily 

좋은 아침입니다! 안녕하세요, 저의 이름은 김 입니다.%"Good Morning! My Name is Kim." in Korean

The text output is just like: 좋은아침입니다! 안녕하세요, 저의이름은김입니다. So, spaces will only be processed after punctuation marks.

I know I'm doing something wrong, but I can't tell what exactly.

  • 1
    Now xeCJK is updated to provide space option and \CJKspace. Check out the code at code.google.com/p/ctex-kit/source/checkout . The package will be uploaded to CTAN some time later. – Leo Liu May 21 '11 at 3:04
  • Now xeCJK 2.4.2 is uploaded to CTAN. – Leo Liu Jun 13 '11 at 5:22

Quick fix:


In xeCJK 2.4.1 (2011/05/20), you can use:

\renewcommand\CJKglue{}% get proper linebreaking if spaces are provided

or use \CJKspace to allow spaces between CJK charecters.

Before the new xeCJK updated to CTAN, you can always get the latest code through SVN:


| improve this answer | |
  • While you're at it, please change the explicit character class assignments by using the allocation mechanism with \newXeTeXintercharclass so that xeCJK can cooperate with other packages that use character classes. – egreg May 4 '11 at 7:53
  • @egreg: Thanks, it does be in the todo list, but it's not urgent. And AFAIK, it's more difficult than you say. The situation is a bit complex: class 1, 2 and 3 are predefined in XeTeX for CJK scripts and punctuations (although we redefined them), and others should be allocated with \newXeTeXintercharclass. Furthermore, this does little help with compatibility with other packages (e.g. polyglossia) --- once we allocate a new character class, we often have to define \XeTeXinterchartoks for all former character classes to make it work well. – Leo Liu May 4 '11 at 10:28
  • Thank you very much! I just copied in the modifications you gave me and Tada! it's working now. Exactly what I was looking for. I'll notify you, if there are any further problems comming up with this new command being included now. – sunny May 5 '11 at 20:22
  • @sunny: It isn't a new command in fact. In CJK package there are \CJKspace and \CJKnospace, and this is just a reimplementation of that. Prof. Sun, the author of xeCJK, also took part in development of some parts of CJK package. xeCJK borrows many things from CJK. – Leo Liu May 9 '11 at 12:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.