Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

As you know, there are many languages out there that don't use a SPACE character for word segmentation. For such language, special non-printable characters are used, such ZERO WIDTH NON JOINER or ZERO WIDTH SPACE characters.

It seems XeTeX or XeLaTeX depends on SPACE characters only for the wrapping behavior. Is there a way to change this behavior? Are there packages out there that may help in this? Say, be able to specify characters that Tex can use to determine where to wrap text? If not, I wonder if this is something one can develop?

Any pointers would be much appreciated!

share|improve this question
Welcome to TeX.sx! Usually, we don't put a greeting or a "thank you" in our posts. While this might seem strange at first, it is not a sign of lack of politeness, but rather part of our trying to keep everything very concise. Upvoting is the preferred way here to say "thank you" to users who helped you. –  adn Dec 14 '11 at 11:21
Did you consider the xeCJK package? –  egreg Dec 14 '11 at 11:49
I am not sure if I understand the question, an example might help. If I get it correctly, you want line breaks not only at spaces, luatex might be suitable. –  mbork Dec 14 '11 at 11:51
add comment

3 Answers

XeTeX has \XeTeXlinebreaklocale, followed by language code, to set language specific line breaking behaviour, e.g. \XeTeXlinebreaklocale "zh" or\XeTeXlinebreaklocale "th" to set line breaking for Chinese or Thai, respectively.

Some languages have dedicated packages for XeLaTeX that handles this and more language specific stuff, like xeCJK.

share|improve this answer
add comment

For XeTeX, I suggest our xeCJK package. The package not only handle the line breaking, but also sets the fonts and takes care of the punctuations. See also How to write Japanese with LaTeX?. An example:

\usepackage[BoldFont]{xeCJK} % compatible with some packages which relys on CJK
\setCJKmainfont{MS Mincho} % Set a Japanese font you have
この FAQ リストは、よくある質問とその答を集め、役に立つよう
にしたものです。この FAQ リストの構造は、以前のものと比べて大幅に変更
されています。\textbf{\ruby{新}{あたら}しい構造に関しては、「この FAQ

The low level solution is to use:

\XeTeXlinebreaklocale "ja"         % for Japanese
\XeTeXlinebreakskip 0pt plus 0.1pt % sets the skip
share|improve this answer
add comment

Using \XeTeXlinebreaklocale and \XeTeXlinebreakskip was the way to go. Specifically, for this post, I was dealing with Myanmar (Burmese) text. Applied "my" as locale for this language and set the XeTeXlinebreakskip option to 0pt plus 0.1pt, which took care of the orphaned punctuation marks.

share|improve this answer
add comment

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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