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?

2
  • 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
    Commented Jan 10, 2017 at 7:35
  • Thank you! I'll try to figure out how to report it there then. Commented Jan 10, 2017 at 13:16

2 Answers 2

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
1
  • 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 Commented Jan 10, 2017 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

You must log in to answer this question.

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