From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/30730 Path: news.gmane.org!not-for-mail From: Aditya Mahajan Newsgroups: gmane.comp.tex.context Subject: Re: Define doifoneelse Date: Mon, 11 Sep 2006 01:57:10 -0400 (EDT) Message-ID: References: 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 1157954255 28287 80.91.229.2 (11 Sep 2006 05:57:35 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 11 Sep 2006 05:57:35 +0000 (UTC) Original-X-From: ntg-context-bounces@ntg.nl Mon Sep 11 07:57:33 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 1GMenK-0001zf-KK for gctc-ntg-context-518@m.gmane.org; Mon, 11 Sep 2006 07:57:22 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id E8C501FCF6; Mon, 11 Sep 2006 07:57:21 +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 07839-04; Mon, 11 Sep 2006 07:57:17 +0200 (CEST) Original-Received: from ronja.vet.uu.nl (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id EBF931FCEF; Mon, 11 Sep 2006 07:57:16 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 7AC5A1FCEF for ; Mon, 11 Sep 2006 07:57:15 +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 07840-03-2 for ; Mon, 11 Sep 2006 07:57:13 +0200 (CEST) Original-Received: from tombraider.mr.itd.umich.edu (smtp.mail.umich.edu [141.211.93.161]) by ronja.ntg.nl (Postfix) with SMTP id 881461FCE5 for ; Mon, 11 Sep 2006 07:57:13 +0200 (CEST) Original-Received: FROM aditya.annarb01.mi.comcast.net (c-68-40-50-205.hsd1.mi.comcast.net [68.40.50.205]) BY tombraider.mr.itd.umich.edu ID 4504FAB6.9E2E5.14960 ; 11 Sep 2006 01:57:11 -0400 Original-To: mailing list for ConTeXt users In-Reply-To: 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:30730 Archived-At: On Mon, 11 Sep 2006, Aditya Mahajan wrote: > Hi, > > I want to define a macro, \doifoneelse, that checks if the first > argument is 1 or not. It should work for decimals and strings also. > So, > > \doifoneelse{1}{a}{b} gives a > \doifoneelse{1.5}{a}{b} gives b > \doifonelese{string}{a}{b} gives b > > Can someone suggest how to define this? Ah, it is already defined in context. I was so fixated upon using \ifnum and \ifcase that I did not see \doifelse. Sorry about the noise. Aditya