\setuppapersize[A4]%[A4]
\setuplayout[
width=210mm,
height=297mm,
topspace=0pt,
backspace=0pt,
header=0mm,
footer=0mm,
margin=0mm,
bottomspace=0mm
]
\startuseMPgraphic{ticket}{i,j}
path p,q;
pair A,B;
p := unitsquare xyscaled (67mm,73mm);
A := point 0.5 of p;
B := point 2.5 of p;
draw p;
label(textext("Text"), .25A+.75B );
label(textext("\tfd " & decimal (3*\MPvar{i}-\MPvar{j})), center p);
label(textext("Text"), .75A + .25B);
\stopuseMPgraphic
\starttext
\dorecurse{4}{
\startcombination[3*1]%distance=0mm]
{\useMPgraphic{ticket}{i=\recurselevel,j=2}}{}
{\useMPgraphic{ticket}{i=\recurselevel,j=1}}{}
{\useMPgraphic{ticket}{i=\recurselevel,j=0}}{}
\stopcombination
\startcombination[3*1]%distance=0mm]
{\useMPgraphic{ticket}{i=\recurselevel,j=2}}{}
{\useMPgraphic{ticket}{i=\recurselevel,j=1}}{}
{\useMPgraphic{ticket}{i=\recurselevel,j=0}}{}
\stopcombination
}
\page
\dostepwiserecurse{5}{8}{1}{
\startcombination[3*1]%distance=0mm]
{\useMPgraphic{ticket}{i=\recurselevel,j=2}}{}
{\useMPgraphic{ticket}{i=\recurselevel,j=1}}{}
{\useMPgraphic{ticket}{i=\recurselevel,j=0}}{}
\stopcombination
\startcombination[3*1]%distance=0mm]
{\useMPgraphic{ticket}{i=\recurselevel,j=2}}{}
{\useMPgraphic{ticket}{i=\recurselevel,j=1}}{}
{\useMPgraphic{ticket}{i=\recurselevel,j=0}}{}
\stopcombination
}
\stoptext