ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Sanjoy Mahajan <sanjoy@mrao.cam.ac.uk>
Subject: MPenvironment \def gives "Parameters must be numbered consecutively"
Date: Fri, 29 Sep 2006 01:07:23 -0400	[thread overview]
Message-ID: <E1GTAap-00057B-PF@approximate.corpus.cam.ac.uk> (raw)

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.
<to be read again> 
                   ##
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

             reply	other threads:[~2006-09-29  5:07 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-09-29  5:07 Sanjoy Mahajan [this message]
2006-09-29  7:29 ` Hans Hagen
2006-09-30 15:50   ` Sanjoy Mahajan
2006-10-05  7:10   ` Aditya Mahajan
2006-09-29 16:29 ` Mojca Miklavec
2006-09-30 15:46   ` Sanjoy Mahajan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=E1GTAap-00057B-PF@approximate.corpus.cam.ac.uk \
    --to=sanjoy@mrao.cam.ac.uk \
    --cc=ntg-context@ntg.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).