From: Wolfgang Schuster <schuster.wolfgang@googlemail.com>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: Re: MetaPost Animation
Date: Fri, 16 Apr 2010 16:43:45 +0200 [thread overview]
Message-ID: <4BC877A1.9060506@googlemail.com> (raw)
In-Reply-To: <t2hcf53c9501004160551k5593c18bpe93f1a46a236dd6d@mail.gmail.com>
Am 16.04.10 14:51, schrieb Troy Henderson:
> If I have two different \startMPcode ... \stopMPcode sections, is
> there a way (perhaps it does this by default) to have the variables
> stored in the first block available in the second block? In pure
> MetaPost, I can do
>
> numeric a:=4;
> beginfig(1);
> label(decimal(a),origin);
> endfig;
> beginfig(2);
> label(decimal(a),origin);
> endfig;
> end
>
> and both figures have the value of 'a' available to them because 'a'
> was defined before each figure. What is the ConTeXt way of doing
> this?
>
\starttext
\startluacode
local a = 0
for i=1,10 do
a = a + 1
context.startMPpage()
-- context('label("%d",origin);',a)
context('label(textext("%d"),origin);',a)
context.stopMPpage()
end
\stopluacode
\stoptext
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 : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___________________________________________________________________________________
next prev parent reply other threads:[~2010-04-16 14:43 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-04-15 17:53 Troy Henderson
2010-04-16 7:36 ` Boštjan Vesnicer
2010-04-16 7:54 ` Hans Hagen
2010-04-16 12:51 ` Troy Henderson
2010-04-16 14:19 ` Boštjan Vesnicer
2010-04-16 14:43 ` Wolfgang Schuster [this message]
[not found] <20050330203818.ADE29128CA@ronja.ntg.nl>
2005-03-31 1:48 ` Beginnner's question: fumbling with font finding failures Paul R Martin
2005-03-31 11:53 ` Thomas A.Schmitz
2005-03-31 12:50 ` Metapost animation Albrecht Kauffmann
-- strict thread matches above, loose matches on Subject: below --
2004-09-13 16:57 Michal Kvasnicka
2004-09-13 17:14 ` Henning Hraban Ramm
2004-09-13 19:40 ` Patrick Gundlach
2004-09-14 8:27 ` Michal Kvasnicka
2004-09-14 8:21 ` Patrick Gundlach
2004-09-14 16:33 ` Hans Hagen
2004-09-14 19:18 ` Michal Kvasnicka
2004-09-15 8:22 ` Hans Hagen
2004-09-16 17:05 ` Michal Kvasnicka
2005-05-19 14:28 ` Mojca Miklavec
2005-05-19 14:39 ` luigi.scarso
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=4BC877A1.9060506@googlemail.com \
--to=schuster.wolfgang@googlemail.com \
--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).