Using XeLaTeX with polyglossia, I’m typesetting a document that includes Chinese pinyin: not the whole text, but still a fair bit, so I want to avoid manually providing rules for hyphenation.

Unfortunately, polyglossia doesn’t seem to offer Chinese pinyin support. Is there a package that provides pinyin hyphenation (maybe triggered by a command like \pinyin{text in pinyin})?

The documentation of the xeCJK package (which I use) doesn’t say anything about pinyin, and the xpinyin package seems to do something different altogether.

1 Answer 1


Hum, the polyglossia hook seems to be broken. You probably want to file a bug report at tex-hyphen.

The babel version works for pdfTeX.

According to the documentation, you should be able to bypass polyglossia in XeLaTeX by directly using the low-level command, and it appears the following code, which you can build using xelatex, works (gives the same output as pdflatex with babel):


\newcommand\pinyin[1]{\begingroup \language=\l@pinyin #1\endgroup}

Woshi zhongguoren. Wo bushi beijingren. 

    \pinyin{Woshi zhongguoren. Wo bushi beijingren. }


enter image description here


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .