ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: "Mojca Miklavec" <mojca.miklavec.lists@gmail.com>
Subject: Re: how to figure out the number of elements inside \defineconversion?
Date: Thu, 10 Aug 2006 21:36:02 +0200	[thread overview]
Message-ID: <6faad9f00608101236p70b42fc9w3d0ed8195cd465e3@mail.gmail.com> (raw)
In-Reply-To: <44DB4F3E.20203@wxs.nl>

On 8/10/06, Hans Hagen wrote:
> Mojca Miklavec wrote:
> > Hello,
> >
> > I would like to \defineconversion and the use that set of symbols
> > inside a metapost graphic. But I need to know the number of symbols,
> > so that I can define enough "metapost images with symbols" in advance.
> > I realise that there might be a problem since conversion can sometimes
> > take an arbitrary number (using a command defined elsewhere), but if I
> > could have a reasonable guess for conversions defined explicitely,
> > that would already help a lot. (As a workaround and/or if there is no
> > easy method to figure that out I can still hardcode "25" and wait
> > until someone complains that that is not enough to satisfy his/her
> > needs.)

> \unprotect
>
> \def\doifelseconversionnumber#1#2%
>   {\doifdefinedelse{\??cv#1#2}}
>
> \protect
>
> \defineconversion[abc][$\star$,$\bullet$,$\ast$]
> \defineconversion[def][m,o,j,c,a]
>
> \doloop
>   {\doifelseconversionnumber{abc}{\recurselevel}
>      {[abc \recurselevel\space defined]}
>      {\exitloop}}
>
> \doloop
>   {\doifelseconversionnumber{def}{\recurselevel}
>      {[def \recurselevel\space defined]}
>      {\exitloop}}

Perfect. That's exactly what I needed. I only have to keep my fingers
crossed now (I haven't tested the executable for a while) ...

Mojca

      reply	other threads:[~2006-08-10 19:36 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-08-10 14:16 Mojca Miklavec
2006-08-10 15:22 ` Hans Hagen
2006-08-10 19:36   ` Mojca Miklavec [this message]

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=6faad9f00608101236p70b42fc9w3d0ed8195cd465e3@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).