1

For some reason code like this:

\startMPinclusions
    picture p;
    p := image(
        draw btex 123 etex;
    );
\stopMPinclusions
\startMPcode
    draw p;
\stopMPcode

Causes error Equation cannot be performed (color=vacuous)... (I actually tried to report this as a bug, but, likely, did something wrong).

Is there any workaround for this, that does not require moving labels to MPcode?

  • 1
    It is better to report such bugs on the context mailing list rather than on the luatex bug tracker. The bug appears to be on line 421 of mlib-lua.lua: it should read local box = textexts and textexts[n]. That gets rid of the error message, but there is no text displayed. I'll have to look more carefully as to what is happening. The best bet is to report it to the context mailing list – Aditya Jan 10 '17 at 7:35
  • Thank you! I'll try to figure out how to report it there then. – Sergey Slyusarev Jan 10 '17 at 13:16
1

This appears to be a bug. As a work around, you can use:

\startuseMPgraphic{picp}
    picture p;
    p := image(
        draw  btex 123 etex;
    );
\stopuseMPgraphic
\starttext
\startMPcode
    \includeMPgraphic{picp}
    draw p;
\stopMPcode
\stoptext
  • It works, thank you! It looks roughly equivalent to: \startMPinclusions def q = picture p; p := image( draw btex 123 etex; ); enddef; \stopMPinclusions \startMPcode q; draw p; \stopMPcode if I still want to use MPinclusions – Sergey Slyusarev Jan 10 '17 at 13:14
1

Well, here's another working solution:

\startMPinclusions
    vardef p = 
        image(
            draw btex 123 etex;
        )
    enddef;
\stopMPinclusions
\startMPcode
    draw p;
\stopMPcode

This way I don't even have to do anything with *MPcode

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.