ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* [passing parameter into MPpage]
@ 2021-02-12 11:42 Floris van Manen
  2021-02-12 11:58 ` Hans Hagen
  0 siblings, 1 reply; 2+ messages in thread
From: Floris van Manen @ 2021-02-12 11:42 UTC (permalink / raw)
  To: mailing list for ConTeXt users

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]


___________________________________________________________________________________
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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [passing parameter into MPpage]
  2021-02-12 11:42 [passing parameter into MPpage] Floris van Manen
@ 2021-02-12 11:58 ` Hans Hagen
  0 siblings, 0 replies; 2+ messages in thread
From: Hans Hagen @ 2021-02-12 11:58 UTC (permalink / raw)
  To: mailing list for ConTeXt users, Floris van Manen

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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-02-12 11:58 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-12 11:42 [passing parameter into MPpage] Floris van Manen
2021-02-12 11:58 ` Hans Hagen

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).