From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/41184 Path: news.gmane.org!not-for-mail From: Stephan Hennig Newsgroups: gmane.comp.tex.context Subject: Re: luaTeX and on-the-fly MetaPost compilation Date: Sat, 24 May 2008 12:49:39 +0200 Message-ID: References: <4837C423.1080800@wxs.nl> 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 1211632026 16840 80.91.229.12 (24 May 2008 12:27:06 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 24 May 2008 12:27:06 +0000 (UTC) To: ntg-context@ntg.nl Original-X-From: ntg-context-bounces@ntg.nl Sat May 24 14:27:45 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 1JzsqS-0002aO-LI for gctc-ntg-context-518@m.gmane.org; Sat, 24 May 2008 14:27:32 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 273FB1FB89; Sat, 24 May 2008 14:26:45 +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 05540-01-21; Sat, 24 May 2008 14:26:21 +0200 (CEST) Original-Received: from ronja.vet.uu.nl (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 943C71FB8C; Sat, 24 May 2008 14:26:21 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 088351FB77 for ; Sat, 24 May 2008 14:26:20 +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 05540-01-20 for ; Sat, 24 May 2008 14:25:44 +0200 (CEST) Original-Received: from ciao.gmane.org (main.gmane.org [80.91.229.2]) by ronja.ntg.nl (Postfix) with ESMTP id 8BC331FB7E for ; Sat, 24 May 2008 14:25:44 +0200 (CEST) Original-Received: from list by ciao.gmane.org with local (Exim 4.43) id 1Jzsoi-00039y-4A for ntg-context@ntg.nl; Sat, 24 May 2008 12:25:44 +0000 Original-Received: from dialin-212-144-219-045.pools.arcor-ip.net ([212.144.219.45]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 24 May 2008 12:25:44 +0000 Original-Received: from mailing_list by dialin-212-144-219-045.pools.arcor-ip.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 24 May 2008 12:25:44 +0000 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 54 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: dialin-212-144-219-045.pools.arcor-ip.net User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.8.1.12) Gecko/20080213 Thunderbird/2.0.0.12 In-Reply-To: <4837C423.1080800@wxs.nl> 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:41184 Archived-At: Hans Hagen schrieb: > glue to tex: > > \def\includeMetaPost#1#2% io.loaddata is part of l-io.lua > {\directlua0{tex.print(filterfromMPblob(io.loaddata("#1",#2)))}} > > of course this need to be embeded in some general mp support > > (i'll add it to my todolist; actually a bit more is involved since one > probably wants to include the data between the figures too since it may > be called upon) Thank you for the outline. For the exact mechanism of how to process an .mp file I think there are three possible cases: 1. Strictly process what's between figure(n)..endfig only. For this example pair pnt; pnt:=origin; beginfig(1); pnt:=(100,100); drawdot pnt; endfig; beginfig(2); drawdot pnt; endfig; end compilation of figure 2 should fail, since variable pnt is undeclared. 2. Process everything up-to the specified figure, omitting stuff inside non-matching figure numbers. In the example above, the output of figure 2 should be a dot at point (0,0). This case is convenient if multiple figures share common variables or macros that are defined outside the scope of beginfig..endfig. This should be the default case for .mp file interpretation. 3. Process everything up-to the specified figure, including all non-matching figures, but discard their output. That is, in the example, the output of figure 2 should be a dot at point (100,100), since pnt was modified in figure 1. Note, this is not a pressing feature for me. The advantage is that MetaPost and TeX code can be held in separate files (which has several advantages) and users can easily compile the code in a single TeX run, without knowing about Makefiles. Well, there is the \write18 feature. But that is as difficult to use as a Makefile or even more difficult for the inexperienced user. Best regards, Stephan Hennig ___________________________________________________________________________________ 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 ___________________________________________________________________________________