From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/34980 Path: news.gmane.org!not-for-mail From: Wolfgang Schuster Newsgroups: gmane.comp.tex.context Subject: Re: loadcurrentMPgraphic from metafun manual Date: Sun, 10 Jun 2007 17:26:59 +0200 Message-ID: <20070610172659.59b0efe1.schuster.wolfgang@googlemail.com> References: <20070608162513.36ju508ao0040okk@web.mail.umich.edu> 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: sea.gmane.org 1181489248 21317 80.91.229.12 (10 Jun 2007 15:27:28 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sun, 10 Jun 2007 15:27:28 +0000 (UTC) To: ntg-context@ntg.nl Original-X-From: ntg-context-bounces@ntg.nl Sun Jun 10 17:27:26 2007 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 1HxPK5-0001PR-32 for gctc-ntg-context-518@m.gmane.org; Sun, 10 Jun 2007 17:27:21 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 845061FFB8; Sun, 10 Jun 2007 17:27: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 30320-07-3; Sun, 10 Jun 2007 17:27:13 +0200 (CEST) Original-Received: from ronja.vet.uu.nl (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id CEBFB1FFC0; Sun, 10 Jun 2007 17:27:12 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 77F821FFC0 for ; Sun, 10 Jun 2007 17:27:10 +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 30320-07-2 for ; Sun, 10 Jun 2007 17:27:07 +0200 (CEST) Original-Received: from ug-out-1314.google.com (ug-out-1314.google.com [66.249.92.169]) by ronja.ntg.nl (Postfix) with ESMTP id 833B01FFB8 for ; Sun, 10 Jun 2007 17:27:07 +0200 (CEST) Original-Received: by ug-out-1314.google.com with SMTP id o2so1310857uge for ; Sun, 10 Jun 2007 08:27:07 -0700 (PDT) Original-Received: by 10.82.186.5 with SMTP id j5mr9105643buf.1181489226936; Sun, 10 Jun 2007 08:27:06 -0700 (PDT) Original-Received: from eve ( [89.51.234.65]) by mx.google.com with ESMTP id k9sm18548465nfh.2007.06.10.08.27.03 (version=SSLv3 cipher=OTHER); Sun, 10 Jun 2007 08:27:05 -0700 (PDT) In-Reply-To: <20070608162513.36ju508ao0040okk@web.mail.umich.edu> X-Mailer: Sylpheed 2.4.1 (GTK+ 2.10.11; i686-pc-mingw32) 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:34980 Archived-At: On Fri, 08 Jun 2007 16:25:13 -0400 Aditya Mahajan wrote: > Quoting nicola : > > > Hi, > > I have tried the following example (metafun-p.pdf, p. 112-3): > > > > \startMPgraphic > > draw unitsquare xscaled 5cm yscaled 1cm withpen pencircle scaled 2mm > > withcolor .625red; > > \stopMPgraphic > > > > \hbox \bgroup > > \loadcurrentMPgraphic{width=5cm,height=1cm}\placeMPgraphic \quad > > \loadcurrentMPgraphic{width=8cm,height=1cm}\placeMPgraphic \egroup > > > > but nothing is drawn unless I remove the setups in curly braces (in > > which case a rectangle 5cm x 1cm is drawn). Is there a different way to > > pass options to the figure inclusion macro? > > Interesting....what is happening is something equivalent to > > \externalfigure > [\MPgraphicfile.\the\currentMPgraphic] > [type=mps,object=no, > symbol=yes,reset=yes, > maxwidth=,maxheight=, > frame=off,background=, > width=8cm, > height=1cm]% > > and there is no figure. If I remove object=no, the figure is there. I > do not understand why object=no should affect the placement of the > figure. > > Aditya Hi, right, the object=no value is the problem. You can solve your problem by inserting the following macro somewhere before starttext in your document: \unprotect \def\insertMPfileARG#1#2% {\ifx\undefined\externalfigure \message{[insert file #1 here]}% \else \externalfigure [#1] [\c!type=\c!mps,\c!object=\v!yes, \c!symbol=\v!yes,\c!reset=\v!yes, \c!maxwidth=,\c!maxheight=, \c!frame=\v!off,\c!background=, #2]% \fi} \protect I changed only the "no" value from "object" to "yes". 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 ___________________________________________________________________________________