12 Jan
2017
12 Jan
'17
4:53 p.m.
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