ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* gnuplot module broken
@ 2013-02-18 16:40 Marco Patzer
  2013-02-19  0:37 ` Mojca Miklavec
  0 siblings, 1 reply; 5+ messages in thread
From: Marco Patzer @ 2013-02-18 16:40 UTC (permalink / raw)
  To: mailing list for ConTeXt users


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

Hi Mojca et al.

todays beta broke the gnuplot module. This is probably due to the
changes in the MP inclusion mechanism.

\usemodule [gnuplot]
\starttext
\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] 5+ messages in thread

* Re: gnuplot module broken
  2013-02-18 16:40 gnuplot module broken Marco Patzer
@ 2013-02-19  0:37 ` Mojca Miklavec
  2013-02-19  9:36   ` Hans Hagen
  0 siblings, 1 reply; 5+ messages in thread
From: Mojca Miklavec @ 2013-02-19  0:37 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On Mon, Feb 18, 2013 at 5:40 PM, Marco Patzer wrote:
> Hi Mojca et al.
>
> todays beta broke the gnuplot module. This is probably due to the
> changes in the MP inclusion mechanism.
>
> \usemodule [gnuplot]
> \starttext
> \stoptext

Here's an almost minimal example:

\def\abc{1cm}

\startMPextensions
a := \abc;
color b;
b := \MPcolor{currentcolor};
\stopMPextensions

\def\abc{3cm}

\starttext
\startcolor[blue]
\startMPcode
fill fullcircle scaled a withcolor b;
\stopMPcode
\stopcolor
\stoptext

The old ConTeXt draws a blue circle with diameter 3cm and the new
ConTeXt draws a black circle with diameter 1cm. Which one is right?
From a recent message by Hans:

> - add mp functionality (immediate expansion)

It seems that ConTeXt now parses everything inside MPextensions
earlier than it did before and I don't have the slightest idea how to
account for this in the module without a major rewrite. In case that
Hans wants to keep the new functionality, I either need [quite some]
help with the module or I'll simply stick to TeX Live 2012 for the
foreseeable future ;)

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

* Re: gnuplot module broken
  2013-02-19  0:37 ` Mojca Miklavec
@ 2013-02-19  9:36   ` Hans Hagen
  2013-04-19  7:37     ` Mojca Miklavec
  0 siblings, 1 reply; 5+ messages in thread
From: Hans Hagen @ 2013-02-19  9:36 UTC (permalink / raw)
  To: mailing list for ConTeXt users; +Cc: Mojca Miklavec

On 2/19/2013 1:37 AM, Mojca Miklavec wrote:
> On Mon, Feb 18, 2013 at 5:40 PM, Marco Patzer wrote:
>> Hi Mojca et al.
>>
>> todays beta broke the gnuplot module. This is probably due to the
>> changes in the MP inclusion mechanism.
>>
>> \usemodule [gnuplot]
>> \starttext
>> \stoptext
>
> Here's an almost minimal example:
>
> \def\abc{1cm}
>
> \startMPextensions
> a := \abc;
> color b;
> b := \MPcolor{currentcolor};
> \stopMPextensions
>
> \def\abc{3cm}
>
> \starttext
> \startcolor[blue]
> \startMPcode
> fill fullcircle scaled a withcolor b;
> \stopMPcode
> \stopcolor
> \stoptext
>
> The old ConTeXt draws a blue circle with diameter 3cm and the new
> ConTeXt draws a black circle with diameter 1cm. Which one is right?
>  From a recent message by Hans:
>
>> - add mp functionality (immediate expansion)
>
> It seems that ConTeXt now parses everything inside MPextensions
> earlier than it did before and I don't have the slightest idea how to
> account for this in the module without a major rewrite. In case that
> Hans wants to keep the new functionality, I either need [quite some]
> help with the module or I'll simply stick to TeX Live 2012 for the
> foreseeable future ;)

For the (not texlive) module use:

\defineMPinstance[gnuplot]
   [format=metafun,
    extensions=yes,
    initializations=yes,
    method=double]

\startMPdefinitions[gnuplot] ...

and then use the gnuplot instance. This not only isolates the code, but 
also gives you floats. It also means that if someone crashes the gnuplot 
instance, the rest still keeps running.

Definitions are per instance and are delayed i.e. passed via the tex end 
when they get expanded.

The reason for extensions being immediate (at least for now) is that it 
was more easy to implement as extensions meant for mp extensions and can 
be for all instances of specific (sets) of instances.

Sorry for the changes but as we have multiple instances, scale vs double 
and maybe more coming it's probably worth the trouble.

Hans

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

