From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/34595 Path: news.gmane.org!not-for-mail From: Aditya Mahajan Newsgroups: gmane.comp.tex.context Subject: Re: MetaPost question Date: Fri, 4 May 2007 17:18:48 -0400 (EDT) Message-ID: References: <4638F6E2.2030602@net-b.de> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1178313567 1768 80.91.229.12 (4 May 2007 21:19:27 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 4 May 2007 21:19:27 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Fri May 04 23:19:25 2007 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 lo.gmane.org with esmtp (Exim 4.50) id 1Hk5BU-0000dH-Pz for gctc-ntg-context-518@m.gmane.org; Fri, 04 May 2007 23:19:24 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 0904220099; Fri, 4 May 2007 23:19:19 +0200 (CEST) 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 12137-07-2; Fri, 4 May 2007 23:19:06 +0200 (CEST) Original-Received: from ronja.vet.uu.nl (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 85A8620080; Fri, 4 May 2007 23:19:06 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 833292008D for ; Fri, 4 May 2007 23:19:03 +0200 (CEST) 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 13076-02 for ; Fri, 4 May 2007 23:18:52 +0200 (CEST) Original-Received: from tombraider.mr.itd.umich.edu (smtp.mail.umich.edu [141.211.93.161]) by ronja.ntg.nl (Postfix) with ESMTP id 670F72007F for ; Fri, 4 May 2007 23:18:51 +0200 (CEST) Original-Received: FROM aditya.annarb01.mi.comcast.net (c-68-40-50-205.hsd1.mi.comcast.net [68.40.50.205]) BY tombraider.mr.itd.umich.edu ID 463BA338.AEAE5.7911 ; 4 May 2007 17:18:49 -0400 In-Reply-To: X-Virus-Scanned: amavisd-new at ntg.nl X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.9 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:34595 Archived-At: On Wed, 2 May 2007, Aditya Mahajan wrote: > On Wed, 2 May 2007, Tobias Burnus wrote: > >> Hi, >> >> I want to define a macro in MetaPost which does: >> >> def myfunc (expr x,y)(text t) = >> draw thelabel.rt (btex You passed \quotation{t} etex, (x,y)); >> >> where t in btex ... text is replaced by the argument. How to do so? > > You can do that using TEX.mp. I remember that it is also possible to use > textext to do something like this. I need to check my files to see if I > have an example. Here is a working solution. \starttext \forceMPTEXcheck{myfunc} \startMPinclusions def myfunc (expr x,y) (text t) = label.rt (textext("You passed \quotation{" & t & "}"), (x,y)) enddef; \stopMPinclusions \startMPpage myfunc (0,0) ("Hello") ; myfunc (2cm,1cm) ("World") ; \stopMPpage \stoptext Aditya ___________________________________________________________________________________ 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 : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________________