From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/39779 Path: news.gmane.org!not-for-mail From: "Zhichu Chen" Newsgroups: gmane.comp.tex.context Subject: Re: Converting counters? Date: Tue, 1 Apr 2008 19:37:04 +0800 Message-ID: <769ba7780804010437s5b231180v9c172bdbfaa4c972@mail.gmail.com> References: <769ba7780804010018n1f4ad1a7kf0c20195877f872a@mail.gmail.com> <115224fb0804010041s17d4da00t3564f57209abf8ee@mail.gmail.com> <769ba7780804010056n370caa3ele529f95cf5711771@mail.gmail.com> <115224fb0804010149g2820114bja3cd53dd90181039@mail.gmail.com> <115224fb0804010204l59390b3bt1f3a87ccbc3e4c5f@mail.gmail.com> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1023688224==" X-Trace: ger.gmane.org 1207050026 25872 80.91.229.12 (1 Apr 2008 11:40:26 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 1 Apr 2008 11:40:26 +0000 (UTC) To: "mailing list for ConTeXt users" Original-X-From: ntg-context-bounces@ntg.nl Tue Apr 01 13:40:56 2008 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from ronja.vet.uu.nl ([131.211.172.88] helo=ronja.ntg.nl) by lo.gmane.org with esmtp (Exim 4.50) id 1JgerI-0002LO-4p for gctc-ntg-context-518@m.gmane.org; Tue, 01 Apr 2008 13:40:56 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id C19641FC83; Tue, 1 Apr 2008 13:40:16 +0200 (CEST) Original-Received: from ronja.ntg.nl ([127.0.0.1]) by localhost (smtp.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 15028-01-9; Tue, 1 Apr 2008 13:39:48 +0200 (CEST) Original-Received: from ronja.vet.uu.nl (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id CB9C61FBBA; Tue, 1 Apr 2008 13:39:47 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 04BF61FBBA for ; Tue, 1 Apr 2008 13:39:46 +0200 (CEST) Original-Received: from ronja.ntg.nl ([127.0.0.1]) by localhost (smtp.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 15157-01-7 for ; Tue, 1 Apr 2008 13:39:04 +0200 (CEST) Original-Received: from rn-out-0910.google.com (rn-out-0910.google.com [64.233.170.190]) by ronja.ntg.nl (Postfix) with ESMTP id 9F6601FB82 for ; Tue, 1 Apr 2008 13:37:08 +0200 (CEST) Original-Received: by rn-out-0910.google.com with SMTP id s46so884938rnb.14 for ; Tue, 01 Apr 2008 04:37:04 -0700 (PDT) Original-Received: by 10.142.49.4 with SMTP id w4mr4537436wfw.220.1207049824234; Tue, 01 Apr 2008 04:37:04 -0700 (PDT) Original-Received: by 10.143.165.19 with HTTP; Tue, 1 Apr 2008 04:37:04 -0700 (PDT) In-Reply-To: <115224fb0804010204l59390b3bt1f3a87ccbc3e4c5f@mail.gmail.com> X-Virus-Scanned: amavisd-new at ntg.nl X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.9 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: ntg-context-bounces@ntg.nl Errors-To: ntg-context-bounces@ntg.nl X-Virus-Scanned: amavisd-new at ntg.nl Xref: news.gmane.org gmane.comp.tex.context:39779 Archived-At: --===============1023688224== Content-Type: multipart/alternative; boundary="----=_Part_18363_4412779.1207049824231" ------=_Part_18363_4412779.1207049824231 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline Thanks Wolfgang, it's perfect. On Tue, Apr 1, 2008 at 5:04 PM, Wolfgang Schuster < schuster.wolfgang@googlemail.com> wrote: > On Tue, Apr 1, 2008 at 10:49 AM, Wolfgang Schuster > wrote: > > On Tue, Apr 1, 2008 at 9:56 AM, Zhichu Chen > wrote: > > > 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. > > A slightly modified version. > > You could now also use counter values. > > \def\dododozhnumber#1% > {\ifcase#1 > a\or > b\or > c\or > d\or > e\or > f\or > g\or > i\or > h\or > i\fi} > > \def\zhnumber#1% > {\expandafter\dozhnumber#1\endzhnumber} > > \def\endzhnumber{\endzhnumber} > > \def\dozhnumber > {\futurelet\next\dodozhnumber} > > \def\dodozhnumber > {\ifx\next\endzhnumber > \let\next\gobbleoneargument > \else > \def\next##1{\dododozhnumber{##1}\dozhnumber}% > \fi\next} > > \starttext > \zhnumber{01234} > > \zhnumber{\number\pageno} > \stoptext > > Wolfgang > > ___________________________________________________________________________________ > 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 > > ___________________________________________________________________________________ > -- Best Regards Chen ---------------------------------------------------------------- Zhi-chu Chen | Shanghai Synchrotron Radiation Facility No. 2019 | Jialuo Rd. | Jiading | Shanghai | P.R. China tel: 086 21 5955 3405 | zhichu.chen.googlepages.com | www.sinap.ac.cn ---------------------------------------------------------------- ------=_Part_18363_4412779.1207049824231 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline Thanks Wolfgang, it's perfect.

On Tue, Apr 1, 2008 at 5:04 PM, Wolfgang Schuster <schuster.wolfgang@googlemail.com> wrote:
On Tue, Apr 1, 2008 at 10:49 AM, Wolfgang Schuster
> On Tue, Apr 1, 2008 at 9:56 AM, Zhichu Chen <zhichu.chen@gmail.com> wrote:
> > 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.

A slightly modified version.

You could now also use counter values.

\def\dododozhnumber#1%
 {\ifcase#1
 a\or
 b\or
 c\or
 d\or
 e\or
 f\or
 g\or
 i\or
 h\or
 i\fi}

\def\zhnumber#1%
 {\expandafter\dozhnumber#1\endzhnumber}

\def\endzhnumber{\endzhnumber}

\def\dozhnumber
 {\futurelet\next\dodozhnumber}

\def\dodozhnumber
 {\ifx\next\endzhnumber
   \let\next\gobbleoneargument
 \else
   \def\next##1{\dododozhnumber{##1}\dozhnumber}%
 \fi\next}

\starttext
\zhnumber{01234}

\zhnumber{\number\pageno}
\stoptext

Wolfgang
___________________________________________________________________________________
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
___________________________________________________________________________________



--
Best Regards
Chen
----------------------------------------------------------------

Zhi-chu Chen | Shanghai Synchrotron Radiation Facility
No. 2019 | Jialuo Rd. | Jiading | Shanghai | P.R. China
tel: 086 21 5955 3405 | zhichu.chen.googlepages.com
| www.sinap.ac.cn
---------------------------------------------------------------- ------=_Part_18363_4412779.1207049824231-- --===============1023688224== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline ___________________________________________________________________________________ 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 ___________________________________________________________________________________ --===============1023688224==--