6

Try to make a text box, like "framed" text in context using metapost by following the example mpboxes or metapost examples

\startMPpage
 %input boxes
 boxit.a(btex test etex);
 a.c = (0,0);
 drawboxed(a);

\stopMPpage

It showed metapost error. Is the "boxes" package obsolete?

2
  • 1
    What error message do you get?
    – Aditya
    Commented Jun 17, 2014 at 17:13
  • why is input boxes commented out?
    – Thruston
    Commented Jun 17, 2014 at 22:44

1 Answer 1

7

In ConTeXt MkIV, the contents of \startMPpage (or \startMPcode) are run twice. (This is so that all the btex .. etex stuff can be collected and typeset, and no external files are created). Therefore, you need to separate out the input filename part from the \startMPpage environment. For example:

\startMPinclusions
   input boxes;
\stopMPinclusions

\starttext
\startMPpage
   boxit.a(btex test etex);
   a.c = (0,0);
   drawboxed(a);
\stopMPpage
\stoptext

Note that in MkIV, you no longer need to use btex .. etex. The following also works!

\startMPinclusions
   input boxes;
\stopMPinclusions

\starttext
\startMPpage
   boxit.a("test");
   a.c = (0,0);
   drawboxed(a);
\stopMPpage
\stoptext
1
  • I've removed my previous erroneous answer.
    – Thruston
    Commented Jun 18, 2014 at 22:45

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .