From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/39776 Path: news.gmane.org!not-for-mail From: "Wolfgang Schuster" Newsgroups: gmane.comp.tex.context Subject: Re: Converting counters? Date: Tue, 1 Apr 2008 11:04:32 +0200 Message-ID: <115224fb0804010204l59390b3bt1f3a87ccbc3e4c5f@mail.gmail.com> References: <769ba7780804010018n1f4ad1a7kf0c20195877f872a@mail.gmail.com> <115224fb0804010041s17d4da00t3564f57209abf8ee@mail.gmail.com> <769ba7780804010056n370caa3ele529f95cf5711771@mail.gmail.com> <115224fb0804010149g2820114bja3cd53dd90181039@mail.gmail.com> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1207040895 27216 80.91.229.12 (1 Apr 2008 09:08:15 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 1 Apr 2008 09:08:15 +0000 (UTC) To: "mailing list for ConTeXt users" Original-X-From: ntg-context-bounces@ntg.nl Tue Apr 01 11:08:45 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 1JgcSp-0002kS-Or for gctc-ntg-context-518@m.gmane.org; Tue, 01 Apr 2008 11:07:31 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 956C91FCBB; Tue, 1 Apr 2008 11:06:53 +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 15045-10-4; Tue, 1 Apr 2008 11:06:13 +0200 (CEST) Original-Received: from ronja.vet.uu.nl (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id A68A01FCE5; Tue, 1 Apr 2008 11:05:08 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id C77D81FCE5 for ; Tue, 1 Apr 2008 11:05:06 +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 15780-01-8 for ; Tue, 1 Apr 2008 11:04:34 +0200 (CEST) Original-Received: from wr-out-0506.google.com (wr-out-0506.google.com [64.233.184.239]) by ronja.ntg.nl (Postfix) with ESMTP id 658DE1FBB9 for ; Tue, 1 Apr 2008 11:04:33 +0200 (CEST) Original-Received: by wr-out-0506.google.com with SMTP id c53so1091234wra.20 for ; Tue, 01 Apr 2008 02:04:32 -0700 (PDT) Original-Received: by 10.150.133.17 with SMTP id g17mr3977884ybd.96.1207040672331; Tue, 01 Apr 2008 02:04:32 -0700 (PDT) Original-Received: by 10.150.49.21 with HTTP; Tue, 1 Apr 2008 02:04:32 -0700 (PDT) In-Reply-To: <115224fb0804010149g2820114bja3cd53dd90181039@mail.gmail.com> Content-Disposition: inline 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:39776 Archived-At: 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 ___________________________________________________________________________________