groff
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [Groff] Apparent weirdness with -ms's PO and LL


From: Ted Harding
Subject: RE: [Groff] Apparent weirdness with -ms's PO and LL
Date: Thu, 06 Feb 2003 08:59:47 -0000 (GMT)

On 06-Feb-03 James J. Ramsey wrote:
> Putting
> 
> .nr PO 1.25i
> .nr LL 6i
> 
> at the top of the file seems to do nothing, yet if I put
> 
> .nr PO 1.25i
> .nr LL 6i
> .po \n(POu
> .ll \n(LLu
> 
> I get what I want, a page offset of 1.25 inches and a
> 6-inch long line.
> 
> I would think that at the very top of the file,
> setting the number registers would be sufficient. Go
> figure.
> 
> What am I missing here?

What you are missing can only be discovered by working through
tmac.s in detail, which is not trivial!

Basically, when you use a macro package (in this case "-ms")
the macro package is read in before troff looks at your document.
In the early stages of reading in tmac.s, several default values
are set up, and these include the page-offset and the line length
(as well as point-size, default font, line spacing, .... ). These
are set in groff itself using the commands ".po", ".ll", etc.
At the same time, number registers "PO", "LL", etc. are set to
the same values. These serve to store the default values so
that these can be restored if they have been temporarily changed.

When groff finally does start to look at your document, it begins
to process it with the default values as set in tmac.s by the
commands ".po", ".ll", etc. and -- and here is the point -- groff
itself never looks at the number registers "PO", "LL", etc. except
within macros defined in tmac.s.

The macro package tmac.s is written in such a way that these
registers "PO" and "LL" are only referred to for the purpose of
setting values using commands ".po \n[PO]u" or ".ll \n[LL]" when
a page break occurs. Therefore, the first page is, by default,
started with the default values which were set when tmac.s was read in
prior to looking at your document. You can set PO and LL, but these
will not be referred to until the formatting breaks to the second page.
Hence the first page is formatted using the default values.

However, as you have discovered, you can over-ride this by
initiating your document with commands which set page offset and
line length, together with setting PO and LL, prior to processing any
of your text. But you need to do both: set the values that groff
will use by ".po" and ".ll", and also set the number registers
"PO" and "LL".

You could use the "-d" option to pass non-standard default values
to groff, since tmac.s checks whether PO, LL, etc. have been
defined before setting them to the defaults: if they are already
defined they are not touched. However, setting such details in
the command line is usually very inconvenient, and it is preferable
to plant the necessary commands in your input file (as you have done).

If you regularly need non-standard defaults, you can conveniently
write your own macro package and append it to the command line like
"groff -ms -mjames ... ", to undo groff's defaults and set your own
before your document is read in.

All the best,
Ted.


--------------------------------------------------------------------
E-Mail: (Ted Harding) <address@hidden>
Fax-to-email: +44 (0)870 167 1972
Date: 06-Feb-03                                       Time: 08:59:46
------------------------------ XFMail ------------------------------

reply via email to

[Prev in Thread] Current Thread [Next in Thread]