groff: Headings in ms
4.3.5.2 Headings
................
Use headings to create a hierarchical structure for your document. The
'ms' macros print headings in *bold*, using the same font family and
point size as the body text.
The following describes the heading macros:
-- Macro: .NH curr-level
-- Macro: .NH S level0 ...
Numbered heading. The argument is either a numeric argument to
indicate the level of the heading, or the letter 'S' followed by
numeric arguments to set the heading level explicitly.
If you specify heading levels out of sequence, such as invoking
'.NH 3' after '.NH 1', 'groff' prints a warning on standard error.
-- String: \*[SN]
-- String: \*[SN-DOT]
-- String: \*[SN-NO-DOT]
After invocation of 'NH', the assigned section number is made
available in the strings 'SN-DOT' (as it appears in a printed
section heading with default formatting, followed by a terminating
period), and 'SN-NO-DOT' (with the terminating period omitted).
The string 'SN' is also defined, as an alias for 'SN-DOT'; if
preferred, you may redefine it as an alias for 'SN-NO-DOT', by
including the initialization
.als SN SN-NO-DOT
at any time *before* you would like the change to take effect.
-- String: \*[SN-STYLE]
You may control the style used to print section numbers, within
numbered section headings, by defining an appropriate alias for the
string 'SN-STYLE'. The default style, in which the printed section
number is followed by a terminating period, is obtained by defining
the alias
.als SN-STYLE SN-DOT
If you prefer to omit the terminating period, from section numbers
appearing in numbered section headings, you may define the alias
.als SN-STYLE SN-NO-DOT
Any such change in section numbering style becomes effective from
the next use of '.NH', following redefinition of the alias for
'SN-STYLE'.
-- Macro: .SH [match-level]
Unnumbered subheading.
The optional MATCH-LEVEL argument is a GNU extension. It is a
number indicating the level of the heading, in a manner analogous
to the CURR-LEVEL argument to '.NH'. Its purpose is to match the
point size, at which the heading is printed, to the size of a
numbered heading at the same level, when the 'GROWPS' and 'PSINCR'
heading size adjustment mechanism is in effect. ⇒ms Document
Control Registers.
The 'HORPHANS' register (⇒ms Document Control Registers)
operates in conjunction with the 'NH' and 'SH' macros, to inhibit the
printing of orphaned section headings at the bottom of any page.