ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* MPenvironment \def gives "Parameters must be numbered consecutively"
@ 2006-09-29  5:07 Sanjoy Mahajan
  2006-09-29  7:29 ` Hans Hagen
  2006-09-29 16:29 ` Mojca Miklavec
  0 siblings, 2 replies; 6+ messages in thread
From: Sanjoy Mahajan @ 2006-09-29  5:07 UTC (permalink / 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

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2006-10-05  7:10 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-09-29  5:07 MPenvironment \def gives "Parameters must be numbered consecutively" Sanjoy Mahajan
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

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).