summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog62
-rw-r--r--NEWS6
-rw-r--r--doc/groff.texinfo7
-rw-r--r--tmac/groff_ms.man11
-rw-r--r--tmac/s.tmac45
5 files changed, 120 insertions, 11 deletions
diff --git a/ChangeLog b/ChangeLog
index d5a63218..e06f8284 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,65 @@
+2004-09-19 Keith Marshall <keith.d.marshall@ntlworld.com>
+
+ This change implements the following features:
+
+ PORPHANS
+ New numeric register: Defines number of lines following LP, PP,
+ QP, IP or XP, which must be kept together, before any automatic
+ page break. If insufficient space remains on the current page, a
+ page break is forced before the new paragraph begins.
+
+ HORPHANS
+ New numeric register: Sets number of lines of following paragraph
+ which must be kept with a heading, defined by NH or SH, before any
+ automatic page break. If insufficient space remains on the
+ current page, a page break is forced before the heading.
+
+ GROWPS
+ (Thanks to Joerg van den Hoff, for this idea).
+
+ New numeric register: Sets the first level of heading (set with
+ NH), which will keep the same point size as body text; e.g. if
+ GROWPS is set to 3, .NH 3, .NH 4, ... will produce headings at the
+ point size specified by \n[PS], but .NH 2 and .NH 1 will have
+ progressively larger point sizes, determined by \n[PSINCR] (see
+ below).
+
+ PSINCR
+ New numeric register: Sets the point size increment for each level
+ of heading, (set with NH), below the threshold level set by
+ GROWPS; e.g. if \n[PS] = 10, \n[GROWPS] = 3 and \n[PSINCR] = 2.0p,
+ then .NH 1 will produce 14pt headings, .NH 2 will produce 12pt,
+ and all other levels will remain at 10pt, (because \n[PS] = 10).
+
+ SH
+ Existing macro now accepts a numeric argument, to make heading
+ size match that of NH with same argument value, when the
+ GROWPS/PSINCR feature is enabled.
+
+ SN-DOT
+ New string, set by NH macro, replaces the existing (undocumented)
+ use of SN, to represent the assigned section number.
+
+ SN-NO-DOT
+ New string, set by NH macro, represents the assigned section
+ number, but omits the terminal period (periods at intermediate
+ levels are retained).
+
+ SN
+ String set by NH macro, originally undocumented, now implemented
+ as an alias for SN-DOT (which reproduces original behaviour).
+
+ * tmac/s.tmac (PORPHANS): New register.
+ (par*start): Use it.
+ (HORPHANS, GROWPS, PSINCR): New registers.
+ (SH-NO-TAG, @SH): Use them.
+ (@NH): Improved.
+
+2004-09-19 Keith Marshall <keith.d.marshall@ntlworld.com>
+
+ * NEWS, doc/groff.texinfo, tmac/groff_ms.man: Document the deletion
+ of `Ds' and `De' macros.
+
2004-09-10 Werner LEMBERG <wl@gnu.org>
In tbl, handle \a as an interpreted leader character if in
diff --git a/NEWS b/NEWS
index 2cf7a031..53402280 100644
--- a/NEWS
+++ b/NEWS
@@ -43,6 +43,12 @@ o The ms macros now support fractional point sizes: A value for the PS, VS,
1000. For example, `.nr PS 10250' sets the document's font size to
10.25 points.
+o The `Ds' and `De' macros provided in ms since groff version 1.19 have been
+ removed; the equivalent `DS' and `DE' macros should be used instead. X11
+ documents which actually use `Ds' and `De' always load a specific macro
+ file from the X11 distribution (macros.t) which provides proper
+ definitions for the two macros.
+
VERSION 1.19.1
==============
diff --git a/doc/groff.texinfo b/doc/groff.texinfo
index 6c60bba7..bfe9af48 100644
--- a/doc/groff.texinfo
+++ b/doc/groff.texinfo
@@ -3573,7 +3573,12 @@ The @code{DE} macro ends the display.
@DefmacList {Ds, , ms}
@DefmacListEnd {De, , ms}
-These two macros are aliases for @code{DS} and @code{DE}, respectively.
+These two macros were formerly provided as aliases for
+@code{DS} and @code{DE}, respectively.
+They have been removed, and should no longer be used.
+X11 documents which actually use @code{Ds} and @code{De} always load a
+specific macro file from the X11 distribution (@file{macros.t}) which
+provides proper definitions for the two macros.
@endDefmac
@sp 1
diff --git a/tmac/groff_ms.man b/tmac/groff_ms.man
index 8ce4bb2b..f18150a9 100644
--- a/tmac/groff_ms.man
+++ b/tmac/groff_ms.man
@@ -629,12 +629,17 @@ The macros
.B Ds
and
.B De
-are aliases for
+were formerly provided as aliases for
.B DS
and
.BR DE ,
-respectively.
-.
+respectively, but they have been removed, and should no longer be used.
+X11 documents which actually use
+.B Ds
+and
+.B De
+always load a specific macro file from the X11 distribution (macros.t)
+which provides proper definitions for the two macros.
.PP
To
.I keep
diff --git a/tmac/s.tmac b/tmac/s.tmac
index 636735e7..ef540c4a 100644
--- a/tmac/s.tmac
+++ b/tmac/s.tmac
@@ -1159,13 +1159,18 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
.de TA
.ta T 5n
..
+.\" \n[PORPHANS] sets number of initial lines of any paragraph,
+.\" which must be kept together, without any included page break.
+.\" Initialise to reproduce original behaviour; user may adjust it.
+.if !rPORPHANS .nr PORPHANS 1
+.
.de par*start
.ds@auto-end
.nr \\n[.ev]:pli \\$1
.nr \\n[.ev]:pri \\$2
.par@reset
.sp \\n[\\n[.ev]:PD]u
-.ne 1v+\\n(.Vu
+.ne \\n[PORPHANS]v+\\n(.Vu
..
.de par@finish
.nr \\n[.ev]:pli 0
@@ -1366,14 +1371,37 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
.\}
.el \!.par*box-draw \\$1 \\$2
..
+.\" \n[HORPHANS] sets how many lines of the following paragraph must be
+.\" kept together, with a preceding section header. Initialise it,
+.\" to reproduce original behaviour; user may change it.
+.if !rHORPHANS .nr HORPHANS 1
+.
+.\" \n[GROWPS] and \n[PSINCR] cause auto-increment of header point size.
+.\" Initialise them, so they have no effect, unless explicitly set by the user.
+.if !rGROWPS .nr GROWPS 0
+.if !rPSINCR .nr PSINCR 1p
+.
.de SH-NO-TAG
.par@finish
-.\" Keep together the heading and the first two lines of the next paragraph.
-.ne 3v+\\n[\\n[.ev]:PD]u+\\n(.Vu
+.\" Keep the heading and the first few lines of the next paragraph together.
+.\" (\n[HORPHANS] defines "first few" -- default = 1; user may redefine it).
+.nr sh*minvs \\n[HORPHANS]v
+.if \\n[sh*psincr]<0 .nr sh*psincr 0
+.ie \\n(VS<1000 .par*vs \\n(VSp+\\n[sh*psincr]u
+.el .par*vs \\n(VSp/1000u+\\n[sh*psincr]u
+.ne 2v+\\n[sh*minvs]u+\\n[\\n[.ev]:PD]u+\\n(.Vu
+.\" Adjust point size for heading text, as specified by \n[GROWPS] and \n[PSINCR].
+.ie \\n(PS<1000 .ps \\n(PS+\\n[sh*psincr]u
+.el .ps \\n(PSz/1000u+\\n[sh*psincr]u
.sp 1
.ft B
..
.de @SH
+.\" Standard ms implementation does not expect an argument,
+.\" but allow ".SH n" to make heading point size match ".NH n",
+.\" for same "n", when \n[GROWPS] and \n[PSINCR] are set.
+. nr sh*psincr 0
+. if 0\\$1>0 .nr sh*psincr (\\n[GROWPS]-0\\$1)*\\n[PSINCR]
. SH-NO-TAG
. HTML-TAG ".SH 1"
..
@@ -1535,15 +1563,18 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
. \}
. nr H\\n[nh*hl] +1
.\}
-.ds SN
-.nr nh*i 0
+.ds SN-NO-DOT \\n(H1
+.nr nh*i 1
.while \\n[nh*i]<\\n[nh*hl] \{\
. nr nh*i +1
-. as SN \\n[H\\n[nh*i]].
+. 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
.HTML-TAG ".NH \\$1"
-\\*[SN]
+\\*[SN-DOT]
..
.\" ****************************
.\" ******** module toc ********