about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorDarren Bane <darren.bane@gmail.com>2020-05-20 23:41:17 +0100
committerDarren Bane <darren.bane@gmail.com>2020-05-20 23:41:40 +0100
commit07a11fbd4b69a02534ab0bd0f907fbc9f6ea5995 (patch)
tree046354e001ab9dad334a50733073a671399333f4
parent01c8c655f67f820bc8028d369c5061c997921e72 (diff)
downloadlsp-07a11fbd4b69a02534ab0bd0f907fbc9f6ea5995.tar.gz
Slightly nicer *roff
-rw-r--r--doc/Makefile9
-rwxr-xr-xdoc/macros.ms115
2 files changed, 120 insertions, 4 deletions
diff --git a/doc/Makefile b/doc/Makefile
index fa8d38d..17b7b7c 100644
--- a/doc/Makefile
+++ b/doc/Makefile
@@ -8,11 +8,12 @@ all: breaking_rules.pdf breaking_rules.html
 # Use stuff beyond that only where absolutely necessary.
 # Similar to code, YAGNI.
 
-breaking_rules.pdf: breaking_rules.md refs
-	lowdown -sTms breaking_rules.md | pdfroff -i -t -R -mspdf -k -Kutf8 > $@
+breaking_rules.pdf: macros.ms breaking_rules.md refs
+	( cat macros.ms; lowdown -sTms breaking_rules.md ) | pdfroff -i -t -R -mspdf -k -Kutf8 > $@
 
-breaking_rules.html: breaking_rules.md refs
-	lowdown -sTms breaking_rules.md | groff -Thtml -i -t -R -ms -k -Kutf8 > $@
+# Headers aren't emitted currently
+breaking_rules.html: macros.ms breaking_rules.md refs
+	( cat macros.ms; lowdown -sTms breaking_rules.md ) | groff -Thtml -i -t -R -ms -k -Kutf8 > $@
 
 .PHONY: clean
 clean:
diff --git a/doc/macros.ms b/doc/macros.ms
new file mode 100755
index 0000000..e95e98b
--- /dev/null
+++ b/doc/macros.ms
@@ -0,0 +1,115 @@
+.de F1
+.nr OI \\n(.iu
+.nr PW 1v
+.KF
+.sp 0.3v
+..
+.de T1
+.F1
+..
+.de F2
+.ds Fp Figure\ \\n(Fi
+.ds Fn Figure\ \\n+(Fi
+.ds Fq \\*(Fp
+.F0
+..
+.de T2
+.ds Tp Table\ \\n(Ti
+.ds Tn Table\ \\n+(Ti
+.ds Tq \\*(Tp
+.T0
+..
+.de F0
+.nr BD 1
+.if t .ps \\n(PS-1
+.ie \\n(VS>=41 .vs \\n(VSu-1p
+.el .vs \\n(VSp-1p
+.ft 1
+.di DD
+.ll \\n(.lu*3u/4u
+.in 0
+.fi
+.ad b
+.sp 0.5v
+\f3\\*(Fq\f1\ \ \c
+..
+.de T0
+.nr BD 1
+.if t .ps \\n(PS-1
+.ie \\n(VS>=41 .vs \\n(VSu-1p
+.el .vs \\n(VSp-1p
+.ft 1
+.di DD
+.ll \\n(.lu*3u/4u
+.in 0
+.fi
+.ad b
+.sp 0.5v
+\f3\\*(Tq\f1\ \ \c
+..
+.de F3
+.sp 0.5v
+.di
+.br
+.ll \\n(.lu*4u/3u
+.if \\n(dl>\\n(BD .nr BD \\n(dl
+.if \\n(BD<\\n(.l .in (\\n(.lu-\\n(BDu)/2u
+.nf
+.DD
+.in \\n(OIu
+.nr BD 0
+.fi
+.KE
+.ie \\n(VS>=41 .vs \\n(VSu
+.el .vs \\n(VSp
+..
+.de T3
+.F3
+..
+.de EX
+.\" P1
+.DS L
+.ft CW
+\s-4
+..
+.de EE
+\s+4
+.\" P2
+.ft
+.DE
+..
+.nr Fi 1 +1
+.nr Ti 1 +1
+.ds Fn Figure\ \\n(Fi
+.ds Tn Table\ \\n(Ti
+.nr XP 2	\" delta point size for program
+.nr XV 2p	\" delta vertical for programs
+.nr XT 4	\" delta tab stop for programs
+.nr DV .5v	\" space before start of program
+.\" FP lucidasans
+.nr PS 11
+.nr VS 13
+.\" nr LL 6.6i
+.\" nr PI 0	\" paragraph indent
+.nr PD 4p	\" extra space between paragraphs
+.\" pl 11i
+.rm CH
+.de L=
+.ie '\\$1'sec' .NH \\$2
+.el .ie '\\$1'table' .if !'\\$3'*' \{
+.DS C
+Table '\\$3' about here
+.DE
+\}
+.el .if '\\$1'fig' .if !'\\$3'*' \{
+.DS C
+Figure '\\$3' about here
+.DE
+\}
+..
+.de R1
+.ig R2
+..
+.\"
+.\" groff-specific:
+.ds FAM H