summaryrefslogtreecommitdiff
path: root/tmac
diff options
context:
space:
mode:
Diffstat (limited to 'tmac')
-rw-r--r--tmac/groff_ms.man65
-rw-r--r--tmac/s.tmac13
2 files changed, 59 insertions, 19 deletions
diff --git a/tmac/groff_ms.man b/tmac/groff_ms.man
index 9ec359eb..00891139 100644
--- a/tmac/groff_ms.man
+++ b/tmac/groff_ms.man
@@ -528,14 +528,57 @@ scaling factor should be employed,
when assigning a value specified in points.
.
.IP
+The style used to represent the section number,
+within a numbered heading,
+is controlled by the
+.B SN-STYLE
+string;
+this may be set to either the
+.B SN-DOT
+or the
+.B SN-NO-DOT
+style,
+(described below),
+by aliasing
+.B SN-STYLE
+accordingly.
+By default,
+.B SN-STYLE
+is initialised by defining the alias
+.RS
+.nf
+.IP
+\&.als SN-STYLE SN-DOT
+.fi
+.RE
+.IP
+it may be changed to the
+.B SN-NO-DOT
+style,
+if preferred,
+by defining the alternative alias
+.RS
+.nf
+.IP
+\&.als SN-STYLE SN-NO-DOT
+.fi
+.RE
+.IP
+Any such change becomes effective with the first use of
+.BR .NH ,
+.I after
+the new alias is defined.
+.
+.IP
After invoking
.BR .NH ,
the assigned heading number is available in the strings
.B SN-DOT
-(exactly as it appears in the formatted heading),
+(as it appears in the default formatting style for numbered headings,
+with a terminating period following the number),
and
.B SN-NO-DOT
-(with its final period omitted).
+(with this terminating period omitted).
The string
.B SN
is also defined,
@@ -550,28 +593,16 @@ by including the initialisation:
.RS
.nf
.IP
-\&.ds SN-NO-DOT
\&.als SN SN-NO-DOT
.fi
.RE
.
.IP
-.I before
-the first use of
+at any time;
+the change becomes effective with the next use of
.BR .NH ,
-or simply:
-.
-.RS
-.nf
-.IP
-\&.als SN SN-NO-DOT
-.fi
-.RE
-.
-.IP
.I after
-the first use of
-.BR .NH .
+the new alias is defined.
.
.TP
.BI .SH\ [ xx ]
diff --git a/tmac/s.tmac b/tmac/s.tmac
index 82e4aaf7..b43fd454 100644
--- a/tmac/s.tmac
+++ b/tmac/s.tmac
@@ -1534,6 +1534,16 @@ Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA.
.\" Numbered headings.
.\" nh*hl is the level of the last heading
.nr nh*hl 0
+.\" SN-DOT and SN-NO-DOT represent the section number of
+.\" the current heading, with and without a terminating dot.
+.ds SN-DOT
+.ds SN-NO-DOT
+.\" SN-STYLE sets the statement numbering style used in headings
+.\" (either SN-DOT or SN-NO-DOT); for backward compatibility with
+.\" earlier ms versions, the default is SN-DOT
+.als SN-STYLE SN-DOT
+.\" Also for backward compatibility, let SN represent SN-DOT.
+.als SN SN-DOT
.\" numbered heading
.de @NH
.ie '\\$1'S' \{\
@@ -1577,12 +1587,11 @@ Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA.
. as SN-NO-DOT .\\n[H\\n[nh*i]]
.\}
.ds SN-DOT \\*[SN-NO-DOT].
-.if !dSN .als SN SN-DOT
.nr sh*psincr (\\n[GROWPS]-\\n[nh*hl])*\\n[PSINCR]
.SH-NO-TAG
.DEVTAG-NH "\\$1"
. if '\*(.T'html' .nr need_eo_h 1
-\\*[SN-DOT]
+\\*[SN-STYLE]
..
.\" ****************************
.\" ******** module toc ********