[NTG-context] \sometxt in staticMPfigure

Sanjoy Mahajan sanjoy at mrao.cam.ac.uk
Wed Sep 27 06:29:27 CEST 2006


Hans Hagen wrote:

  the problem (if you look into the mp file) is that there is *no* 
  beginfig; this is because we now use a more stupid (stripped down) 
  variant of saving the graphic.

Right, I looked into the mp file and saw the new plan.

  \startstaticMPfigure{fig}
  beginfig(1);
    boxit.h(btex h etex);
    drawboxed(h);
  endfig;
  \stopstaticMPfigure

  i'll add the b/e to the main macro. 

I briefly thought about adding the beginfig..endfig by hand, but I
figured it would fail because texexec would wrap another
beginfig..endfig around it -- since it didn't know that some parts of
the file needed to go outside the beginfig..endfig.

However, a simple experiment trumps a fine theory: I added the
beginfig..endfig and it worked.  But the theory wasn't all wrong.
Here's a snippet of texexec-mpgraph.mp

==============================================
beginfig(1);
verbatimtex \global \loadfontfileoncetrue  etex;
input boxes


beginfig(1)
boxit.h(btex  h etex
);
drawboxed(h);
endfig;

;
endfig;
==============================================

Not sure how metapost managed to deal with the nested beginfig's, but it
did.  Here's what the log said:

  2 output files written: texexec-mpgraph.1 .. texexec-mpgraph.1

It looks like a fragile method.  Instead the beginfig..endfig should be
put in explicitly into the mp file (just as you said) and the inclusions
should go outside the beginfig..endfig.

-Sanjoy

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


More information about the ntg-context mailing list