ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* pagenumbers in metafun
@ 2010-09-20  8:31 Thomas A. Schmitz
  2010-09-28  6:21 ` Thomas A. Schmitz
  0 siblings, 1 reply; 2+ messages in thread
From: Thomas A. Schmitz @ 2010-09-20  8:31 UTC (permalink / raw)
  To: mailing ConTeXt users list for

Hi all,

first, for thosw of you who went to the meeting: welcome back home from the ConTeXt meeting - looking at the slides and at the pictures made me really sad I couldn't come; I really hope I will be able to make it next year to Porquerolles!

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.)

All 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
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: pagenumbers in metafun
  2010-09-20  8:31 pagenumbers in metafun Thomas A. Schmitz
@ 2010-09-28  6:21 ` Thomas A. Schmitz
  0 siblings, 0 replies; 2+ messages in thread
From: Thomas A. Schmitz @ 2010-09-28  6:21 UTC (permalink / raw)
  To: mailing list for ConTeXt users


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
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-09-28  6:21 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-09-20  8:31 pagenumbers in metafun Thomas A. Schmitz
2010-09-28  6:21 ` Thomas A. Schmitz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).