From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/81167 Path: news.gmane.org!not-for-mail From: "Thomas A. Schmitz" Newsgroups: gmane.comp.tex.context Subject: Re: TeX macro to MP variable Date: Sat, 16 Mar 2013 16:37:13 +0100 Message-ID: <514491A9.5060005@uni-bonn.de> References: <20130316150731.GO9268@homerow> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; Format="flowed" Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1363448237 7152 80.91.229.3 (16 Mar 2013 15:37:17 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 16 Mar 2013 15:37:17 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Sat Mar 16 16:37:43 2013 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from balder.ntg.nl ([195.12.62.10]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1UGtB0-0007S3-P3 for gctc-ntg-context-518@m.gmane.org; Sat, 16 Mar 2013 16:37:42 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id DBC3A101F2; Sat, 16 Mar 2013 16:37:19 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id Tp2YTXOFuyDL; Sat, 16 Mar 2013 16:37:17 +0100 (CET) Original-Received: from balder.ntg.nl (localhost [IPv6:::1]) by balder.ntg.nl (Postfix) with ESMTP id A9261101EB; Sat, 16 Mar 2013 16:37:17 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id B04F8101EB for ; Sat, 16 Mar 2013 16:37:16 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id EY-P1Rt2XGxz for ; Sat, 16 Mar 2013 16:37:15 +0100 (CET) Original-Received: from filter1-til.mf.surf.net (filter1-til.mf.surf.net [194.171.167.217]) by balder.ntg.nl (Postfix) with ESMTP id D8CCB101E3 for ; Sat, 16 Mar 2013 16:37:15 +0100 (CET) Original-Received: from uni-bonn.de (mail.uni-bonn.de [131.220.15.113]) by filter1-til.mf.surf.net (8.14.3/8.14.3/Debian-9.4) with ESMTP id r2GFbDav016060 for ; Sat, 16 Mar 2013 16:37:13 +0100 Original-Received: from [87.178.43.114] (account tschmit1@uni-bonn.de HELO [192.168.0.37]) by fe2.uni-bonn.de (CommuniGate Pro SMTP 5.4.9) with ESMTPSA id 39904711 for ntg-context@ntg.nl; Sat, 16 Mar 2013 16:37:13 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130311 Thunderbird/17.0.4 In-Reply-To: <20130316150731.GO9268@homerow> X-Bayes-Prob: 0.0001 (Score 0, tokens from: @@RPTN) X-CanIt-Geo: ip=131.220.15.113; country=DE; region=07; city=Bonn; postalcode=53115; latitude=50.7333; longitude=7.1000; http://maps.google.com/maps?q=50.7333,7.1000&z=6 X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 0RJcfBdOD - bebb61526cfd - 20130316 (trained as not-spam) X-Scanned-By: CanIt (www . roaringpenguin . com) on 194.171.167.217 X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.14 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ntg-context-bounces@ntg.nl Original-Sender: ntg-context-bounces@ntg.nl Xref: news.gmane.org gmane.comp.tex.context:81167 Archived-At: On 03/16/2013 04:07 PM, Marco Patzer wrote: > Hi, > > I am looking for a way to assign the value of a TeX macro to an MP variable. > However, this only works the first time, then the value is not updated any > longer. Example: I'm not quite sure if this is what you're looking for, but here is an example how you could do this with \MPvars: \def\Circlediameter{15mm} \def\setupCircle#1[#2]% {\getparameters[Circle][diameter=15mm,#2]} \setupMPvariables [mycircle] [diameter=\Circlediameter, ] \startuseMPgraphic{mycircle} fill unitcircle scaled \MPvar{diameter} withcolor red ; \stopuseMPgraphic \starttext \useMPgraphic{mycircle} \blank[1cm] \setupCircle[diameter=5cm] \useMPgraphic{mycircle} \blank[1cm] \setupCircle[diameter=0.5cm] \useMPgraphic{mycircle} \stoptext Thomas ___________________________________________________________________________________ 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 ___________________________________________________________________________________