From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/28389 Path: news.gmane.org!not-for-mail From: Aditya Mahajan Newsgroups: gmane.comp.tex.context Subject: Treat last element in a commalist differently Date: Fri, 2 Jun 2006 16:34:07 -0400 (EDT) Message-ID: 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 1149280467 19062 80.91.229.2 (2 Jun 2006 20:34:27 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 2 Jun 2006 20:34:27 +0000 (UTC) Original-X-From: ntg-context-bounces@ntg.nl Fri Jun 02 22:34:22 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 1FmGLd-0006Y5-VO for gctc-ntg-context-518@m.gmane.org; Fri, 02 Jun 2006 22:34:22 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id BD7BA12826; Fri, 2 Jun 2006 22:34:20 +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 24546-05-2; Fri, 2 Jun 2006 22:34:16 +0200 (CEST) Original-Received: from ronja.vet.uu.nl (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id EFEA41281B; Fri, 2 Jun 2006 22:34:15 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 77CA51281B for ; Fri, 2 Jun 2006 22:34: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 24546-05 for ; Fri, 2 Jun 2006 22:34:14 +0200 (CEST) Original-Received: from skycaptain.mr.itd.umich.edu (smtp.mail.umich.edu [141.211.93.160]) by ronja.ntg.nl (Postfix) with SMTP id 1E6031279B for ; Fri, 2 Jun 2006 22:34: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 skycaptain.mr.itd.umich.edu ID 4480A0C3.15027.8808 ; 2 Jun 2006 16:34:12 -0400 Original-To: mailing list for ConTeXt users 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:28389 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]{\dodoSEQ{#1}}} \else \mathematics{\bold{#1}}\fi} \def\dodoSEQ#1#2% {#1_{#2},} \starttext \SEQ X[1,2,3] is part of \SEQ X. \stoptext 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? Thanks, Aditya