If you use more than one paragraph Chinese, use our xeCJK
package.
For totally Chinese document, use our documents or packages in ctex
bundle. It is based on xeCJK
.
I have explained this topic in a previous question:
How does one type Chinese in LaTeX?
Of course xeCJK
solve the problem about line breaking. You don't need \XeTeXlinebreaklocale
with xeCJK
; and xeCJK
does not change the \XeTeXlinebreaklocale
either.
You don't need to care about the line break locale if you use
\XeTeXlinebreaklocale "zh"
it does nothing to do with western languages as far as I know. Similarly, using xeCJK
you also don't need to turn off it. Non-CJK text would be untouched. With xeCJK
, it is much easier to set the fonts for Chinese without changing western texts, and you'll get better result for puncuations.
For completeness only, I'll say that you can use \makexeCJKactive
and \makexeCJKinactive
to turn on and off the functions of xeCJK
.
Note: xeCJK
is not completely compatible with polyglossia
package for some of the languages. If you meet more problems, ask more questions or contact me. (I am currently the main maintainer of xeCJK
.)
For updated question, see this previous question:
How to write spaces between Korean words with XeCJK?
You can use space
and nospace
options in xeCJK
, and \CJKspace
and \CJKnospace
option, just like CJK
package do.
I think it is not suggested to suppress line breaks between Chinese characters even if you use \CJKspace
to allow spaces between Chinese characters. If you insist, you can change the definition of \CJKglue
to empty. You can read the document of xeCJK
if you are not sure about the options and commands.
After all, an example:
\documentclass{article}
\usepackage{xeCJK}[2011/05/20]
\setCJKmainfont{SimSun}
\begin{document}
在普通文字之间没有空格
可以避免源代码折行造成
的问题。
\CJKspace
如果 需要 也 可以 保留 空格。
这 对于 汉语 分词 研究 或许 是 有益的。
\end{document}
Best Answer
The correct answer may be to put the two word in an
\mbox{keep together}
. Then you avoid hyphenation, but not overfull lines.You may define a macro to help you save some time when writing:
The flip side is that macros eat spaces. Therefore, in you text, you have to write
\MSaccess{}
to avoid that a space following the macros disappears. You may try to load the package xspace, and define the command as:Unfortunately, there are situations where
xspace
does not work, and it may be better to define the command using theTeX
-commanddef
:Then, you can write
\MSA/
(notice the slash), andLaTeX
will not eat a following space. Unfortunately, such commands may be awkward to type keyboards other than US-English.If you use small caps in your macro, be sure that the font you use has real small caps, and of course, small caps has to be letterspaced (see Bringhurst, The Elements of Typographic Style). Actually, also the
MS
should be letterspaced according to Bringhurst.I agree with Anon in his answer: Typographically a line break between
MS
andAccess
looks better than a sloppy paragraph or an overfull line (a line sticking out in the right margin). Even worseI suggest that you write your article, and when your are finished, as the last touch up when proof reading, you check the line breaks to see if you have places where there is a line break between
MS
andAccess
(or Access is hyphenated) and then put the words in an\mbox{MS Access}
.This MWE demonstrates some of the differences: