[NTG-context] Backgrounds has changed in latest lmtx

Thomas A. Schmitz thomas.schmitz at uni-bonn.de
Sun Oct 23 15:20:35 CEST 2022


Here comes another one that works with the switch --luatex but not in lmtx:

\setuppapersize[A6,landscape][A6,landscape]

\startuseMPgraphic{ornament}
StartPage ;

save diff ;numeric diff;
diff = .3cm ;

save w; numeric w;
w = xpart (lrcorner Field[Text][Text] - llcorner Field[Text][Text]) - diff ;

save factor; numeric factor;
if NOfPages <= 1 :
   factor = w ;
else :
   factor = w/(NOfPages - 1) ;
fi ;

save p; path p ;
p = unitsquare xyscaled (diff,diff)
                shifted (xpart llcorner Field[Text][Text],0.85cm) ;

for i = 1 upto NOfPages:
   if RealPageNumber = i:
     fill p xyscaled (0,2) shifted ( (i-1)*factor,-diff-0.85cm)
          withcolor blue ;
   else :
     fill p shifted ( (i-1)*factor, 0)
          withcolor red ;
   fi ;
endfor ;
StopPage ;
\stopuseMPgraphic

\defineoverlay
   [Ornament]
   [\useMPgraphic{ornament}]

\setupbackgrounds[page]
		 [state=repeat,
		  background={Ornament}]

\starttext

\dorecurse {10} {Test \page}

\stoptext

All best

Thomas


More information about the ntg-context mailing list