Yes, only I don't need that complex. I mean \chinesenumber{123} will give
"one hundred and twenty-three" but all I want is "one two three." Besides,
I don't like to copy such long codes since I really don't want to load font-chi.tex
which gives weird spacing problems while typesetting Chinese along with
English. Anyway, I'd love to learn something rather than to use something.
Thanks.
Hi Chen,
You could use \chinesenumber from font-chi.tex
Wolfgang
___________________________________________________________________________________
On Tue, Apr 1, 2008 at 9:18 AM, Zhichu Chen <zhichu.chen@gmail.com> wrote:
> Hi,
>
> I'm trying to convert the counter to Chinese character one on one, like
> 0->a, 1->b, etc., so 10 will be "ba" (I use a, b, c, . . . to denote the
> Chinese
> glyphs which makes more sense for you). I used some codes like:
> ======================================================
> \def\ChineseZero {o}
> \def\ChineseOne {a}
> \def\ChineseTwo {b}
> \def\ChineseThree{c}
> \def\ChineseFour {d}
> \def\ChineseFive {e}
> \def\ChineseSix {f}
> \def\ChineseSeven{g}
> \def\ChineseEight{h}
> \def\ChineseNine {i}
>
> \unexpanded\def\zhnumber
> {\bgroup
> \catcode`\0=\active \uccode`\~=`\0 \uppercase{\let~\ChineseZero}%
> \catcode`\1=\active \uccode`\~=`\1 \uppercase{\let~\ChineseOne}%
> \catcode`\2=\active \uccode`\~=`\2 \uppercase{\let~\ChineseTwo}%
> \catcode`\3=\active \uccode`\~=`\3 \uppercase{\let~\ChineseThree}%
> \catcode`\4=\active \uccode`\~=`\4 \uppercase{\let~\ChineseFour}%
> \catcode`\5=\active \uccode`\~=`\5 \uppercase{\let~\ChineseFive}%
> \catcode`\6=\active \uccode`\~=`\6 \uppercase{\let~\ChineseSix}%
> \catcode`\7=\active \uccode`\~=`\7 \uppercase{\let~\ChineseSeven}%
> \catcode`\8=\active \uccode`\~=`\8 \uppercase{\let~\ChineseEight}%
> \catcode`\9=\active \uccode`\~=`\9 \uppercase{\let~\ChineseNine}%
> \loggingall
> \dozhnumber }
>
> \def\stripunwantedspaces{}
>
> \def\dozhnumber#1%
> {\expandafter\scantokens\expandafter
> {\detokenize{#1\stripunwantedspaces}}\egroup}
> ======================================================
> It works fine with \zhnumber{15}, it gives "ae" which is exactly what I
> want.
> But it won't work in the following situation:
> ++++++++++++++++++++++++++
> \newcount\tcpageno
> \advance\tcpageno15
> \zhnumber{\number\tcpageno}
> ++++++++++++++++++++++++++
> I know it's not weird, I just don't know how to expand the counter to
> number.
>
>
> Thank you in advance.
>
> --
> Best Regards
> Chen
If your question is of interest to others as well, please add an entry to the Wiki!
maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage : http://www.pragma-ade.nl / http://tex.aanhet.net
archive : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___________________________________________________________________________________