Open main menu

Changes

m
added \startTEXpage[pagestate=start] %`pagestate=start` is needed to have incremented page numbering of the pdf
\startuseMPgraphic{base} %Here in the base, we define the components we will use to draw our images
numeric u; u = 1cm;
numeric framefactor; framefactor = 3.4;path TheFrame ; TheFrame := fullsquare scaled 3.4u xyscaled (framefactor*u, framefactor*u) ; %Needed if you want to have for every page to have the same dimensiondimensions. Use (sqrt(2)*framefactor*u, framefactor*u) for DIN A Landscape ratio of the dimensions.
color stone_color; stone_color = 1/256(199,199,199);
color light_teal_color; light_teal_color = 1/256(154,209,189);
setbounds currentpicture to TheFrame ;
%scaling the page to your preferred dimension:
desiredformat := 150;% In pixels (will be converted by default at 72dpi). The shorter dimension of DIN A4 would be 595 pixels. currentpicture := currentpicture xysized (desiredformat ,desiredformat );%for square pages. If DIN A Landscape, use (sqrt(2)*desiredformat ,desiredformat)
\stopuseMPgraphic %finishing
\dorecurse{6}{ %This loop starts from 1 until the set number and draws each layersetpage onto its own page. Don't set a number which is higher than the number of your last layersetpage.
%By differentiating finishinglayersetpage#1 from finishinglayersetpagelayersetpage#1, we can avoid adding \includeMPgraphic{finishing} to each \startuseMPgraphic{layersetpage<number>}. This allows us to apply the scaling of the page to our desiredformat, because the scaling will done only once per \useMPgraphic{}.
\startuseMPgraphic{finishinglayersetpage#1}
\includeMPgraphic{layersetpage#1} ;
\stopuseMPgraphic
%uncomment if needed: % \setupTEXpage[background=color, backgroundcolor=gray] \startTEXpage[pagestate=start] %`pagestate=start` is needed to have incremented page numbering of the pdf
\useMPgraphic{finishinglayersetpage#1}{mypagenumber=#1}
\stopTEXpage
12

edits