mailing-list for TeXmacs Users

Text archives Help


Re: retrieving page numbers


Chronological Thread 
  • From: David Allouche <address@hidden>
  • To: Benno Dielmann <address@hidden>
  • Cc: address@hidden
  • Subject: Re: retrieving page numbers
  • Date: Fri, 18 Jul 2003 12:15:53 +0200

On Fri, Jul 18, 2003 at 11:09:10AM +0200, Benno Dielmann wrote:
> Hi all,
>
> perhaps my first attempt to get an answer to my question about retrieving
> page
> numbers was not formulated clearly enough... So I give it another try:
>
> How do I retrieve the number of the actual page I'm on somwhere in the
> document body? The value of "thepage" or "page number" is always zero.

I think it is not easy at the moment.

The variables "thepage" and "page number" are only assigned when
building pages, that is after the page bodies have been typeset.
Currently they are only meant to be used in headers and footers (which
are typeset after page breaking).

Page references use a special mechanism using an "auxilliary
collection" which you cannot access without special primitives or
glue, which AFAIK do not exist yet.

It might be possible to do what you want with the following approach:

-- Define a function which uses a counter to produce unique labels.

-- Do some C++ and glue hacking to allow programmatic lookup in the
"references" auxilliary collection (discussion of this should go
on texmacs-dev).

-- Have this function access the auxilliary buffer (maybe using
extern or a friend) to return a tree containing the page number
of the current unique label.

-- Do not forget to "Update Buffer" when you want to get the page
numbers right.

--
-- ddaa



Archive powered by MHonArc 2.6.19.

Top of page