# Removing space before dots produced by pinyin command

I use pinyin in glosses and found a way to convert it automatically (using pinyin package with xelatex). However, the call to pinyin adds space before a dot. The following code produces kuài . rather than kuài.. Is there a way to fix this? The manual is in Chinese and I do not understand the code of the xpinyinpackage.

\documentclass{book}

\usepackage{xpinyin}

\begin{document}

\pinyin{kuai4.}

\end{document}

• It works if you put the dot outside the argument: \pinyin{kuai4}. (But as I don't know pinyin I have no idea if this is senseful). Jul 31 '15 at 13:50
• That would not work since it is automatically included in the call to pinyin in this glossing environment described in the other question. Jul 31 '15 at 18:05

I don't know what other consequence this can have, but the space is set at the start with (something equivalent to)

\xpinyinsetup{pysep={ }}


so you can countermand it:

\documentclass{book}
\usepackage{xpinyin}

\xpinyinsetup{pysep={}}

\begin{document}

\pinyin{kuai4.}

\end{document}


You can also do it locally with

\pinyin[pysep={}]{kuai4.}