groff-commit
[Top][All Lists]
Advanced

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

[groff] 18/30: [mm]: Improve `AV` and `AVL` cosmetics and code.


From: G. Branden Robinson
Subject: [groff] 18/30: [mm]: Improve `AV` and `AVL` cosmetics and code.
Date: Fri, 8 Nov 2024 01:14:30 -0500 (EST)

gbranden pushed a commit to branch master
in repository groff.

commit 158c60996fc345bd372318ae8a2acaa6d0592b1d
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
AuthorDate: Thu Nov 7 11:12:54 2024 -0600

    [mm]: Improve `AV` and `AVL` cosmetics and code.
    
    * contrib/mm/m.tmac: Refactor approval line handling: move baseline
      lengths and corresponding strings, and the minimum width of the gap
      between them, into named parameters.
    
      (AV): Adjust macro cosmetics to more closely resemble DWB 3.3 mm.
      Center the "Date" label below the baseline rule drawn for it, and make
      the proportions of the name and date baseline rules better resemble
      DWB's.
    
      (AV, AVL): Use the same logic in troff and nroff modes instead of
      writing out literal long sequences of underscore character in nroff
      mode.  Use `nop` request instead of text lines.
---
 contrib/mm/ChangeLog | 13 +++++++++++++
 contrib/mm/m.tmac    | 21 +++++++++++++++------
 2 files changed, 28 insertions(+), 6 deletions(-)

diff --git a/contrib/mm/ChangeLog b/contrib/mm/ChangeLog
index b5fe4fc56..1b772363e 100644
--- a/contrib/mm/ChangeLog
+++ b/contrib/mm/ChangeLog
@@ -1,3 +1,16 @@
+2024-11-07  G. Branden Robinson <g.branden.robinson@gmail.com>
+
+       * m.tmac: Refactor approval line handling: move baseline lengths
+       and corresponding strings, and the minimum width of the gap
+       between them, into named parameters.
+       (AV): Adjust macro cosmetics to more closely resemble DWB 3.3
+       mm.  Center the "Date" label below the baseline rule drawn for
+       it, and make the proportions of the name and date baseline rules
+       better resemble DWB's.
+       (AV, AVL): Use the same logic in troff and nroff modes instead
+       of writing out literal long sequences of underscore character in
+       nroff mode.  Use `nop` request instead of text lines.
+
 2024-11-07  G. Branden Robinson <g.branden.robinson@gmail.com>
 
        * m.tmac (let@print-head): Fix code style nit: use `nop` request
diff --git a/contrib/mm/m.tmac b/contrib/mm/m.tmac
index 7603cb542..ed4b87d67 100644
--- a/contrib/mm/m.tmac
+++ b/contrib/mm/m.tmac
@@ -3878,6 +3878,11 @@ undefined
 ..
 .\"------------------------
 .\" Approval signature
+.nr let*name-line-length 40n
+.nr let*date-line-length 15n
+.ds let*name-line \l'\n[let*name-line-length]u'
+.ds let*date-line \l'\n[let*date-line-length]u'
+.nr let*approval-gap 5m
 .de AV
 .ne 6v
 .nf
@@ -3885,10 +3890,15 @@ undefined
 .ie \\n[.$]<2 \\*[Letapp]
 .el           .sp
 .sp 2
-.ie n ______________________________      ______________
-.el   \D'l 25m 0'\h'4m'\D'l 12m 0'
-\Z'\\$1'\h'29m'\f[\\*[@metadata-font]]\\*[Letdate]\fP
+.\" Center the `Letdate` label below its line.
+.ie \w'\\*[Letdate]'>=\\n[let*date-line-length] .nr let*extra-gap 0
+.el .nr let*extra-gap \\n[let*date-line-length]-\w'\\*[Letdate]'/2
+.nop \\*[let*name-line]\h'\\n[let*approval-gap]u'\\*[let*date-line]
+.nop \Z'\\$1'\h'\\n[let*name-line-length]u'\
+\h'\\n[let*approval-gap]u+\\n[let*extra-gap]u'\
+\\*[Letdate]
 .fi
+.rr let*extra-gap
 ..
 .\"------------------------
 .\" Letter signature
@@ -3896,9 +3906,8 @@ undefined
 .ne 6v
 .nf
 .sp 3
-.ie n ______________________________
-.el   \D'l 25m 0'
-\Z'\\$1'
+.nop \\*[let*name-line]
+.nop \Z'\\$1'
 .fi
 ..
 .\"------------------------



reply via email to

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