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 | [EMAIL PROTECTED]
                       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
-------------------------------------------------------------------------

Reply via email to