# Too narrow kerning with xeCJK

I'm trying to typeset Japanese using xelatex and the xeCJK package. For some reason, small kana cause odd kerning in the text. In the following example, I get too narrow spacing between two small kana, and between a small kana and a punctuation. It is also clear that they do not have the same width as regular kana.

%!TEX program = xelatex
\documentclass{article}
\usepackage{xeCJK}
\setCJKmainfont{IPAMincho}
\begin{document}
ぎゅっと持った。あっ、そうかも。

あいうえおかきくけこさしすせそ
\end{document}


Compiling, I get the following:

I tried several fonts with the same results. Am I missing some important definitions? Am I mistaken in believing that small kana should also be monospaced as the regular-sized ones?

It seems that you found a bug of xeCJK.

The bug (Issue 166) was rather old (since ver 2.x). The conditional Japanese starter characters (ゃ, ゅ, ょ, っ, etc.) were wrongly identified as full right punctuations to prevent line breaks. But there would be extra negative kernings sometimes.

We will fix the bug and release a new version of xeCJK soon.

## Update

Qing Lee has uploaded a new version of xeCJK (2014/12/26 v3.3.0), which disables some of the Kinsoku (禁則) to fix this issue. You can upgrade your TeX distribution to use the new package.

Before installing the new release of xeCJK, you can use zxjatype package which is optimized for Japanese typesetting and provides a workaround:

% !TEX program = XeLaTeX
% !TEX encoding = UTF-8
\documentclass{article}
\usepackage{xeCJK}
\usepackage{zxjatype}
\setCJKmainfont{IPAMincho}
\begin{document}
ぎゅっと持った。あっ、そうかも。

あいうえおかきくけこさしすせそ
\end{document}


I managed to compile the example using lualatex. The modified file is

\documentclass{article}
\usepackage{luatexja-fontspec}
\setmainjfont{IPAMincho}
\begin{document}
ぎゅっと持った。あっ、そうかも。

あいうえおかきくけこさしすせそ
\end{document}


Strictly speaking, luatexja-fontspec is not necessary here, as fontspec would handle changing the font equally well. But this is only true for this tiny example. In the actual document, luatexja was needed to handle line-breaks.

One other point that is worth mentioning: In the actual document, I also made use of the ruby package. That worked in xelatex, but for lualatex, the package luatexja-ruby should be used instead.

• You should use luatex-ja for prober line breaking, kerning, font switching, etc. – Leo Liu Dec 25 '14 at 15:03