From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/81940 Path: news.gmane.org!not-for-mail From: Mojca Miklavec Newsgroups: gmane.comp.tex.context Subject: Re: gnuplot module broken Date: Fri, 19 Apr 2013 09:37:02 +0200 Message-ID: References: <20130218164041.GR3733@homerow> <512347AC.30700@wxs.nl> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1366357027 21681 80.91.229.3 (19 Apr 2013 07:37:07 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 19 Apr 2013 07:37:07 +0000 (UTC) Cc: mailing list for ConTeXt users To: Hans Hagen Original-X-From: ntg-context-bounces@ntg.nl Fri Apr 19 09:37:11 2013 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from balder.ntg.nl ([195.12.62.10]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1UT5sc-0006a3-KA for gctc-ntg-context-518@m.gmane.org; Fri, 19 Apr 2013 09:37:10 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 8F84F101EA; Fri, 19 Apr 2013 09:37:09 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id Piw5PUwvw0tB; Fri, 19 Apr 2013 09:37:07 +0200 (CEST) Original-Received: from balder.ntg.nl (localhost [IPv6:::1]) by balder.ntg.nl (Postfix) with ESMTP id 0D559101E6; Fri, 19 Apr 2013 09:37:07 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id CA98B101E6 for ; Fri, 19 Apr 2013 09:37:04 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id uV67QZNl6u12 for ; Fri, 19 Apr 2013 09:37:03 +0200 (CEST) Original-Received: from filter4-ams.mf.surf.net (filter4-ams.mf.surf.net [192.87.102.72]) by balder.ntg.nl (Postfix) with ESMTP id 8B469101E4 for ; Fri, 19 Apr 2013 09:37:03 +0200 (CEST) Original-Received: from mail-we0-x231.google.com (mail-we0-x231.google.com [IPv6:2a00:1450:400c:c03::231]) by filter4-ams.mf.surf.net (8.14.3/8.14.3/Debian-9.4) with ESMTP id r3J7wmxF010702 for ; Fri, 19 Apr 2013 09:58:48 +0200 Original-Received: by mail-we0-f177.google.com with SMTP id o7so3119542wea.36 for ; Fri, 19 Apr 2013 00:37:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:in-reply-to:references:date:message-id :subject:from:to:cc:content-type; bh=KFgzIFVuB4nQrwJVdFkQF2uBonArkeiqhXxqwiIZ4Y4=; b=aNbt5SJ301ZdynBhRbMxTwa5XSUW+2jQo8MBw04TRZe0HJ0ZJp8y9EC+2N+NrpNewK 7uy7GDsXRhcoQDWFhAamR8mnmAiim5KUqITrZhJlW0nlsM009ERQK8/84+kqBR8R/HGA AVy7NiNOb68dXLhs/Rf5P8Efio47cAF//WX91gQ/MQiuWEt4ov0N64KOIoH6/nyA8JfO dxd7jhaLWkkv7IDNvm0yewHpzufdm9AGURhP1A0n185CLs9DJLLwBuSKs1kzGG589Hh/ YqtmZZGmVp5LN9zKs50aw7McPigdFmq3PEKgMFRcJu0BcjfhZG4KDvtcNDVl/UjWHwV3 i9mQ== X-Received: by 10.194.93.231 with SMTP id cx7mr16963239wjb.33.1366357022709; Fri, 19 Apr 2013 00:37:02 -0700 (PDT) Original-Received: by 10.194.222.74 with HTTP; Fri, 19 Apr 2013 00:37:02 -0700 (PDT) In-Reply-To: <512347AC.30700@wxs.nl> X-Bayes-Prob: 0.0001 (Score 0, tokens from: @@RPTN) X-CanIt-Geo: ip=2a00:1450:400c:c03::231; country=IE X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 01JpHWMix - 18632147db06 - 20130419 (trained as not-spam) X-Scanned-By: CanIt (www . roaringpenguin . com) X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.14 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-bounces@ntg.nl Xref: news.gmane.org gmane.comp.tex.context:81940 Archived-At: 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 ___________________________________________________________________________________