groff-commit
[Top][All Lists]
Advanced

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

[groff] 33/51: [mdoc]: Align spacing around headers with man(7).


From: G. Branden Robinson
Subject: [groff] 33/51: [mdoc]: Align spacing around headers with man(7).
Date: Sun, 11 Sep 2022 08:15:54 -0400 (EDT)

gbranden pushed a commit to branch master
in repository groff.

commit 390c85870bb1e872237c08a45ceb3646c9ec5baa
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
AuthorDate: Wed Sep 7 20:55:36 2022 -0500

    [mdoc]: Align spacing around headers with man(7).
    
    * tmac/doc.tmac (doc-save-global-vars, doc-restore-global-vars):
    * tmac/mdoc/doc-common (Rd):
    * tmac/mdoc/doc-ditroff:
    * tmac/mdoc/doc-nroff: Stop defining, saving, and restoring
      `doc-header-space`.
    
    * tmac/mdoc/doc-common (doc-header): When starting new document and not
      continuously rendering, space by one half-inch instead of by the
      now-defunct `doc-header-space` amount (which, strictly, should not
      have applied to this measurement).  If not continuously rendering,
      extend page length by 1v to accommodate header line.  After formatting
      header, if not continuously rendering, space to 1 inch below first
      text baseline.
---
 ChangeLog             | 18 ++++++++++++++++++
 tmac/doc.tmac         |  2 --
 tmac/mdoc/doc-common  | 12 ++++--------
 tmac/mdoc/doc-ditroff |  6 ------
 tmac/mdoc/doc-nroff   |  6 ------
 5 files changed, 22 insertions(+), 22 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 846ae6dc6..87b996a06 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,21 @@
+2022-09-07  G. Branden Robinson <g.branden.robinson@gmail.com>
+
+       [mdoc]: Align spacing around headers with man(7).
+
+       * tmac/doc.tmac (doc-save-global-vars, doc-restore-global-vars):
+       * tmac/mdoc/doc-common (Rd):
+       * tmac/mdoc/doc-ditroff:
+       * tmac/mdoc/doc-nroff: Stop defining, saving, and restoring
+       `doc-header-space`.
+
+       * tmac/mdoc/doc-common (doc-header): When starting new document
+       and not continuously rendering, space by one half-inch instead
+       of by the now-defunct `doc-header-space` amount (which,
+       strictly, should not have applied to this measurement).  If not
+       continuously rendering, extend page length by 1v to accommodate
+       header line.  After formatting header, if not continuously
+       rendering, space to 1 inch below first text baseline.
+
 2022-09-07  G. Branden Robinson <g.branden.robinson@gmail.com>
 
        [mdoc]: Support `C` register for consecutive page numbering.
diff --git a/tmac/doc.tmac b/tmac/doc.tmac
index 8d2006be9..f91febee9 100644
--- a/tmac/doc.tmac
+++ b/tmac/doc.tmac
@@ -3573,7 +3573,6 @@
 .  ds doc-section-saved "\*[doc-section]
 .  ds doc-operating-system-saved "\*[doc-operating-system]
 .  ds doc-date-string-saved "\*[doc-date-string]
-.  nr doc-header-space-saved \n[doc-header-space]
 .  nr doc-display-vertical-saved \n[doc-display-vertical]
 .  ds doc-pageref-saved "\*[doc-pageref]
 .  nr doc-in-see-also-section-saved \n[doc-in-see-also-section]
@@ -3716,7 +3715,6 @@
 .  ds doc-section "\*[doc-section-saved]
 .  ds doc-operating-system "\*[doc-operating-system-saved]
 .  ds doc-date-string "\*[doc-date-string-saved]
-.  nr doc-header-space \n[doc-header-space-saved]
 .  nr doc-display-vertical \n[doc-display-vertical-saved]
 .  ds doc-pageref "\*[doc-pageref-saved]
 .  nr doc-in-see-also-section \n[doc-in-see-also-section-saved]
diff --git a/tmac/mdoc/doc-common b/tmac/mdoc/doc-common
index 88e2f073b..338b60df8 100644
--- a/tmac/mdoc/doc-common
+++ b/tmac/mdoc/doc-common
@@ -1026,10 +1026,8 @@
 .de doc-header
 .  ev doc-env-dh
 .  doc-setup-page-layout
-.  if !\n[cR] \{\
-.    \" Re-use doc-header-space between page top and header.
-.    sp \n[doc-header-space]u
-.  \}
+.  ie \n[cR] .pl +1v
+.  el        .sp .5i
 .  nr doc-reg-dh \w'\*[doc-caption-font]\*[doc-pageref]\f[]'
 .  nr doc-reg-dh1 \w'\*[doc-caption-font2]\*[doc-volume]\f[]'
 .  if (\n[doc-reg-dh] + \n[doc-reg-dh1] + \n[doc-reg-dh] >= \n[.lt]) \{\
@@ -1047,12 +1045,11 @@
 .    as doc-pageref "\|.\|.\|.
 .  \}
 .  tl 
'\*[doc-caption-font]\*[doc-pageref]\f[]'\*[doc-caption-font2]\*[doc-volume]\f[]'\*[doc-caption-font]\*[doc-pageref]\f[]'
-.  ie !\n[cR] \
-.    sp \n[doc-header-space]u
-.  el \{\
+.  ie \n[cR] \{\
 .    pl +1v
 .    sp 1v
 .  \}
+.  el .sp |1i
 .  ev
 .  ns
 ..
@@ -1667,7 +1664,6 @@
 .  tm doc-section == '\*[doc-section]'
 .  tm doc-operating-system == '\*[doc-operating-system]'
 .  tm doc-date-string == '\*[doc-date-string]'
-.  tm doc-header-space == \n[doc-header-space]
 .  tm doc-display-vertical == \n[doc-display-vertical]
 .  tm doc-pageref == '\*[doc-pageref]'
 .  tm doc-in-synopsis-section == \n[doc-in-synopsis-section]
diff --git a/tmac/mdoc/doc-ditroff b/tmac/mdoc/doc-ditroff
index 49092108e..f9d6e6e1f 100644
--- a/tmac/mdoc/doc-ditroff
+++ b/tmac/mdoc/doc-ditroff
@@ -132,12 +132,6 @@
 .nr doc-fixed-width \w'\f[C]0'
 .
 .
-.\" NS doc-header-space global register
-.\" NS   the space between header and body
-.
-.nr doc-header-space .5i
-.
-.
 .\" NS doc-display-vertical global register
 .\" NS   vertical space between list elements etc.
 .
diff --git a/tmac/mdoc/doc-nroff b/tmac/mdoc/doc-nroff
index ca8a62270..b5f8533cc 100644
--- a/tmac/mdoc/doc-nroff
+++ b/tmac/mdoc/doc-nroff
@@ -124,12 +124,6 @@
 .nr doc-fixed-width \w'0'
 .
 .
-.\" NS doc-header-space global register
-.\" NS   the space between header and body
-.
-.nr doc-header-space 1v
-.
-.
 .\" NS doc-display-vertical global register
 .\" NS   vertical space between list elements etc.
 .



reply via email to

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