ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Specifying MP instance for MPpage
@ 2013-02-23 20:03 Marco Patzer
  2013-02-24 13:02 ` Hans Hagen
  0 siblings, 1 reply; 3+ messages in thread
From: Marco Patzer @ 2013-02-23 20:03 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 220 bytes --]

Hi,

how to specify a particular MP instance for a MPpage?

\defineMPinstance
  [myinstance]
  [metafun]
  [textcolor=green]

\starttext
  \startMPpage
    draw textext("Foo") scaled 1cm;
  \stopMPpage
\stoptext


Marco

[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 490 bytes --]

[-- Attachment #2: Type: text/plain, Size: 485 bytes --]

___________________________________________________________________________________
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: Specifying MP instance for MPpage
  2013-02-23 20:03 Specifying MP instance for MPpage Marco Patzer
@ 2013-02-24 13:02 ` Hans Hagen
  2013-02-24 15:19   ` Marco Patzer
  0 siblings, 1 reply; 3+ messages in thread
From: Hans Hagen @ 2013-02-24 13:02 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On 2/23/2013 9:03 PM, Marco Patzer wrote:
> \defineMPinstance
>    [myinstance]
>    [metafun]
>    [textcolor=green]
>
> \starttext
>    \startMPpage
>      draw textext("Foo") scaled 1cm;
>    \stopMPpage
> \stoptext

You can add this to cont-new.mkiv:

\unprotect

\def\c!instance{instance}

\unexpanded\def\meta_process_graphic_instance#1%
   {\edef\currentMPinstance{#1}%
    \ifx\currentMPinstance\empty
      \let\currentMPinstance\defaultMPinstance
    \fi
    \edef\currentMPformat{\MPinstanceparameter\s!format}%
    \meta_process_graphic}

\definefittingpage
   [MPpage]
   [\c!align=,
 
\c!command=\meta_process_graphic_instance{\fittingpageparameter\c!instance},
    \c!instance=]

\unprotect

and then do:

\defineMPinstance
   [myinstance]
   [metafun]
   [textcolor=green]

\starttext
   \startMPpage[instance=myinstance,offset=1cm]
     fill fullcircle scaled 10cm ;
     draw textext("Foo") scaled 1cm;
   \stopMPpage
\stoptext



-- 

-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
     tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
                                              | 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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


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

* Re: Specifying MP instance for MPpage
  2013-02-24 13:02 ` Hans Hagen
@ 2013-02-24 15:19   ` Marco Patzer
  0 siblings, 0 replies; 3+ messages in thread
From: Marco Patzer @ 2013-02-24 15:19 UTC (permalink / raw)
  To: ntg-context


[-- Attachment #1.1: Type: text/plain, Size: 216 bytes --]

On 2013–02–24 Hans Hagen wrote:

> You can add this to cont-new.mkiv:
>
> […]
>
> and then do:
> 
> […]
> 
>   \startMPpage[instance=myinstance,offset=1cm]

Thanks Hans for adding this!

Marco

[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 490 bytes --]

[-- Attachment #2: Type: text/plain, Size: 485 bytes --]

___________________________________________________________________________________
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

end of thread, other threads:[~2013-02-24 15:19 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-02-23 20:03 Specifying MP instance for MPpage Marco Patzer
2013-02-24 13:02 ` Hans Hagen
2013-02-24 15:19   ` Marco Patzer

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