From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/31105 Path: news.gmane.org!not-for-mail From: Sanjoy Mahajan Newsgroups: gmane.comp.tex.context Subject: MPenvironment \def gives "Parameters must be numbered consecutively" Date: Fri, 29 Sep 2006 01:07:23 -0400 Message-ID: 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 1159507471 2501 80.91.229.2 (29 Sep 2006 05:24:31 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 29 Sep 2006 05:24:31 +0000 (UTC) Original-X-From: ntg-context-bounces@ntg.nl Fri Sep 29 07:24:30 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 1GTArG-0003UR-Jr for gctc-ntg-context-518@m.gmane.org; Fri, 29 Sep 2006 07:24:22 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id C45281FF6C; Fri, 29 Sep 2006 07:24:21 +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 12848-03-2; Fri, 29 Sep 2006 07:24:14 +0200 (CEST) Original-Received: from ronja.vet.uu.nl (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 7CBB31FF8F; Fri, 29 Sep 2006 07:24:14 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 40A8F1FF6C for ; Fri, 29 Sep 2006 07:24:10 +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 12848-03 for ; Fri, 29 Sep 2006 07:24:03 +0200 (CEST) Original-Received: from elasmtp-galgo.atl.sa.earthlink.net (elasmtp-galgo.atl.sa.earthlink.net [209.86.89.61]) by ronja.ntg.nl (Postfix) with SMTP id 140601FF8F for ; Fri, 29 Sep 2006 07:21:58 +0200 (CEST) Original-Received: from [24.41.6.91] (helo=approximate.corpus.cam.ac.uk) by elasmtp-galgo.atl.sa.earthlink.net with asmtp (TLSv1:AES256-SHA:256) (Exim 4.34) id 1GTAor-0007dK-8B; Fri, 29 Sep 2006 01:21:53 -0400 Original-Received: from sanjoy by approximate.corpus.cam.ac.uk with local (Exim 4.60) (envelope-from ) id 1GTAap-00057B-PF; Fri, 29 Sep 2006 01:07:23 -0400 Original-To: ntg-context@ntg.nl X-Mailer: MH-E 7.85; nmh 1.1; GNU Emacs 21.4.1 X-ELNK-Trace: dcd19350f30646cc26f3bd1b5f75c9f474bf435c0eb9d4786a166ed818d7c7474db1744e9f57c6bd84d7e02e36265306350badd9bab72f9c350badd9bab72f9c X-Originating-IP: 24.41.6.91 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:31105 Archived-At: 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 \startreusableMPgraphic{fig} label(btex sun etex, origin); \stopreusableMPgraphic \reuseMPgraphic{fig} \stoptext ======================================== fails with the error: ! Parameters must be numbered consecutively. ## l.44 \global \loadfontfileoncetrue \def \2## 1##2{\vbox {\halign {\hfil ####\... 1-mpgraph.mp gets this figure definition: beginfig(1); verbatimtex \global \loadfontfileoncetrue \def \2##1##2{\vbox {\halign {\hfil ####\hfil \cr ##1\cr ##2\cr }}} etex; label(btex sun etex , origin); ; endfig; So the parameters in the definition are being doubled up by one of the transformations that inserts the verbatimtex..etex block. By the way, should the verbatimtex..etex block go outside the beginfig..endfig, as it would in a standalone MP file? If only for efficiency rather than MP reparsing it with each beginfig. -Sanjoy `A society of sheep must in time beget a government of wolves.' -- Bertrand de Jouvenal