Dear list,

        I have some difficulty to reuse a static picture in a multipage MetaFun 
document. I wish to define a complex image, with graphic and texts, and 
manipulate this image at each page. As the minimal working example shows, if I 
define a particular picture in the variable « AnImage » and a random text in 
another picture called « AnotherImage », I can use these two pictures in the 
first page of the document, but only one of them appears in the second page of 
the document (with the same code). I know that if I replace 
startMPinclusions/stopMPinclusions by 
startMPinitializations/stopMPinitializations, this works, but the image is 
recalculated (a different number is drawn), and I do not want this since the 
image is complex and takes time to make. 

        So the question : how to make the two pictures « AnImage » and « 
AnotherImage » appears in the both page ?
        Thanks for any help !
        Fabrice,

% MWE :
% 8< ---------------------------------------
\starttext

\startMPinclusions
        picture AnImage , AnotherImage;
        AnImage := image (
          draw fullcircle scaled 40;
        );
        AnotherImage := image (
          arandomnumber := uniformdeviate(1);
          draw textext(decimal(arandomnumber)) scaled 0.5;
        );
\stopMPinclusions

\startMPpage
        draw AnImage ;
        draw AnotherImage ;
\stopMPpage

\startMPpage
        draw AnImage ;
        draw AnotherImage ;
\stopMPpage
\stoptext
% 8< ---------------------------------------


___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki     : https://wiki.contextgarden.net
___________________________________________________________________________________

Reply via email to