From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/47206 Path: news.gmane.org!not-for-mail From: Wolfgang Schuster Newsgroups: gmane.comp.tex.context Subject: Re: Determing if the argument is one character or not Date: Wed, 4 Feb 2009 00:53:24 +0100 Message-ID: References: Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 (Apple Message framework v930.3) Content-Type: text/plain; charset="us-ascii"; Format="flowed"; DelSp="yes" Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1233706866 17566 80.91.229.12 (4 Feb 2009 00:21:06 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 4 Feb 2009 00:21:06 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Wed Feb 04 01:22:20 2009 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 1LUVWx-0006zH-35 for gctc-ntg-context-518@m.gmane.org; Wed, 04 Feb 2009 01:22:15 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id E4D721FD47; Wed, 4 Feb 2009 01:20:36 +0100 (CET) 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 16792-04-7; Wed, 4 Feb 2009 01:19:38 +0100 (CET) Original-Received: from ronja.vet.uu.nl (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id CE9751FB30; Wed, 4 Feb 2009 01:19:31 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 308221FCF4 for ; Wed, 4 Feb 2009 01:18:58 +0100 (CET) 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 17103-03-2 for ; Wed, 4 Feb 2009 01:18:19 +0100 (CET) Original-Received: from filter2-til.mf.surf.net (filter2-til.mf.surf.net [194.171.167.218]) by ronja.ntg.nl (Postfix) with ESMTP id 0142B1FCBB for ; Wed, 4 Feb 2009 00:54:23 +0100 (CET) Original-Received: from fg-out-1718.google.com (fg-out-1718.google.com [72.14.220.156]) by filter2-til.mf.surf.net (8.13.8/8.13.8/Debian-3) with ESMTP id n13NsNlc022582 for ; Wed, 4 Feb 2009 00:54:23 +0100 Original-Received: by fg-out-1718.google.com with SMTP id e21so1104881fga.8 for ; Tue, 03 Feb 2009 15:54:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:received:received:message-id:from:to :in-reply-to:content-type:content-transfer-encoding:mime-version :subject:date:references:x-mailer; bh=fI3Smg8xO3BEYrKzuwUdXtuEHpKn7ZzOYiW4pdkQJMo=; b=aqKViRLovFLwxdS0dvIv+EM5jg+huPFgyzvUFgUwcwBsWdU1voPlW1mDIqGzqvipAq QsqRjcMu65wb3/Yp6rMb5jmiOksXHAml+O9B9d1soWseZw++purIGaXugqdWZtsL+a8H /iRI2+079TFOqXbhGhSdskDXyPbLZaQ6Y12Fo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=message-id:from:to:in-reply-to:content-type :content-transfer-encoding:mime-version:subject:date:references :x-mailer; b=qRsEC1JYA36WHejMHr44dxypjfRiaAEm+/EMv5qI4uGR3gaL0jhM9Sf5YXE4RRhBN3 5odjbbZxUU2kaH8Sl/qftngrNkv+aadet/9GGMCq6UbobarW/vGt5wpiFSPEVgLqLRop C3gJSiZG8+zV2rBmjWNW7Rs6C0DIAjzO1G2SI= Original-Received: by 10.86.82.6 with SMTP id f6mr397934fgb.42.1233705263145; Tue, 03 Feb 2009 15:54:23 -0800 (PST) Original-Received: from ?10.70.60.222? (8.106.113.82.net.de.o2.com [82.113.106.8]) by mx.google.com with ESMTPS id d6sm358197fga.39.2009.02.03.15.54.19 (version=TLSv1/SSLv3 cipher=RC4-MD5); Tue, 03 Feb 2009 15:54:22 -0800 (PST) In-Reply-To: X-Mailer: Apple Mail (2.930.3) X-Bayes-Prob: 0.0001 (Score 0, tokens from: @@RPTN) X-CanIt-Geo: ip=72.14.220.156; country=US; region=CA; city=Mountain View; postalcode=94043; latitude=37.4192; longitude=-122.0574; metrocode=807; areacode=650; http://maps.google.com/maps?q=37.4192,-122.0574&z=6 X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 174639553 - 944fbf3256c1 X-Scanned-By: CanIt (www . roaringpenguin . com) on 194.171.167.218 X-Virus-Scanned: amavisd-new at ntg.nl X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.11 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:47206 Archived-At: Am 04.02.2009 um 00:11 schrieb Aditya Mahajan: > I want to write a macro which behaves differently depending on > whether its argumet is a single character or not. > > \MACRO[a] should give $X_{a}$ > \MACRO[a:b] should give $X_{[a:b]}$ > > Any hints on how to do this? To test for the number argument use \counttoken(s) and to check if the string contains a ":" use \doifinstring/\doifinstringelse. 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 ___________________________________________________________________________________