From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/71508 Path: news.gmane.org!not-for-mail From: "Meer, H. van der" Newsgroups: gmane.comp.tex.context Subject: Re: metapost to pdf on the fly Date: Mon, 3 Oct 2011 07:05:06 +0000 Message-ID: References: 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: dough.gmane.org 1317625529 15605 80.91.229.12 (3 Oct 2011 07:05:29 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 3 Oct 2011 07:05:29 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Mon Oct 03 09:05:25 2011 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from balder.ntg.nl ([195.12.62.10]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1RAcaa-0000Hd-FS for gctc-ntg-context-518@m.gmane.org; Mon, 03 Oct 2011 09:05:24 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 2B7F1CAFF3; Mon, 3 Oct 2011 09:05:23 +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 SM1eK7mLIdXU; Mon, 3 Oct 2011 09:05:20 +0200 (CEST) Original-Received: from balder.ntg.nl (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 8D935CAFF0; Mon, 3 Oct 2011 09:05:20 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 9D87CCAFF0 for ; Mon, 3 Oct 2011 09:05:19 +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 klzngNqhjH3r for ; Mon, 3 Oct 2011 09:05:08 +0200 (CEST) Original-Received: from filter2-ams.mf.surf.net (filter2-ams.mf.surf.net [192.87.102.70]) by balder.ntg.nl (Postfix) with ESMTP id 16DE1CAFC1 for ; Mon, 3 Oct 2011 09:05:08 +0200 (CEST) Original-Received: from holleman.uva.nl (holleman.uva.nl [146.50.108.228]) by filter2-ams.mf.surf.net (8.14.3/8.14.3/Debian-5+lenny1) with ESMTP id p93757qT020255 for ; Mon, 3 Oct 2011 09:05:07 +0200 Original-Received: from bijvoet.uva.nl (146.50.108.241) by holleman.uva.nl (146.50.108.228) with Microsoft SMTP Server (TLS) id 14.1.289.1; Mon, 3 Oct 2011 09:05:07 +0200 Original-Received: from ketelaar.uva.nl ([fe80::cc61:4c73:c438:df97]) by bijvoet.uva.nl ([2002:9232:666f::9232:666f]) with mapi id 14.01.0289.001; Mon, 3 Oct 2011 09:05:06 +0200 Thread-Topic: [NTG-context] metapost to pdf on the fly Thread-Index: AQHMftbZkKrEHzet7EWdXt8szogJXJVkmt4AgAV7fYA= In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [82.95.102.36] Content-ID: X-Bayes-Prob: 0.0001 (Score 0, tokens from: @@RPTN) X-CanIt-Geo: ip=146.50.108.228; country=NL; region=07; city=Amsterdam; latitude=52.3500; longitude=4.9167; http://maps.google.com/maps?q=52.3500,4.9167&z=6 X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 0rFE757Rm - f21995bc624a - 20111003 X-Scanned-By: CanIt (www . roaringpenguin . com) on 192.87.102.70 X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.12 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 Xref: news.gmane.org gmane.comp.tex.context:71508 Archived-At: I am afraid I don't completely understand this. Doing: \startbuffer[fig-1] \startMPcode draw origin-(20,0) .. origin+(0,20) .. origin+(20,0) .. origin+(0,-20) .. cycle withcolor darkgreen; label(textext("Test"),origin); \stopMPcode \stopbuffer \starttext \processMPbuffer[fig-1] \stoptext I get the error: ! Argument of \dostartMPpositiongraphic has an extra }. system > tex > error on line 8 in file onfly.tex: Argument of ... 1 \startbuffer[fig-1] 2 \startMPcode 3 draw origin-(20,0) .. origin+(0,20) .. origin+(20,0) .. origin+(0,-20) .. cycle withcolor darkgreen; 4 label(textext("Test"),origin); 5 \stopMPcode 6 \stopbuffer 7 \starttext 8 >> \processMPbuffer[fig-1] .. \par } \processMPgraphic ...le ;\!!es , \MPaskedfigure )} }\egroup \placeMPgraphic \... \doprocessMPbuffer ...("\currentMPgraphicname ")}} \endMPgraphicgroup l.8 \processMPbuffer[fig-1] Hans van der Meer On 29 sep. 2011, at 21:21, Aditya Mahajan wrote: > On Thu, 29 Sep 2011, Meer, H. van der wrote: > >> I would like to generate metapost figures in separate pdf-files (in some convenient directory, they are reused elsewhere). This as part of a project structure. I know that on a separate run such a pdf can be generated with: >> context figurefile running on input >> \input some-metapost-inclusions >> \starttext >> \startMPpage >> .. >> \stopMPpage >> \stoptext >> >> But the idea is to do it on the fly while typesetting a project (using mode=*first to prevent further iterations): >> .. >> \component figurefile >> .. >> And in the figurefile >> \startcomponent figurefile >> \environment some-metapost-inclusions >> \starttext >> .. BUT THEN WHAT? >> >> As such it is not sufficient for the goal proposed. Can this be done at all? > > What I usually do is have all the figures in separate buffers: > > \startenvironment figures > > \startbuffer[fig-1] > ... > \stopbuffer > > \stopenvironment > > and in the main file > > \environment figures > > \starttext > .... > \processMPbuffer[fig-1] > .... > \stoptext > > This way you can also combine multiple figures using > > \processMPbuffer[fig-common,fig-1] > > etc. > > The metapost processing is fast enough that there is no noticable speed difference. > > Aditya > ___________________________________________________________________________________ > 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 > ___________________________________________________________________________________ ___________________________________________________________________________________ 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 ___________________________________________________________________________________