From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/94259 Path: news.gmane.org!not-for-mail From: "Meer, Hans van der" Newsgroups: gmane.comp.tex.context Subject: Re: deprecated startMPenvironment Date: Mon, 4 Apr 2016 09:48:58 +0000 Message-ID: <6E626BC7-D571-4311-9CBA-44BADBCC4B7A@uva.nl> References: <5701956A.7010700@wxs.nl> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============5479836016673819757==" X-Trace: ger.gmane.org 1459763388 30989 80.91.229.3 (4 Apr 2016 09:49:48 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 4 Apr 2016 09:49:48 +0000 (UTC) To: NTG ConTeXt Original-X-From: ntg-context-bounces@ntg.nl Mon Apr 04 11:49:35 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 1an18Y-0003xe-Ej for gctc-ntg-context-518@m.gmane.org; Mon, 04 Apr 2016 11:49:34 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id ED4059DC6; Mon, 4 Apr 2016 11:49:12 +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 iYZFaKeT3hHd; Mon, 4 Apr 2016 11:49:10 +0200 (CEST) Original-Received: from zapf.ntg.nl (localhost [IPv6:::1]) by zapf.ntg.nl (Postfix) with ESMTP id D45DE9DCD; Mon, 4 Apr 2016 11:49:10 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 61C179DC3 for ; Mon, 4 Apr 2016 11:49:09 +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 dOkPIHaT6-mj for ; Mon, 4 Apr 2016 11:49:08 +0200 (CEST) Original-Received: from HUB01.uva.nl (hub01.uva.nl [146.50.108.230]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by zapf.ntg.nl (Postfix) with ESMTPS id D299B9DC2 for ; Mon, 4 Apr 2016 11:48:58 +0200 (CEST) Original-Received: from MBX02.uva.nl ([169.254.2.58]) by HUB01.uva.nl ([::1]) with mapi id 14.03.0266.001; Mon, 4 Apr 2016 11:48:58 +0200 Thread-Topic: [NTG-context] deprecated startMPenvironment Thread-Index: AQHRjlc1c/5xqe9KGkuQ68R8tuJq1w== In-Reply-To: <5701956A.7010700@wxs.nl> 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:1459747122, ts:1459763338 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:94259 Archived-At: --===============5479836016673819757== Content-Language: en-US Content-Type: multipart/alternative; boundary="_000_6E626BC7D57143119CBA44BADBCC4B7Auvanl_" --_000_6E626BC7D57143119CBA44BADBCC4B7Auvanl_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable On 04 Apr 2016, at 00:12, Hans Hagen > = wrote: On 4/3/2016 4:07 PM, Meer, Hans van der wrote: Previously I could do the following \starttext \startMPenvironment[+]\switchtobodyfont[small]\stopMPenvironment \startMPpage % metafont code \stopMPpage \stoptext \endinput This is called by context --run --once etc. producing the figure and in thi= s case modifying the font to a smaller size. Note, the context call occurs = on the fly inside a \directlua{{os.execute(..)}. You may find this complica= ted, but it works for me and I would rather like not having to change may t= hings all over the place. Now I learn from the ConTeXtgarden that startMPenvironment is deprecated an= d that I should use defineMPinstance and setupMPinstance instead. Thus I tried \defineMPinstance[mp:local][metafun][setups=3Dmp:smallfont,textcolor=3Dred] \startsetups mp:smallfont \switchtobodyfont[small] \stopsetups \startMPpage and also \startMPpage[mp:local] % metafont code \stopMPpage \stoptext \endinput But nothing happens. How do I get the effect earlier obtained with startMPe= nvironment without having to rely an a deprecated macro? the bodyfont environment was needed because we had to communicate to the ex= ternal mp run what the intended settings were in mkiv the run is internal so the mp text generator adapts to the current = settings and there is no need to pass anything Indeed, I can see the effect of mp functioning inside mkiv. But there is st= ill something I do not understand. I get small italic text doing this: \startMPenvironment[+] \switchtobodyfont[small] \it \stopMPenvironment But italic only doing: %\startMPenvironment[+] \switchtobodyfont[small] \it %\stopMPenvironment How is that possible? Hans van der Meer --_000_6E626BC7D57143119CBA44BADBCC4B7Auvanl_ Content-Type: text/html; charset="us-ascii" Content-ID: <03C9D8D86AF4684A93AA4C274E20393E@uva.nl> Content-Transfer-Encoding: quoted-printable


On 04 Apr 2016, at 00:12, Hans Hagen <pragma@wxs.nl> wrote:

On 4/3/2016 4:07 PM, Meer, Hans van der wrote:
Previously I could do the following
\starttext
\startMPenvironment[+]\switchtobodyfont[small]\stopMPenvironment
\startMPpage
% metafont code
\stopMPpage
\stoptext
\endinput

This is called by context --run --once etc. producing the figure and in thi= s case modifying the font to a smaller size. Note, the context call occurs = on the fly inside a \directlua{{os.execute(..)}. You may find this complica= ted, but it works for me and I would rather like not having to change may things all over the place.

Now I learn from the ConTeXtgarden that startMPenvironment is deprecated an= d that I should use defineMPinstance and setupMPinstance instead.
Thus I tried

\defineMPinstance[mp:local][metafun][setups=3Dmp:smallfont,textcolor=3Dred]=
\startsetups mp:smallfont
\switchtobo= dyfont[small]
\stopsetups
\startMPpage  and also \startMPpage[mp:local]
% metafont code
\stopMPpage
\stoptext
\endinput

But nothing happens. How do I get the effect earlier obtained with startMPe= nvironment without having to rely an a deprecated macro?

the bodyfont environment was needed because we had to communicate to the ex= ternal mp run what the intended settings were
in mkiv the run is internal so the mp text generator adapts to the current = settings and there is no need to pass anything


Indeed, I can see the effect of mp functioning inside mkiv.= But there is still something I do not understand.

I get small italic text doing this:

\startMPenvironment[+= ]
\switchtobodyfont[small]<= /font>
\it
\stopMPenvironment=

But italic only doing:

%\startMPenvironment[+= ;]
\switchtobodyfont[small]<= /font>
\it
%\stopMPenvironment

How is that possible?

Hans van der Meer

--_000_6E626BC7D57143119CBA44BADBCC4B7Auvanl_-- --===============5479836016673819757== 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= --===============5479836016673819757==--