From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/30218 Path: news.gmane.org!not-for-mail From: "Mojca Miklavec" Newsgroups: gmane.comp.tex.context Subject: Re: how to figure out the number of elements inside \defineconversion? Date: Thu, 10 Aug 2006 21:36:02 +0200 Message-ID: <6faad9f00608101236p70b42fc9w3d0ed8195cd465e3@mail.gmail.com> References: <6faad9f00608100716l5715b634p51f823f76ac51221@mail.gmail.com> <44DB4F3E.20203@wxs.nl> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1155238655 27124 80.91.229.2 (10 Aug 2006 19:37:35 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 10 Aug 2006 19:37:35 +0000 (UTC) Original-X-From: ntg-context-bounces@ntg.nl Thu Aug 10 21:37:29 2006 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 ciao.gmane.org with esmtp (Exim 4.43) id 1GBGKs-0001J8-2w for gctc-ntg-context-518@m.gmane.org; Thu, 10 Aug 2006 21:36:54 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 635DC1FEF2; Thu, 10 Aug 2006 21:36:52 +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 28239-03; Thu, 10 Aug 2006 21:36:43 +0200 (CEST) Original-Received: from ronja.vet.uu.nl (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 878AB1FEE8; Thu, 10 Aug 2006 21:36:43 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 556D81FEE8 for ; Thu, 10 Aug 2006 21:36:41 +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 28238-04-2 for ; Thu, 10 Aug 2006 21:36:38 +0200 (CEST) Original-Received: from nf-out-0910.google.com (nf-out-0910.google.com [64.233.182.189]) by ronja.ntg.nl (Postfix) with SMTP id 7E3461FEC5 for ; Thu, 10 Aug 2006 21:36:38 +0200 (CEST) Original-Received: by nf-out-0910.google.com with SMTP id x29so634331nfb for ; Thu, 10 Aug 2006 12:36:03 -0700 (PDT) Original-Received: by 10.78.183.15 with SMTP id g15mr1664981huf; Thu, 10 Aug 2006 12:36:02 -0700 (PDT) Original-Received: by 10.78.175.15 with HTTP; Thu, 10 Aug 2006 12:36:02 -0700 (PDT) Original-To: "mailing list for ConTeXt users" In-Reply-To: <44DB4F3E.20203@wxs.nl> Content-Disposition: inline X-Virus-Scanned: amavisd-new at ntg.nl X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.7 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:30218 Archived-At: On 8/10/06, Hans Hagen wrote: > Mojca Miklavec wrote: > > Hello, > > > > I would like to \defineconversion and the use that set of symbols > > inside a metapost graphic. But I need to know the number of symbols, > > so that I can define enough "metapost images with symbols" in advance. > > I realise that there might be a problem since conversion can sometimes > > take an arbitrary number (using a command defined elsewhere), but if I > > could have a reasonable guess for conversions defined explicitely, > > that would already help a lot. (As a workaround and/or if there is no > > easy method to figure that out I can still hardcode "25" and wait > > until someone complains that that is not enough to satisfy his/her > > needs.) > \unprotect > > \def\doifelseconversionnumber#1#2% > {\doifdefinedelse{\??cv#1#2}} > > \protect > > \defineconversion[abc][$\star$,$\bullet$,$\ast$] > \defineconversion[def][m,o,j,c,a] > > \doloop > {\doifelseconversionnumber{abc}{\recurselevel} > {[abc \recurselevel\space defined]} > {\exitloop}} > > \doloop > {\doifelseconversionnumber{def}{\recurselevel} > {[def \recurselevel\space defined]} > {\exitloop}} Perfect. That's exactly what I needed. I only have to keep my fingers crossed now (I haven't tested the executable for a while) ... Mojca