On 2013–10–10 Thangalin wrote:
I noticed something unexpected with the following code:
\enabletrackers[metapost.showlog]
\startuseMPgraphic{heading:ThemeTitleStyle} show "HEADING:THEMETITLESTYLE"; show \MPstring{heading:title};
draw textext( \MPstring{heading:title} ) rotated 5 withcolor blue; \stopuseMPgraphic
[…]
It appears as though heading:ThemeTitleStyle is being called twice:
If I'm not mistaken that's the way MP works when text is involved, it's a two-pass approach. In graphics without text MP has all information it needs to create the image. The text in MP graphics is typeset using TeX. After it's typeset MP picks it up in a second run.
I am trying to produce a random number that is not equal to the previous random number. However, if the code is called twice, then I'd have to add code to ignore one of the calls.
Maintain a vector with the last two elements to check against. Marco