From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/24735 Path: news.gmane.org!not-for-mail From: David Arnold Newsgroups: gmane.comp.tex.context Subject: Passing text to Metapost functions Date: Sun, 25 Dec 2005 19:34:36 -0800 Message-ID: <8B3296E7-0060-4D06-84AE-C3A5816A4F5E@cox.net> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 (Apple Message framework v746.2) Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1135568166 21627 80.91.229.2 (26 Dec 2005 03:36:06 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 26 Dec 2005 03:36:06 +0000 (UTC) Original-X-From: ntg-context-bounces@ntg.nl Mon Dec 26 04:36:02 2005 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from ronja.vet.uu.nl ([131.211.172.88] helo=ronja.ntg.nl) by ciao.gmane.org with esmtp (Exim 4.43) id 1Eqj9V-0003Lx-57 for gctc-ntg-context-518@m.gmane.org; Mon, 26 Dec 2005 04:36:01 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 8C1F9127DB; Mon, 26 Dec 2005 04:35:59 +0100 (CET) Original-Received: from ronja.ntg.nl ([127.0.0.1]) by localhost (smtp.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 25158-01; Mon, 26 Dec 2005 04:35:53 +0100 (CET) Original-Received: from ronja.vet.uu.nl (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id AF742127BA; Mon, 26 Dec 2005 04:35:53 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 9E02F127BA for ; Mon, 26 Dec 2005 04:35:52 +0100 (CET) Original-Received: from ronja.ntg.nl ([127.0.0.1]) by localhost (smtp.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 25031-03 for ; Mon, 26 Dec 2005 04:35:51 +0100 (CET) Original-Received: from fed1rmmtao02.cox.net (fed1rmmtao02.cox.net [68.230.241.37]) by ronja.ntg.nl (Postfix) with ESMTP id CF943127A3 for ; Mon, 26 Dec 2005 04:35:50 +0100 (CET) Original-Received: from [10.0.1.2] (really [70.191.56.23]) by fed1rmmtao02.cox.net (InterMail vM.6.01.05.02 201-2131-123-102-20050715) with ESMTP id <20051226033415.POZY17006.fed1rmmtao02.cox.net@[10.0.1.2]> for ; Sun, 25 Dec 2005 22:34:15 -0500 Original-To: Context Mailing List List X-Mailer: Apple Mail (2.746.2) X-Virus-Scanned: amavisd-new at ntg.nl X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.5 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: ntg-context-bounces@ntg.nl Errors-To: ntg-context-bounces@ntg.nl X-Virus-Scanned: amavisd-new at ntg.nl Xref: news.gmane.org gmane.comp.tex.context:24735 Archived-At: All, I'd like to do something like this: create_axes(xmin,xmax,ymin,ymax,ux,uy)(x); Where x will be a label for my x-axis. But once in a while it might be t or u or some other thing such as "Days." I want to use it like this: beginfig(0); %initialize window parameters numeric xmin, xmax, xscl, ymin, ymax, yscl; xmin:=-5; xmax:=5; xscl:=1; ymin:=-5; ymax:=5; yscl:=1; %initialize scale numeric ux, uy; (xmax-xmin)*ux=4in; (ymax-ymin)*uy=3in; %create-axes function vardef create_axes(expr xxmin, xxmax, yymin, yymax, uux, uuy)(text xlbl)= drawdblarrow (1.05*xxmin*uux,0)--(1.05*xxmax*uux,0); label.rt(btex $xlbl$, (1.05*xxmax*uux,0)); drawdblarrow (0,1.05*yymin*uuy)--(0,1.05*yymax*uuy); enddef; create_axes(xmin,xmax,ymin,ymax,ux,uy)(x); endfig; end. Two questions: 1. How can I do this in plain metapost? 2. What would be the "Context Way?"