Re: [NTG-context] Treat last element in a commalist differently

2006-06-02 Thread Aditya Mahajan
On Fri, 2 Jun 2006, Aditya Mahajan wrote: > Hi, > I am trying to write a macro so that > > \SEQ X[1,2,3] expands to $X_1, X_2, X_3$ > \SEQ X[1-N] expands to $X_1, \dots, X_N$ > and > \SEQ X expands to ${\bf X}$. > > So far I have On Fri, 2 Jun 2006, Taco Hoekwater wrote: > It is much easier to

Re: [NTG-context] Treat last element in a commalist differently

2006-06-02 Thread Aditya Mahajan
On Fri, 2 Jun 2006, Taco Hoekwater wrote: > Aditya Mahajan wrote: >>> >>> \def\dodoSEQ#1#2% >>>{\ifdone ,\else \donetrue\fi#1_{#2}} >> >> Thanks Taco, >> >> Works like ... er ... magic. Where is \done set to true? > > Right above here, in \dodoSEQ. Duh... I need to read TeX code more care

Re: [NTG-context] Treat last element in a commalist differently

2006-06-02 Thread Taco Hoekwater
Aditya Mahajan wrote: >> >> \def\dodoSEQ#1#2% >>{\ifdone ,\else \donetrue\fi#1_{#2}} > > Thanks Taco, > > Works like ... er ... magic. Where is \done set to true? Right above here, in \dodoSEQ. Taco ___ ntg-context mailing list ntg-context@nt

Re: [NTG-context] Treat last element in a commalist differently

2006-06-02 Thread Aditya Mahajan
On Fri, 2 Jun 2006, Taco Hoekwater wrote: > Aditya Mahajan wrote: >> There is an extra comma at the end. That is, >> >> \SEQ X[1,2,3] expands to $X_1,X_2,X_3,$ >> ^^^ >> >> How can I treat the last element of a commalist differently? > > It is much easier to tr

Re: [NTG-context] Treat last element in a commalist differently

2006-06-02 Thread Taco Hoekwater
Aditya Mahajan wrote: > There is an extra comma at the end. That is, > > \SEQ X[1,2,3] expands to $X_1,X_2,X_3,$ > ^^^ > > How can I treat the last element of a commalist differently? It is much easier to treat the first element as special: \def\doSEQ[#1]

[NTG-context] Treat last element in a commalist differently

2006-06-02 Thread Aditya Mahajan
Hi, I am trying to write a macro so that \SEQ X[1,2,3] expands to $X_1, X_2, X_3$ \SEQ X[1-N] expands to $X_1, \dots, X_N$ and \SEQ X expands to ${\bf X}$. So far I have \def\SEQ#1% {\dodoubleempty\doSEQ[#1]} \def\doSEQ[#1][#2]% {\ifsecondargument \mathematics{\processcommalist[#2]{\dodoSE