aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Ankarström <john@ankarstrom.se>2021-06-17 18:33:18 +0200
committerJohn Ankarström <john@ankarstrom.se>2021-06-17 18:33:18 +0200
commit85343762e6e382cd0b746893ac03275cd4d791ad (patch)
tree37484f430b2b43ddb11f4d6dba11101daf726b91
parent01f5e05d2519945a337db76557a81c38842c1f09 (diff)
downloadmk-85343762e6e382cd0b746893ac03275cd4d791ad.tar.gz
Rework initialization
-rw-r--r--example.mg8
-rw-r--r--g.tmac45
2 files changed, 28 insertions, 25 deletions
diff --git a/example.mg b/example.mg
index c201dca..25cf934 100644
--- a/example.mg
+++ b/example.mg
@@ -8,8 +8,14 @@ John Ankarström
.p
.e mg
is a simple macro package for troff.
+It is designed to be easy to understand and to customize
+by editing the source code.
It makes use of the extended support for environments
-offered by many modern troff implementations.
+offered by many modern troff implementations
+(but it can be made compatible with the original troff if need be).
+.p
+It is also designed to be practically easy to use.
+Macros are consistently one letter long and written in lowercase.
.p
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do
eiusmod tempor incididunt ut labore et dolore magna aliqua.
diff --git a/g.tmac b/g.tmac
index 6423cd9..f325daa 100644
--- a/g.tmac
+++ b/g.tmac
@@ -1,29 +1,22 @@
.eo
-.\" s -- start document section
+.\" s -- setup document (configurable)
.de s
-. \" start header
-. if '\$1'h' \{\
-. sp 1i
-. _d t \" title
-. ps +4p
-. vs +2p
-. ft B
-. ad c
-. _d
-. _d n \" name (of author)
-. ad c
-. _d
-. _d d \" date
-. ad c
-. _d
-. _d p \" paragraph
-. ad b
-. _d
-. \}
-. \" start body
-. if '\$1'b' \{\
-. sp 0.2i
-. \}
+.sp 1i
+._d t \" title
+. ps +4p
+. vs +2p
+. ft B
+. ad c
+._d
+._d n \" name (of author)
+. ad c
+._d
+._d d \" date
+. ad c
+._d
+._d p \" paragraph
+. ad b
+._d
..
.\" _d -- define environment
.de _d
@@ -63,6 +56,9 @@
. br
. _e p
. sp 0.3v
+. if '\*[penv]'t' .sp 0.5v
+. if '\*[penv]'n' .sp 0.5v
+. if '\*[penv]'d' .sp 0.5v
. if '\*[penv]'p' \h'0.5c'
..
.\" e -- emphasis
@@ -74,3 +70,4 @@
\$3\f(BI\$1\fP\$2
..
.ec
+.s