aboutsummaryrefslogtreecommitdiff
path: root/g.tmac
diff options
context:
space:
mode:
authorJohn Ankarström <john@ankarstrom.se>2021-06-19 19:57:24 +0200
committerJohn Ankarström <john@ankarstrom.se>2021-06-19 19:57:24 +0200
commit30bde561cdcb73a206d3486f98934b23e92995df (patch)
tree5f580157ad68f63d6c41bee60d43fce25b1a0815 /g.tmac
parent7beb26b7fe72ccf6a7a231bf7dbc3bbdf62f6c75 (diff)
downloadmk-30bde561cdcb73a206d3486f98934b23e92995df.tar.gz
Fix page break bug in _ft
Sometimes, the first word after a page break would be displayed in the wrong place. This fixes that.
Diffstat (limited to 'g.tmac')
-rw-r--r--g.tmac28
1 files changed, 22 insertions, 6 deletions
diff --git a/g.tmac b/g.tmac
index 4a7c417..6461c60 100644
--- a/g.tmac
+++ b/g.tmac
@@ -31,7 +31,7 @@
. \" initialize document
. wh 0 _ht
. wh -\n(mbu _ft
-. _ht \" trigger header
+. sp 1u \" trigger header
. ns
.
. \" configure environments
@@ -111,8 +111,9 @@
.
. \" save special environment variables
. if !'\n[.ev]'0' \{\
-. nr \n[.ev]_sp \n(sp
-. nr \n[.ev]_ti \n(ti
+. nr \n[.ev]_sp \n(sp \" vertical space before any environment
+. nr \n[.ev]_sq \n(sq \" vertical space before different environment
+. nr \n[.ev]_ti \n(ti \" first line indentation
. ev
. \}
.
@@ -145,22 +146,37 @@
. if !'\$1'' \{\
. ev \$1
. nr sp \n[\n[.ev]_sp]
+. nr sq \n[\n[.ev]_sq]
. nr ti \n[\n[.ev]_ti]
. sp \n(spu
+. if !'\*[_env]'\*[_penv]' .sp \n(squ
. \}
..
.
. \" _ec -- copy environment
.de _ec
-. evc 0
+. evc \$1
+. nr sp \n[\$1_sp]
+. nr sq \n[\$1_sq]
+. nr ti \n[\$1_ti]
..
.
.\" _ft -- footer trap
.de _ft
+.
+. \" collect overflowed text
+. di _rest
+. br
+. di
+.
+. \" print footer
. _E _m
-' sp 2v
+. sp 2v
. tl ''%''
-' bp
+. bp
+.
+. \" print overflowed text on next page
+. _rest
..
.
.\" _ht -- header trap