ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* deprecated startMPenvironment
@ 2016-04-03 14:07 Meer, Hans van der
  2016-04-03 22:12 ` Hans Hagen
  0 siblings, 1 reply; 4+ messages in thread
From: Meer, Hans van der @ 2016-04-03 14:07 UTC (permalink / raw)
  To: NTG ConTeXt

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 this 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 complicated, 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 and that I should use defineMPinstance and setupMPinstance instead.
Thus I tried

\defineMPinstance[mp:local][metafun][setups=mp:smallfont,textcolor=red]
\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 startMPenvironment without having to rely an a deprecated macro?

Hans van der Meer




___________________________________________________________________________________
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] 4+ messages in thread

* Re: deprecated startMPenvironment
  2016-04-03 14:07 deprecated startMPenvironment Meer, Hans van der
@ 2016-04-03 22:12 ` Hans Hagen
  2016-04-04  9:48   ` Meer, Hans van der
  0 siblings, 1 reply; 4+ messages in thread
From: Hans Hagen @ 2016-04-03 22:12 UTC (permalink / raw)
  To: ntg-context

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 this 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 complicated, 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 and that I should use defineMPinstance and setupMPinstance instead.
> Thus I tried
>
> \defineMPinstance[mp:local][metafun][setups=mp:smallfont,textcolor=red]
> \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 startMPenvironment without having to rely an a deprecated macro?

the bodyfont environment was needed because we had to communicate to the 
external 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

Hans

-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
       tel: 038 477 53 69 | 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] 4+ messages in thread

* Re: deprecated startMPenvironment
  2016-04-03 22:12 ` Hans Hagen
@ 2016-04-04  9:48   ` Meer, Hans van der
  2016-04-04  9:52     ` Wolfgang Schuster
  0 siblings, 1 reply; 4+ messages in thread
From: Meer, Hans van der @ 2016-04-04  9:48 UTC (permalink / raw)
  To: NTG ConTeXt


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



On 04 Apr 2016, at 00:12, Hans Hagen <pragma@wxs.nl<mailto: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 this 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 complicated, 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 and that I should use defineMPinstance and setupMPinstance instead.
Thus I tried

\defineMPinstance[mp:local][metafun][setups=mp:smallfont,textcolor=red]
\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 startMPenvironment without having to rely an a deprecated macro?

the bodyfont environment was needed because we had to communicate to the external 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]
\it
\stopMPenvironment

But italic only doing:

%\startMPenvironment[+]
\switchtobodyfont[small]
\it
%\stopMPenvironment

How is that possible?

Hans van der Meer


[-- Attachment #1.2: Type: text/html, Size: 4010 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] 4+ messages in thread

* Re: deprecated startMPenvironment
  2016-04-04  9:48   ` Meer, Hans van der
@ 2016-04-04  9:52     ` Wolfgang Schuster
  0 siblings, 0 replies; 4+ messages in thread
From: Wolfgang Schuster @ 2016-04-04  9:52 UTC (permalink / raw)
  To: mailing list for ConTeXt users


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

> Meer, Hans van der <mailto:H.vanderMeer@uva.nl>
> 4. April 2016 um 11:48
>
>
>> On 04 Apr 2016, at 00:12, Hans Hagen <pragma@wxs.nl 
>> <mailto: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 this 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 complicated, 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 and that I should use defineMPinstance and 
>>> setupMPinstance instead.
>>> Thus I tried
>>>
>>> \defineMPinstance[mp:local][metafun][setups=mp:smallfont,textcolor=red]
>>> \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 
>>> startMPenvironment without having to rely an a deprecated macro?
>>
>> the bodyfont environment was needed because we had to communicate to 
>> the external 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]
>     \it
>     \stopMPenvironment
>
>
> But italic only doing:
>
>     %\startMPenvironment[+]
>     \switchtobodyfont[small]
>     \it
>     %\stopMPenvironment
>
>
> How is that possible?
Please send complete examples and not only snippets.

Wolfgang

[-- Attachment #1.2: Type: text/html, Size: 4894 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] 4+ messages in thread

end of thread, other threads:[~2016-04-04  9:52 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-04-03 14:07 deprecated startMPenvironment Meer, Hans van der
2016-04-03 22:12 ` Hans Hagen
2016-04-04  9:48   ` Meer, Hans van der
2016-04-04  9:52     ` Wolfgang Schuster

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