5

When typing Chinese using xeCJK, periods and/or closing square brackets are too closely spaced together. How can I get more natural-looking spacings (e.g., tweaking xeCJK settings to match the Word output below) without manually inserting horizontal spaces like \thinspace?

MWE:

\documentclass[12pt,a4paper]{article}
\usepackage{fontspec}
\usepackage{xeCJK}
\setCJKmainfont{標楷體}
\XeTeXlinebreaklocale "zh" 
\XeTeXlinebreakskip = 0pt plus 1pt
\begin{document}
她說:「你好。」
\end{document}

Output:

enter image description here

Output in Word:

enter image description here

  • Comparing your two outputs, I would say adding a space respectively right after the column : and the chinese period。 will do the trick in this case. Or maybe I don't understand your question. – Jesse Nov 10 '14 at 2:42
  • @Jesse It's not customary to add a space after a period in Chinese texts (Note: There are no spaces in the Word document). So, for example, it would be a tremendous hassle if I had to insert manual spaces for every period in a lengthy document. – SEL Nov 10 '14 at 2:45
  • Indeed, I understand now, you are searching for a more general solution. Thanks. – Jesse Nov 10 '14 at 2:47
3

Punctuation spacing style is configurable. And there are 6 predefined styles in xeCJK: quanjiao, banjiao, kaiming, hangmobanjiao, CCT and plain. What you need is the plain style, which does not change the original width of punctuations. If you can read Chinese, you should read the package document of xeCJK first.

\documentclass[12pt,a4paper]{article}
\usepackage{xeCJK}
\setCJKmainfont{標楷體}
\xeCJKsetup{PunctStyle=plain}
\begin{document}
她說:「你好。」
\end{document}

enter image description here

BTW, I deleted the useless \XeTeXlinebreaklocale and \XeTeXlinebreakskip in your code. Note that xeCJK package provides more powerful functions than that.

1

Would this be what you seek? Idea inspired from here

enter image description here

Code

\documentclass[border=10pt,varwidth]{standalone}%[12pt,a4paper]{article}
\usepackage{fontspec}
\usepackage{xeCJK}
\setCJKmainfont{標楷體}
\XeTeXlinebreaklocale "zh" 
\XeTeXlinebreakskip = 0pt plus 1pt

\makeatletter
\newcommand\myc{\@ifnextchar:{「}{:\@}}
\newcommand\myp{\@ifnextchar。{」}{。\@}}
\makeatother

\begin{document}

她說:「你好。」


她說\myc「你好\myp」
\end{document}
  • Thanks for the attempt, Jesse. But it's cumbersome to replace punctuation marks with commands, especially in longer pieces of writing. – SEL Nov 10 '14 at 6:26

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.