From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/28579 Path: news.gmane.org!not-for-mail From: Aditya Mahajan Newsgroups: gmane.comp.tex.context Subject: Re: Using metapost figures in context Date: Wed, 14 Jun 2006 11:00:49 -0400 (EDT) Message-ID: References: <448DDFEB.9080104@wxs.nl> <448E7381.8070501@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 1150369164 8744 80.91.229.2 (15 Jun 2006 10:59:24 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 15 Jun 2006 10:59:24 +0000 (UTC) Cc: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Thu Jun 15 12:59:22 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 1FqpZJ-0006Gm-G1 for gctc-ntg-context-518@m.gmane.org; Thu, 15 Jun 2006 12:59:21 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id A7FDB12792; Thu, 15 Jun 2006 12:54: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 02328-01-46; Thu, 15 Jun 2006 12:54:07 +0200 (CEST) Original-Received: from ronja.vet.uu.nl (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 5C4B012883; Thu, 15 Jun 2006 12:53:27 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 13756127CB for ; Wed, 14 Jun 2006 17:00:56 +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 02039-07-2 for ; Wed, 14 Jun 2006 17:00:54 +0200 (CEST) Original-Received: from skycaptain.mr.itd.umich.edu (smtp.mail.umich.edu [141.211.93.160]) by ronja.ntg.nl (Postfix) with SMTP id 2B75A1278E for ; Wed, 14 Jun 2006 17:00:53 +0200 (CEST) Original-Received: FROM aditya.annarb01.mi.comcast.net (c-68-40-50-205.hsd1.mi.comcast.net [68.40.50.205]) BY skycaptain.mr.itd.umich.edu ID 449024A2.BC36E.28417 ; 14 Jun 2006 11:00:50 -0400 Original-To: Hans Hagen In-Reply-To: <448E7381.8070501@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:28579 Archived-At: On Tue, 13 Jun 2006, Hans Hagen wrote: > Aditya Mahajan wrote: >> I have right now kept the command as MPfigure. >> > grep MPfigure in meta-fig -) > Now I am using staticMPfigure. This is the final version \def\startstaticMPfigure#1#2\stopstaticMPfigure {\bgroup \setMPrandomseedfalse %Otherwise randomseed := number line always differ \doifmodeelse{*pdf} {\def\executeMPTEX##1% {texmfstart --verbose --ifchanged=##1.mp texexec --mpgraphic ##1.mp} \let\executeMPOST=\executeMPTEX} {\def\executeMPOST##1% {texmfstart --verbose --ifchanged=##1.mp bin:mpost \ifcase\interactionmode\MPOSTbatchswitch\or\MPOSTnonstopswitch\fi \space\ifuseMETAFUNformat \MPOSTformatswitch metafun \fi ##1} \def\executeMPTEX##1% slower, due to nested texexec call {texmfstart --verbose --ifchanged=##1.mp texexec --batch \ifcase\interactionmode --logfile='mptex.log' \fi --output=\MPOSTdriver\space \ifuseMETAFUNformat --mpformat=metafun \fi --mptex --nomp --once ##1}} \def\MPgraphicfile{\jobname-#1} \newcount\currentMPgraphic \startMPgraphic #2 \stopMPgraphic\egroup\deallocateMPslot\currentMPgraphic} \def\usestaticMPfigure{\dosingleempty\dousestaticMPfigure} \def\dousestaticMPfigure[#1]% {\doifmodeelse{*pdf} {\externalfigure[\jobname-#1.pdf]} {\externalfigure[\jobname-#1.1]}} \starttext \startstaticMPfigure{circle} fill fullcircle scaled 10cm; \stopstaticMPfigure \startstaticMPfigure{axis} drawarrow (0,0)--(1cm,0) ; drawarrow (0,0)--(0,1cm) ; label.llft(textext("(0,0)") ,origin) ; \stopstaticMPfigure \hbox to \hsize \bgroup \hss \usestaticMPfigure[circle][width=1cm] \hss \usestaticMPfigure[axis] \hss \egroup \stoptext Thanks, Aditya