3

I am trying to use the pinyin package for glossing Chinese text. There are two problems:

  • First, it complains about \Xiand \Pi allready being defined and
  • second the dash about the a and the e is not set.

Here is a minimal working example:

\documentclass{book}                          
\usepackage{xeCJK}
  \setCJKmainfont{SimSun}
\usepackage{pinyin}

\begin{document}

很 快 *(的) 车 \\
\hen3 \kuai4 *(de) \che1 \\
very fast attr car\\

他 跑 *(得) 很 快。 \\
\Ta1 \pao3 *(de) \hen3 \kuai4. \\
he run deg very fast \\

\end{document} 

This is what would be correct output:

enter image description here

1

1 Answer 1

1

Ok. Thank you very much! The link in the comment to https://tex.stackexchange.com/a/35121/42880 helped with the answer. Of course typing unicode in directly would be the best solution, but one would break ones fingers and we have everyting in pinyin already. So here is the solution using the gb4epackage for glossing:

\documentclass{book}                          


\usepackage{xeCJK}
\setCJKmainfont{SimSun}


\usepackage{xpinyin}

\usepackage{gb4e}

\let\eachwordtwo=\pinyin

\begin{document}

\glll  很 快 *(的) 车 \\
       hen3 kuai4 *(de) che1 \\
       very fast attr car\\


\glll 他 跑 *(得) 很 快。 \\
      Ta1 pao3 *(de) hen3 kuai4. \\
      he run deg very fast \\


\glll 他 很 快 *(地) 跑。 \\
      Ta1 hen3 kuai4 *(de) pao3. \\
      he very fast adv run \\


\end{document} 

By using \let\eachwordtwo=\pinyin the call to pinyin is wrapped around every word in the glossing and we get what we want. readable and nice. The only open issue is that pinyin adds space before the dot, e.g. after kuai4 but this can be fixed, I hope.

You must log in to answer this question.

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