From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/30948 Path: news.gmane.org!not-for-mail From: Wolfgang Schuster Newsgroups: gmane.comp.tex.context Subject: Re: does metafun require texexec --final? Date: Sat, 23 Sep 2006 18:16:27 +0200 Message-ID: <20060923181627.440dc0c7.schuster.wolfgang@googlemail.com> References: Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1159028236 14648 80.91.229.2 (23 Sep 2006 16:17:16 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sat, 23 Sep 2006 16:17:16 +0000 (UTC) Original-X-From: ntg-context-bounces@ntg.nl Sat Sep 23 18:17:13 2006 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 ciao.gmane.org with esmtp (Exim 4.43) id 1GRABW-0002r1-W6 for gctc-ntg-context-518@m.gmane.org; Sat, 23 Sep 2006 18:16:59 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 7094E1FE7B; Sat, 23 Sep 2006 18:16:58 +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 13262-04-2; Sat, 23 Sep 2006 18:16:53 +0200 (CEST) Original-Received: from ronja.vet.uu.nl (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 293FE1FE35; Sat, 23 Sep 2006 18:16:53 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 3497C1FE35 for ; Sat, 23 Sep 2006 18:16:49 +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 13913-02 for ; Sat, 23 Sep 2006 18:16:42 +0200 (CEST) Original-Received: from nf-out-0910.google.com (nf-out-0910.google.com [64.233.182.190]) by ronja.ntg.nl (Postfix) with SMTP id 89EE81FE20 for ; Sat, 23 Sep 2006 18:16:42 +0200 (CEST) Original-Received: by nf-out-0910.google.com with SMTP id d4so1154583nfe for ; Sat, 23 Sep 2006 09:16:42 -0700 (PDT) Original-Received: by 10.78.188.19 with SMTP id l19mr806618huf; Sat, 23 Sep 2006 09:16:42 -0700 (PDT) Original-Received: from unknown ( [89.51.234.57]) by mx.gmail.com with ESMTP id y1sm334162hua.2006.09.23.09.16.38; Sat, 23 Sep 2006 09:16:41 -0700 (PDT) Original-To: ntg-context@ntg.nl In-Reply-To: X-Mailer: Sylpheed version 2.2.6 (GTK+ 2.6.10; i686-pc-mingw32) X-Virus-Scanned: amavisd-new at ntg.nl X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.7 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:30948 Archived-At: On Sat, 23 Sep 2006 15:03:57 +0100 Sanjoy Mahajan wrote: > [Hans: Feature suggestion for figure inclusion at the end...] > > I wrote: > > So, is --final a requirement when using metafun, or am I hacking > > around a problem I've caused by leaving something out? > > An answer is that I should set \runMPgraphicstrue. I thought it was > automatically set, half-remembering what Aditya said in the previous > thread on metafun. So the following works (changing the r changes the > result right away without requiring --final or requiring two texexec > runs): > > ========= cut here ================== > \runMPgraphicstrue > \starttext > > \startreusableMPgraphic{a} > r := 1cm; > fill fullcircle scaled r; > \stopreusableMPgraphic > > \placefigure[force,none]{}{\reuseMPgraphic{a}} > > the figure above should be a small circle > > \stoptext > ========= cut here ================== > > To see where and when \runMPgraphicstrue was done, I looked into the > metafun interface code, and asked grep for help: > > $ grep '\\runMPgraphicstrue' *.tex > s-pre-02.tex:113:%D switch \type {\runMPgraphicstrue} to the local file \type > supp-mps.tex:1195:%D \runMPgraphicstrue > supp-mps.tex:1209:%D \type{\runMPgraphicstrue}, the \METAPOST\ scratch file > supp-mps.tex:1653:%D \global\runMPgraphicstrue > supp-mps.tex:1991: \runMPgraphicstrue > > So it's commented-in only at line 1991, which is part of a new (to me) > method of figure inclusion: \startstaticMPgraphic, which says > "Dedicated to Aditya Mahajan. See meta-ini for usage", so I see how > Aditya would conclude that \runMPgraphicstrue is always true :-) > > The following therefore also works to get instant updating, and is > more efficient than reusable MP graphics in that it reruns metapost on > included figures only when they change: > > ========= cut here ================== > % no need to set \runMPgraphicstrue > \starttext > > % see how smart staticMPfigure is by changing r here but not > % in the figure definition itself. Will it re-metapost the graphic? > % Answer: It's smart. > \startMPinclusions > r := 1cm; > \stopMPinclusions > > \startstaticMPfigure{a} > fill fullcircle scaled r; > \stopstaticMPfigure > > \placefigure[force,none]{}{\usestaticMPfigure[a]} > > the figure above should be a small or large circle > > \stoptext > ========= cut here ================== > > Which I just now see is on the Wiki page about metafun (I'd been > working from the excellent metafun manual). > > It's doubly smart in that changing the papersize (which changes the > layout parameters, which are included in the metapost file) will rerun > the graphic, even if r stays the same. So the graphic can base itself > on those parameters and be updated when needed. > > Thanks, Hans and Aditya! > > While experimenting with the methods of figure inclusion, I've been > changing among \reuseMPgraphic, \usestaticMPfigure, \useMPgraphic, and > \externalfigure to call up the figure. Do all the figure labels live > in the same namespace? In which case (warning: feature suggestion!) > when they are defined, e.g. with \useexternalfigure, > \startstaticMPfigure, ..., could the label have associated with it the > command that calls it up? So one could do for all types: > > \usefigure[thelabel] > > and ConTeXt would figure out what kind of figure it is and turn > \usefigure into the appropriate one (\reuseMPgraphic, ...). > > Then speaking purely hypothetically of course: If, after learning > metafun, one decides to turn many external metapost figures into > metafun figures (and then static figures instead of reusable figures), > the figure placement commands don't have change. > > -Sanjoy > Hi Sanjoy, you should also look in your cont-sys.tex if \runMPgraphicstrue is enabled for every ConTeXt run. Wolfgang