From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/62019 Path: news.gmane.org!not-for-mail From: "Thomas A. Schmitz" Newsgroups: gmane.comp.tex.context Subject: Re: pagenumbers in metafun Date: Tue, 28 Sep 2010 08:21:59 +0200 Message-ID: References: <05AF4727-E6B9-4CB9-988A-C0AFC5ECCA90@uni-bonn.de> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 (Apple Message framework v1081) Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1285654976 17641 80.91.229.12 (28 Sep 2010 06:22:56 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 28 Sep 2010 06:22:56 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Tue Sep 28 08:22:53 2010 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from balder.ntg.nl ([195.12.62.10]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1P0TaW-0001oF-3d for gctc-ntg-context-518@m.gmane.org; Tue, 28 Sep 2010 08:22:52 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 44A3BCA728; Tue, 28 Sep 2010 08:22:51 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id duKQwKD9uVuB; Tue, 28 Sep 2010 08:22:47 +0200 (CEST) Original-Received: from balder.ntg.nl (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id F1ED9CA702; Tue, 28 Sep 2010 08:22:46 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 7C2DACA702 for ; Tue, 28 Sep 2010 08:22:44 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id ER+GbndyVkzy for ; Tue, 28 Sep 2010 08:22:32 +0200 (CEST) Original-Received: from filter1-nij.mf.surf.net (filter1-nij.mf.surf.net [195.169.124.152]) by balder.ntg.nl (Postfix) with ESMTP id 5A4BECA6F6 for ; Tue, 28 Sep 2010 08:22:32 +0200 (CEST) Original-Received: from uni-bonn.de (mail.uni-bonn.de [131.220.15.113]) by filter1-nij.mf.surf.net (8.14.3/8.14.3/Debian-5+lenny1) with ESMTP id o8S6MVHV004361 for ; Tue, 28 Sep 2010 08:22:31 +0200 Original-Received: from [80.187.208.98] (account tschmit1@uni-bonn.de HELO [10.142.16.207]) by fe2.uni-bonn.de (CommuniGate Pro SMTP 5.2.12) with ESMTPA id 46454132 for ntg-context@ntg.nl; Tue, 28 Sep 2010 08:22:27 +0200 In-Reply-To: <05AF4727-E6B9-4CB9-988A-C0AFC5ECCA90@uni-bonn.de> X-Mailer: Apple Mail (2.1081) X-Bayes-Prob: 0.0001 (Score 0, tokens from: @@RPTN) X-CanIt-Geo: ip=131.220.15.113; country=DE; region=07; city=Bonn; latitude=50.7333; longitude=7.1000; http://maps.google.com/maps?q=50.7333,7.1000&z=6 X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 07Dc6mvVm - 49fad96d424d - 20100928 X-Scanned-By: CanIt (www . roaringpenguin . com) on 195.169.124.152 X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.12 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: ntg-context-bounces@ntg.nl Errors-To: ntg-context-bounces@ntg.nl Xref: news.gmane.org gmane.comp.tex.context:62019 Archived-At: 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 ___________________________________________________________________________________