From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/31020 Path: news.gmane.org!not-for-mail From: Sanjoy Mahajan Newsgroups: gmane.comp.tex.context Subject: Re: \sometxt in staticMPfigure Date: Tue, 26 Sep 2006 14:33:22 +0100 Message-ID: References: <45191D66.7090203@wxs.nl> 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 1159277856 15469 80.91.229.2 (26 Sep 2006 13:37:36 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 26 Sep 2006 13:37:36 +0000 (UTC) Original-X-From: ntg-context-bounces@ntg.nl Tue Sep 26 15:37:33 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 1GSD47-0005TM-Cb for gctc-ntg-context-518@m.gmane.org; Tue, 26 Sep 2006 15:33:39 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id D99D81FC03; Tue, 26 Sep 2006 15:33:38 +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 22443-03-8; Tue, 26 Sep 2006 15:33:31 +0200 (CEST) Original-Received: from ronja.vet.uu.nl (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id B7BDB1FF03; Tue, 26 Sep 2006 15:33:30 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 243D91FF03 for ; Tue, 26 Sep 2006 15:33:28 +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 22443-03-7 for ; Tue, 26 Sep 2006 15:33:24 +0200 (CEST) Original-Received: from mraos.ra.phy.cam.ac.uk (mraos.ra.phy.cam.ac.uk [131.111.48.8]) by ronja.ntg.nl (Postfix) with SMTP id 526F01FEFC for ; Tue, 26 Sep 2006 15:33:23 +0200 (CEST) Original-Received: from skye.ra.phy.cam.ac.uk ([131.111.48.158] ident=mail) by mraos.ra.phy.cam.ac.uk with esmtp (Exim 4.43) id 1GSD3q-0007eM-ND; Tue, 26 Sep 2006 14:33:22 +0100 Original-Received: from sanjoy by skye.ra.phy.cam.ac.uk with local (Exim 3.36 #1) id 1GSD3q-0007y3-00; Tue, 26 Sep 2006 14:33:22 +0100 Original-To: mailing list for ConTeXt users In-Reply-To: Your message of "Tue, 26 Sep 2006 14:30:30 +0200." <45191D66.7090203@wxs.nl> 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:31020 Archived-At: > you can test the beta This gives the clearboxes error: =================== box.tex =================== \startMPinclusions input boxes \stopMPinclusions \starttext \startstaticMPfigure{fig} boxit.h(btex h etex); drawboxed(h); \stopstaticMPfigure \usestaticMPfigure[fig] \stoptext ===================================== The cause is that it produces this intermediate mp file: ========= box-fig.mp =============== input boxes boxit.h(btex h etex); drawboxed(h); =================================== This fails because all three lines go into a beginfig..endfig and metapost fails. That may be a metapost bug in this case, but for robustness I think it should become: input boxes beginfig(1) boxit.h(btex h etex); drawboxed(h); endfig; end In order to do that transformation, box-fig.mp would need separate sections for the inclusions and for the main figure code. Am I using inclusions incorrectly? i.e. Should I instead use MPextensions to get material placed at the top of the metapost file for use by all figures? Like this: =============== box-e.tex ================ \startMPextensions input boxes \stopMPextensions \starttext \startstaticMPfigure{fig} boxit.h(btex h etex); drawboxed(h); \stopstaticMPfigure \usestaticMPfigure[fig] \stoptext ======================================= But that produces (texexec-mpgraph.mp >> boxit.h ! Isolated expression. ( l.148 boxit.h( btex h etex ? because the added extensions ('input boxes') are not included in texexec-mpgraph.mp. -Sanjoy `Never underestimate the evil of which men of power are capable.' --Bertrand Russell, _War Crimes in Vietnam_, chapter 1.