ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* \startuseMPgraphic
@ 2016-04-11  8:35 Meer, Hans van der
  2016-04-11 12:42 ` \startuseMPgraphic Wolfgang Schuster
  0 siblings, 1 reply; 12+ messages in thread
From: Meer, Hans van der @ 2016-04-11  8:35 UTC (permalink / raw)
  To: NTG ConTeXt


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

I seem to remember the following variations in \startuseMPgraphic.

(1) \startuseMPgraphic{name}{comma separated list of variables}
(2) \startuseMPgraphic{name}{comma separated list of key=value pairs}
In the second case one is able to set a default value to that variable, possibly to be overridden with \useMPgraphic{name}{key=value}.
I very much would like to specify default values on the \startuseMPgraphic definition of the graphic.

However, I cannot get option (2) working. Do I have a bad memory (possible of course ;-), Has it to be done otherwise?
In the example below the graphic myname1 is ok, but myname2 gives the following error:
metapost        > error:
>> orange
! Improper type.
<to be read again>
                   ;
<*> ...raw unitsquare scaled 1cm withcolor orange;

minimal example:

\starttext
\startuseMPgraphic{myname1}{color}
  pickup pencircle scaled 1mm;
  draw unitsquare scaled 1cm withcolor \MPvar{color};
\stopuseMPgraphic

\startuseMPgraphic{myname2}{color=red}
  pickup pencircle scaled 1mm;
  draw unitsquare scaled 1cm withcolor \MPvar{color};
\stopuseMPgraphic

\useMPgraphic{myname1}{color=blue}
\useMPgraphic{myname2}{color=orange}

\stoptext

Hans van der Meer


[-- Attachment #1.2: Type: text/html, Size: 3547 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] 12+ messages in thread
[parent not found: <mailman.1.1460368801.12686.ntg-context@ntg.nl>]

end of thread, other threads:[~2016-04-11 23:00 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-04-11  8:35 \startuseMPgraphic Meer, Hans van der
2016-04-11 12:42 ` \startuseMPgraphic Wolfgang Schuster
2016-04-11 13:30   ` \startuseMPgraphic Meer, Hans van der
2016-04-11 14:12     ` \startuseMPgraphic Wolfgang Schuster
     [not found] <mailman.1.1460368801.12686.ntg-context@ntg.nl>
2016-04-11 13:10 ` \startuseMPgraphic Jeong Dal
2016-04-11 14:17   ` \startuseMPgraphic Alan BRASLAU
2016-04-11 14:38     ` \startuseMPgraphic Meer, Hans van der
2016-04-11 17:16       ` \startuseMPgraphic Aditya Mahajan
2016-04-11 19:50         ` \startuseMPgraphic Meer, Hans van der
2016-04-11 20:27           ` \startuseMPgraphic Wolfgang Schuster
2016-04-11 22:30             ` \startuseMPgraphic Alan BRASLAU
2016-04-11 23:00               ` \startuseMPgraphic Aditya Mahajan

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