From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/39791 Path: news.gmane.org!not-for-mail From: "Wolfgang Schuster" Newsgroups: gmane.comp.tex.context Subject: Re: Converting counters? Date: Wed, 2 Apr 2008 08:18:43 +0200 Message-ID: <115224fb0804012318u4eac8c8fqf9572468ea2683a2@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: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1207117212 18723 80.91.229.12 (2 Apr 2008 06:20:12 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 2 Apr 2008 06:20:12 +0000 (UTC) To: "mailing list for ConTeXt users" Original-X-From: ntg-context-bounces@ntg.nl Wed Apr 02 08:20:44 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 1JgwKx-00068P-9A for gctc-ntg-context-518@m.gmane.org; Wed, 02 Apr 2008 08:20:43 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 1639D1FBBE; Wed, 2 Apr 2008 08:20:03 +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 07850-02-3; Wed, 2 Apr 2008 08:19:20 +0200 (CEST) Original-Received: from ronja.vet.uu.nl (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 40D991FBAC; Wed, 2 Apr 2008 08:19:20 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 7B7A01FBAC for ; Wed, 2 Apr 2008 08:19:18 +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 08032-02-6 for ; Wed, 2 Apr 2008 08:18:44 +0200 (CEST) Original-Received: from yw-out-1718.google.com (yw-out-1718.google.com [74.125.46.152]) by ronja.ntg.nl (Postfix) with ESMTP id 635CB1FBA8 for ; Wed, 2 Apr 2008 08:18:44 +0200 (CEST) Original-Received: by yw-out-1718.google.com with SMTP id 6so414643ywa.74 for ; Tue, 01 Apr 2008 23:18:43 -0700 (PDT) Original-Received: by 10.150.54.6 with SMTP id c6mr4694453yba.112.1207117123401; Tue, 01 Apr 2008 23:18:43 -0700 (PDT) Original-Received: by 10.150.49.21 with HTTP; Tue, 1 Apr 2008 23:18:43 -0700 (PDT) In-Reply-To: <115224fb0804010204l59390b3bt1f3a87ccbc3e4c5f@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:39791 Archived-At: On Tue, Apr 1, 2008 at 11:04 AM, Wolfgang Schuster 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. Another solution using \afterassignment. The number is now removed from the input but you have to use a if test, number tests did not work. \def\zhnumber#1% {\expandafter\dozhnumber#1\endzhnumber} \def\endzhnumber{\endzhnumber} \def\dozhnumber {\afterassignment\dodozhnumber\let\next= } \def\dodozhnumber {\ifx\next\endzhnumber\let\next\relax \else \if\next 0a\else \if\next 1b\else \if\next 2c\else \if\next 3d\else \if\next 4e\else \if\next 5f\else \if\next 6g\else \if\next 7h\else \if\next 8i\else \if\next 9j\relax \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi \let\next\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 ___________________________________________________________________________________