Bug: \textext inside \*MPinclusions causes error
![](https://secure.gravatar.com/avatar/d6ea547150ed47259079a2848b7542f7.jpg?s=120&d=mm&r=g)
Hi, i found the following bug (likely) some time ago: When \textext (or any other text generating thing like btex etex etc.) is present inside \*MPinclusions and \*MPinclusions are followed by \*MPcode ConTeXt returns error: Equation cannot be performed (color=vacuous). Minimal example would be: \startMPinclusions picture p; p := image( draw textext("Foo"); ); \stopMPinclusions \startMPcode \stopMPcode tested on http://live.contextgarden.net/
![](https://secure.gravatar.com/avatar/49e63acb01f2ca80efce7eed08310ce8.jpg?s=120&d=mm&r=g)
On 1/11/2017 11:08 PM, Sergey Slyusarev wrote:
Hi, i found the following bug (likely) some time ago:
When \textext (or any other text generating thing like btex etex etc.) is present inside \*MPinclusions and \*MPinclusions are followed by \*MPcode ConTeXt returns error: Equation cannot be performed (color=vacuous).
Minimal example would be:
\startMPinclusions picture p; p := image( draw textext("Foo"); ); \stopMPinclusions \startMPcode \stopMPcode
tested on http://live.contextgarden.net/
you can use \startMPinitializations \stopMPinitializations as these are expanded each graphic run action pass 1 pass 2 definitions yes extensions yes inclusions yes begin figure yes initializations yes yes metapost code yes yes end figure yes yes Hans ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl -----------------------------------------------------------------
![](https://secure.gravatar.com/avatar/ac3fbaf0a287c4cffbc9f18fa931586c.jpg?s=120&d=mm&r=g)
On Thu, 12 Jan 2017 10:06:09 +0100
Hans Hagen
you can use
\startMPinitializations \stopMPinitializations
as these are expanded each graphic run
action pass 1 pass 2
definitions yes extensions yes inclus figure yes initializations yes yes metapost code yes yes end figure yes yes
One needs to remember that MPlib goes through several runs, and many standard MP code examples are written for a single, mpost run. This means that code can fail if variables, for example, are not properly initialized (or re-initialized). Another example is reading from files in MP, as the file descriptors are kept open by default, reading on from where one stopped in a previous run. Alan
participants (3)
-
Alan Braslau
-
Hans Hagen
-
Sergey Slyusarev