On Sep 20, 2010, at 10:31 AM, Thomas A. Schmitz wrote: > > Here's a question that has been on my mind for a while now and that I would > have loved to ask Taco and Hans at Brejlov: we now have shiny new > \userpagenumber and \realpagenumber etc. Is any of these available and > accessible from within Metafun? Right now, in a StartPage -- StopPage > environment, I use > NOfPages and PageNumber, but it would be convenient if we had access to > userpagenumber as well (so the number can be reset etc.) > Here's what you get when you ask a question without testing first! I'm very embarrassed to say that this question is bovine excrements. The metafun macro PageNumber does indeed refer to \userpagenumber, so this part is answered. However, there's still something I would like to know. Consider the following example:
\startuseMPgraphic{back} StartPage ; z[1] = center Page ; label.bot(textext("\switchtobodyfont[30pt]\startcolor[orange]" & decimal PageNumber & "\stopcolor\ -- \startcolor[darkblue]" & decimal NOfPages & "\stopcolor"), z[1]) ; StopPage ; \stopuseMPgraphic \defineoverlay [pageback] [\useMPgraphic{back}] \setupbackgrounds[page][background=pageback] \setupuserpagenumber[state=start] \starttext \dorecurse{8}{\userpagenumber \input knuth\page} \resetuserpagenumber \dorecurse{8}{\userpagenumber \input knuth\page} \stoptext The PageNumber does the right thing: goes from 1 to 8, then is reset to 1 again. But NOfPages results in "16," the total number. Is there any way I can have a metafun macro "the highest page number before \userpagenumber was reset"? Thanks, and best Thomas ___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________________