[Top][All Lists]

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

RE: [Groff] ms Section Heading String

From: Ted Harding
Subject: RE: [Groff] ms Section Heading String
Date: Wed, 24 Dec 2003 15:10:21 -0000 (GMT)

On 24-Dec-03 Andrew J. Piziali wrote:
>    I writing a book using the ms macro package.  I'd like the even page
> footer to contain the section title associated with the most recent .NH
> call.  What string must I reference?

The string which contains the section _number_ is \*[SN]

There is no string which contains the section _title_ since the
way it works is this:

The text of the section title
.LP [for instance]

simply ends the preceding paragraph, emits a blank line, sets up some
protected space (with .ne) and sets the font to bold.
At this point whatever you type in as "The text of the section title"
comes out in bold, until you start a new paragraph.
It is not saved in any string.

When you use .NH, this constructs a string \*[SN] according to the
level specified in the call to .NH, calls .SH, emits \*[SN], and
quits, so the number and then the title are output in bold as before.

So you don't get the title stored in a string anyway!

If you are content to just get the section number in the footer,
then you could define

.ds EF \\*[SN]


.ds EF \fB\\*[SN]\fP

Note that \*[EF] is emitted when the end-of-page macro .BT is
executed, so that the last-occurring \*[SN] on that page will be
used (if you have more than one call to .NH on the page).

One way in which you could arrange to print the title as well
is to define you own string for it, e.g.

.ds NST The title of my next section
.NH 2

and then, if you have defined (e.g.)

.ds EF \fB\\*[SN] \\*[NST]\fP

you should get section number and title together.

I hope this helps!


E-Mail: (Ted Harding) <address@hidden>
Fax-to-email: +44 (0)870 167 1972
Date: 24-Dec-03                                       Time: 15:10:21
------------------------------ XFMail ------------------------------

reply via email to

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