5

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?

  • 1
    What error message do you get? – Aditya Jun 17 '14 at 17:13
  • why is input boxes commented out? – Thruston Jun 17 '14 at 22:44
6

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
  • I've removed my previous erroneous answer. – Thruston Jun 18 '14 at 22:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.