From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/31124 Path: news.gmane.org!not-for-mail From: "Mojca Miklavec" Newsgroups: gmane.comp.tex.context Subject: Re: MPenvironment \def gives "Parameters must be numbered consecutively" Date: Fri, 29 Sep 2006 18:29:05 +0200 Message-ID: <6faad9f00609290929m4f03532asf0b1abb4ce26500f@mail.gmail.com> References: Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1159547406 4928 80.91.229.2 (29 Sep 2006 16:30:06 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 29 Sep 2006 16:30:06 +0000 (UTC) Original-X-From: ntg-context-bounces@ntg.nl Fri Sep 29 18:30:02 2006 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 1GTLEs-0000hz-EJ for gctc-ntg-context-518@m.gmane.org; Fri, 29 Sep 2006 18:29:28 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 3BFE51FF1A; Fri, 29 Sep 2006 18:29:25 +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 17833-02; Fri, 29 Sep 2006 18:29:18 +0200 (CEST) Original-Received: from ronja.vet.uu.nl (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id B2C0C1FF02; Fri, 29 Sep 2006 18:29:18 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id E6C751FF02 for ; Fri, 29 Sep 2006 18:29:14 +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 17809-02 for ; Fri, 29 Sep 2006 18:29:09 +0200 (CEST) Original-Received: from wr-out-0506.google.com (wr-out-0506.google.com [64.233.184.226]) by ronja.ntg.nl (Postfix) with SMTP id A51FD1FEF2 for ; Fri, 29 Sep 2006 18:29:07 +0200 (CEST) Original-Received: by wr-out-0506.google.com with SMTP id i22so470481wra for ; Fri, 29 Sep 2006 09:29:06 -0700 (PDT) Original-Received: by 10.90.28.12 with SMTP id b12mr1724178agb; Fri, 29 Sep 2006 09:29:05 -0700 (PDT) Original-Received: by 10.90.25.15 with HTTP; Fri, 29 Sep 2006 09:29:05 -0700 (PDT) Original-To: "mailing list for ConTeXt users" In-Reply-To: Content-Disposition: inline X-Virus-Scanned: amavisd-new at ntg.nl X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.7 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:31124 Archived-At: On 9/29/06, Sanjoy Mahajan wrote: > This test file (beta 2006.09.28): > > ============ 1.tex ============================ > \starttext > \startMPenvironment > \def\2#1#2{\vbox{\halign{\hfil##\hfil\cr #1\cr #2\cr}}} > \stopMPenvironment A lesson that I learned while trying to implement a few functions for gnuplot: never try to do tricky stuff like definitions inside MPenvironement, because it is parsed and changed slightly. I would also prefer if definitions and other commands inside MPenvironement would work as they were supposed to, but exactly this was one reason more why I like \sometxt so much now. You can create a definition anywhere in your TeX document and then use it inside \sometxt: \def\a{abc} \starttext \startMPcode label(\sometxt{\a},origin); \stopMPcode \stoptext Would that kind of approach satisfy your needs? (that being just another point of view from what Hans pointed out; Hans's approach might also be useful; although I admit that I will soon start mixing up all the different MP commands: MPinclusions, MPextensions, preambles, environment ... ) Mojca PS: that should go into another thread and is not that urgent since I found an ugly workaround, but anyway: is there a chance to access dimensions such as PageWidth, OverlayWidth ... and others inside MPextensions/inclusions? OverlayWidth is defined just behind the extensions/inclusions, which basically means that I can use it inside a graphic, but not inside macros defined in MPextensions. Any remedy for that?