[NTG-context] Define doifoneelse

Aditya Mahajan adityam at umich.edu
Mon Sep 11 07:57:10 CEST 2006

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 


More information about the ntg-context mailing list