ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* How to get the total page number at startup in luatex?
@ 2008-12-08  9:33 Zhichu Chen
  2008-12-08  9:47 ` Wolfgang Schuster
  0 siblings, 1 reply; 3+ messages in thread
From: Zhichu Chen @ 2008-12-08  9:33 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Hi,

I've met a weird thing, I can't get \totalnumberofpages in the preamble.
But it used to work.

A simple test file is
++++++++++++++++++++++++++++++++++
\dorecurse{\totalnumberofpages}{\setvalue{test::\recurselevel}{:\recurselevel:}}
\def\test{\getvalue{test::\pagenumber}}
\starttext
\input knuth
\page[yes]
\input knuth
\page[yes]
This should be \quotation{:\pagenumber:}, but it's \quotation{\test}
\stoptext
++++++++++++++++++++++++++++++++++++

Any suggestions about how to do that? I wanna define each page a macro.
-- 
Best Regards
Chen
----------------------------------------------------------------

          Zhi-chu Chen | Shanghai Synchrotron Radiation Facility
         No. 2019 | Jialuo Rd. | Jiading | Shanghai | P.R. China
             tel: 086 21 5955 3405 | zhichu.chen.googlepages.com
                                               | www.sinap.ac.cn
----------------------------------------------------------------
___________________________________________________________________________________
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  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


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

* Re: How to get the total page number at startup in luatex?
  2008-12-08  9:33 How to get the total page number at startup in luatex? Zhichu Chen
@ 2008-12-08  9:47 ` Wolfgang Schuster
  2008-12-08 10:10   ` Zhichu Chen
  0 siblings, 1 reply; 3+ messages in thread
From: Wolfgang Schuster @ 2008-12-08  9:47 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On Mon, Dec 8, 2008 at 10:33 AM, Zhichu Chen <zhichu.chen@gmail.com> wrote:
> Hi,
>
> I've met a weird thing, I can't get \totalnumberofpages in the preamble.
> But it used to work.
>
> A simple test file is
> ++++++++++++++++++++++++++++++++++
> \dorecurse{\totalnumberofpages}{\setvalue{test::\recurselevel}{:\recurselevel:}}
> \def\test{\getvalue{test::\pagenumber}}
> \starttext
> \input knuth
> \page[yes]
> \input knuth
> \page[yes]
> This should be \quotation{:\pagenumber:}, but it's \quotation{\test}
> \stoptext
> ++++++++++++++++++++++++++++++++++++
>
> Any suggestions about how to do that? I wanna define each page a macro.

Define your macros *after* \starttext.

Wolfgang
___________________________________________________________________________________
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  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


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

* Re: How to get the total page number at startup in luatex?
  2008-12-08  9:47 ` Wolfgang Schuster
@ 2008-12-08 10:10   ` Zhichu Chen
  0 siblings, 0 replies; 3+ messages in thread
From: Zhichu Chen @ 2008-12-08 10:10 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On Mon, Dec 8, 2008 at 5:47 PM, Wolfgang Schuster
<schuster.wolfgang@googlemail.com> wrote:
> On Mon, Dec 8, 2008 at 10:33 AM, Zhichu Chen <zhichu.chen@gmail.com> wrote:
>> Hi,
>>
>> I've met a weird thing, I can't get \totalnumberofpages in the preamble.
>> But it used to work.
>>
>> A simple test file is
>> ++++++++++++++++++++++++++++++++++
>> \dorecurse{\totalnumberofpages}{\setvalue{test::\recurselevel}{:\recurselevel:}}
>> \def\test{\getvalue{test::\pagenumber}}
>> \starttext
>> \input knuth
>> \page[yes]
>> \input knuth
>> \page[yes]
>> This should be \quotation{:\pagenumber:}, but it's \quotation{\test}
>> \stoptext
>> ++++++++++++++++++++++++++++++++++++
>>
>> Any suggestions about how to do that? I wanna define each page a macro.
>
> Define your macros *after* \starttext.
Nice, though it makes some trouble that I should use \appendtoks for a module.

Thanks.
>
> Wolfgang
> ___________________________________________________________________________________
> 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  : https://foundry.supelec.fr/projects/contextrev/
> wiki     : http://contextgarden.net
> ___________________________________________________________________________________
>



-- 
Best Regards
Chen
----------------------------------------------------------------

          Zhi-chu Chen | Shanghai Synchrotron Radiation Facility
         No. 2019 | Jialuo Rd. | Jiading | Shanghai | P.R. China
             tel: 086 21 5955 3405 | zhichu.chen.googlepages.com
                                               | www.sinap.ac.cn
----------------------------------------------------------------
___________________________________________________________________________________
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  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


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

end of thread, other threads:[~2008-12-08 10:10 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-12-08  9:33 How to get the total page number at startup in luatex? Zhichu Chen
2008-12-08  9:47 ` Wolfgang Schuster
2008-12-08 10:10   ` Zhichu Chen

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