![](https://secure.gravatar.com/avatar/c5ae4f9aa0d3a9bd5376e92b322c3e50.jpg?s=120&d=mm&r=g)
3 Feb
2009
3 Feb
'09
6:07 p.m.
On Wed, 4 Feb 2009, Wolfgang Schuster wrote:
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.
Thanks. For the moment, I will go with Hans's solution, since it is much simpler. Aditya