* Re: gnuplot module broken
  2013-02-19  9:36   ` Hans Hagen
@ 2013-04-19  7:37     ` Mojca Miklavec
  2013-04-19  8:09       ` Marco Patzer
  0 siblings, 1 reply; 5+ messages in thread
From: Mojca Miklavec @ 2013-04-19  7:37 UTC (permalink / raw)
  To: Hans Hagen; +Cc: mailing list for ConTeXt users

Dear Hans,

please consider the following example in MKII:

\setupcolors[state=start]

\starttext

\startMPextensions
a := \abc;
color b;
b := \MPcolor{currentcolor};
\stopMPextensions

\startuseMPgraphic{bla}
fill fullcircle scaled a withcolor b;
\stopuseMPgraphic

\def\abc{3cm}\color[blue]{\useMPgraphic{bla}}

% Nice small black circle
\def\abc{1cm}\useMPgraphic{bla}

\stoptext


I still don't know how to reproduce this in MKIV. I tried with
MPdefinitions as you suggested, but this only works the first time
when it is used. The following example creates two equal circles
instead of two different ones:


\starttext

\startMPdefinitions
a := \abc;
color b;
b := \MPcolor{currentcolor};
\stopMPdefinitions

\startuseMPgraphic{bla}
fill fullcircle scaled a withcolor b;
\stopuseMPgraphic

\def\abc{3cm}\color[blue]{\useMPgraphic{bla}}

% I want a black 1cm circle here
\def\abc{1cm}\useMPgraphic{bla}

\stoptext


Unless MKII is more powerful than MKIV: how can I achieve the same
functionality in MKIV as I did in MKII?

Thank you,
    Mojca


On Tue, Feb 19, 2013 at 10:36 AM, Hans Hagen wrote:
> On 2/19/2013 1:37 AM, Mojca Miklavec wrote:
>>
>> On Mon, Feb 18, 2013 at 5:40 PM, Marco Patzer wrote:
>>>
>>> Hi Mojca et al.
>>>
>>> todays beta broke the gnuplot module. This is probably due to the
>>> changes in the MP inclusion mechanism.
>>>
>>> \usemodule [gnuplot]
>>> \starttext
>>> \stoptext
>>
>> Here's an almost minimal example:
>>
>> \def\abc{1cm}
>>
>> \startMPextensions
>> a := \abc;
>> color b;
>> b := \MPcolor{currentcolor};
>> \stopMPextensions
>>
>> \def\abc{3cm}
>>
>> \starttext
>> \startcolor[blue]
>> \startMPcode
>> fill fullcircle scaled a withcolor b;
>> \stopMPcode
>> \stopcolor
>> \stoptext
>>
>> The old ConTeXt draws a blue circle with diameter 3cm and the new
>> ConTeXt draws a black circle with diameter 1cm. Which one is right?
>>  From a recent message by Hans:
>>
>>> - add mp functionality (immediate expansion)
>>
>>
>> It seems that ConTeXt now parses everything inside MPextensions
>> earlier than it did before and I don't have the slightest idea how to
>> account for this in the module without a major rewrite. In case that
>> Hans wants to keep the new functionality, I either need [quite some]
>> help with the module or I'll simply stick to TeX Live 2012 for the
>> foreseeable future ;)
>
>
> For the (not texlive) module use:
>
> \defineMPinstance[gnuplot]
>   [format=metafun,
>    extensions=yes,
>    initializations=yes,
>    method=double]
>
> \startMPdefinitions[gnuplot] ...
>
> and then use the gnuplot instance. This not only isolates the code, but also
> gives you floats. It also means that if someone crashes the gnuplot
> instance, the rest still keeps running.
>
> Definitions are per instance and are delayed i.e. passed via the tex end
> when they get expanded.
>
> The reason for extensions being immediate (at least for now) is that it was
> more easy to implement as extensions meant for mp extensions and can be for
> all instances of specific (sets) of instances.
>
> Sorry for the changes but as we have multiple instances, scale vs double and
> maybe more coming it's probably worth the trouble.
>
> Hans
___________________________________________________________________________________
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] 5+ messages in thread

* Re: gnuplot module broken
  2013-04-19  7:37     ` Mojca Miklavec
@ 2013-04-19  8:09       ` Marco Patzer
  0 siblings, 0 replies; 5+ messages in thread
From: Marco Patzer @ 2013-04-19  8:09 UTC (permalink / raw)
  To: ntg-context


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

On 2013–04–19 Mojca Miklavec wrote:

> Dear Hans,
> 
> please consider the following example in MKII:
> 
> \setupcolors[state=start]
> 
> \starttext
> 
> \startMPextensions
> a := \abc;
> color b;
> b := \MPcolor{currentcolor};
> \stopMPextensions
> 
> \startuseMPgraphic{bla}
> fill fullcircle scaled a withcolor b;
> \stopuseMPgraphic
> 
> \def\abc{3cm}\color[blue]{\useMPgraphic{bla}}
> 
> % Nice small black circle
> \def\abc{1cm}\useMPgraphic{bla}
> 
> \stoptext
> 
> 
> I still don't know how to reproduce this in MKIV.

Use \startMPinitializations instead of \startMPextensions, it's
global to all MP instances, though.

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

end of thread, other threads:[~2013-04-19  8:09 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-02-18 16:40 gnuplot module broken Marco Patzer
2013-02-19  0:37 ` Mojca Miklavec
2013-02-19  9:36   ` Hans Hagen
2013-04-19  7:37     ` Mojca Miklavec
2013-04-19  8:09       ` 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).