From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/43635 Path: news.gmane.org!not-for-mail From: "Wolfgang Schuster" Newsgroups: gmane.comp.tex.context Subject: Re: How does MPinclusions work in mkiv? Date: Tue, 2 Sep 2008 13:31:41 +0200 Message-ID: <115224fb0809020431u46ab0905qc32205d5256efa01@mail.gmail.com> References: <6faad9f00809020413x5b09647en894e0e9830792223@mail.gmail.com> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1220355336 18198 80.91.229.12 (2 Sep 2008 11:35:36 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 2 Sep 2008 11:35:36 +0000 (UTC) To: "mailing list for ConTeXt users" Original-X-From: ntg-context-bounces@ntg.nl Tue Sep 02 13:36:30 2008 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from ronja.vet.uu.nl ([131.211.172.88] helo=ronja.ntg.nl) by lo.gmane.org with esmtp (Exim 4.50) id 1KaUBD-0006KA-HS for gctc-ntg-context-518@m.gmane.org; Tue, 02 Sep 2008 13:36:15 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 0C3301FE70; Tue, 2 Sep 2008 13:35:09 +0200 (CEST) Original-Received: from ronja.ntg.nl ([127.0.0.1]) by localhost (smtp.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 11329-01-2; Tue, 2 Sep 2008 13:34:05 +0200 (CEST) Original-Received: from ronja.vet.uu.nl (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 38AE01FDD7; Tue, 2 Sep 2008 13:34:04 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 0A6311FCC7 for ; Tue, 2 Sep 2008 13:34:00 +0200 (CEST) Original-Received: from ronja.ntg.nl ([127.0.0.1]) by localhost (smtp.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 11561-01 for ; Tue, 2 Sep 2008 13:33:20 +0200 (CEST) Original-Received: from yw-out-1718.google.com (yw-out-1718.google.com [74.125.46.153]) by ronja.ntg.nl (Postfix) with ESMTP id 433981FC7A for ; Tue, 2 Sep 2008 13:31:43 +0200 (CEST) Original-Received: by yw-out-1718.google.com with SMTP id 5so220592ywm.74 for ; Tue, 02 Sep 2008 04:31:42 -0700 (PDT) Original-Received: by 10.150.228.12 with SMTP id a12mr3959813ybh.97.1220355101899; Tue, 02 Sep 2008 04:31:41 -0700 (PDT) Original-Received: by 10.151.103.21 with HTTP; Tue, 2 Sep 2008 04:31:41 -0700 (PDT) In-Reply-To: <6faad9f00809020413x5b09647en894e0e9830792223@mail.gmail.com> Content-Disposition: inline X-Virus-Scanned: amavisd-new at ntg.nl X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.9 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: ntg-context-bounces@ntg.nl Errors-To: ntg-context-bounces@ntg.nl X-Virus-Scanned: amavisd-new at ntg.nl Xref: news.gmane.org gmane.comp.tex.context:43635 Archived-At: On Tue, Sep 2, 2008 at 1:13 PM, Mojca Miklavec wrote: > Hello (Hans), > > this "minimal" example worked OK in mkiv back in May (most of settings > in the code below are just unimportant cosmetics, but otherwise it's > difficult to explain the idea behind); now it still works in mkii, but > not in mkiv. > > \def\mynextmpgraphic{\startMPinclusions erase_picture := 1; \stopMPinclusions} > > \startusableMPgraphic{bubble} > if erase_picture = 0: > draw last_picture; > else: > % draw a new picture; in mkiv this code is only reached once, > % \mynextgraphic does not reset erase_picture > fi; > \stopusableMPgraphic > > The code is ugly anyway, I know, but how should I reset variables to > redraw the picture once more? > > Thanks a lot, > Mojca > > ------------------- > > \setupcolors[state=start] > \definecolor[color 1][r=.7,g=.0,b=.0] > \definecolor[color 2][r=.7,g=.35,b=.0] > \definecolor[color 3][r=.67,g=.7,b=.0] > \definecolor[color 4][r=.3,g=.7,b=.0] > \definecolor[color 5][r=.0,g=.7,b=.0] > \definecolor[color 6][r=.0,g=.7,b=.4] > \definecolor[color 7][r=.0,g=.6,b=.7] > \definecolor[color 8][r=.0,g=.3,b=.7] > \definecolor[color 9][r=.1,g=.0,b=.7] > \definecolor[color 10][r=.4,g=.0,b=.7] > \definecolor[pagecolor][color 1] > > \setuphead > [section] > [number=no, > page=yes, > style=\bfd, > color=pagecolor] > \setuppapersize > [S6][S6] > \setuppagenumbering > [location=] > \definelayer > [page] > [width=\paperwidth, > height=\paperheight] ? > \setupbackgrounds > [page] > [background=bubble] > \defineoverlay > [bubble] > [\useMPgraphic{bubble}] > > \startMPinclusions > picture last_picture; > last_picture := nullpicture; > erase_picture := 1; > \stopMPinclusions > > \startusableMPgraphic{bubble} > if erase_picture = 0: > draw last_picture; > else: > for i=1 upto 20: > path p; p := fullcircle > scaled (2cm+uniformdeviate(3cm)) > shifted (uniformdeviate(\overlaywidth),uniformdeviate(\overlayheight)); > fill p withcolor .2[white,\MPcolor{pagecolor}]; > draw p withcolor .5[white,\MPcolor{pagecolor}]; > endfor; > > setbounds currentpicture to unitsquare xyscaled > (\overlaywidth,\overlayheight); > > last_picture := currentpicture; > erase_picture := 0; > fi; > \stopusableMPgraphic > > \def\mynextmpgraphic{\startMPinclusions erase_picture := 1; \stopMPinclusions} > > \starttext > > \section{abc first time} > \section{abc second time} > \section{abc third time} > > \page\definecolor[pagecolor][color 2]\mynextmpgraphic\page > > \section{def first time} > \section{def second time} > \section{def third time} > > \page\definecolor[pagecolor][color 3]\mynextmpgraphic\page > > \section{ghi first time} > \section{ghi second time} > > \page\definecolor[pagecolor][color 4]\mynextmpgraphic\page > > \section{jkl first time} > \section{jkl second time} > \section{jkl third time} > \section{jkl fourth time} > > \stoptext Write the test in TeX, the information will not be lost in this way. Wolfgang ___________________________________________________________________________________ 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 : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________________