From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/94358 Path: news.gmane.org!not-for-mail From: "Meer, Hans van der" Newsgroups: gmane.comp.tex.context Subject: \startuseMPgraphic Date: Mon, 11 Apr 2016 08:35:33 +0000 Message-ID: <87835776-211F-4B8A-9730-A49978E25D66@uva.nl> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============4419227339343805107==" X-Trace: ger.gmane.org 1460363760 12053 80.91.229.3 (11 Apr 2016 08:36:00 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 11 Apr 2016 08:36:00 +0000 (UTC) To: NTG ConTeXt Original-X-From: ntg-context-bounces@ntg.nl Mon Apr 11 10:35:59 2016 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from zapf.boekplan.nl ([5.39.185.232] helo=zapf.ntg.nl) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1apXKA-00042N-Uh for gctc-ntg-context-518@m.gmane.org; Mon, 11 Apr 2016 10:35:59 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id D8CA7A285; Mon, 11 Apr 2016 10:35:47 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at zapf.boekplan.nl Original-Received: from zapf.ntg.nl ([127.0.0.1]) by localhost (zapf.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id jBkK-0m9GEPY; Mon, 11 Apr 2016 10:35:47 +0200 (CEST) Original-Received: from zapf.ntg.nl (localhost [IPv6:::1]) by zapf.ntg.nl (Postfix) with ESMTP id 3504FA284; Mon, 11 Apr 2016 10:35:47 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 71730A284 for ; Mon, 11 Apr 2016 10:35:45 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at zapf.boekplan.nl Original-Received: from zapf.ntg.nl ([127.0.0.1]) by localhost (zapf.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 8t-gISzpmD0y for ; Mon, 11 Apr 2016 10:35:45 +0200 (CEST) Original-Received: from HUB02.uva.nl (hub02.uva.nl [146.50.108.231]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by zapf.ntg.nl (Postfix) with ESMTPS id F23BCA280 for ; Mon, 11 Apr 2016 10:35:34 +0200 (CEST) Original-Received: from MBX02.uva.nl ([169.254.2.58]) by HUB02.uva.nl ([::1]) with mapi id 14.03.0266.001; Mon, 11 Apr 2016 10:35:33 +0200 Thread-Topic: \startuseMPgraphic Thread-Index: AQHRk80eFcSIE9rg1USWMhLlFH/9qQ== Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [84.106.134.200] x-endpointsecurity-0xde81-ev: v:6.2.7.719, d:out, a:y, w:t, t:0, sv:1460356013, ts:1460363733 X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.16 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ntg-context-bounces@ntg.nl Original-Sender: "ntg-context" Xref: news.gmane.org gmane.comp.tex.context:94358 Archived-At: --===============4419227339343805107== Content-Language: en-US Content-Type: multipart/alternative; boundary="_000_87835776211F4B8A9730A49978E25D66uvanl_" --_000_87835776211F4B8A9730A49978E25D66uvanl_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable 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=3Dvalue pairs} In the second case one is able to set a default value to that variable, pos= sibly to be overridden with \useMPgraphic{name}{key=3Dvalue}. 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 follo= wing error: metapost > error: >> orange ! Improper type. ; <*> ...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=3Dred} pickup pencircle scaled 1mm; draw unitsquare scaled 1cm withcolor \MPvar{color}; \stopuseMPgraphic \useMPgraphic{myname1}{color=3Dblue} \useMPgraphic{myname2}{color=3Dorange} \stoptext Hans van der Meer --_000_87835776211F4B8A9730A49978E25D66uvanl_ Content-Type: text/html; charset="us-ascii" Content-ID: <0396CDD0F4C7B34DAA68C0AB42C30081@uva.nl> Content-Transfer-Encoding: quoted-printable I seem to remember the following variations in \startuseMPgraphic.

(1) \startuseMPgraphic{name}{comma separated list of v= ariables}
(2) \startuseMPgraphic{name}{comma separated list of k= ey=3Dvalue pairs}
In the second case one is able to set a default value to th= at variable, possibly to be overridden with \useMPgraphic{name}{key=3Dvalue= }.
I very much would like to specify default values on the \st= artuseMPgraphic definition of the graphic.

However, I cannot get option (2) working. Do I have a bad m= emory (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{myname= 1}{color}
  pickup pencircle s= caled 1mm;
  draw unitsquare sc= aled 1cm withcolor \MPvar{color};
\stopuseMPgraphic<= /div>

\startuseMPgraphic{myname= 2}{color=3Dred}
  pickup pencircle s= caled 1mm;
  draw unitsquare sc= aled 1cm withcolor \MPvar{color};
\stopuseMPgraphic<= /div>

\useMPgraphic{myname1}{co= lor=3Dblue}
\useMPgraphic{myname2}{co= lor=3Dorange}

\stoptext

Hans van der Meer

--_000_87835776211F4B8A9730A49978E25D66uvanl_-- --===============4419227339343805107== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX18KSWYgeW91ciBxdWVzdGlvbiBpcyBvZiBpbnRlcmVz dCB0byBvdGhlcnMgYXMgd2VsbCwgcGxlYXNlIGFkZCBhbiBlbnRyeSB0byB0aGUgV2lraSEKCm1h aWxsaXN0IDogbnRnLWNvbnRleHRAbnRnLm5sIC8gaHR0cDovL3d3dy5udGcubmwvbWFpbG1hbi9s aXN0aW5mby9udGctY29udGV4dAp3ZWJwYWdlICA6IGh0dHA6Ly93d3cucHJhZ21hLWFkZS5ubCAv IGh0dHA6Ly90ZXguYWFuaGV0Lm5ldAphcmNoaXZlICA6IGh0dHA6Ly9mb3VuZHJ5LnN1cGVsZWMu ZnIvcHJvamVjdHMvY29udGV4dHJldi8Kd2lraSAgICAgOiBodHRwOi8vY29udGV4dGdhcmRlbi5u ZXQKX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX19fX18= --===============4419227339343805107==--