From: Hans Hagen <j.hagen@xs4all.nl>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>,
Floris van Manen <vm@klankschap.nl>
Subject: Re: [passing parameter into MPpage]
Date: Fri, 12 Feb 2021 12:58:17 +0100 [thread overview]
Message-ID: <cb4765d7-742e-8e40-14b0-b12f37dc1645@xs4all.nl> (raw)
In-Reply-To: <cc0e759f-e43b-d026-5966-0c16a2aab8ff@klankschap.nl>
On 2/12/2021 12:42 PM, Floris van Manen wrote:
> What is the correct ways to pass parameters into a \startMPpage section?
> This does not produce a page (obviously if you know how it works)
> But how to get the intende output?
>
>
> \def\blz[#1][#2][#3]{
> \startMPpage
> draw thefmttext(#1) shifted(10mm, 20mm);
> draw thefmttext(#2) shifted(10mm, 205m);
> draw thefmttext(#3) shifted(10mm, 30mm);
> \stopMPpage
> }
>
> \blz[01][02][AA]
>
> \blz[03][42][ZZ]
whatever suits your purpose or taste, like
\def\blz[#1]%
{\begingroup
\setvariables[blz][#1]%
\startMPpage
draw textext("\getvariable{blz}{a}") shifted(10mm, 10mm);
draw textext("\getvariable{blz}{b}") shifted(10mm, 20mm);
draw textext("\getvariable{blz}{c}") shifted(10mm, 30mm);
\stopMPpage
\endgroup}
\blz[a=01,b=02,c=AA]
-----------------------------------------------------------------
Hans Hagen | PRAGMA ADE
Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-----------------------------------------------------------------
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!
maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage : http://www.pragma-ade.nl / http://context.aanhet.net
archive : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___________________________________________________________________________________
prev parent reply other threads:[~2021-02-12 11:58 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-02-12 11:42 Floris van Manen
2021-02-12 11:58 ` Hans Hagen [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=cb4765d7-742e-8e40-14b0-b12f37dc1645@xs4all.nl \
--to=j.hagen@xs4all.nl \
--cc=ntg-context@ntg.nl \
--cc=vm@klankschap.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).