groff
[Top][All Lists]
Advanced

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

[Groff] ms Heading Macro Font Size Control


From: Andrew J. Piziali
Subject: [Groff] ms Heading Macro Font Size Control
Date: Fri, 26 Dec 2003 10:33:44 -0600 (CST)

   I use the following macro, along with the groff ms macros, to store
the chapter title of top-level chapters for use in the footer and to
make the font size of section headers proportional to their level.
Unfortunately, I discovered a side effect of this implementation is that
if the .NH macro call triggers a page break, the temporarily altered PS
and VS registers cause the page footer to be displayed in the larger
font.

   Without enhancing the .NH macro itself, is there a way to manage the
section header font size without influencing the font used for page
headers and footers?

   Thank you.

'\"
'\" ===========================================================================
'\" NHT - numbered section heading which stores chapter title in string
'\"       \*[chapterTitle] on level one calls.  It also makes the heading font
'\"       size proportional to the section level.
'\" ===========================================================================
'\" 
'\" $1 is the heading level, $2 is the title
'\"
.de NHT
.if (\\$1 == 1) .ds chapterTitle \\$2\" Update chapter title on top level
'\"                                       sections.
.nr oPS \\n(PS\"                        Save current font size
.nr oVS \\n(VS\"                          and vertical spacing.
.if (\\$1 == 1) \{\"                    Use a section heading font size which
.  nr PS +3\"                             is proportional to the heading level.
.  nr VS +3\"                           [TBD: This implementation has the side
.\}\"                                     effect of increasing the font size of
.if (\\$1 == 2) \{\"                      the footer when the .NH macro triggers
.  nr PS +2\"                             a page break.  Figure out how to
.  nr VS +2\"                             manipulate the font size of the
.\}\"                                     section heading without messing with
.if (\\$1 == 3) \{\"                      the footer font size.]
.  nr PS +1
.  nr VS +1 
.\} 
.NH \\$1
\&\\$2
.nr PS \\n[oPS]\"                       Restore paragraph font size
.nr VS \\n[oVS]\"                         and vertical spacing.
..


-- 
                                                        |
address@hidden                       ________------+------________
                                                       / \
                                                      *---*

reply via email to

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