[R] Is the page number in a document created with "pdf()" accessible?

Prof Brian Ripley ripley at stats.ox.ac.uk
Fri Dec 17 18:24:10 CET 2004

On Fri, 17 Dec 2004, Dennis Fisher wrote:

> When I create pdf documents in R using pdf(), each page has text in the outer 
> margin indicating the page number.

It neither has an outer margin nor anything there, unless you added code 
to do this.  I guess your PDF viewer is adding this.

> I track page numbers in a cumbersome 
> manner.  Is the page number in a multi-page document tracked internally by 
> par() or some other function?

It's in the PDF file (part of the definition of PDF) and is tracked by the 
device driver.

See ?plot.new / ?grid.newpage: you could use hooks to do the counting.

Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595

More information about the R-help mailing list