aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--g.tmac32
1 files changed, 30 insertions, 2 deletions
diff --git a/g.tmac b/g.tmac
index 3739c8d..3fda230 100644
--- a/g.tmac
+++ b/g.tmac
@@ -286,7 +286,7 @@ ___________________
.\" h -- heading
.de h
. br
-. ne 3 \" may need to be adjusted
+. w h p
. _e h
.
..
@@ -306,7 +306,7 @@ ___________________
.\" s -- subheading
.de s
. br
-. ne 3 \" may need to be adjusted
+. w s p
. _e s
..
.
@@ -349,4 +349,32 @@ ___________________
. if !'\n(dn'0' .wh -\n[_dn]u-\n(mbu-12p _tn
..
.
+. \" w -- want space
+.de w
+. br
+. *w 0 \$@
+..
+.de *w
+. nr s \$1 \" accumulated space
+. length n \$2 \" number of lines in environment
+. ds __e \$2 \" environment
+. nr n -1
+. substring __e 0 0
+.
+. \" add environment sp/sq
+. nr s +\n[\*[__e]_sp]
+. nr s +\n[\*[__e]_sq]
+.
+. \" add environment vs
+. _E \*[__e]
+. nr _v \n(.v
+. _E
+. nr s +(\nn*\n(_v)
+. shift 2
+.
+. \" request space or recurse
+. ie \n(.$=0 .ne \nsu
+. el .*w \ns \$@
+..
+.
.ec \" re-enable backslash escapes