ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Sanjoy Mahajan <sanjoy@mrao.cam.ac.uk>
Subject: MPenvironment ignored for btex..etex (or should I use sometxt)?
Date: Fri, 29 Sep 2006 01:21:45 -0400	[thread overview]
Message-ID: <E1GTAoj-00059B-Rg@approximate.corpus.cam.ac.uk> (raw)

I'm not sure what's going on here, but this file fails (2006.09.28
beta): [well I have a better idea now after writing out the whole email,
see the end...]

=================== 3.tex =================
\starttext
\startMPenvironment
\def\2{hello}
\stopMPenvironment

\startreusableMPgraphic{fig}
label(btex \2 etex, origin);
\stopreusableMPgraphic

\reuseMPgraphic{fig}

\stoptext
=========================================

The error is (from 3.log):

============== error snippet ===============
systems         : begin file 3 at line 1
color           : currentcolor (def) is not defined 
\openout7 = `3-mpgraph.mp'.

! Undefined control sequence.
<argument>  label(btex \2
                          etex, origin);
\writecheckedMPgraphic ...icfalse \edef \ascii {#1
                                                  }\convertcommand \ascii \t...

\startMPgraphic ...hic \writecheckedMPgraphic {#1}
                                                  \stopwritingMPgraphic 
\handlereusableMPgraphic ...phic #3\stopMPgraphic 
                                                  \doifobjectssupportedelse ...

\douseMPgraphic ...s [#1][#2]\getvalue {\@@MPG #1}
                                                  {}\elabelgroup 
<to be read again> 
                    
l.10 \reuseMPgraphic{fig}
                         
? R
etc.
============== error snippet ===============

But 3-mpgraph.mp (produced after giving 'R' to enter nonstopmode) looks
fine:

=============== 3-mpgraph.mp ================
<lots of stuff>
beginfig(1);
verbatimtex \global \loadfontfileoncetrue \def \2{hello}  etex;
label(btex  \2 etex
, origin);
;
endfig;
let end=mprunend;
end.
=============== 3-mpgraph.mp ================

It processes by hand fine:

$ mpost -mem=metafun 3-mpgraph
...
1 output file written: 3-mpgraph.1

(or by using the system(texmfstart ...) command in 3.log)

Oh, wait, if metapost is fine with the file but ConTeXt isn't, then the
error above must be from ConTeXt parsing the metapost code and seeing
the \2, then complaining.  So am I supposed to use the global option to
\startMPenvironment?  If it's needed in this case, I think it would be
needed in every case (ConTeXt would see all the metapost uses of the
definition).  Or is btex deprecated and I should use \sometxt (except in
loops)?  Or am I just confused?!

-Sanjoy

`A society of sheep must in time beget a government of wolves.'
   -- Bertrand de Jouvenal

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

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-09-29  5:21 Sanjoy Mahajan [this message]
2006-09-29  7:32 ` Hans Hagen

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=E1GTAoj-00059B-Rg@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).