[comp.text.tex] LaTeX - how to detect a new page

Damian.Cugley@prg.ox.ac.uk (Damian Cugley) (02/13/91)

From:		Patrick van der Smagt <smagt@fwi.uva.nl>
Message-Id:	<1991Feb13.073012.24461@fwi.uva.nl>

[How to reset the footnote counter for each page in LaTeX?]

> [...]it appears that the page counter is not incremented
> until at least half of the next page is incremented (as noted
> in the TeXBook).  So how can I detect when a new page is started?

It can't be done.  

TeX generally goes some way beyond the best breakpoint before it is sure
that it *is* the best breakpoint.  It then takes the
vertical-mode-material that didn't get shipped out and sticks it back on
the "current contributions" list.  Therefore the first paragraph or so
of the new page was turned into hboxes etc. before the output routine is
even started, so it's too late to change the footnote counter.  (You
could do it by having explicit \setcounter commands in the document.)

 //- Damian Cugley ---------------------------------------------------\ 
 ||  Oxford University Computing Laboratory, 11 Keble Rd, Oxford, UK  ||
 ||  pdc@prg.ox.ac.uk or pdc@uk.ac.ox.prg in UK      DON'T PANIC!     ||
  \-------------------------------------------------------------------//

raymond@math.berkeley.edu (Raymond Chen) (02/14/91)

In article <DAMIAN.CUGLEY.91Feb13143353@msc9.prg.ox.ac.uk>, Damian.Cugley@prg (Damian Cugley) writes:
>[How to reset the footnote counter for each page in LaTeX?]
>It can't be done.  

Well, it can, but you'll have to use a two-pass algorithm (which is what
LaTeX uses for other things, anyway, e.g., forward references for figures
and tables, and building the table of contents).

The first pass records the page number of each footnote, and the second
pass looks at those numbers and chooses which symbol to use.