From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/59892 Path: news.gmane.org!not-for-mail From: "Tom" Newsgroups: gmane.comp.tex.context Subject: Re: Converting numerals to text Date: Sun, 27 Jun 2010 23:22:43 -0400 Message-ID: <00b801cb1671$2c4efa40$84eceec0$@com> 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" Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1277695378 20790 80.91.229.12 (28 Jun 2010 03:22:58 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 28 Jun 2010 03:22:58 +0000 (UTC) To: "'mailing list for ConTeXt users'" Original-X-From: ntg-context-bounces@ntg.nl Mon Jun 28 05:22:53 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 1OT4vt-0000i4-El for gctc-ntg-context-518@m.gmane.org; Mon, 28 Jun 2010 05:22:53 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 6528BC9AE3; Mon, 28 Jun 2010 05:22:51 +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 0KAj9nRR2nfU; Mon, 28 Jun 2010 05:22:48 +0200 (CEST) Original-Received: from balder.ntg.nl (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 788C6C9AF5; Mon, 28 Jun 2010 05:22:48 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 0E97AC9AF5 for ; Mon, 28 Jun 2010 05:22:48 +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 pH7u+DOEBI-5 for ; Mon, 28 Jun 2010 05:22:45 +0200 (CEST) Original-Received: from smtp1.ctinetworks.com (smtp1.ctinetworks.com [205.166.61.208]) by balder.ntg.nl (Postfix) with ESMTP id 41948C9AE3 for ; Mon, 28 Jun 2010 05:22:45 +0200 (CEST) Original-Received: from TomPC (dsl-206-251-12-162.dsl0.crls.pa.net [206.251.12.162]) by smtp1.ctinetworks.com (Postfix) with ESMTP id 8BE015857D8 for ; Sun, 27 Jun 2010 23:22:42 -0400 (EDT) In-Reply-To: X-Mailer: Microsoft Office Outlook 12.0 Thread-Index: AcsWahx1qbAyFuhGRECFfdqHRrh4bwABtNaw Content-Language: en-us X-ctinetworks-Information: Please contact the ISP for more information X-ctinetworks-MailScanner-ID: 8BE015857D8.A512E X-ctinetworks-VirusCheck: Found to be clean X-ctinetworks-SpamCheck: X-ctinetworks-Watermark: 1278559364.15264@5x1KlY9RUHGLEO1ywoalBw 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:59892 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 I do that, they will always be in upper case. I would lose the option of having them in lower case. Tom Benjey 717-258-9733 voice 717-243-0074 fax Twitter: @TomBenjey ___________________________________________________________________________________ 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 ___________________________________________________________________________________