🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.text
Article #672

Re: page numbering between chapters in nroff

#672
From: Peter Fales
Date: Tue, 29 Aug 1989 20:48
39 lines
1891 bytes
In article <5689@ttidca.TTI.COM>, kevin@ttidca.TTI.COM (Kevin Carothers) writes:
> people I know don't seem to have any ideas either, so here goes.
> 
> I have a very large document, consisting of multiple chapters, and
> I would like to pass the ending page from the previous chapter to 
> thefirst page of the next chapter (plus 1, of course).
> 
> The Nroff/Troff Users guide mentions that number registers (.nr %) can
> be read or written, but I have seen no example.  Ideally, I would like to
> set an environment variable with the page #, so that from a makefile I can
> do something like
> 
>       "nroff -ms -n$page chapterx.ms"


I don't have access to the ms macros, but if I understand what you
are asking, I tried the following and it works.

	nroff -mm -rP5 filex

This cause the first page to be printed  with page number 5.  By way
of explanation, "P" is the name of the number register that holds the
page number in the mm macros.   It can be be set this way from the 
command line, or by putting a 

.nr P 5

in the document.  Number registers can also be printed in a document
using the \n construct.  You could say somthing like: "the page number
I am currently on is \nP."  To print a two character number register
like Fg, you would print \n(Fg. 

I hope this is what you are looking for.

-- 
Peter Fales			AT&T, Room 5B-420
				2000 N. Naperville Rd.
UUCP:	...att!peter.fales	Naperville, IL 60566
Domain: peter.fales@att.com	work:	(312) 979-8031
Technical Details
Message-ID: <2786@cbnewsc.ATT.COM>
Path: arc1-ca.pugleaf.net!utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!cwjcc!tut.cis.ohio-state.edu!att!cbnewsc!psfales
References: <5689@ttidca.TTI.COM>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!cwjcc!tut.cis.ohio-state.edu!att!cbnewsc!psfales
From: psfales@cbnewsc.ATT.COM (Peter Fales)
Newsgroups: comp.text
Subject: Re: page numbering between chapters in nroff
Message-ID: <2786@cbnewsc.ATT.COM>
Date: 29 Aug 89 20:48:44 GMT
References: <5689@ttidca.TTI.COM>
Organization: AT&T Bell Laboratories
Lines: 39