From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/5576 Path: main.gmane.org!not-for-mail From: Hans Hagen Newsgroups: gmane.comp.tex.context Subject: Re: Metapost... Date: Mon, 10 Sep 2001 11:25:42 +0200 Sender: owner-ntg-context@let.uu.nl Message-ID: <5.1.0.14.1.20010910112159.03483110@server-1> References: <20010908174846.3469.qmail@crux.private.off-line> NNTP-Posting-Host: coloc-standby.netfonds.no Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; format=flowed X-Trace: main.gmane.org 1035396158 2803 80.91.224.250 (23 Oct 2002 18:02:38 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Wed, 23 Oct 2002 18:02:38 +0000 (UTC) Cc: "NTG-ConTeXt mailing list" Original-To: Joop Susan In-Reply-To: <20010908174846.3469.qmail@crux.private.off-line> Xref: main.gmane.org gmane.comp.tex.context:5576 X-Report-Spam: http://spam.gmane.org/gmane.comp.tex.context:5576 At 07:48 PM 9/8/2001 +0200, Joop Susan wrote: >Hello, > >How can one pass a MetaPost variable to ConTeXt in a btex-etex clause? > >My MetaPost code calculates a number that I would like to use in as a >literal (evaluated if the variable was assigned an expression) within a >btex-etex construct. > >Extremely simplified, but you'll get my drift: > >numeric FONTSIZE; >FONTSIZE:=16pt; >draw btex \switchtobodyfont[ss,FONTSIZE] Fontsize = FONTSIZE etex; > >I know that this simple example can be done in MetaPost itself, but my >application also uses ConTeXt font definitions, frames, etc. > >Is \MPvar only used to pass ConTeXt variables to MetaPost code? And not >the other way around? indeed, although you can use the %D \setMPtext{identifier}{text} %D %D \MPtext {identifier} %D \MPstring{identifier} %D \MPbetex {identifier} to do more tricky things. Another trick is to use indirectness, i.e. put data into \startuseMPgraphic{something} and include it later with \includeMPgraphic or to build up graphics using \startMPdata Hans ------------------------------------------------------------------------- Hans Hagen | PRAGMA ADE | pragma@wxs.nl Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: +31 (0)38 477 53 69 | fax: +31 (0)38 477 53 74 | www.pragma-ade.com -------------------------------------------------------------------------