xpinyin: suppress pinyin annotation in footnotes

The pinyinscope environment of the xpinyin package adds pinyin annotations to all Chinese characters therein, including those that appear in the footnote.

Is it possible to suppress pinyin annotation for footnotes inside a pinyinscope environment (or inside an \xpinyin* command)?

My current work around is to use the \footnotemark+\footnotetext combination. But this is hardly efficient when there are a lot of footnotes to be entered.

MWE

\documentclass{article}
\usepackage[UTF8]{ctex}
\usepackage{xpinyin}

\begin{document}
\begin{pinyinscope}

\end{pinyinscope}

\begin{pinyinscope}

\end{pinyinscope}
\footnotetext{腳註\ using \texttt{\string\footnotemark} and \texttt{\string\footnotetext}}
\end{document}


My idea is to let the pinyin part become empty in the footnotes. To realise it I redefine the \footnote command and control the format option of the \xpinyin command. The package manual (in Chinese) gives details of options. The following codes do work as a workaround with both plflatex and xelatex, although I think they are a little ugly.

\documentclass{article}
\usepackage[UTF8]{ctex}
\usepackage{xpinyin}

\makeatletter
\let\oldfootnote=\footnote
\renewcommand{\footnote}[1]{\oldfootnote{\xpinyin*[format={\@gobble}]{#1}}}
\makeatother

\begin{document}
\begin{pinyinscope}

\end{pinyinscope}

\begin{pinyinscope}

\end{pinyinscope}
\footnotetext{腳註\ using \texttt{\string\footnotemark} and \texttt{\string\footnotetext}}

\end{document}


Anyway, I still suggest you to contact with the package author to solve this problem in essential and also expect a wiser solution.

• @KevinC The authors noticed this bug yesterday and have fixed it. See their discussion at link – Wenbo Jan 13 '14 at 2:48
• It is an undocumented feature. I'm glad you know it. – Qing Lee Jan 13 '14 at 10:54

This feature has been added in the new version (avaliable in ctex-kit currently). I will submit it to CTAN soon. If you have any other suggestions, please let me know.

Update: The new version is available in TeX Live 2013.

• Thank you for this nice package and the prompt response! I really appreciate your devotion to ctex. I'll let you know if other issues come up ;) – Herr K. Jan 13 '14 at 15:19