ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Hans Hagen <pragma@wxs.nl>
Cc: "NTG-ConTeXt mailing list" <ntg-context@ntg.nl>
Subject: Re: Metapost...
Date: Mon, 10 Sep 2001 11:25:42 +0200	[thread overview]
Message-ID: <5.1.0.14.1.20010910112159.03483110@server-1> (raw)
In-Reply-To: <20010908174846.3469.qmail@crux.private.off-line>

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
-------------------------------------------------------------------------


  reply	other threads:[~2001-09-10  9:25 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-09-08 17:48 Metapost Joop Susan
2001-09-10  9:25 ` Hans Hagen [this message]
  -- strict thread matches above, loose matches on Subject: below --
2010-02-17 21:18 metapost Martin 'golodhrim' Scholz
2010-02-17 21:31 ` metapost Hans Hagen
2010-02-17 21:34 ` metapost Mojca Miklavec
2010-02-17 21:37   ` metapost Mojca Miklavec
2002-11-09 13:57 Metapost Michał Morawski
2002-11-10 21:02 ` Metapost Hans Hagen
2002-11-10 21:10 ` Metapost K.H. Wesseling
1999-08-23  5:08 Metapost David Arnold
1999-08-23  8:31 ` Metapost Hans Hagen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5.1.0.14.1.20010910112159.03483110@server-1 \
    --to=pragma@wxs.nl \
    --cc=ntg-context@ntg.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).