4 Feb
2009
4 Feb
'09
1:06 a.m.
On Wed, 4 Feb 2009, Hans Hagen wrote:
Aditya Mahajan wrote:
Hi,
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?
\def\MACRO[#1#2]% {\doifelsenothing{#2} {$X_{#1}$} {$X_{[#1#2]}$}}
Duh. I should really try to understand TeX parsing rules some day. Thanks, Aditya