ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Mojca Miklavec <mojca.miklavec.lists@gmail.com>
Subject: Re: How to "\processcommalist"?
Date: Mon, 4 Jul 2005 23:08:33 +0200	[thread overview]
Message-ID: <6faad9f00507041408331cc919@mail.gmail.com> (raw)
In-Reply-To: <42C951ED.3040400@wxs.nl>

Hans Hagen wrote:
> Mojca Miklavec wrote:
> > Taco Hoekwater wrote:
> >>Mojca Miklavec wrote:
> >>
> >>>I would like to define a command, which would be called in the following way:
> >>>    \TheBossWantsTheWorkToBeDoneOn[monday,wednesday,thursday]{tidy up}
> >>>
> >>>so that it would be equivalent to:
> >>>    \WeHaveToDo[monday]{tidy up}
> >>>    \WeHaveToDo[wednesday]{tidy up}
> >>>    \WeHaveToDo[thursday]{tidy up}
>
> Actually, there is an easier way to do this; just swap the arguments to WeHaveToDo:
> 
> \def\TheBossWantsTheWorkToBeDoneOn[#1]#2%
>    {\processcommalist[#1]{\WeHaveToDo{#2}}}
> 
> \def\WeHaveToDo#1#2{(#2: #1)}

Thanks for the proposal. I included it into Wiki, but in my case the
"\WeHaveToDo" was already defined and I needed it exactly in the form
that Taco suggested (to call \OnlyStep[#1]{#2} with
\OnSteps[1-3,5]{content} in t-rsteps module).

> btw, nice thread for a wiki entry

I added it to http://contextgarden.net/Inside_ConTeXt#Processing_lists_of_values.

> >>>Is there also a possibility to define a command like
> >>>    \IHaveToDoTheTasks[1-4,7,9-11]{until tomorrow}
> >>
> >>There was not, but knowing Hans I trust that soon there will be :-).
> 
> hm, well, it does rain outside, but ...

Taco's solution already solved my problem, but I believe it would be
nice to add some \processenumeratedlist (well, some better name should
be given!) command to ConTeXt one day. That way it would be possible
to process some commands like
    \filterpages[file.pdf][1,3,5]
also with
    \filterpages[file.pdf][1-3,5,7-11]

Mojca

  reply	other threads:[~2005-07-04 21:08 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-07-01 16:15 Mojca Miklavec
2005-07-01 17:54 ` Taco Hoekwater
2005-07-01 18:45   ` Mojca Miklavec
2005-07-04 15:12     ` Hans Hagen
2005-07-04 21:08       ` Mojca Miklavec [this message]
2005-07-04 22:20         ` Hans Hagen
2005-07-01 20:39   ` How to "\processcommalist"? (corrected solution) Taco Hoekwater

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=6faad9f00507041408331cc919@mail.gmail.com \
    --to=mojca.miklavec.lists@gmail.com \
    --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).