From: Aditya Mahajan <adityam@umich.edu>
Subject: Treat last element in a commalist differently
Date: Fri, 2 Jun 2006 16:34:07 -0400 (EDT) [thread overview]
Message-ID: <Pine.WNT.4.63.0606021629370.3188@nqvgln> (raw)
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
next reply other threads:[~2006-06-02 20:34 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-06-02 20:34 Aditya Mahajan [this message]
2006-06-02 20:47 ` Taco Hoekwater
2006-06-02 21:09 ` Aditya Mahajan
2006-06-02 21:37 ` Taco Hoekwater
2006-06-03 4:42 ` Aditya Mahajan
2006-06-03 5:45 ` Aditya Mahajan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Pine.WNT.4.63.0606021629370.3188@nqvgln \
--to=adityam@umich.edu \
--cc=ntg-context@ntg.nl \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).