From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/59891 Path: news.gmane.org!not-for-mail From: Aditya Mahajan Newsgroups: gmane.comp.tex.context Subject: Re: Converting numerals to text Date: Sun, 27 Jun 2010 22:31:40 -0400 (EDT) Message-ID: References: <008101cb156e$89d93350$9d8b99f0$@com> <00ae01cb1653$3c922b20$b5b68160$@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"; Format="flowed" Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1277692322 14717 80.91.229.12 (28 Jun 2010 02:32:02 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 28 Jun 2010 02:32:02 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Mon Jun 28 04:32:01 2010 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from balder.ntg.nl ([195.12.62.10]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1OT48f-0006CZ-4c for gctc-ntg-context-518@m.gmane.org; Mon, 28 Jun 2010 04:32:01 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 940DAC9B07; Mon, 28 Jun 2010 04:32:00 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id bipej0+3LTBg; Mon, 28 Jun 2010 04:31:57 +0200 (CEST) Original-Received: from balder.ntg.nl (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 9BC8CC9AF5; Mon, 28 Jun 2010 04:31:57 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 932F8C9AF5 for ; Mon, 28 Jun 2010 04:31:55 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id nYkilShXI8CO for ; Mon, 28 Jun 2010 04:31:52 +0200 (CEST) Original-Received: from tombraider.mr.itd.umich.edu (smtp.mail.umich.edu [141.211.12.86]) by balder.ntg.nl (Postfix) with ESMTP id 9FDC3C9AE3 for ; Mon, 28 Jun 2010 04:31:51 +0200 (CEST) Original-Received: FROM [192.168.2.8] (c-76-28-91-31.hsd1.ct.comcast.net [76.28.91.31]) By tombraider.mr.itd.umich.edu ID 4C280993.F17EE.21240 ; Authuser adityam; 27 Jun 2010 22:31:48 EDT In-Reply-To: <00ae01cb1653$3c922b20$b5b68160$@com> User-Agent: Alpine 2.01 (LNX 1266 2009-07-14) X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.12 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 Xref: news.gmane.org gmane.comp.tex.context:59891 Archived-At: On Sun, 27 Jun 2010, Tom wrote: > On Sat, Jun 26, 2010 at 22:31, Tom wrote: >> Is there a command or macro that converts a numeral to its English > language >> equivalent? For example, I would like to display Thirteen for 13. > > http://wiki.contextgarden.net/Page_numbering_in_words > > http://thread.gmane.org/gmane.comp.tex.context/33962/focus=34304 > (there is an attachment t-counting.tex in that thread) > > Mojca > > > The wiki includes the code for a macro, \numstr, that can be used to create > lower-case chapter numbers, but when I try to capitalize the first word, get > error messages. For example, the following errors out: > > Chapter \Word{\numstr{23}} > > As does > > Chapter \Words{\numstr{23}} > > but > > Chapter \numstr{23} > > Works as does > > Chapter \Words{twenty-three} > > However, the former returns twenty-three (all lower case) > and the latter returns Twenty-three (only the first part is in upper case) > > It's not clear from the Chicago Manual of Style if three should be > capitalized in this instance but, to my eye, it doesn't look right. Is there > a way to convert chapter numbers to text and select the desired > capitalization? If you want every word to be capitalized, simply change one, two, three, etc in the source of \numstr to One, Two, Three. Aditya ___________________________________________________________________________________ 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 : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________________