From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/39769 Path: news.gmane.org!not-for-mail From: "Wolfgang Schuster" Newsgroups: gmane.comp.tex.context Subject: Re: Converting counters? Date: Tue, 1 Apr 2008 09:41:13 +0200 Message-ID: <115224fb0804010041s17d4da00t3564f57209abf8ee@mail.gmail.com> References: <769ba7780804010018n1f4ad1a7kf0c20195877f872a@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 1207035763 10218 80.91.229.12 (1 Apr 2008 07:42:43 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 1 Apr 2008 07:42:43 +0000 (UTC) To: "mailing list for ConTeXt users" Original-X-From: ntg-context-bounces@ntg.nl Tue Apr 01 09:43:14 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 1Jgb9F-0003Kt-2F for gctc-ntg-context-518@m.gmane.org; Tue, 01 Apr 2008 09:43:13 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 268AA1FB57; Tue, 1 Apr 2008 09:42:34 +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 32630-02; Tue, 1 Apr 2008 09:41:53 +0200 (CEST) Original-Received: from ronja.vet.uu.nl (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 543621FBC9; Tue, 1 Apr 2008 09:41:53 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id DB9A61FBC6 for ; Tue, 1 Apr 2008 09:41:50 +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 00181-02-6 for ; Tue, 1 Apr 2008 09:41:15 +0200 (CEST) Original-Received: from yw-out-1718.google.com (yw-out-1718.google.com [74.125.46.157]) by ronja.ntg.nl (Postfix) with ESMTP id DC1151FB57 for ; Tue, 1 Apr 2008 09:41:14 +0200 (CEST) Original-Received: by yw-out-1718.google.com with SMTP id 6so295077ywa.74 for ; Tue, 01 Apr 2008 00:41:13 -0700 (PDT) Original-Received: by 10.150.152.17 with SMTP id z17mr3954819ybd.37.1207035673548; Tue, 01 Apr 2008 00:41:13 -0700 (PDT) Original-Received: by 10.150.49.21 with HTTP; Tue, 1 Apr 2008 00:41:13 -0700 (PDT) In-Reply-To: <769ba7780804010018n1f4ad1a7kf0c20195877f872a@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:39769 Archived-At: Hi Chen, You could use \chinesenumber from font-chi.tex Wolfgang On Tue, Apr 1, 2008 at 9:18 AM, Zhichu Chen 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 ___________________________________________________________________________________